Contracts move fixtures to new crate (#2246)

Small PR that introduce a new crate that will host RISC-V & wasm
fixtures for testing pallet-contracts
This commit is contained in:
PG Herveou
2023-11-10 12:22:47 +01:00
committed by GitHub
parent 03ee44d9e1
commit 64effd0e6f
57 changed files with 74 additions and 23 deletions
@@ -0,0 +1,39 @@
(module
(import "seal0" "seal_deposit_event" (func $seal_deposit_event (param i32 i32 i32 i32)))
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
(import "env" "memory" (memory 16 16))
;; [0, 4) size of the input buffer
(data (i32.const 0) "\04")
(func $assert (param i32)
(block $ok
(br_if $ok
(get_local 0)
)
(unreachable)
)
)
(func (export "call")
(call $seal_input (i32.const 4) (i32.const 0))
;; assert input size == 4
(call $assert
(i32.eq
(i32.load (i32.const 0))
(i32.const 4)
)
)
;; place a garbage value in storage, the size of which is specified by the call input.
(call $seal_deposit_event
(i32.const 0) ;; topics_ptr
(i32.const 0) ;; topics_len
(i32.const 0) ;; data_ptr
(i32.load (i32.const 4)) ;; data_len
)
)
(func (export "deploy"))
)