Skip to content

Commit

Permalink
Assets: Remove zombies, introduce approvals (paritytech#8220)
Browse files Browse the repository at this point in the history
* Initial work

* Tests for frame system

* Self-sufficient account ref-counting

* Fixes

* Benchmarks building.

* Update frame/system/src/lib.rs

Co-authored-by: Jaco Greeff <[email protected]>

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Test approvals

* Fixes

* Report assets pallet tests

* Tests for approvals & force_cancel_approval

* Use structs rather than tuples for approval data

* Add force_asset_status, force_set_metadata

* Add clear_metadata.

* approval benchmarks

* force_asset_status benchmarks

* final benchmarks

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Update frame/system/src/lib.rs

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Update frame/system/src/lib.rs

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Update frame/system/src/lib.rs

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Docs for new approval dispatches.

* Docs for pallet.

* Remove accidental code.

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Fixes

* Update frame/assets/src/lib.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

* Grumbles.

* Transfer zero works, use DispatchResult

* fix test

* Remove force_destroy

* Remove TODO

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* transfer_keep_alive

* Fixes

* Fixes

* Fixes

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Jaco Greeff <[email protected]>
Co-authored-by: Parity Benchmarking Bot <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
  • Loading branch information
5 people authored Mar 9, 2021
1 parent ac1f7ff commit 641aa72
Show file tree
Hide file tree
Showing 7 changed files with 1,776 additions and 1,073 deletions.
12 changes: 6 additions & 6 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,9 @@ parameter_types! {
impl pallet_lottery::Config for Runtime {
type ModuleId = LotteryModuleId;
type Call = Call;
type Event = Event;
type Currency = Balances;
type Randomness = RandomnessCollectiveFlip;
type Event = Event;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxCalls = MaxCalls;
type ValidateCall = Lottery;
Expand All @@ -1024,8 +1024,8 @@ impl pallet_lottery::Config for Runtime {
}

parameter_types! {
pub const AssetDepositBase: Balance = 100 * DOLLARS;
pub const AssetDepositPerZombie: Balance = 1 * DOLLARS;
pub const AssetDeposit: Balance = 100 * DOLLARS;
pub const ApprovalDeposit: Balance = 1 * DOLLARS;
pub const StringLimit: u32 = 50;
pub const MetadataDepositBase: Balance = 10 * DOLLARS;
pub const MetadataDepositPerByte: Balance = 1 * DOLLARS;
Expand All @@ -1037,11 +1037,11 @@ impl pallet_assets::Config for Runtime {
type AssetId = u32;
type Currency = Balances;
type ForceOrigin = EnsureRoot<AccountId>;
type AssetDepositBase = AssetDepositBase;
type AssetDepositPerZombie = AssetDepositPerZombie;
type StringLimit = StringLimit;
type AssetDeposit = AssetDeposit;
type MetadataDepositBase = MetadataDepositBase;
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = StringLimit;
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
}

Expand Down
Loading

0 comments on commit 641aa72

Please sign in to comment.