Skip to content

Commit

Permalink
init function is capable of returning value
Browse files Browse the repository at this point in the history
  • Loading branch information
qalisander committed Jan 16, 2025
1 parent 8ae0ebd commit 50c3971
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/motsu/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,12 @@ impl<ST: StorageType + TestRouter + 'static> Contract<ST> {

/// Initialize the contract with an `initializer` function, and on behalf of
/// the given `account`.
pub fn init<A: Into<Address>>(
pub fn init<A: Into<Address>, Output>(
&self,
account: A,
initializer: impl FnOnce(&mut ST),
) {
initializer(&mut self.sender(account.into()));
initializer: impl FnOnce(&mut ST) -> Output,
) -> Output {
initializer(&mut self.sender(account.into()))
}

/// Create a new contract with random address.
Expand Down

0 comments on commit 50c3971

Please sign in to comment.