Skip to content

Commit

Permalink
Re-export initialize_contract from utils module
Browse files Browse the repository at this point in the history
  • Loading branch information
HCastano committed Dec 10, 2021
1 parent 14aa098 commit 7cde1ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion crates/lang/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ pub mod result_info;

#[cfg_attr(not(feature = "show-codegen-docs"), doc(hidden))]
pub mod codegen;
pub use codegen::initialize_contract;

/// Utility functions for contract development.
pub mod utils {
// We want to expose this function without making users go through
// the `codgen` module
pub use super::codegen::initialize_contract;
}

pub mod reflect;

Expand Down
2 changes: 1 addition & 1 deletion examples/dns/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod dns {
pub fn new() -> Self {
// This call is required in order to correctly initialize the
// `Mapping`s of our contract.
ink_lang::initialize_contract(|contract: &mut Self| {
ink_lang::utils::initialize_contract(|contract: &mut Self| {
contract.default_address = Default::default();
})
}
Expand Down
2 changes: 1 addition & 1 deletion examples/erc1155/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ mod erc1155 {
// `Mapping`s of our contract.
//
// Not that `token_id_nonce` will be initialized to its `Default` value.
ink_lang::initialize_contract(|_| {})
ink_lang::utils::initialize_contract(|_| {})
}

/// Create the initial supply for a token.
Expand Down
2 changes: 1 addition & 1 deletion examples/erc20/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod erc20 {
pub fn new(initial_supply: Balance) -> Self {
// This call is required in order to correctly initialize the
// `Mapping`s of our contract.
ink_lang::initialize_contract(|contract| {
ink_lang::utils::initialize_contract(|contract| {
Self::new_init(contract, initial_supply)
})
}
Expand Down

0 comments on commit 7cde1ac

Please sign in to comment.