Closed stanleyyconsensys closed 1 month ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Issues
4 New issues
0 Accepted issues
Measures
0 Security Hotspots
4.3% Coverage on New Code
0.0% Duplication on New Code
This PR is to add state management base class
SnapStateManager
it provides the functionally of
update, get, set, withTransaction, commit, rollback
get
andset
is the simple method to get the state and set the state.update
is an method combine with get, then set, but also compatible with transaction mode.withTransaction
is a method to init a transaction by getting the state, and do the callback, if anything happen, it will rollback to the state that we get previously, it can combine withupdate
to use.commit
is a method to force commit in a transaction before it auto commit.rollback
is a internal method to rollback the state.example use: