mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
04b185e3d4
* seal: Change prefix "ext_" to "seal_" for contract callable functions The word Ext is a overloaded term in the context of substrate. It usually is a trait which abstracts away access to external resources usually in order to mock them away for the purpose of tests. The contract module has its own `Ext` trait in addition the the substrate `Ext` which makes things even more confusing. In order to differentiate the contract callable functions more clearly from this `Ext` concept we rename them to use the "seal_" prefix instead. This should change no behaviour at all. This is a pure renaming commit. * seal: Rename import module from "env" to "seal0" * seal: Fixup integration test * seal: Add more tests for new import module names
44 lines
826 B
WebAssembly Text Format
44 lines
826 B
WebAssembly Text Format
(module
|
|
(import "seal0" "seal_rent_allowance" (func $seal_rent_allowance (param i32 i32)))
|
|
(import "env" "memory" (memory 1 1))
|
|
|
|
;; [0, 8) reserved for $seal_rent_allowance output
|
|
|
|
;; [8, 16) length of the buffer
|
|
(data (i32.const 8) "\08")
|
|
|
|
;; [16, inf) zero initialized
|
|
|
|
(func $assert (param i32)
|
|
(block $ok
|
|
(br_if $ok
|
|
(get_local 0)
|
|
)
|
|
(unreachable)
|
|
)
|
|
)
|
|
|
|
(func (export "call"))
|
|
|
|
(func (export "deploy")
|
|
;; fill the buffer with the rent allowance.
|
|
(call $seal_rent_allowance (i32.const 0) (i32.const 8))
|
|
|
|
;; assert len == 8
|
|
(call $assert
|
|
(i32.eq
|
|
(i32.load (i32.const 8))
|
|
(i32.const 8)
|
|
)
|
|
)
|
|
|
|
;; assert that contents of the buffer is equal to <BalanceOf<T>>::max_value().
|
|
(call $assert
|
|
(i64.eq
|
|
(i64.load (i32.const 0))
|
|
(i64.const 0xFFFFFFFFFFFFFFFF)
|
|
)
|
|
)
|
|
)
|
|
)
|