mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
seal: Change prefix and module name from "ext_" to "seal_" for contract callable functions (#6798)
* 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
This commit is contained in:
committed by
GitHub
parent
f9f8262303
commit
04b185e3d4
@@ -1,7 +1,7 @@
|
||||
(module
|
||||
(import "env" "ext_get_storage" (func $ext_get_storage (param i32 i32 i32) (result i32)))
|
||||
(import "env" "ext_set_storage" (func $ext_set_storage (param i32 i32 i32)))
|
||||
(import "env" "ext_input" (func $ext_input (param i32 i32)))
|
||||
(import "seal0" "seal_get_storage" (func $seal_get_storage (param i32 i32 i32) (result i32)))
|
||||
(import "seal0" "seal_set_storage" (func $seal_set_storage (param i32 i32 i32)))
|
||||
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
|
||||
(import "env" "memory" (memory 16 16))
|
||||
|
||||
;; [0, 32) storage key
|
||||
@@ -12,10 +12,10 @@
|
||||
;; [36, 40) size of the input buffer
|
||||
(data (i32.const 36) "\04")
|
||||
|
||||
;; [40, 44) size of buffer for ext_get_storage set to max
|
||||
;; [40, 44) size of buffer for seal_get_storage set to max
|
||||
(data (i32.const 40) "\FF\FF\FF\FF")
|
||||
|
||||
;; [44, inf) ext_get_storage buffer
|
||||
;; [44, inf) seal_get_storage buffer
|
||||
|
||||
(func $assert (param i32)
|
||||
(block $ok
|
||||
@@ -27,7 +27,7 @@
|
||||
)
|
||||
|
||||
(func (export "call")
|
||||
(call $ext_input (i32.const 32) (i32.const 36))
|
||||
(call $seal_input (i32.const 32) (i32.const 36))
|
||||
|
||||
;; assert input size == 4
|
||||
(call $assert
|
||||
@@ -38,7 +38,7 @@
|
||||
)
|
||||
|
||||
;; place a garbage value in storage, the size of which is specified by the call input.
|
||||
(call $ext_set_storage
|
||||
(call $seal_set_storage
|
||||
(i32.const 0) ;; Pointer to storage key
|
||||
(i32.const 0) ;; Pointer to value
|
||||
(i32.load (i32.const 32)) ;; Size of value
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
(call $assert
|
||||
(i32.eq
|
||||
(call $ext_get_storage
|
||||
(call $seal_get_storage
|
||||
(i32.const 0) ;; Pointer to storage key
|
||||
(i32.const 44) ;; buffer where to copy result
|
||||
(i32.const 40) ;; pointer to size of buffer
|
||||
|
||||
Reference in New Issue
Block a user