Skip to content

Commit 7cde1ac

Browse files
committed
Re-export initialize_contract from utils module
1 parent 14aa098 commit 7cde1ac

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

crates/lang/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ pub mod result_info;
2020

2121
#[cfg_attr(not(feature = "show-codegen-docs"), doc(hidden))]
2222
pub mod codegen;
23-
pub use codegen::initialize_contract;
23+
24+
/// Utility functions for contract development.
25+
pub mod utils {
26+
// We want to expose this function without making users go through
27+
// the `codgen` module
28+
pub use super::codegen::initialize_contract;
29+
}
2430

2531
pub mod reflect;
2632

examples/dns/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ mod dns {
9090
pub fn new() -> Self {
9191
// This call is required in order to correctly initialize the
9292
// `Mapping`s of our contract.
93-
ink_lang::initialize_contract(|contract: &mut Self| {
93+
ink_lang::utils::initialize_contract(|contract: &mut Self| {
9494
contract.default_address = Default::default();
9595
})
9696
}

examples/erc1155/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mod erc1155 {
272272
// `Mapping`s of our contract.
273273
//
274274
// Not that `token_id_nonce` will be initialized to its `Default` value.
275-
ink_lang::initialize_contract(|_| {})
275+
ink_lang::utils::initialize_contract(|_| {})
276276
}
277277

278278
/// Create the initial supply for a token.

examples/erc20/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mod erc20 {
6565
pub fn new(initial_supply: Balance) -> Self {
6666
// This call is required in order to correctly initialize the
6767
// `Mapping`s of our contract.
68-
ink_lang::initialize_contract(|contract| {
68+
ink_lang::utils::initialize_contract(|contract| {
6969
Self::new_init(contract, initial_supply)
7070
})
7171
}

0 commit comments

Comments
 (0)