Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
pallet-contracts: migrate to nested storage transaction mechanism (#6382
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
3 people authored Jun 23, 2020
1 parent d59281f commit 9a9b248
Show file tree
Hide file tree
Showing 11 changed files with 661 additions and 936 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frame/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pallet-transaction-payment = { version = "2.0.0-rc3", default-features = false,
wabt = "0.9.2"
assert_matches = "1.3.0"
hex-literal = "0.2.1"
pretty_assertions = "0.6.1"
pallet-balances = { version = "2.0.0-rc3", path = "../balances" }
pallet-timestamp = { version = "2.0.0-rc3", path = "../timestamp" }
pallet-randomness-collective-flip = { version = "2.0.0-rc3", path = "../randomness-collective-flip" }
Expand Down
6 changes: 5 additions & 1 deletion frame/contracts/fixtures/restoration.wat
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(module
(import "env" "ext_set_storage" (func $ext_set_storage (param i32 i32 i32)))
(import "env" "ext_restore_to" (func $ext_restore_to (param i32 i32 i32 i32 i32 i32 i32 i32)))
(import "env" "ext_restore_to"
(func $ext_restore_to
(param i32 i32 i32 i32 i32 i32 i32 i32)
)
)
(import "env" "memory" (memory 1 1))

(func (export "call")
Expand Down
Loading

0 comments on commit 9a9b248

Please sign in to comment.