Skip to content

Commit

Permalink
Release v4.4.0-1 (#1257)
Browse files Browse the repository at this point in the history
* bump chainspec

Signed-off-by: Georgi Zlatarev <[email protected]>

* Update changelog

Signed-off-by: Georgi Zlatarev <[email protected]>

* BUmp tx version

Signed-off-by: Georgi Zlatarev <[email protected]>

* Revert tx-version bump

Signed-off-by: Georgi Zlatarev <[email protected]>

* Revert #1236

Signed-off-by: Georgi Zlatarev <[email protected]>

* update changelog

Signed-off-by: Georgi Zlatarev <[email protected]>

---------

Signed-off-by: Georgi Zlatarev <[email protected]>
  • Loading branch information
ghzlatarev authored Sep 27, 2023
1 parent 902e20c commit ba80769
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 28 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- [\#1234](https://github.com/Manta-Network/Manta/pull/1234) Serialize/deserialize vfr key [MACA]
- [\#1191](https://github.com/Manta-Network/Manta/pull/1191) Fix metadata diff checker workflow [MACA]
- [\#1243](https://github.com/Manta-Network/Manta/pull/1243) Add manta docker image to publish
- [\#1236](https://github.com/Manta-Network/Manta/pull/1236) Update Asset metadata call to not have dummy parameters [MACA]
- [\#1253](https://github.com/Manta-Network/Manta/pull/1253) Fix benchmark [CA]

## v4.4.0
Expand Down
2 changes: 1 addition & 1 deletion pallets/asset-manager/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ benchmarks! {
let metadata = AssetRegistryMetadata::<Balance>::testing_default();
Pallet::<T>::register_asset(RawOrigin::Root.into(), location, metadata.clone())?;
let some_valid_asset_id = <T as Config>::AssetId::from(assets_count);
}: _(RawOrigin::Root, some_valid_asset_id, metadata.metadata.clone())
}: _(RawOrigin::Root, some_valid_asset_id, metadata.clone())
verify {
assert_last_event::<T>(crate::Event::AssetMetadataUpdated { asset_id: some_valid_asset_id, metadata }.into());
}
Expand Down
25 changes: 5 additions & 20 deletions pallets/asset-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,15 +541,14 @@ pub mod pallet {
///
/// * `origin`: Caller of this extrinsic, the access control is specified by `ForceOrigin`.
/// * `asset_id`: AssetId to be updated.
/// * `metadata`: new `metadata` to be associated with `asset_id`, note `is_frozen`
/// flag in metadata will have no effect and and cannot be changed.
/// * `metadata`: new `metadata` to be associated with `asset_id`.
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::update_asset_metadata())]
#[transactional]
pub fn update_asset_metadata(
origin: OriginFor<T>,
asset_id: T::AssetId,
metadata: AssetStorageMetadata,
metadata: AssetRegistryMetadata<Balance>,
) -> DispatchResult {
T::ModifierOrigin::ensure_origin(origin)?;
ensure!(
Expand All @@ -562,25 +561,11 @@ pub mod pallet {
);
<T::AssetConfig as AssetConfig<T>>::AssetRegistry::update_asset_metadata(
&asset_id,
metadata.clone(),
metadata.clone().into(),
)?;

let mut registered_metadata =
AssetIdMetadata::<T>::get(asset_id).ok_or(Error::<T>::UpdateNonExistentAsset)?;
let new_metadata = AssetStorageMetadata {
name: metadata.name,
symbol: metadata.symbol,
decimals: metadata.decimals,
// is frozen flag doesn't do anything in metadata
is_frozen: registered_metadata.metadata.is_frozen,
};
registered_metadata.metadata = new_metadata;

AssetIdMetadata::<T>::insert(asset_id, &registered_metadata);
Self::deposit_event(Event::<T>::AssetMetadataUpdated {
asset_id,
metadata: registered_metadata,
});
AssetIdMetadata::<T>::insert(asset_id, &metadata);
Self::deposit_event(Event::<T>::AssetMetadataUpdated { asset_id, metadata });
Ok(())
}

Expand Down
8 changes: 4 additions & 4 deletions pallets/asset-manager/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn wrong_modifier_origin_should_not_work() {
AssetManager::update_asset_metadata(
RuntimeOrigin::signed([3u8; 32].into()),
0,
asset_metadata.metadata
asset_metadata
),
BadOrigin
);
Expand Down Expand Up @@ -174,14 +174,14 @@ fn update_asset() {
AssetManager::update_asset_metadata(
RuntimeOrigin::root(),
native_asset_id,
new_metadata.metadata.clone(),
new_metadata.clone(),
),
Error::<Runtime>::CannotUpdateNativeAssetMetadata
);
assert_ok!(AssetManager::update_asset_metadata(
RuntimeOrigin::root(),
asset_id,
new_metadata.metadata.clone(),
new_metadata.clone(),
),);
assert_eq!(Assets::name(&asset_id), new_name);
assert_eq!(Assets::symbol(&asset_id), new_symbol);
Expand Down Expand Up @@ -213,7 +213,7 @@ fn update_asset() {
AssetManager::update_asset_metadata(
RuntimeOrigin::root(),
next_asset_id,
new_metadata.metadata.clone()
new_metadata.clone(),
),
Error::<Runtime>::UpdateNonExistentAsset
);
Expand Down
2 changes: 1 addition & 1 deletion runtime/calamari/src/diff_tx_fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ fn calculate_all_current_extrinsic_tx_fee() -> (
let call =
crate::RuntimeCall::AssetManager(pallet_asset_manager::Call::update_asset_metadata {
asset_id: 1,
metadata: AssetRegistryMetadata::testing_default().into(),
metadata: AssetRegistryMetadata::testing_default(),
});
let (dispatch_info, call_len) = get_call_details(&call);
calamari_runtime_calls.push((
Expand Down
2 changes: 1 addition & 1 deletion runtime/manta/src/diff_tx_fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ fn calculate_all_current_extrinsic_tx_fee() -> (
let call =
crate::RuntimeCall::AssetManager(pallet_asset_manager::Call::update_asset_metadata {
asset_id: 1,
metadata: AssetRegistryMetadata::testing_default().into(),
metadata: AssetRegistryMetadata::testing_default(),
});
let (dispatch_info, call_len) = get_call_details(&call);
calamari_runtime_calls.push((
Expand Down

0 comments on commit ba80769

Please sign in to comment.