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

add parachain c #699

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

zqhxuyuan
Copy link
Contributor

@zqhxuyuan zqhxuyuan commented Feb 20, 2022

some parachain may not use GeneralKey as its token, but use just its parachain, i.e. PHA:

https://github.com/AcalaNetwork/Acala/blob/d92b2db7e384ebf24dafc89d7cc0e04ee4724435/runtime/karura/src/lib.rs#L1811-L1812

// Phala Native token
Token(PHA) => Some(MultiLocation::new(1, X1(Parachain(parachains::phala::ID)))),

this PR add parachain c, and use parachain(3) to represent its token.

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2022

Codecov Report

Merging #699 (f87e99f) into master (4a66b29) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #699      +/-   ##
==========================================
+ Coverage   74.63%   74.74%   +0.11%     
==========================================
  Files          83       83              
  Lines        7261     7293      +32     
==========================================
+ Hits         5419     5451      +32     
  Misses       1842     1842              
Impacted Files Coverage Δ
xtokens/src/mock/mod.rs 92.72% <100.00%> (+0.41%) ⬆️
xtokens/src/tests.rs 99.22% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a66b29...f87e99f. Read the comment docs.

@xlc xlc requested a review from shaunxw February 20, 2022 05:41
_ => None,
},
MultiLocation { parents, interior } if parents == 0 => match interior {
X1(GeneralKey(k)) if k == a => Some(CurrencyId::A),
X1(GeneralKey(k)) if k == b => Some(CurrencyId::B),
X1(GeneralKey(k)) if k == a1 => Some(CurrencyId::A1),
X1(GeneralKey(k)) if k == b1 => Some(CurrencyId::B1),
Here => Some(CurrencyId::C),
Copy link
Member

Choose a reason for hiding this comment

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

Parachains in mock shares the same CurrencyIdConvert, this will make all of them convert Here to CurrencyId::C, which doesn't make sense.

You'll need to define a convert impl only for Parachain C.

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.

3 participants