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

Fix astar convertor #915

Merged
Merged
Changes from all commits
Commits
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
22 changes: 1 addition & 21 deletions crust-collator/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ parameter_types! {
pub SelfReserve: MultiLocation = MultiLocation::here();
pub CheckingAccount: AccountId = PalletId(*b"checking").into_account_truncating();
}
use xcm_executor::traits::{Convert as LocationConvert, InvertLocation};
use xcm_executor::traits::Convert as LocationConvert;
pub struct SiblingAccountId32Aliases<Network, AccountId>(PhantomData<(Network, AccountId)>);
impl<Network: Get<NetworkId>, AccountId: From<[u8; 32]> + Into<[u8; 32]> + Clone>
LocationConvert<MultiLocation, AccountId> for SiblingAccountId32Aliases<Network, AccountId>
Expand All @@ -513,26 +513,6 @@ impl<Network: Get<NetworkId>, AccountId: From<[u8; 32]> + Into<[u8; 32]> + Clone
}
}

pub struct SiblingAccountId32Aliases<Network, AccountId>(PhantomData<(Network, AccountId)>);
impl<Network: Get<NetworkId>, AccountId: From<[u8; 32]> + Into<[u8; 32]> + Clone>
Convert<MultiLocation, AccountId> for SiblingAccountId32Aliases<Network, AccountId>
{
fn convert_ref(location: impl Borrow<MultiLocation>) -> Result<AccountId, ()> {
let id = match location {
MultiLocation {
parents: 1,
interior: Junctions::X2(Parachain(_), AccountId32 { id, network: _ })
} => id,
_ => return Err(location),
}
Ok(id.into())
}

fn reverse_ref(_: impl Borrow<AccountId>) -> Result<MultiLocation, ()> {
Err(())
}
}

type LocationToAccountId = (
ParentIsPreset<AccountId>,
SiblingParachainConvertsVia<Sibling, AccountId>,
Expand Down