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

Migrate xpallet-asset-registrar to pallet v2 #550

Merged
merged 25 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a098f47
migrate xpallets-asset-registrar
Jun 10, 2021
a6ff765
migrate xpallets-asset-registrar
Jun 10, 2021
9821aaf
migrate xpallets-asset-registrar pallet v2
VegeBun-csj Jun 10, 2021
41b9ac9
Merge branch 'develop' of https://github.com/VegeBun-csj/ChainX into …
VegeBun-csj Jun 10, 2021
87d0112
migrate pallet v2
VegeBun-csj Jun 10, 2021
47c2efd
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
743be74
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
ec7ee76
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
dc31c81
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
7068936
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
606fbdd
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
033f5cb
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
dd47b6f
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
d60d75a
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
f0fe96c
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 10, 2021
d5b45f1
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
4e83d04
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
c846024
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
18b0e5b
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
6ce29c1
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
c95c6a8
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 11, 2021
9a89c5f
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 12, 2021
c1103f7
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 12, 2021
96b562f
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 12, 2021
be5ad7c
migrate xpallets-assets-registrar pallet v2
VegeBun-csj Jun 12, 2021
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 runtime/chainx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ construct_runtime!(

// ChainX basics.
XSystem: xpallet_system::{Pallet, Call, Storage, Event<T>, Config} = 24,
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event, Config} = 25,
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event<T>, Config} = 25,
XAssets: xpallet_assets::{Pallet, Call, Storage, Event<T>, Config<T>} = 26,

// Mining, must be after XAssets.
Expand Down
2 changes: 1 addition & 1 deletion runtime/dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ construct_runtime!(

// ChainX basics.
XSystem: xpallet_system::{Pallet, Call, Storage, Event<T>, Config},
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event, Config},
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event<T>, Config},
XAssets: xpallet_assets::{Pallet, Call, Storage, Event<T>, Config<T>},

// Mining, must be after XAssets.
Expand Down
2 changes: 1 addition & 1 deletion runtime/malan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ construct_runtime!(

// ChainX basics.
XSystem: xpallet_system::{Pallet, Call, Storage, Event<T>, Config} = 24,
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event, Config} = 25,
XAssetsRegistrar: xpallet_assets_registrar::{Pallet, Call, Storage, Event<T>, Config} = 25,
XAssets: xpallet_assets::{Pallet, Call, Storage, Event<T>, Config<T>} = 26,

// Mining, must be after XAssets.
Expand Down
9 changes: 4 additions & 5 deletions xpallets/assets-registrar/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2019-2020 ChainX Project Authors. Licensed under GPL-3.0.

use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
use frame_support::StorageMap;
use frame_system::RawOrigin;

use chainx_primitives::AssetId;
Expand All @@ -26,15 +25,15 @@ benchmarks! {
let asset_info = b_asset_info_test_data::<T>();
}: _(RawOrigin::Root, ASSET_ID, asset_info.clone(), true, true)
verify {
assert_eq!(AssetInfoOf::get(ASSET_ID), Some(asset_info));
assert_eq!(AssetInfoOf::<T>::get(ASSET_ID), Some(asset_info));
}

deregister {
let asset_info = b_asset_info_test_data::<T>();
Pallet::<T>::register(RawOrigin::Root.into(), ASSET_ID, asset_info.clone(), true, true)?;
}: _(RawOrigin::Root, ASSET_ID)
verify {
assert!(!AssetOnline::get(ASSET_ID));
assert!(!AssetOnline::<T>::get(ASSET_ID));
}

recover {
Expand All @@ -43,7 +42,7 @@ benchmarks! {
Pallet::<T>::deregister(RawOrigin::Root.into(), ASSET_ID)?;
}: _(RawOrigin::Root, ASSET_ID, true)
verify {
assert!(AssetOnline::get(ASSET_ID));
assert!(AssetOnline::<T>::get(ASSET_ID));
}

update_asset_info {
Expand All @@ -61,7 +60,7 @@ benchmarks! {
new_asset_info.set_token(b"new_token".to_vec());
new_asset_info.set_token_name(b"new_token_name".to_vec());
new_asset_info.set_desc(b"new_desc".to_vec());
assert_eq!(AssetInfoOf::get(ASSET_ID).unwrap(), new_asset_info);
assert_eq!(AssetInfoOf::<T>::get(ASSET_ID).unwrap(), new_asset_info);
}
}

Expand Down
Loading