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,42 @@
(module
(import "seal0" "seal_balance" (func $seal_balance (param i32 i32)))
(import "env" "memory" (memory 1 1))
;; [0, 8) reserved for $seal_balance output
;; [8, 16) length of the buffer for $seal_balance
(data (i32.const 8) "\08")
;; [16, inf) zero initialized
(func $assert (param i32)
(block $ok
(br_if $ok
(get_local 0)
)
(unreachable)
)
)
(func (export "deploy"))
(func (export "call")
(call $seal_balance (i32.const 0) (i32.const 8))
;; Balance should be encoded as a u64.
(call $assert
(i32.eq
(i32.load (i32.const 8))
(i32.const 8)
)
)
;; Assert the free balance to be zero.
(call $assert
(i64.eq
(i64.load (i32.const 0))
(i64.const 0)
)
)
)
)