mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 03:18:01 +00:00
25de5b5c78
* Transition getter functions to not use scratch buffer * Remove scratch buffer from ext_get_storage * Remove scratch buffer from ext_call * Remove scratch buffer from ext_instantiate * Add ext_input and remove scratch buffer * Rework error handling (changes RPC exposed data) * ext_return passes a flags field instead of a return code * Flags is only for seal and not for the caller * flags: u32 replaced status_code: u8 in RPC exposed type * API functions use a unified error type (ReturnCode) * ext_transfer now traps on error to be consistent with call and instantiate * Remove the no longer used `Dispatched` event * Updated inline documentation * Prevent skipping of copying the output for getter API * Return gas_consumed from the RPC contracts call interface * Updated COMPLEXTITY.md * Rename ext_gas_price to ext_weight_to_fee * Align comments with spaces * Removed no longer used `ExecError` * Remove possible panic in `from_typed_value` * Use a struct as associated data for SpecialTrap::Return * Fix nits in COMPLEXITY.md * Renamed SpecialTrap to TrapReason * Fix test * Finish renaming special_trap -> trap_reason * Remove no longer used get_runtime_storage * fixup! Remove no longer used get_runtime_storage * Removed tabs for comment aligment
44 lines
820 B
WebAssembly Text Format
44 lines
820 B
WebAssembly Text Format
(module
|
|
(import "env" "ext_rent_allowance" (func $ext_rent_allowance (param i32 i32)))
|
|
(import "env" "memory" (memory 1 1))
|
|
|
|
;; [0, 8) reserved for $ext_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 $ext_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)
|
|
)
|
|
)
|
|
)
|
|
)
|