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:
Alexander Theißen
2020-08-10 15:14:34 +02:00
committed by GitHub
parent f9f8262303
commit 04b185e3d4
29 changed files with 355 additions and 303 deletions
@@ -1,8 +1,8 @@
(module
(import "env" "ext_set_storage" (func $ext_set_storage (param i32 i32 i32)))
(import "env" "ext_input" (func $ext_input (param i32 i32)))
(import "env" "ext_restore_to"
(func $ext_restore_to
(import "seal0" "seal_set_storage" (func $seal_set_storage (param i32 i32 i32)))
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
(import "seal0" "seal_restore_to"
(func $seal_restore_to
(param i32 i32 i32 i32 i32 i32 i32 i32)
)
)
@@ -19,7 +19,7 @@
(func (export "call")
;; copy code hash to contract memory
(call $ext_input (i32.const 264) (i32.const 304))
(call $seal_input (i32.const 264) (i32.const 304))
(call $assert
(i32.eq
(i32.load (i32.const 304))
@@ -27,7 +27,7 @@
)
)
(call $ext_restore_to
(call $seal_restore_to
;; Pointer and length of the encoded dest buffer.
(i32.const 256)
(i32.const 8)
@@ -45,14 +45,14 @@
)
(func (export "deploy")
;; Data to restore
(call $ext_set_storage
(call $seal_set_storage
(i32.const 0)
(i32.const 0)
(i32.const 4)
)
;; ACL
(call $ext_set_storage
(call $seal_set_storage
(i32.const 100)
(i32.const 0)
(i32.const 4)
@@ -68,7 +68,7 @@
;; Address of bob
(data (i32.const 256) "\02\00\00\00\00\00\00\00")
;; [264, 296) Code hash of SET_RENT (copied here by ext_input)
;; [264, 296) Code hash of SET_RENT (copied here by seal_input)
;; [296, 304) Rent allowance
(data (i32.const 296) "\32\00\00\00\00\00\00\00")