Skip to content

Commit

Permalink
imports - base framework refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Apr 9, 2024
1 parent 0c74401 commit 3df1695
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 44 deletions.
7 changes: 7 additions & 0 deletions framework/base/src/derive_imports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub use crate::{
codec,
codec::derive::{
NestedDecode, NestedEncode, TopDecode, TopDecodeOrDefault, TopEncode, TopEncodeOrDefault,
},
derive::{type_abi, ManagedVecItem, TypeAbi},
};
22 changes: 22 additions & 0 deletions framework/base/src/imports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pub use crate::{
abi::TypeAbi,
api::{ErrorApiImpl, ManagedTypeApi, VMApi},
arrayvec::ArrayVec,
codec::{
multi_types::*, CodecFrom, CodecFromSelf, CodecInto, DecodeError, Empty, IntoMultiValue,
NestedDecode, NestedEncode, TopDecode, TopEncode,
},
contract_base::{ContractBase, ProxyObjBase, ProxyObjNew},
err_msg,
io::*,
non_zero_usize,
non_zero_util::*,
require, sc_format, sc_panic, sc_print,
storage::mappers::*,
types::{system_proxy::*, *},
};

pub use core::ops::{
Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
Mul, MulAssign, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
};
41 changes: 0 additions & 41 deletions framework/base/src/imports_reexport.rs

This file was deleted.

13 changes: 10 additions & 3 deletions framework/base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ pub use hex_call_data::*;
pub use hex_literal;
pub use storage::{storage_clear, storage_get, storage_get_len, storage_set};

// not to be used internally
mod imports_reexport;
pub use imports_reexport::{derive_imports, imports, proxy_imports};
/// Conveniently groups all framework imports required by a smart contract form the framework.
pub mod imports;

/// Conveniently groups all imports required for deriving framework-related traits for types.
pub mod derive_imports;

/// Conveniently groups all imports required for generated proxies.
pub mod proxy_imports {
pub use super::{derive_imports::*, imports::*};
}

0 comments on commit 3df1695

Please sign in to comment.