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

Use FromNetwork #80

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Use FromNetwork #80

merged 3 commits into from
Dec 20, 2023

Conversation

alistair-singh
Copy link

Copy link
Collaborator

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅🏻

}

#[test]
fn from_network_contains_works() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

Some(sp_std::vec![
EthereumLocation::get().interior.split_global().expect("invalid configuration for Ethereum").1,
]),
Some(sp_std::vec![Junctions::Here]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, its basically the equivalent of

EthereumLocation::get().interior.split_global().expect("invalid configuration for Ethereum").1

Because EthereumLocation.get().interior is GlobalConsensus(Ethereum { chain_id: .. }), then we split_global() which strips the first global consensus part, leaving ( GlobalConsensus(Ethereum { chain_id: .. }) , Junctions::Here ). Then we take the second member of the tuple with .1.

@alistair-singh alistair-singh merged commit 67e8718 into snowbridge Dec 20, 2023
6 of 11 checks passed
@alistair-singh alistair-singh deleted the alistair/use-from-network branch December 20, 2023 11:57
claravanstaden pushed a commit that referenced this pull request Dec 20, 2023
* wip

* use from network

* add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants