From 50c39719fbc96933c5306e6ef36f2086446ca42e Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Thu, 16 Jan 2025 19:07:13 +0400 Subject: [PATCH] init function is capable of returning value --- crates/motsu/src/context.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/motsu/src/context.rs b/crates/motsu/src/context.rs index 9fd16bb..c1b20d0 100644 --- a/crates/motsu/src/context.rs +++ b/crates/motsu/src/context.rs @@ -346,12 +346,12 @@ impl Contract { /// Initialize the contract with an `initializer` function, and on behalf of /// the given `account`. - pub fn init>( + pub fn init, 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.