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

Commit

Permalink
Replace sp-sandbox and wasmi-validation by just wasmi
Browse files Browse the repository at this point in the history
  • Loading branch information
athei committed Oct 28, 2022
1 parent 83ed732 commit 6ffeb48
Show file tree
Hide file tree
Showing 18 changed files with 907 additions and 669 deletions.
71 changes: 61 additions & 10 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions frame/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ serde = { version = "1", optional = true, features = ["derive"] }
smallvec = { version = "1", default-features = false, features = [
"const_generics",
] }
wasmi-validation = { version = "0.5", default-features = false }
wasmi = { version = "0.19", default-features = false }
wasmparser = { package = "wasmparser-nostd", version = "0.91", default-features = false }
impl-trait-for-tuples = "0.2"

# Only used in benchmarking to generate random contract code
Expand All @@ -42,7 +43,6 @@ sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primit
sp-core = { version = "6.0.0", default-features = false, path = "../../primitives/core" }
sp-io = { version = "6.0.0", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
sp-sandbox = { version = "0.10.0-dev", default-features = false, path = "../../primitives/sandbox" }
sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" }

[dev-dependencies]
Expand All @@ -69,16 +69,16 @@ std = [
"sp-runtime/std",
"sp-io/std",
"sp-std/std",
"sp-sandbox/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"wasm-instrument/std",
"wasmi-validation/std",
"wasmi/std",
"pallet-contracts-primitives/std",
"pallet-contracts-proc-macro/full",
"log/std",
"rand/std",
"wasmparser/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
(import "seal0" "seal_deposit_event" (func $seal_deposit_event (param i32 i32 i32 i32)))
(import "env" "memory" (memory 1 1))

(start $start)
(func $start
(func (export "deploy")
(call $seal_deposit_event
(i32.const 0) ;; The topics buffer
(i32.const 0) ;; The topics buffer's length
Expand All @@ -22,7 +21,6 @@
(func (export "call")
(unreachable)
)
(func (export "deploy"))

(data (i32.const 8) "\01\02\03\04")
)
4 changes: 4 additions & 0 deletions frame/contracts/fixtures/invalid_contract.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;; Valid module but missing the call function
(module
(func (export "deploy"))
)
6 changes: 0 additions & 6 deletions frame/contracts/fixtures/invalid_import.wat

This file was deleted.

8 changes: 8 additions & 0 deletions frame/contracts/fixtures/invalid_module.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; An invalid module
(module
(func (export "deploy"))
(func (export "call")
;; imbalanced stack
(i32.const 7)
)
)
Loading

0 comments on commit 6ffeb48

Please sign in to comment.