Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants