Skip to content

Commit

Permalink
More checks
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Sep 23, 2024
1 parent 425a738 commit 413692e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bridges/snowbridge/pallets/system/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ fn initialize_bridge() {
agent_key(bridge_hub_agent_id).0
);

assert_eq!(Channels::<Test>::contains_key(PRIMARY_GOVERNANCE_CHANNEL), false);

let key_value_items = vec![
(agent_key(bridge_hub_agent_id).0, ().encode()),
(agent_key(asset_hub_agent_id).0, ().encode()),
Expand All @@ -782,6 +784,8 @@ fn initialize_bridge() {
];
assert_ok!(System::set_storage(RuntimeOrigin::root(), key_value_items.clone()));

assert_eq!(Channels::<Test>::contains_key(PRIMARY_GOVERNANCE_CHANNEL), true);

assert_eq!(Channels::<Test>::contains_key(asset_hub_channel_id), true);

let channel = Channels::<Test>::get(asset_hub_channel_id).unwrap();
Expand All @@ -793,7 +797,8 @@ fn initialize_bridge() {
let set_storage_call: <Test as frame_system::Config>::RuntimeCall =
frame_system::Call::<Test>::set_storage { items: key_value_items.clone() }.into();

assert_eq!(to_hex(&set_storage_call.encode(), false), "0x0004142101ccee781f0b9380204db9882d1b1c771d0ec3e268c3abf5d87f15dde43fc56ec13a4d74bbd00efc4503170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314002101ccee781f0b9380204db9882d1b1c771d0ec3e268c3abf5d87f15dde43fc56ec14f4be588bc0653e381c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7b874cb762a9d6a66800000000000000000000000000000000000000000000000000000000000000019003170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314ea0300002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7bbf8a4d00acb08a4700000000000000000000000000000000000000000000000000000000000000029003170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314ea0300002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7b594aa8a9c557dabac173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a05399081c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79e8030000");

assert_eq!(to_hex(&set_storage_call.encode(), false),
"0x0004142101ccee781f0b9380204db9882d1b1c771d0ec3e268c3abf5d87f15dde43fc56ec13a4d74bbd00efc4503170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314002101ccee781f0b9380204db9882d1b1c771d0ec3e268c3abf5d87f15dde43fc56ec14f4be588bc0653e381c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7b874cb762a9d6a66800000000000000000000000000000000000000000000000000000000000000019003170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314ea0300002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7bbf8a4d00acb08a4700000000000000000000000000000000000000000000000000000000000000029003170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314ea0300002101ccee781f0b9380204db9882d1b1c771d7759ccc18de172078306ca5973251a7b594aa8a9c557dabac173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a05399081c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79e8030000"
);
});
}

0 comments on commit 413692e

Please sign in to comment.