mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-21 07:31:03 +00:00
Fix for BridgedSignedAccountId32AsNative
This commit is contained in:
@@ -91,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("statemine"),
|
spec_name: create_runtime_str!("statemine"),
|
||||||
impl_name: create_runtime_str!("statemine"),
|
impl_name: create_runtime_str!("statemine"),
|
||||||
authoring_version: 1,
|
authoring_version: 1,
|
||||||
spec_version: 9301,
|
spec_version: 9302,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 8,
|
transaction_version: 8,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("westmint"),
|
spec_name: create_runtime_str!("westmint"),
|
||||||
impl_name: create_runtime_str!("westmint"),
|
impl_name: create_runtime_str!("westmint"),
|
||||||
authoring_version: 1,
|
authoring_version: 1,
|
||||||
spec_version: 9301,
|
spec_version: 9302,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 8,
|
transaction_version: 8,
|
||||||
|
|||||||
@@ -399,24 +399,38 @@ where
|
|||||||
kind: OriginKind,
|
kind: OriginKind,
|
||||||
) -> Result<RuntimeOrigin, MultiLocation> {
|
) -> Result<RuntimeOrigin, MultiLocation> {
|
||||||
let origin = origin.into();
|
let origin = origin.into();
|
||||||
|
log::trace!(
|
||||||
|
target: "xcm::origin_conversion",
|
||||||
|
"BridgedSignedAccountId32AsNative origin: {:?}, kind: {:?}",
|
||||||
|
origin, kind,
|
||||||
|
);
|
||||||
if let OriginKind::SovereignAccount = kind {
|
if let OriginKind::SovereignAccount = kind {
|
||||||
match origin {
|
match origin {
|
||||||
|
// this represents remote relaychain
|
||||||
MultiLocation {
|
MultiLocation {
|
||||||
parents: 2,
|
parents: 2,
|
||||||
interior:
|
interior:
|
||||||
X2(
|
X2(
|
||||||
GlobalConsensus(remote_network),
|
GlobalConsensus(remote_network),
|
||||||
AccountId32 { network: Some(account_remote_network), id: _id },
|
AccountId32 { network: _network, id: _id },
|
||||||
),
|
),
|
||||||
|
} |
|
||||||
|
// this represents remote parachain
|
||||||
|
MultiLocation {
|
||||||
|
parents: 2,
|
||||||
|
interior:
|
||||||
|
X3(
|
||||||
|
GlobalConsensus(remote_network),
|
||||||
|
Parachain(_),
|
||||||
|
AccountId32 { network: _network, id: _id },
|
||||||
|
),
|
||||||
} => {
|
} => {
|
||||||
// TODO:check-parameter - hack - configured local bridge-hub behaves on behalf of any origin from configured bridged network (just to pass Transact/System::remark_with_event - ensure_signed)
|
// TODO:check-parameter - hack - configured local bridge-hub behaves on behalf of any origin from configured bridged network (just to pass Transact/System::remark_with_event - ensure_signed)
|
||||||
// find configured local bridge_hub for remote network
|
// find configured local bridge_hub for remote network
|
||||||
let bridge_hub_location = BridgedNetworks::get()
|
let bridge_hub_location = BridgedNetworks::get()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|(_, configured_bridged_network)| match configured_bridged_network {
|
.find(|(_, configured_bridged_network)| match configured_bridged_network {
|
||||||
GlobalConsensus(bridged_network) =>
|
GlobalConsensus(bridged_network) => bridged_network.eq(&remote_network),
|
||||||
bridged_network.eq(&account_remote_network) &&
|
|
||||||
bridged_network.eq(&remote_network),
|
|
||||||
_ => false,
|
_ => false,
|
||||||
})
|
})
|
||||||
.map(|(bridge_hub_location, _)| bridge_hub_location.clone());
|
.map(|(bridge_hub_location, _)| bridge_hub_location.clone());
|
||||||
|
|||||||
@@ -330,13 +330,17 @@ fn test_receive_bridged_xcm_transact_with_remark_with_event_works() {
|
|||||||
let origin = MultiLocation { parents: 1, interior: X1(Parachain(1014)) };
|
let origin = MultiLocation { parents: 1, interior: X1(Parachain(1014)) };
|
||||||
let xcm = Xcm(vec![
|
let xcm = Xcm(vec![
|
||||||
UniversalOrigin(GlobalConsensus(Rococo)),
|
UniversalOrigin(GlobalConsensus(Rococo)),
|
||||||
DescendOrigin(X1(AccountId32 {
|
DescendOrigin(X2(
|
||||||
network: Some(Rococo),
|
Parachain(1000),
|
||||||
id: [
|
AccountId32 {
|
||||||
28, 189, 45, 67, 83, 10, 68, 112, 90, 208, 136, 175, 49, 62, 24, 248, 11,
|
network: Some(Rococo),
|
||||||
83, 239, 22, 179, 97, 119, 205, 75, 119, 184, 70, 242, 165, 240, 124,
|
id: [
|
||||||
],
|
28, 189, 45, 67, 83, 10, 68, 112, 90, 208, 136, 175, 49, 62, 24, 248,
|
||||||
})),
|
11, 83, 239, 22, 179, 97, 119, 205, 75, 119, 184, 70, 242, 165, 240,
|
||||||
|
124,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
)),
|
||||||
Transact {
|
Transact {
|
||||||
origin_kind: OriginKind::SovereignAccount,
|
origin_kind: OriginKind::SovereignAccount,
|
||||||
require_weight_at_most: 1000000000,
|
require_weight_at_most: 1000000000,
|
||||||
|
|||||||
Reference in New Issue
Block a user