mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 03:18:01 +00:00
6863476603
* Frame no longer needs to be mutable (refactoring artifact) * Remove Contract/Tombstone deposit * Add StorageMeter * cargo fmt * Fix weight annotation * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Simplify keep check for contract accounts - Make sure that the "base deposit" for each contract >= ed - Remove now obsolete checks when sneding away free balance * Remove unused imports and functions * Rename storage_limit to storage_deposit_limit * cargo fmt * Fix typo Co-authored-by: Michael Müller <michi@parity.io> * Finish up rename of storage_limit * Fix rpc tests * Make use of `StorageDepositLimitTooHigh` * Add tests and fix bugs discovered by tests * Add storage migration * Don't use u128 in RPC * Fix weight of migration * Rename `endowment` to `value` * Fix bug where contract couldn't get funded by a storage deposit - Make sure that contract gets funded from deposits before value is transferred - Don't reserve value at origin because otherwise funding isn't possible - Just transfer free balance and reserve it after the transfer - When refunding make sure that this refund can't dust the contract - Can only happen after a runtime upgrade where costs where upped - Add more tests * Apply suggestions from code review Co-authored-by: Andrew Jones <ascjones@gmail.com> * Remove unused `fn storage_meter` * Fix copy pasta doc error * Import `MaxEncodeLen` from codec * Beautify RPC trait bounds * Add re-instrument behaviour to dispatchable doc * Make sure a account won't be destroyed a refund after a slash * Apply suggestions from code review Co-authored-by: Andrew Jones <ascjones@gmail.com> * Update `Storage::write` docs * Improve doc * Remove superflous conditional * Typos * Remove superflous clone (refactoring artifact) * Apply suggestions from code review Co-authored-by: Andrew Jones <ascjones@gmail.com> Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Michael Müller <michi@parity.io> Co-authored-by: Andrew Jones <ascjones@gmail.com>
46 lines
1.0 KiB
WebAssembly Text Format
46 lines
1.0 KiB
WebAssembly Text Format
;; Stores a value of the passed size.
|
|
(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 "call")
|
|
(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 "deploy"))
|
|
)
|