* Add CallbackHandle to pallet-assets
* Address review comments
* Add use for sp_io::storage
* Rebase & review comments
* Fix UT
Co-authored-by: Hoon Kim <mail@hoonkim.me>
* Fixup some wrong dependencies
Dev dependencies should not appear in the feature list. If features are required, they should be
directly enabled for the `dev-dependency`.
* More fixups
* Fix fix
* Remove deprecated feature
* Make all work properly and nice!!
* FMT
* Fix formatting
* frame-system: explicit call index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use explicit call indices
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* pallet-template: explicit call index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* DNM: Temporarily require call_index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "DNM: Temporarily require call_index"
This reverts commit c4934e312e12af72ca05a8029d7da753a9c99346.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove Default, HasCompact, and TypeInfo trait bounds on AssetId
* don't use default in benchmarking
* add helper trait
* add helper to assets tx payment test
* docs fixes
* i'm confused
* aha, cargo
* move affected dispatchable calls into new indices
* Helper -> BenchmarkHelper
* benchmark use of helper
* actually, don't break every call interface
* use into on AssetIdParameter
* Remove From from AssetIdParameter and use it in BenchmarkHelper
* include from
Co-authored-by: parity-processbot <>
* Support repeated destroys to safely destroy large assets
* require freezing accounts before destroying
* support only deleting asset as final stage when there's no assets left
* pre: introduce the RemoveKeyLimit config parameter
* debug_ensure empty account in the right if block
* update to having separate max values for accounts and approvals
* add tests and use RemoveKeyLimit constant
* add useful comments to the extrinsics, and calculate returned weight
* add benchmarking for start_destroy and finish destroy
* push failing benchmark logic
* add benchmark tests for new functions
* update weights via local benchmarks
* remove extra weight file
* Update frame/assets/src/lib.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update frame/assets/src/types.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update frame/assets/src/lib.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* effect some changes from codereview
* use NotFrozen error
* remove origin checks, as anyone can complete destruction after owner has begun the process; Add live check for other extrinsics
* fix comments about Origin behaviour
* add AssetStatus docs
* modularize logic to allow calling logic in on_idle and on_initialize hooks
* introduce simple migration for assets details
* reintroduce logging in the migrations
* move deposit_Event out of the mutate block
* Update frame/assets/src/functions.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
* Update frame/assets/src/migration.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
* move AssetNotLive checkout out of the mutate blocks
* rename RemoveKeysLimit to RemoveItemsLimit
* update docs
* fix event name in benchmark
* fix cargo fmt.
* fix lint in benchmarking
* Empty commit to trigger CI
* Update frame/assets/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/functions.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/functions.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/functions.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/assets/src/functions.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* effect change suggested during code review
* move limit to a single location
* Update frame/assets/src/functions.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* rename events
* fix weight typo, using rocksdb instead of T::DbWeight. Pending generating weights
* switch to using dead_account.len()
* rename event in the benchmarks
* empty to retrigger CI
* trigger CI to check cumulus dependency
* trigger CI for dependent cumulus
* Update frame/assets/src/migration.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* move is-frozen to the assetStatus enum (#12547)
* add pre and post migration hooks
* update do_transfer logic to add new assert for more correct error messages
* trigger CI
* switch checking AssetStatus from checking Destroying state to checking live state
* fix error type in tests from Frozen to AssetNotLive
* trigger CI
* change ensure check for fn reducible_balance()
* change the error type to Error:<T,I>::IncorrectStatus to be clearer
* Trigger CI
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Force base weights to be the minimum only when the intercept is negative; emit minimum execution times
* Add an `assert` making sure the intercept is zero when it's supposed to be zero
* Fix template
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* ".git/.scripts/bench-bot.sh" pallet dev pallet_assets
* ".git/.scripts/bench-bot.sh" pallet dev pallet_uniques
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
* BREAKING: Rename Origin
* more renaming
* a bit more renaming
* fix
* more fixing
* fix in frame_support
* even more fixes
* fix
* small fix
* ...
* update .stderr
* docs
* update docs
* update docs
* docs
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* remove RefTimeWeight
* Update frame/contracts/src/storage.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* not needed
* Fixes
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* Update frame/support/src/weights/weight_v2.rs
* not needed
* fix weight file
* pallet-asset: Fix transfer of a large amount of an asset
Before this pr transferring a large amount of an asset would check that transferring the asset would
not overflow the supply of the asset. However, it doesn't make sense to check for asset supply
overflow when we just transfer from one account to another account and don't increase the supply in
any way. It also required to extend the `can_deposit` method of `fungible` and `fungibles` with a
`mint` parameter. If this parameter is set to `true`, it means we want to mint the amount of an
asset before transferring it into an account. For `can_withdraw` we don't need to add an extra
parameter, because withdrawing should never be able to underflow the supply. If that would happen,
it would mean that somewhere the supply wasn't increased while increasing the balance of an account.
* Update frame/assets/src/functions.rs
* Update frame/assets/src/functions.rs
* Update frame/assets/src/functions.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* FMT
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Upgraded dependencies
* Adapting code to scale v3
* Empty commit to trigger CI
* Triggering CI
* Fixing UI test
* Remove superfluous dev-dep added by #9228
* Cryout for CI
* assets: execute `died` hook outside of mutate
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* assets: extend tests for `died` hook
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* assets: update doc of FrozenBalance::died
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* assets: review fixes
- fix cases where `died` should not have been called
- use `Option<DeadConsequence>` instead of `DeadConsequence`
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* assets: update comment in mock.rs
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* assets: return `Remove` in dead_account
The return value is ignored in the only case that it is produced
by a call, but having it this way makes it more understandable.
Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
* Add optimization flags to 'release' profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Optimized weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add missing pallets
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add `production` profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* pallet-collective: fix tests
the weight of System.remark went to 0, the collective test uses a
remark call to trigger an out-of-gas condition so I replaced it
with a `remark_with_event` call.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Introduce `SecretUri`
* `inspect-key`: Adds support for `expect-public`
`expect-public` can be used to check that a given secret uri corresponds to the given public key.
This is mainly useful when the secret uri is protected by a password and a new derived account
should be generated. With `--expect-public` the user can pass the public key/account-id of the
"base" secret uri aka the one without any derivation to ensure the correct password was inserted.
* Fixes
* 🤦
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Review feedback
* FMT
* Bump the versions
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>