difftreelog
cargo fmt
in: master
3 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -37,8 +37,7 @@
use crate::{
AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,
- SelfWeightOf, weights::WeightInfo, TokenProperties,
- property_guard::PropertyGuard,
+ SelfWeightOf, weights::WeightInfo, TokenProperties, property_guard::PropertyGuard,
};
#[solidity_interface(name = "TokenProperties")]
@@ -88,13 +87,8 @@
.recorder
.weight_calls_budget(<StructureWeight<T>>::find_parent());
- let mut guard = PropertyGuard::new(
- &caller,
- self,
- TokenId(token_id),
- is_token_create,
- &budget,
- );
+ let mut guard =
+ PropertyGuard::new(&caller, self, TokenId(token_id), is_token_create, &budget);
<Pallet<T>>::set_token_property(Property { key, value }, &mut guard)
.map_err(dispatch_to_evm::<T>)
@@ -112,16 +106,10 @@
.recorder
.weight_calls_budget(<StructureWeight<T>>::find_parent());
- let mut guard = PropertyGuard::new(
- &caller,
- self,
- TokenId(token_id),
- is_token_create,
- &budget,
- );
+ let mut guard =
+ PropertyGuard::new(&caller, self, TokenId(token_id), is_token_create, &budget);
- <Pallet<T>>::delete_token_property(key, &mut guard)
- .map_err(dispatch_to_evm::<T>)
+ <Pallet<T>>::delete_token_property(key, &mut guard).map_err(dispatch_to_evm::<T>)
}
/// Throws error if key not found
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -488,7 +488,10 @@
})
}
- pub fn set_token_property(property: Property, guard: &mut PropertyGuard<'_, T>) -> DispatchResult {
+ pub fn set_token_property(
+ property: Property,
+ guard: &mut PropertyGuard<'_, T>,
+ ) -> DispatchResult {
Self::check_token_change_permission(&property.key, guard)?;
<TokenProperties<T>>::try_mutate((guard.collection.id, guard.token), |properties| {
@@ -530,7 +533,10 @@
Ok(())
}
- pub fn delete_token_property(property_key: PropertyKey, guard: &mut PropertyGuard<'_, T>) -> DispatchResult {
+ pub fn delete_token_property(
+ property_key: PropertyKey,
+ guard: &mut PropertyGuard<'_, T>,
+ ) -> DispatchResult {
Self::check_token_change_permission(&property_key, guard)?;
<TokenProperties<T>>::try_mutate((guard.collection.id, guard.token), |properties| {
@@ -547,7 +553,10 @@
Ok(())
}
- fn check_token_change_permission(property_key: &PropertyKey, guard: &mut PropertyGuard<'_, T>) -> DispatchResult {
+ fn check_token_change_permission(
+ property_key: &PropertyKey,
+ guard: &mut PropertyGuard<'_, T>,
+ ) -> DispatchResult {
let permission = <PalletCommon<T>>::property_permissions(guard.collection.id)
.get(property_key)
.cloned()
pallets/nonfungible/src/property_guard.rsdiffbeforeafterboth27 budget,27 budget,282829 collection_admin_result: None,29 collection_admin_result: None,30 token_owner_result: None30 token_owner_result: None,31 }31 }32 }32 }3333