Skip to content

Commit

Permalink
Cleanup xc asset config
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Aug 11, 2023
1 parent 17015a6 commit b9523a2
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 27 deletions.
22 changes: 0 additions & 22 deletions pallets/xc-asset-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@ pub mod pallet {
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

/// Callback definition trait for cross-chain asset registration/deregistration notifications.
pub trait XcAssetChanged<T: Config> {
/// Will be called by pallet when new asset Id has been registered
fn xc_asset_registered(asset_id: T::AssetId);

/// Will be called by pallet when asset Id has been unregistered
fn xc_asset_unregistered(asset_id: T::AssetId);
}

/// Implementation that does nothing
impl<T: Config> XcAssetChanged<T> for () {
fn xc_asset_registered(_: T::AssetId) {}
fn xc_asset_unregistered(_: T::AssetId) {}
}

/// Defines conversion between asset Id and cross-chain asset location
pub trait XcAssetLocation<AssetId> {
/// Get asset type from assetId
Expand Down Expand Up @@ -139,10 +124,6 @@ pub mod pallet {
/// a AssetLocation
type AssetId: Member + Parameter + Default + Copy + HasCompact + MaxEncodedLen;

/// TODO: this has essentially been deprecated and can be removed.
/// Callback handling for cross-chain asset registration or unregistration.
type XcAssetChanged: XcAssetChanged<Self>;

/// The required origin for managing cross-chain asset configuration
///
/// Should most likely be root.
Expand Down Expand Up @@ -243,8 +224,6 @@ pub mod pallet {
AssetIdToLocation::<T>::insert(&asset_id, asset_location.clone());
AssetLocationToId::<T>::insert(&asset_location, asset_id);

T::XcAssetChanged::xc_asset_registered(asset_id);

Self::deposit_event(Event::AssetRegistered {
asset_location,
asset_id,
Expand Down Expand Up @@ -355,7 +334,6 @@ pub mod pallet {
AssetIdToLocation::<T>::remove(&asset_id);
AssetLocationToId::<T>::remove(&asset_location);
AssetLocationUnitsPerSecond::<T>::remove(&asset_location);
T::XcAssetChanged::xc_asset_unregistered(asset_id);

Self::deposit_event(Event::AssetRemoved {
asset_id,
Expand Down
1 change: 0 additions & 1 deletion pallets/xc-asset-config/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ type AssetId = u128;
impl pallet_xc_asset_config::Config for Test {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type XcAssetChanged = ();
type ManagerOrigin = frame_system::EnsureRoot<AccountId>;
type WeightInfo = ();
}
Expand Down
1 change: 0 additions & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ impl pallet_sudo::Config for Runtime {
impl pallet_xc_asset_config::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type XcAssetChanged = ();
type ManagerOrigin = EnsureRoot<AccountId>;
type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight<Self>;
}
Expand Down
1 change: 0 additions & 1 deletion runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ impl pallet_proxy::Config for Runtime {
impl pallet_xc_asset_config::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type XcAssetChanged = ();
// Good enough for testnet since we lack pallet-assets hooks for now
type ManagerOrigin = EnsureRoot<AccountId>;
type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight<Self>;
Expand Down
1 change: 0 additions & 1 deletion runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,6 @@ impl pallet_sudo::Config for Runtime {
impl pallet_xc_asset_config::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type XcAssetChanged = ();
type ManagerOrigin = EnsureRoot<AccountId>;
type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight<Self>;
}
Expand Down
1 change: 0 additions & 1 deletion tests/xcm-simulator/src/mocks/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ parameter_types! {
impl pallet_xc_asset_config::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type XcAssetChanged = ();
type ManagerOrigin = EnsureRoot<AccountId>;
type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight<Runtime>;
}
Expand Down

0 comments on commit b9523a2

Please sign in to comment.