Skip to content

Commit

Permalink
formatted the change
Browse files Browse the repository at this point in the history
  • Loading branch information
x3c41a committed Oct 23, 2024
1 parent e8c9813 commit ef05ebb
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 163 deletions.
24 changes: 5 additions & 19 deletions system-parachains/asset-hubs/asset-hub-kusama/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,8 @@ fn treasury_pallet_account_not_none() {

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: polkadot_core_primitives::AccountId::from(ALICE).into(),
};
let alice_32 =
AccountId32 { network: None, id: polkadot_core_primitives::AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -750,21 +748,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -775,10 +764,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
24 changes: 5 additions & 19 deletions system-parachains/asset-hubs/asset-hub-polkadot/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,8 @@ fn change_xcm_bridge_hub_ethereum_base_fee_by_governance_works() {

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: polkadot_core_primitives::AccountId::from(ALICE).into(),
};
let alice_32 =
AccountId32 { network: None, id: polkadot_core_primitives::AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -774,21 +772,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -799,10 +788,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
18 changes: 3 additions & 15 deletions system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,21 +411,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5EueAXd4h8u75nSbFdDJbC29cmi4Uo1YJssqEL9idvindxFL",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5Dmbuiq48fU4iW58FKYqoGbbfxFHjbAeGLMtjFg6NNCw3ssr",
},
// DescribeAccountKey20Terminal
Expand All @@ -436,10 +427,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
18 changes: 3 additions & 15 deletions system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,21 +412,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5EueAXd4h8u75nSbFdDJbC29cmi4Uo1YJssqEL9idvindxFL",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5Dmbuiq48fU4iW58FKYqoGbbfxFHjbAeGLMtjFg6NNCw3ssr",
},
// DescribeAccountKey20Terminal
Expand All @@ -437,10 +428,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ const ALICE: [u8; 32] = [1u8; 32];

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: AccountId::from(ALICE).into(),
};
let alice_32 = AccountId32 { network: None, id: AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -63,21 +60,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -88,10 +76,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
24 changes: 5 additions & 19 deletions system-parachains/coretime/coretime-kusama/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ fn timeslice_period_is_sane() {

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: polkadot_core_primitives::AccountId::from(ALICE).into(),
};
let alice_32 =
AccountId32 { network: None, id: polkadot_core_primitives::AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -155,21 +153,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -180,10 +169,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
24 changes: 5 additions & 19 deletions system-parachains/coretime/coretime-polkadot/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ fn timeslice_period_is_sane() {

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: polkadot_core_primitives::AccountId::from(ALICE).into(),
};
let alice_32 =
AccountId32 { network: None, id: polkadot_core_primitives::AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -155,21 +153,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -180,10 +169,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
23 changes: 4 additions & 19 deletions system-parachains/people/people-kusama/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ const ALICE: [u8; 32] = [1u8; 32];

#[test]
fn location_conversion_works() {
let alice_32 = AccountId32 {
network: None,
id: AccountId::from(ALICE).into(),
};
let alice_32 = AccountId32 { network: None, id: AccountId::from(ALICE).into() };
let bob_20 = AccountKey20 { network: None, key: [123u8; 20] };

// the purpose of hardcoded values is to catch an unintended location conversion logic change.
Expand Down Expand Up @@ -63,21 +60,12 @@ fn location_conversion_works() {
// DescribeAccountId32Terminal
TestCase {
description: "DescribeAccountId32Terminal Parent",
location: Location::new(
1,
[alice_32.clone()],
),
location: Location::new(1, [alice_32.clone()]),
expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4",
},
TestCase {
description: "DescribeAccountId32Terminal Sibling",
location: Location::new(
1,
[
Parachain(1111),
alice_32.clone(),
],
),
location: Location::new(1, [Parachain(1111), alice_32.clone()]),
expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg",
},
// DescribeAccountKey20Terminal
Expand All @@ -88,10 +76,7 @@ fn location_conversion_works() {
},
TestCase {
description: "DescribeAccountKey20Terminal Sibling",
location: Location::new(
1,
[Parachain(1111), bob_20.clone()],
),
location: Location::new(1, [Parachain(1111), bob_20.clone()]),
expected_account_id_str: "5CE6V5AKH8H4rg2aq5KMbvaVUDMumHKVPPQEEDMHPy3GmJQp",
},
// DescribeTreasuryVoiceTerminal
Expand Down
Loading

0 comments on commit ef05ebb

Please sign in to comment.