@@ -79,7 +79,10 @@ pub trait Multisig {
7979
8080 #[ init]
8181 fn init ( & self , quorum : usize , #[ var_args] board : VarArgs < Address > ) -> SCResult < ( ) > {
82- require ! ( board. len( ) > 0 , "board cannot be empty on init, no-one would be able to propose" ) ;
82+ require ! (
83+ board. len( ) > 0 ,
84+ "board cannot be empty on init, no-one would be able to propose"
85+ ) ;
8386 require ! ( quorum <= board. len( ) , "quorum cannot exceed board size" ) ;
8487 self . set_quorum ( quorum) ;
8588
@@ -143,8 +146,17 @@ pub trait Multisig {
143146 }
144147
145148 #[ endpoint( proposeSendEgld) ]
146- fn propose_send_egld ( & self , to : Address , amount : BigUint ) -> SCResult < usize > {
147- self . propose_action ( Action :: SendEgld { to, amount } )
149+ fn propose_send_egld (
150+ & self ,
151+ to : Address ,
152+ amount : BigUint ,
153+ #[ var_args] opt_data : OptionalArg < BoxedBytes > ,
154+ ) -> SCResult < usize > {
155+ let data = match opt_data {
156+ OptionalArg :: Some ( data) => data,
157+ OptionalArg :: None => BoxedBytes :: empty ( ) ,
158+ } ;
159+ self . propose_action ( Action :: SendEgld { to, amount, data } )
148160 }
149161
150162 #[ endpoint( proposeSCDeploy) ]
@@ -214,7 +226,10 @@ pub trait Multisig {
214226
215227 #[ endpoint]
216228 fn sign ( & self , action_id : usize ) -> SCResult < ( ) > {
217- require ! ( !self . is_empty_action_data( action_id) , "action does not exist" ) ;
229+ require ! (
230+ !self . is_empty_action_data( action_id) ,
231+ "action does not exist"
232+ ) ;
218233
219234 let caller_address = self . get_caller ( ) ;
220235 let caller_id = self . users_module ( ) . get_user_id ( & caller_address) ;
@@ -232,7 +247,10 @@ pub trait Multisig {
232247
233248 #[ endpoint]
234249 fn unsign ( & self , action_id : usize ) -> SCResult < ( ) > {
235- require ! ( !self . is_empty_action_data( action_id) , "action does not exist" ) ;
250+ require ! (
251+ !self . is_empty_action_data( action_id) ,
252+ "action does not exist"
253+ ) ;
236254
237255 let caller_address = self . get_caller ( ) ;
238256 let caller_id = self . users_module ( ) . get_user_id ( & caller_address) ;
@@ -320,7 +338,6 @@ pub trait Multisig {
320338 signer_ids
321339 . iter ( )
322340 . filter ( |signer_id| {
323-
324341 let signer_role = self . get_user_id_to_role ( * * signer_id) ;
325342 signer_role. can_sign ( )
326343 } )
@@ -343,7 +360,10 @@ pub trait Multisig {
343360 caller_role. can_perform_action( ) ,
344361 "only board members and proposers can perform actions"
345362 ) ;
346- require ! ( self . quorum_reached( action_id) , "quorum has not been reached" ) ;
363+ require ! (
364+ self . quorum_reached( action_id) ,
365+ "quorum has not been reached"
366+ ) ;
347367
348368 self . perform_action ( action_id)
349369 }
@@ -387,8 +407,8 @@ pub trait Multisig {
387407 ) ;
388408 self . set_quorum ( new_quorum)
389409 } ,
390- Action :: SendEgld { to, amount } => {
391- self . send_tx ( & to, & amount, "" ) ;
410+ Action :: SendEgld { to, amount, data } => {
411+ self . send_tx ( & to, & amount, data . as_slice ( ) ) ;
392412 } ,
393413 Action :: SCDeploy {
394414 amount,
0 commit comments