@@ -45,11 +45,11 @@ impl Contract for CounterContract {
4545 self . state . value . set ( value) ;
4646 }
4747
48- async fn execute_operation ( & mut self , operation : CounterOperation ) -> u64 {
49- let CounterOperation :: Increment ( operation ) = operation;
50- let new_value = self . state . value . get ( ) + operation ;
48+ async fn execute_operation ( & mut self , operation : CounterOperation ) -> CounterOperation {
49+ let CounterOperation :: Increment ( increment ) = operation;
50+ let new_value = self . state . value . get ( ) + increment ;
5151 self . state . value . set ( new_value) ;
52- new_value
52+ operation
5353 }
5454
5555 async fn execute_message ( & mut self , _message : ( ) ) {
@@ -84,8 +84,8 @@ mod tests {
8484
8585 let expected_value = initial_value + increment;
8686
87- assert_eq ! ( response, expected_value ) ;
88- assert_eq ! ( * counter. state. value. get( ) , initial_value + increment ) ;
87+ assert_eq ! ( response, CounterOperation :: Increment ( increment ) ) ;
88+ assert_eq ! ( * counter. state. value. get( ) , expected_value ) ;
8989 }
9090
9191 #[ test]
@@ -115,7 +115,7 @@ mod tests {
115115
116116 let expected_value = initial_value + increment;
117117
118- assert_eq ! ( response, expected_value ) ;
118+ assert_eq ! ( response, CounterOperation :: Increment ( increment ) ) ;
119119 assert_eq ! ( * counter. state. value. get( ) , expected_value) ;
120120 }
121121
0 commit comments