File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -719,18 +719,20 @@ impl ChiselDispatcher {
719
719
}
720
720
}
721
721
722
- // If the contract execution failed, continue on without
723
- // updating the source.
724
- DispatchResult :: CommandFailed ( Self :: make_error (
725
- "Failed to execute edited contract!" ,
726
- ) )
727
- } else {
728
- // the code could be compiled, save it
729
- * self . source_mut ( ) = new_session_source;
730
- DispatchResult :: CommandSuccess ( Some ( String :: from (
731
- "Successfully edited `run()` function's body!" ,
732
- ) ) )
722
+ if failed {
723
+ // If the contract execution failed, continue on without
724
+ // updating the source.
725
+ return DispatchResult :: CommandFailed ( Self :: make_error (
726
+ "Failed to execute edited contract!" ,
727
+ ) ) ;
728
+ }
733
729
}
730
+
731
+ // the code could be compiled, save it
732
+ * self . source_mut ( ) = new_session_source;
733
+ DispatchResult :: CommandSuccess ( Some ( String :: from (
734
+ "Successfully edited `run()` function's body!" ,
735
+ ) ) )
734
736
}
735
737
Err ( _) => {
736
738
DispatchResult :: CommandFailed ( "The code could not be compiled" . to_string ( ) )
You can’t perform that action at this time.
0 commit comments