Sovereign-Labs / sovereign-sdk

A framework for building seamlessly scalable and interoperable rollups that can run on any blockchain
https://sovereign.xyz
Apache License 2.0
365 stars 104 forks source link

sov-modules: Add `transactions` to the module system. #73

Closed bkolad closed 1 year ago

bkolad commented 1 year ago

If a module method returns early, we need to revert all state-related changes, for example:

fn foo(&mut self) -> Result {
   ...
   self.some_value.set(x);
   let v = self.some_other_value.get()?;  <- returns because of an error 
   ...
}

Shouldn't persist x or any other state change.

preston-evans98 commented 1 year ago

@bkolad, Should this be part of the Alpha release? Adding for now, feel free to remove.

bkolad commented 1 year ago

This is already implemented (we revert in AppTemplate in this case), I forgot to close the issue.