pallet-contracts: migrate to nested storage transaction mechanism (#6382)
* Add a simple direct storage access module * WIP * Completely migrate to the transactional system. * Format * Fix wasm compilation * Get rid of account_db module * Make deposit event eager * Make restore_to eager * It almost compiles. * Make it compile. * Make the tests compile * Get rid of account_db * Drop the result. * Backport the book keeping. * Fix all remaining tests. * Make it compile for std * Remove a stale TODO marker * Remove another stale TODO * Add proof for `terminate` * Remove a stale comment. * Make restoration diverging. * Remove redudnant trait: `ComputeDispatchFee` * Update frame/contracts/src/exec.rs Co-authored-by:Alexander Theißen <alex.theissen@me.com> * Introduce proper errors into the storage module. * Adds comments for contract storage module. * Inline `ExecutionContext::terminate`. * Restore_to should not let sacrifice itself if the contract present on the stack. * Inline `transfer` function * Update doc - add "if succeeded" * Adapt to TransactionOutcome changes * Updates the docs for `ext_restore_to` * Add a proper assert. * Update frame/contracts/src/wasm/runtime.rs Co-authored-by:
Alexander Theißen <alex.theissen@me.com> Co-authored-by:
Alexander Theißen <alex.theissen@me.com> Co-authored-by:
Alexander Theißen <alexander.theissen@parity.io>
Showing
- substrate/Cargo.lock 1 addition, 0 deletionssubstrate/Cargo.lock
- substrate/frame/contracts/Cargo.toml 1 addition, 0 deletionssubstrate/frame/contracts/Cargo.toml
- substrate/frame/contracts/fixtures/restoration.wat 5 additions, 1 deletionsubstrate/frame/contracts/fixtures/restoration.wat
- substrate/frame/contracts/src/account_db.rs 0 additions, 450 deletionssubstrate/frame/contracts/src/account_db.rs
- substrate/frame/contracts/src/exec.rs 239 additions, 256 deletionssubstrate/frame/contracts/src/exec.rs
- substrate/frame/contracts/src/lib.rs 12 additions, 136 deletionssubstrate/frame/contracts/src/lib.rs
- substrate/frame/contracts/src/rent.rs 90 additions, 1 deletionsubstrate/frame/contracts/src/rent.rs
- substrate/frame/contracts/src/storage.rs 195 additions, 0 deletionssubstrate/frame/contracts/src/storage.rs
- substrate/frame/contracts/src/tests.rs 85 additions, 65 deletionssubstrate/frame/contracts/src/tests.rs
- substrate/frame/contracts/src/wasm/mod.rs 8 additions, 12 deletionssubstrate/frame/contracts/src/wasm/mod.rs
- substrate/frame/contracts/src/wasm/runtime.rs 25 additions, 15 deletionssubstrate/frame/contracts/src/wasm/runtime.rs
Please register or sign in to comment