-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Derive AgentId for BridgeHub in a consistent manner (#1022)
* Add DescribeHere * Update sdk * Fix breaking test * Update BRIDGE_HUB_AGENT_ID with the new value * Update Cargo.lock * Change tuple order
- Loading branch information
Showing
10 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
use crate::{mock::*, *}; | ||
use frame_support::{assert_noop, assert_ok}; | ||
use hex_literal::hex; | ||
use snowbridge_core::sibling_sovereign_account_raw; | ||
use sp_core::H256; | ||
use sp_runtime::{AccountId32, DispatchError::BadOrigin, TokenError}; | ||
|
@@ -26,6 +27,18 @@ fn create_agent() { | |
}); | ||
} | ||
|
||
#[test] | ||
fn test_agent_for_here() { | ||
new_test_ext().execute_with(|| { | ||
let origin_location = MultiLocation::here(); | ||
let agent_id = make_agent_id(origin_location); | ||
assert_eq!( | ||
agent_id, | ||
hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(), | ||
) | ||
}); | ||
} | ||
|
||
#[test] | ||
fn create_agent_fails_on_funds_unavailable() { | ||
new_test_ext().execute_with(|| { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters