Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Assets] Implement pallet-assets-holder #4530

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a0f5015
change(pallet-assets): define HeldBalance
pandres95 May 21, 2024
6d2aa57
change(pallet-assets): implement `Holder` to calculate reducible bala…
pandres95 Jun 10, 2024
029e887
change: add Holder type to missing pallet_assets Config implementations
pandres95 Jun 17, 2024
bf376a5
change(pallet-assets): call died hook for Holder whenever necessary
pandres95 Jun 17, 2024
fe951fa
Merge branch 'master' into pallet-assets-holder
pandres95 Jun 17, 2024
89ea43a
fix(pallet-asset-conversion-ops): missing Holder in mock config
pandres95 Jun 17, 2024
2ab3535
change(pallet-assets): adjust reducible/can_decrease to be in line wi…
pandres95 Jul 10, 2024
9d326b8
Merge branch 'master' into pallet-assets-holder
pandres95 Jul 10, 2024
c76b654
change(pallet-assets): introduce tests to check for holds and freezes…
pandres95 Jul 11, 2024
c5690e1
Merge branch 'master' into pallet-assets-holder
pandres95 Jul 11, 2024
a4bb10c
change(pallet-assets-freezer): adjust mock and tests to changes in `p…
pandres95 Jul 29, 2024
32fa5c1
feat(pallet-assets-holder): pallet implementation
pandres95 Aug 1, 2024
fe0a5e5
Merge branch 'master' into pallet-assets-holder
pandres95 Aug 1, 2024
b93337e
fix: fmt / cargo fmt
pandres95 Aug 1, 2024
4e0ced7
chore: umbrella
pandres95 Aug 1, 2024
c5b103a
chore: pr doc
pandres95 Aug 1, 2024
9cdb256
Merge branch 'master' into pallet-assets-holder
pandres95 Aug 8, 2024
f36b540
fix(staging-xcm-builder): missing references to `Holder`
pandres95 Aug 8, 2024
5829558
change(pallet-assets): set `Holder` and `Freezer` to have default val…
pandres95 Aug 8, 2024
17ce1d9
change(pallet-assets-holder): apply @gui1117's suggestion of tightly …
pandres95 Aug 8, 2024
f2a9e96
change(pallet-assets): account for `held_balance` when calculating `t…
pandres95 Aug 8, 2024
fc41634
change(pallet-assets-holder): test preservation of `total_balance`.
pandres95 Aug 8, 2024
9e9edfb
change(pallet-assets-holder): resolve `VARIANT_COUNT` to match number…
pandres95 Aug 8, 2024
e7155eb
change(pallet-assets-holder): remove assertion in test that fails aft…
pandres95 Aug 9, 2024
4268b76
change(pallet-assets-holder): implement changes suggested by @gui1117
pandres95 Aug 28, 2024
818e590
change(pallet-assets-holder): apply change from HeldBalance to Balanc…
pandres95 Aug 28, 2024
06db701
minor(pallet-assets-holder): small adjustments
pandres95 Aug 28, 2024
be7576e
Merge branch 'master' into pallet-assets-holder
pandres95 Aug 28, 2024
0a0487e
Merge branch 'pallet-assets-holder' of https://github.com/pandres95/p…
pandres95 Aug 28, 2024
7dff111
fix(pallet-revive-mock-network): include Holder on pallet_assets conf…
pandres95 Aug 28, 2024
5d04950
change(prdoc): update prdoc with all impacted crates
pandres95 Aug 28, 2024
44e8f62
change(pallet-assets-holder): add additional assertions to `try_state…
pandres95 Aug 28, 2024
bb1a98d
minor(pallet-assets-holder): rename _held_ references in comments wit…
pandres95 Aug 28, 2024
aab6498
Merge branch 'master' into pallet-assets-holder
pandres95 Aug 28, 2024
3688f89
change(pallet-assets-holder): address changes requested by @muharem
pandres95 Sep 4, 2024
900dbaa
change(pallet-assets-holder): impls -> impl_fungibles
pandres95 Sep 4, 2024
b689e2e
fix(pallet-assets-holder): missing `CheckedAdd` import
pandres95 Sep 5, 2024
2f14b32
change(pallet-assets-holder): make `died` burn balance on hold (if any).
pandres95 Sep 5, 2024
548eee1
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 5, 2024
5d7d874
change(pallet-assets-holder): fast exit for `set_balance_on_hold`.
pandres95 Sep 5, 2024
427a29b
fix(penpal-runtime): missing `Holder` in `PoolAssets` config
pandres95 Sep 6, 2024
7c28175
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 6, 2024
9ccc35c
fix(pallet-assets-holder): lint
pandres95 Sep 6, 2024
c65a4c2
change(pallet-assets-holder): revert `died` to make it an infallible …
pandres95 Sep 6, 2024
174b3d5
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 6, 2024
f1c0983
change(pallet-assets): remark the change of parameters in the `freeze…
pandres95 Sep 9, 2024
ae2f67a
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 9, 2024
92769f1
change(pallet-assets): implement contains_holds / contains_freezes
pandres95 Sep 11, 2024
a02904d
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 11, 2024
b559bda
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 11, 2024
0e848ac
fix(pallet-assets-freezer): missing import
pandres95 Sep 11, 2024
3bd7241
change(pallet-assets): disallow `refund`/`refund_other` for an accoun…
pandres95 Sep 13, 2024
4e25e73
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 13, 2024
3233d48
fix(umbrella): revert unintended misformatting of Cargo.toml
pandres95 Sep 13, 2024
a80e6e3
fix(Cargo): revert unintended regression in Cargo lockfile
pandres95 Sep 13, 2024
668c148
fix(pallet-assets): missing documentation changes
pandres95 Sep 13, 2024
4f27725
fix(pallet-assets): missing borrowing
pandres95 Sep 13, 2024
9d2256d
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 16, 2024
dec2a4c
change: resolve issues raised by ci checks
pandres95 Sep 16, 2024
25d9bb0
change(pallet-assets): make `dead_account` return either `DeadConsequ…
pandres95 Sep 23, 2024
de4702e
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 23, 2024
c81ad85
change(Cargo): update lockfile
pandres95 Sep 23, 2024
bd72de1
fix(pallet-pass): missing clone for asset id
pandres95 Sep 23, 2024
4bab6f1
make ci happy
pandres95 Sep 23, 2024
f1e5b9b
Merge branch 'master' into pallet-assets-holder
pandres95 Sep 25, 2024
8d46fa3
change(pallet-assets): tests to assert calling on `dead_account` fail…
pandres95 Oct 7, 2024
8b9b6db
Merge branch 'master' into pallet-assets-holder
pandres95 Oct 7, 2024
ba8c452
Merge branch 'master' into pallet-assets-holder
pandres95 Oct 7, 2024
7d84bee
change(pallet-assets-holder): make CI happy
pandres95 Oct 7, 2024
608b688
change(prdoc): apply suggestions and clarify changes in balance model
pandres95 Nov 3, 2024
f12acd2
Merge branch 'master' into pallet-assets-holder
pandres95 Nov 3, 2024
6ce2b83
Merge branch 'master' into pallet-assets-holder
pandres95 Nov 3, 2024
189d8d4
change(pallet-assets-freezer): handle `assert_debug`s when calling `d…
pandres95 Nov 3, 2024
6130c60
fix(pallet-assets): on `can_decrease`, return `WouldDie` if there's b…
pandres95 Nov 4, 2024
f7d0a41
change(pallet-assets): assert `died` hooks for both `Freezer` AND `Ho…
pandres95 Nov 4, 2024
6bebe7e
change(pallet-assets): document the `balance` field of `AssetAccount`…
pandres95 Nov 4, 2024
3e797b1
change(pallet-assets): assert deposit
pandres95 Nov 5, 2024
595b838
fix(pallet-assets): typo (thanks to @gui1117 for the suggestion)
pandres95 Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ members = [
"substrate/frame/asset-rate",
"substrate/frame/assets",
"substrate/frame/assets-freezer",
"substrate/frame/assets-holder",
"substrate/frame/atomic-swap",
"substrate/frame/aura",
"substrate/frame/authority-discovery",
Expand Down Expand Up @@ -878,6 +879,7 @@ pallet-asset-rate = { path = "substrate/frame/asset-rate", default-features = fa
pallet-asset-tx-payment = { path = "substrate/frame/transaction-payment/asset-tx-payment", default-features = false }
pallet-assets = { path = "substrate/frame/assets", default-features = false }
pallet-assets-freezer = { path = "substrate/frame/assets-freezer", default-features = false }
pallet-assets-holder = { path = "substrate/frame/assets-holder", default-features = false }
pallet-atomic-swap = { default-features = false, path = "substrate/frame/atomic-swap" }
pallet-aura = { path = "substrate/frame/aura", default-features = false }
pallet-authority-discovery = { path = "substrate/frame/authority-discovery", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = AssetsStringLimit;
type Holder = ();
type Freezer = AssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_local::WeightInfo<Runtime>;
Expand Down Expand Up @@ -308,6 +309,7 @@ impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
type MetadataDepositPerByte = ConstU128<0>;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = PoolAssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_pool::WeightInfo<Runtime>;
Expand Down Expand Up @@ -431,6 +433,7 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte;
type ApprovalDeposit = ForeignAssetsApprovalDeposit;
type StringLimit = ForeignAssetsAssetsStringLimit;
type Holder = ();
type Freezer = ForeignAssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_foreign::WeightInfo<Runtime>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = AssetsStringLimit;
type Holder = ();
type Freezer = AssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_local::WeightInfo<Runtime>;
Expand Down Expand Up @@ -306,6 +307,7 @@ impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
type MetadataDepositPerByte = ConstU128<0>;
type ApprovalDeposit = ConstU128<0>;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = PoolAssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_pool::WeightInfo<Runtime>;
Expand Down Expand Up @@ -429,6 +431,7 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte;
type ApprovalDeposit = ForeignAssetsApprovalDeposit;
type StringLimit = ForeignAssetsAssetsStringLimit;
type Holder = ();
type Freezer = ForeignAssetsFreezer;
type Extra = ();
type WeightInfo = weights::pallet_assets_foreign::WeightInfo<Runtime>;
Expand Down
3 changes: 3 additions & 0 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = AssetsStringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
Expand Down Expand Up @@ -500,6 +501,7 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte;
type ApprovalDeposit = ForeignAssetsApprovalDeposit;
type StringLimit = ForeignAssetsAssetsStringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
Expand Down Expand Up @@ -539,6 +541,7 @@ impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
type MetadataDepositPerByte = ConstU128<0>;
type ApprovalDeposit = ConstU128<0>;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ impl pallet_assets::Config for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = AssetsStringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
Expand Down
1 change: 1 addition & 0 deletions polkadot/xcm/pallet-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ impl pallet_assets::Config for Test {
type MetadataDepositPerByte = ConstU128<1>;
type ApprovalDeposit = ConstU128<1>;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = ();
type WeightInfo = ();
type CallbackHandle = ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type Freezer = ();
type Holder = ();
type CallbackHandle = ();
}

Expand All @@ -97,6 +98,7 @@ impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type Freezer = ();
type Holder = ();
type CallbackHandle = ();
}

Expand Down
1 change: 1 addition & 0 deletions polkadot/xcm/xcm-builder/src/tests/pay/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl pallet_assets::Config for Test {
type AssetAccountDeposit = AssetAccountDeposit;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = AssetsStringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = ();
Expand Down
1 change: 1 addition & 0 deletions polkadot/xcm/xcm-runtime-apis/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl pallet_assets::Config for TestRuntime {
type Currency = Balances;
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type Holder = ();
type Freezer = ();
type AssetDeposit = ConstU128<1>;
type AssetAccountDeposit = ConstU128<10>;
Expand Down
63 changes: 63 additions & 0 deletions prdoc/pr_4530.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
title: "Implement `pallet-assets-holder`"

doc:
- audience: Runtime Dev
description: |
This change creates the `pallet-assets-holder` pallet, as well as changes `pallet-assets`
to support querying held balances via a new trait: `BalanceOnHold`.

It also adjusts the balance model implementation for fungible
pandres95 marked this conversation as resolved.
Show resolved Hide resolved
sets (see [sdk docs](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/index.html#visualising-balance-components-together-)).

The `pallet-assets-holder` implements `hold` traits for `pallet-assets`, by extending this
pallet and implementing the `BalanceOnHold` trait so the held balance can be queried by
`pallet-assets` to calculate the reducible (a.k.a. spendable) balance.

These changes imply adding a configuration type in `pallet-assets` for `Holder`

## Default implementation of `Holder`

Use `()` as the default value, when no holding capabilities are wanted in the runtime
implementation.

## Enable `pallet-assets-holder`

Define an instance of `pallet-assets-holder` (we'll call it `AssetsHolder`) and use
`AssetsHolder` as the value for `Holder`, when intend to use holding capabilities are
pandres95 marked this conversation as resolved.
Show resolved Hide resolved
wanted in the runtime implementation.

crates:
- name: asset-hub-rococo-runtime
bump: minor
- name: asset-hub-westend-runtime
bump: minor
- name: pallet-asset-tx-payment
bump: patch
- name: pallet-asset-conversion-ops
bump: patch
- name: pallet-asset-conversion-tx-payment
bump: patch
- name: pallet-assets
bump: major
- name: pallet-assets-holder
bump: major
- name: pallet-assets-freezer
bump: patch
- name: pallet-contracts-mock-network
bump: patch
- name: pallet-nft-fractionalization
bump: patch
- name: pallet-revive-mock-network
bump: patch
- name: pallet-xcm
bump: patch
- name: penpal-runtime
bump: patch
- name: rococo-parachain-runtime
bump: patch
- name: polkadot-sdk
bump: minor
- name: staging-xcm-builder
bump: patch
- name: xcm-runtime-apis
bump: patch
2 changes: 2 additions & 0 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,7 @@ impl pallet_assets::Config<Instance1> for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = StringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type CallbackHandle = ();
Expand Down Expand Up @@ -1725,6 +1726,7 @@ impl pallet_assets::Config<Instance2> for Runtime {
type MetadataDepositPerByte = MetadataDepositPerByte;
type ApprovalDeposit = ApprovalDeposit;
type StringLimit = StringLimit;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
Expand Down
2 changes: 2 additions & 0 deletions substrate/frame/asset-conversion/ops/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl pallet_assets::Config<Instance1> for Test {
type Currency = Balances;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<Self::AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Holder = ();
type Freezer = ();
}

Expand All @@ -76,6 +77,7 @@ impl pallet_assets::Config<Instance2> for Test {
type CreateOrigin =
AsEnsureOriginWithArg<EnsureSignedBy<AssetConversionOrigin, Self::AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Holder = ();
type Freezer = ();
}

Expand Down
2 changes: 2 additions & 0 deletions substrate/frame/asset-conversion/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl pallet_assets::Config<Instance1> for Test {
type MetadataDepositPerByte = ConstU128<1>;
type ApprovalDeposit = ConstU128<1>;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = ();
Expand All @@ -108,6 +109,7 @@ impl pallet_assets::Config<Instance2> for Test {
type MetadataDepositPerByte = ConstU128<0>;
type ApprovalDeposit = ConstU128<0>;
type StringLimit = ConstU32<50>;
type Holder = ();
type Freezer = ();
type Extra = ();
type WeightInfo = ();
Expand Down
5 changes: 5 additions & 0 deletions substrate/frame/assets-freezer/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use frame_support::traits::{
};
use pallet_assets::FrozenBalance;
use sp_runtime::traits::Zero;
use storage::StorageDoubleMap;

// Implements [`FrozenBalance`] from [`pallet-assets`], so it can understand how much of an
// account balance is frozen, and is able to signal to this pallet when to clear the state of an
Expand All @@ -38,6 +39,10 @@ impl<T: Config<I>, I: 'static> FrozenBalance<T::AssetId, T::AccountId, T::Balanc
FrozenBalances::<T, I>::remove(asset.clone(), who);
pandres95 marked this conversation as resolved.
Show resolved Hide resolved
Freezes::<T, I>::remove(asset, who);
}

fn contains_freezes(asset: T::AssetId) -> bool {
Freezes::<T, I>::contains_prefix(asset)
}
}

// Implement [`fungibles::Inspect`](frame_support::traits::fungibles::Inspect) as it is bound by
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/assets-freezer/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl pallet_assets::Config for Test {
type RemoveItemsLimit = ConstU32<10>;
type CallbackHandle = ();
type Currency = Balances;
type Holder = ();
type Freezer = AssetsFreezer;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
Expand Down
14 changes: 7 additions & 7 deletions substrate/frame/assets-freezer/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod impl_mutate_freeze {
Preservation::Preserve,
Fortitude::Polite,
),
89
90
);
System::assert_last_event(
Event::<Test>::Frozen { asset_id: ASSET_ID, who: WHO, amount: 10 }.into(),
Expand All @@ -186,7 +186,7 @@ mod impl_mutate_freeze {
Preservation::Preserve,
Fortitude::Polite,
),
91
92
);
System::assert_last_event(
Event::<Test>::Thawed { asset_id: ASSET_ID, who: WHO, amount: 2 }.into(),
Expand Down Expand Up @@ -219,7 +219,7 @@ mod impl_mutate_freeze {
Preservation::Preserve,
Fortitude::Polite,
),
89
90
);
assert_ok!(AssetsFreezer::extend_freeze(
ASSET_ID,
Expand All @@ -237,7 +237,7 @@ mod impl_mutate_freeze {
Preservation::Preserve,
Fortitude::Polite,
),
88
89
);
});
}
Expand All @@ -261,7 +261,7 @@ mod impl_mutate_freeze {
Preservation::Preserve,
Fortitude::Polite,
),
89
90
);
assert_ok!(AssetsFreezer::thaw(ASSET_ID, &DummyFreezeReason::Governance, &WHO));
System::assert_has_event(
Expand Down Expand Up @@ -295,10 +295,10 @@ mod with_pallet_assets {
20
));
assert_noop!(
Assets::transfer(RuntimeOrigin::signed(WHO), Compact(ASSET_ID), 2, 80),
Assets::transfer(RuntimeOrigin::signed(WHO), Compact(ASSET_ID), 2, 81),
pallet_assets::Error::<Test>::BalanceLow,
);
assert_ok!(Assets::transfer(RuntimeOrigin::signed(WHO), Compact(ASSET_ID), 2, 79));
assert_ok!(Assets::transfer(RuntimeOrigin::signed(WHO), Compact(ASSET_ID), 2, 80));
});
}
}
Loading
Loading