Skip to content

Commit bb2109c

Browse files
pepyakinathei
andauthored
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>
1 parent 4ba5c7a commit bb2109c

File tree

10 files changed

+660
-936
lines changed

10 files changed

+660
-936
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pallet-transaction-payment = { version = "2.0.0-rc3", default-features = false,
3131
wabt = "0.9.2"
3232
assert_matches = "1.3.0"
3333
hex-literal = "0.2.1"
34+
pretty_assertions = "0.6.1"
3435
pallet-balances = { version = "2.0.0-rc3", path = "../balances" }
3536
pallet-timestamp = { version = "2.0.0-rc3", path = "../timestamp" }
3637
pallet-randomness-collective-flip = { version = "2.0.0-rc3", path = "../randomness-collective-flip" }

fixtures/restoration.wat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
(module
22
(import "env" "ext_set_storage" (func $ext_set_storage (param i32 i32 i32)))
3-
(import "env" "ext_restore_to" (func $ext_restore_to (param i32 i32 i32 i32 i32 i32 i32 i32)))
3+
(import "env" "ext_restore_to"
4+
(func $ext_restore_to
5+
(param i32 i32 i32 i32 i32 i32 i32 i32)
6+
)
7+
)
48
(import "env" "memory" (memory 1 1))
59

610
(func (export "call")

0 commit comments

Comments
 (0)