-
Notifications
You must be signed in to change notification settings - Fork 300
NonReserve case support teleport instead of reserve transfer #785
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
Conversation
xcm-support/src/currency_adapter.rs
Outdated
@@ -145,6 +145,12 @@ impl< | |||
DepositFailureHandler, | |||
> | |||
{ | |||
fn check_in(_origin: &MultiLocation, _what: &MultiAsset) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to align at polkadot CurrencyAdapter: https://github.com/paritytech/polkadot/blob/b0722401e1d66e6b5470995bf748467ea3fb92dd/xcm/xcm-builder/src/currency_adapter.rs#L97-L134
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to implement those? I don't think we will ever support teleport operation locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, only statemine need this CurrencyAdapter
implementation, but in our testcase both sender and receiver are using same MultiCurrencyAdapter
. I'll try let sender use MultiCurrencyAdapter
and receiver use CurrencyAdapter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ParaC
using polkadot CurrencyAdapter, there'll be execution error in testcase, So I add another MultiTeleportCurrencyAdapter
inside mock, this MultiTeleportCurrencyAdapter
add default check_in
and can_check_in
implements. It's used only in testcase.
@@ -571,6 +574,7 @@ pub mod module { | |||
&dest, | |||
Some(T::SelfLocation::get()), | |||
dest_weight, | |||
true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment above, I just set true
here, then this first xcm will always using teleport
. Do we need use configuration setting like TrustedTeleporters
to decide whether use teleport or not?
Current
fee_reserve != non_fee_reserve
only used in parachain transfer back asset back to Statemine, The first xcm we can change to teleport.