mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
contracts: Allow ChainExtension::call() to access &mut self (#11874)
* Give chain extensions the ability to store some temporary values * Update frame/contracts/src/wasm/runtime.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Rename func_id -> id * Replace `id` param by two functions on `env` Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
626140454d
commit
c470e9d11d
@@ -31,14 +31,14 @@
|
||||
|
||||
;; the chain extension passes through the input and returns it as output
|
||||
(call $seal_call_chain_extension
|
||||
(i32.load (i32.const 4)) ;; func_id
|
||||
(i32.load (i32.const 4)) ;; id
|
||||
(i32.const 4) ;; input_ptr
|
||||
(i32.load (i32.const 0)) ;; input_len
|
||||
(i32.const 16) ;; output_ptr
|
||||
(i32.const 12) ;; output_len_ptr
|
||||
)
|
||||
|
||||
;; the chain extension passes through the func_id
|
||||
;; the chain extension passes through the id
|
||||
(call $assert (i32.eq (i32.load (i32.const 4))))
|
||||
|
||||
(call $seal_return (i32.const 0) (i32.const 16) (i32.load (i32.const 12)))
|
||||
|
||||
Reference in New Issue
Block a user