mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 06:47:57 +00:00
64effd0e6f
Small PR that introduce a new crate that will host RISC-V & wasm fixtures for testing pallet-contracts
43 lines
733 B
WebAssembly Text Format
43 lines
733 B
WebAssembly Text Format
(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)
|
|
)
|
|
)
|
|
)
|
|
)
|