Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
89ccc72
WIP
gui1117 Apr 15, 2024
e286945
rename
gui1117 Apr 16, 2024
a716e0f
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Apr 16, 2024
9430c24
version and prdoc
gui1117 Apr 16, 2024
f185216
doc
gui1117 Apr 16, 2024
ef36ecf
formatting refactoring
gui1117 Apr 16, 2024
4f61356
prdoc
gui1117 Apr 16, 2024
31ebf61
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Apr 23, 2024
1c8185d
address comments improves prdoc
gui1117 Apr 23, 2024
fb0a90c
safer internal API
gui1117 Apr 23, 2024
602eeab
doc
gui1117 Apr 23, 2024
18358ad
reorg and fix destroying assert
gui1117 Apr 23, 2024
f7021bb
fmt and typo
gui1117 Apr 23, 2024
a2a3a26
make runtimes burn when privilege is revoked
gui1117 Apr 23, 2024
e2315c6
fmt
gui1117 Apr 23, 2024
27cf5a8
weights
gui1117 Apr 23, 2024
b5884a2
fake weight before benchmarking with bot
gui1117 Apr 23, 2024
a9f51b5
fix
gui1117 Apr 23, 2024
250b321
prdoc
gui1117 Apr 23, 2024
4dc68c4
weights
gui1117 Apr 23, 2024
0dd982a
spelling and fix compilation
gui1117 Apr 23, 2024
51ae60c
log
gui1117 Apr 23, 2024
e2a3782
fix migration for pallet with instance
gui1117 Apr 23, 2024
d3c2801
fix benchmarking by using force_create
gui1117 Apr 23, 2024
bc31d85
Merge branch 'master' into gui-assets-revoke-through-status
joepetrowski Apr 23, 2024
9176cd9
".git/.scripts/commands/fmt/fmt.sh"
Apr 23, 2024
1aec7d5
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Apr 23, 2024
0ac4845
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Apr 23, 2024
bb1a490
Fix migration idempotency
gui1117 Apr 24, 2024
43b61d8
prdoc suggestions
gui1117 Apr 24, 2024
c4f98f6
Fix spelling and use saturating_add
gui1117 Apr 24, 2024
3cda448
Use versioned migration
gui1117 Apr 24, 2024
615f5ae
Fix compilation
gui1117 Apr 24, 2024
c1d67aa
Fix migration
gui1117 Apr 24, 2024
266cbb8
fix compilation
gui1117 Apr 24, 2024
f146170
fix unused
gui1117 Apr 24, 2024
a76350b
Merge branch 'master' into gui-assets-revoke-through-status
gui1117 Apr 27, 2024
e1853a6
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Jun 27, 2024
7dd5394
fix mock
gui1117 Jun 27, 2024
f76b23f
Apply suggestions from code review
gui1117 Jul 1, 2024
3036e0c
doc
gui1117 Jul 1, 2024
3794a11
Burn at relay
gui1117 Jul 1, 2024
d6d83e2
Merge branch 'master' into gui-assets-revoke-through-status
gui1117 Jul 1, 2024
6976d91
add integration test for assets and burn at relay
gui1117 Jul 3, 2024
247c84a
hello clippy
gui1117 Jul 3, 2024
a0c0f1f
Merge branch 'master' into gui-assets-revoke-through-status
gui1117 Jul 3, 2024
85e4fcc
minor improvement
gui1117 Jul 3, 2024
47d4bfd
Apply suggestions from code review
joepetrowski Jul 3, 2024
69ee8b4
Merge branch 'master' into gui-assets-revoke-through-status
gui1117 Jul 4, 2024
5962bb5
add migration for penpal and rococo and do prdoc
gui1117 Jul 4, 2024
36a3d7d
fmt
gui1117 Jul 4, 2024
a49b673
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Aug 7, 2024
905f658
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Aug 7, 2024
35fb7e2
Merge branch 'master' into gui-assets-revoke-through-status
gui1117 Aug 7, 2024
c0929cb
fix nostd
gui1117 Aug 7, 2024
5be3576
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Aug 27, 2024
ec8f2d0
fix tests
gui1117 Aug 27, 2024
50634c9
prdoc
gui1117 Aug 27, 2024
6594d94
address review: refactor + error returned on internal error, instead …
gui1117 Sep 6, 2024
04bd5ae
Merge remote-tracking branch 'origin/master' into gui-assets-revoke-t…
gui1117 Sep 6, 2024
24ab012
fixup
gui1117 Sep 6, 2024
d0a8ab2
better doc about reset team
gui1117 Sep 9, 2024
d029b29
fix test
gui1117 Sep 9, 2024
0fbdeb3
slightly better wording
gui1117 Sep 9, 2024
5d30a4e
use some random account for team with no privileges
gui1117 Sep 9, 2024
6b99f08
prdoc
gui1117 Sep 9, 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
2 changes: 1 addition & 1 deletion Cargo.lock

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

36 changes: 36 additions & 0 deletions prdoc/pr_4150.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: "pallet assets: Add the new status live and no privileges. and new call to revoke privileges"
topic: pallet assets


doc:
- audience: Runtime Dev
description: |
The new status "live and no privileges" (`LiveAndNoPrivileges`) is created. Under this
status, owner, issuer, admin and freezer has no privileges and metadata are frozen.
The new call `revoke_all_privileges` is created. This call allows `ForceOrigin` or the
`Owner` to revoke all the privileges on the asset. This operation is irrevesible for the
`Owner`, `ForceOrigin` can always reverse by using `force_asset_status`.

Storage is backward compatible so the migration consist of updating storage version
from V1 to V2.

`Config` trait has a new associated type `DepositDestinationOnRevocation`
This type is used for the destination of the deposit when privileges are revoked.
Set it to `()` to burn them.

- audience: Runtime User
description: |
The new status "live and no privileges" (`LiveAndNoPrivileges`) is created. Under this
status, owner, issuer, admin and freezer has no privileges and metadata are frozen.
The new call `revoke_all_privileges` is created. This call allows `ForceOrigin` or the
`Owner` to revoke all the privileges on the asset. This operation is irrevesible for the
`Owner`, `ForceOrigin` can always reverse by using `force_asset_status`.

crates:
- name: pallet-assets
bump: major

migrations:
runtime:
- reference: "pallet-assets: storage version 2"
description: "V2: update is backward compatible with V1, so only storage version 2 needs to be stored"
2 changes: 1 addition & 1 deletion substrate/frame/assets/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-assets"
version = "29.1.0"
version = "30.0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be done when released to avoid multiple version increments

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed in 6594d94

authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
Expand Down
24 changes: 24 additions & 0 deletions substrate/frame/assets/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,5 +553,29 @@ benchmarks_instance_pallet! {
assert_last_event::<T, I>(Event::Blocked { asset_id: asset_id.into(), who: caller }.into());
}

revoke_all_privileges {
let asset_id = default_asset_id::<T, I>();
let caller: T::AccountId = whitelisted_caller();
let caller_lookup = T::Lookup::unlookup(caller.clone());

let needed_balance = T::Currency::minimum_balance()
+ T::AssetDeposit::get()
+ T::MetadataDepositBase::get();
T::Currency::make_free_balance_be(&caller, needed_balance);

// We use `create` so we have a deposit to unreserve.
assert!(
Assets::<T, I>::create(
SystemOrigin::Signed(caller.clone()).into(),
asset_id.clone(),
caller_lookup.clone(),
1u32.into(),
).is_ok()
);
}: _(SystemOrigin::Signed(caller.clone()), asset_id.clone())
verify {
assert_eq!(Asset::<T, I>::get(asset_id.into()).unwrap().status, AssetStatus::LiveAndNoPrivileges);
}

impl_benchmark_test_suite!(Assets, crate::mock::new_test_ext(), crate::mock::Test)
}
113 changes: 69 additions & 44 deletions substrate/frame/assets/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
keep_alive: bool,
) -> Result<T::Balance, DispatchError> {
let details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&details)?;

let account = Account::<T, I>::get(&id, who).ok_or(Error::<T, I>::NoAccount)?;
ensure!(!account.status.is_frozen(), Error::<T, I>::Frozen);
Expand Down Expand Up @@ -317,11 +317,13 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
ensure!(!Account::<T, I>::contains_key(&id, &who), Error::<T, I>::AlreadyExists);
let deposit = T::AssetAccountDeposit::get();
let mut details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
ensure!(
!check_depositor || &depositor == &details.admin || &depositor == &details.freezer,
Error::<T, I>::NoPermission
);
Self::ensure_live_asset(&details)?;
if check_depositor {
ensure!(
details.admin() == Some(&depositor) || details.freezer() == Some(&depositor),
Error::<T, I>::NoPermission
);
}
let reason = Self::new_account(&who, &mut details, Some((&depositor, deposit)))?;
T::Currency::reserve(&depositor, deposit)?;
Asset::<T, I>::insert(&id, details);
Expand All @@ -347,7 +349,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let mut account = Account::<T, I>::get(&id, &who).ok_or(Error::<T, I>::NoDeposit)?;
ensure!(matches!(account.reason, Consumer | DepositHeld(..)), Error::<T, I>::NoDeposit);
let mut details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(matches!(details.status, Live | Frozen), Error::<T, I>::IncorrectStatus);
ensure!(details.status != Destroying, Error::<T, I>::DestroyingAsset);
ensure!(account.balance.is_zero() || allow_burn, Error::<T, I>::WouldBurn);

if let Some(deposit) = account.reason.take_deposit() {
Expand Down Expand Up @@ -381,10 +383,13 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let (depositor, deposit) =
account.reason.take_deposit_from().ok_or(Error::<T, I>::NoDeposit)?;
let mut details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&details)?;
ensure!(!account.status.is_frozen(), Error::<T, I>::Frozen);
if let Some(caller) = maybe_check_caller {
ensure!(caller == depositor || caller == details.admin, Error::<T, I>::NoPermission);
ensure!(
caller == depositor || Some(&caller) == details.admin(),
Error::<T, I>::NoPermission
);
}
ensure!(account.balance.is_zero(), Error::<T, I>::WouldBurn);

Expand Down Expand Up @@ -417,7 +422,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
) -> DispatchResult {
Self::increase_balance(id.clone(), beneficiary, amount, |details| -> DispatchResult {
if let Some(check_issuer) = maybe_check_issuer {
ensure!(check_issuer == details.issuer, Error::<T, I>::NoPermission);
ensure!(details.issuer() == Some(&check_issuer), Error::<T, I>::NoPermission);
}
debug_assert!(details.supply.checked_add(&amount).is_some(), "checked in prep; qed");

Expand Down Expand Up @@ -452,7 +457,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Self::can_increase(id.clone(), beneficiary, amount, true).into_result()?;
Asset::<T, I>::try_mutate(&id, |maybe_details| -> DispatchResult {
let details = maybe_details.as_mut().ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&details)?;
check(details)?;

Account::<T, I>::try_mutate(&id, beneficiary, |maybe_account| -> DispatchResult {
Expand Down Expand Up @@ -494,15 +499,12 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
f: DebitFlags,
) -> Result<T::Balance, DispatchError> {
let d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(
d.status == AssetStatus::Live || d.status == AssetStatus::Frozen,
Error::<T, I>::IncorrectStatus
);
ensure!(d.status != AssetStatus::Destroying, Error::<T, I>::DestroyingAsset);

let actual = Self::decrease_balance(id.clone(), target, amount, f, |actual, details| {
// Check admin rights.
if let Some(check_admin) = maybe_check_admin {
ensure!(check_admin == details.admin, Error::<T, I>::NoPermission);
ensure!(details.admin() == Some(&check_admin), Error::<T, I>::NoPermission);
}

debug_assert!(details.supply >= actual, "checked in prep; qed");
Expand Down Expand Up @@ -537,7 +539,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
}

let details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&details)?;

let actual = Self::prep_debit(id.clone(), target, amount, f)?;
let mut target_died: Option<DeadConsequence> = None;
Expand Down Expand Up @@ -612,7 +614,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
return Ok((amount, None))
}
let details = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(details.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&details)?;

// Figure out the debit and credit, together with side-effects.
let debit = Self::prep_debit(id.clone(), source, amount, f.into())?;
Expand All @@ -627,7 +629,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {

// Check admin rights.
if let Some(need_admin) = maybe_need_admin {
ensure!(need_admin == details.admin, Error::<T, I>::NoPermission);
ensure!(details.admin() == Some(&need_admin), Error::<T, I>::NoPermission);
}

// Skip if source == dest
Expand Down Expand Up @@ -712,20 +714,20 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {

Asset::<T, I>::insert(
&id,
AssetDetails {
owner: owner.clone(),
issuer: owner.clone(),
admin: owner.clone(),
freezer: owner.clone(),
supply: Zero::zero(),
deposit: Zero::zero(),
AssetDetails::new(
owner.clone(),
owner.clone(),
owner.clone(),
owner.clone(),
Zero::zero(),
Zero::zero(),
min_balance,
is_sufficient,
accounts: 0,
sufficients: 0,
approvals: 0,
status: AssetStatus::Live,
},
0,
0,
0,
AssetStatus::Live,
),
);
ensure!(T::CallbackHandle::created(&id, &owner).is_ok(), Error::<T, I>::CallbackFailed);
Self::deposit_event(Event::ForceCreated { asset_id: id, owner: owner.clone() });
Expand All @@ -741,7 +743,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Asset::<T, I>::try_mutate_exists(id.clone(), |maybe_details| -> Result<(), DispatchError> {
let details = maybe_details.as_mut().ok_or(Error::<T, I>::Unknown)?;
if let Some(check_owner) = maybe_check_owner {
ensure!(details.owner == check_owner, Error::<T, I>::NoPermission);
ensure!(details.owner() == Some(&check_owner), Error::<T, I>::NoPermission);
}
details.status = AssetStatus::Destroying;

Expand Down Expand Up @@ -848,10 +850,9 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
ensure!(T::CallbackHandle::destroyed(&id).is_ok(), Error::<T, I>::CallbackFailed);

let metadata = Metadata::<T, I>::take(&id);
T::Currency::unreserve(
&details.owner,
details.deposit.saturating_add(metadata.deposit),
);
if let Some(owner) = details.owner() {
T::Currency::unreserve(owner, details.deposit.saturating_add(metadata.deposit));
}
Self::deposit_event(Event::Destroyed { asset_id: id });

Ok(())
Expand All @@ -869,7 +870,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
amount: T::Balance,
) -> DispatchResult {
let mut d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(d.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&d)?;
Approvals::<T, I>::try_mutate(
(id.clone(), &owner, &delegate),
|maybe_approved| -> DispatchResult {
Expand Down Expand Up @@ -920,7 +921,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let mut owner_died: Option<DeadConsequence> = None;

let d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(d.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
Self::ensure_live_asset(&d)?;

Approvals::<T, I>::try_mutate_exists(
(id.clone(), &owner, delegate),
Expand Down Expand Up @@ -969,8 +970,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
symbol.clone().try_into().map_err(|_| Error::<T, I>::BadMetadata)?;

let d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(d.status == AssetStatus::Live, Error::<T, I>::AssetNotLive);
ensure!(from == &d.owner, Error::<T, I>::NoPermission);
Self::ensure_live_asset(&d)?;
ensure!(d.owner() == Some(&from), Error::<T, I>::NoPermission);

Metadata::<T, I>::try_mutate_exists(id.clone(), |metadata| {
ensure!(metadata.as_ref().map_or(true, |m| !m.is_frozen), Error::<T, I>::NoPermission);
Expand Down Expand Up @@ -1019,8 +1020,21 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
.collect::<Vec<_>>()
}

/// Ensure the asset is live or live and with no privileges.
pub(super) fn ensure_live_asset(
d: &AssetDetails<T::Balance, T::AccountId, DepositBalanceOf<T, I>>,
) -> DispatchResult {
ensure!(
d.status == AssetStatus::Live || d.status == AssetStatus::LiveAndNoPrivileges,
Error::<T, I>::AssetNotLive
);
Ok(())
}

/// Reset the team for the asset with the given `id`.
///
/// If the asset status is `LiveAndNoPrivileges` then it is changed to `Live`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth mentioning something in ResetTeam trait doc that it is a force reset

Copy link
Copy Markdown
Contributor Author

@gui1117 gui1117 Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer to change the trait to have 2 functions: try_reset_team and force_reset_team instead?

EDIT: keeping the trait with just an additional doc could be fine considering any trait using ResetTeam would know that the owner doesn't exist when the status is LiveAndNoPrivileges

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only improved the doc: d0a8ab2

I think it is fine to keep the trait as it is, because reset_team is quite authoritative by itself, and caller should know why it can or cannot reset the team.

///
/// ### Parameters
/// - `id`: The identifier of the asset for which the team is being reset.
/// - `owner`: The new `owner` account for the asset.
Expand All @@ -1035,11 +1049,22 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
freezer: T::AccountId,
) -> DispatchResult {
let mut d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
d.owner = owner;
d.admin = admin;
d.issuer = issuer;
d.freezer = freezer;
if d.status == AssetStatus::LiveAndNoPrivileges {
d.status = AssetStatus::Live
}
match d.try_set_team(&owner, &issuer, &admin, &freezer) {
Ok(()) => (),
Err(SetTeamError::AssetStatusLiveAndNoPrivileges) => log::error!(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we still update the status on this failure? we probably wanna exit with this arm from the function

Copy link
Copy Markdown
Contributor Author

@gui1117 gui1117 Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ok, I added a new error variant: InternalError and abort in case of such internal error. 6594d94

target: LOG_TARGET,
"Operation failed because status is `LiveAndNoPrivileges`, but is was set to
`Live` before; qed"
),
}
Asset::<T, I>::insert(&id, d);

Self::deposit_event(Event::TeamChanged { asset_id: id.clone(), issuer, admin, freezer });
Self::deposit_event(Event::OwnerChanged { asset_id: id, owner });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added events here. This is unrelated to the PR, Let me know if this is unwanted


Ok(())
}
}
8 changes: 4 additions & 4 deletions substrate/frame/assets/src/impl_fungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,19 @@ impl<T: Config<I>, I: 'static> fungibles::roles::Inspect<<T as SystemConfig>::Ac
for Pallet<T, I>
{
fn owner(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId> {
Asset::<T, I>::get(asset).map(|x| x.owner)
Asset::<T, I>::get(asset).and_then(|x| x.owner().cloned())
}

fn issuer(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId> {
Asset::<T, I>::get(asset).map(|x| x.issuer)
Asset::<T, I>::get(asset).and_then(|x| x.issuer().cloned())
}

fn admin(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId> {
Asset::<T, I>::get(asset).map(|x| x.admin)
Asset::<T, I>::get(asset).and_then(|x| x.admin().cloned())
}

fn freezer(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId> {
Asset::<T, I>::get(asset).map(|x| x.freezer)
Asset::<T, I>::get(asset).and_then(|x| x.freezer().cloned())
}
}

Expand Down
Loading