Files
pezkuwi-subxt/substrate/frame/contracts/fixtures/store_deploy.wat
T
Sasha Gryaznov 60310de7d6 [contracts] Port host functions to Weight V2 and storage deposit limit (#13565)
* added [unstable][seal2] call()

* updated test to cover new seal_call proof_limit

* docs updated

* add [seal2][unstable] instantiate() and test

* add [seal2][unstable] weight_to_fee() + docs and test

* add [seal2][unstable] gas_left() + docs and test

* update benchmarks

* add DefaultDepositLimit to pallet Config

* specify deposit limit for nested call

add test for nested call deposit limit

save: separate deposit limit for nested calls

* specify deposit limit for nested instantiate

save: works with test

cleaned up debugging outputs

* update benchmarks

* added missing fixtures

* fix benches

* pass explicit deposit limit to storage bench

* explicit deposit limit for another set_storage bench

* add more deposit limit for storage benches

* moving to simplified benchmarks

* moved to simplified benchmarks

* fix seal_weight_to_fee bench

* fix seal_instantiate benchmark

* doc typo fix

* default dl for benchmarking

more dl for tests

dl for tests to max

deposit_limit fix in instantiate bench

fix instantiate bench

fix instantiate benchmark

fix instantiate bench again

remove dbg

fix seal bench again

fixing it still

seal_instantiate zero deposit

less runs to check if deposit enough

try

try 2

try 3

try 4

* max_runtime_mem to Schedule limits

* add default deposit limit fallback check to test

* weight params renaming

* fmt

* Update frame/contracts/src/benchmarking/mod.rs

Co-authored-by: PG Herveou <pgherveou@gmail.com>

* prettify inputs in tests

* typestate param refactored

---------

Co-authored-by: PG Herveou <pgherveou@gmail.com>
2023-04-26 11:27:13 +00:00

46 lines
1.0 KiB
WebAssembly Text Format

;; Stores a value of the passed size in constructor.
(module
(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
(data (i32.const 0) "\01")
;; [32, 36) buffer where input is copied (expected size of storage item)
;; [36, 40) size of the input buffer
(data (i32.const 36) "\04")
(func $assert (param i32)
(block $ok
(br_if $ok
(get_local 0)
)
(unreachable)
)
)
(func (export "deploy")
(call $seal_input (i32.const 32) (i32.const 36))
;; assert input size == 4
(call $assert
(i32.eq
(i32.load (i32.const 36))
(i32.const 4)
)
)
;; place a value in storage, the size of which is specified by the call input.
;; we don't care about the contents of the storage item
(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
)
)
(func (export "call"))
)