centrifuge / fudge

FUlly Decoupled Generic Environment for Substrate-chains
Other
22 stars 2 forks source link

Implement `with_state_drain` & `with_state_at_drain` #41

Open mustermeiszer opened 1 year ago

mustermeiszer commented 1 year ago

The method should allow using any state and return the respective storage changes of the closure afterwards.

API

fn with_state_drain(exec: F) -> Result<(R, StorageChanges), Error> 
    where F: FnOnce() -> R {}

fn with_state_at_drain(at: BlockId, exec: F) -> Result<(R, StorageChanges), Error> 
    where F: FnOnce() -> R {}