fix: add fallback price for global rate limiter#1427
Open
Conversation
…o onchain route for asset pair
|
Crate versions that have not been updated:
Runtime version has not been increased. |
F3Joule
reviewed
Apr 21, 2026
| } | ||
|
|
||
| let (converted, _) = ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert(( | ||
| ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert(( |
Contributor
There was a problem hiding this comment.
convert_to_hdx is generic over ReferenceCurrencyId, but the fallback assumes ref currency = HDX (since currency_price always returns price relative to the native asset). Current callers all pass NativeAssetId so this is fine, but consider a debug_assert! or comment to guard against future misuse.
ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert((
|
Quick benchmark at commit 4534722 has been executed successfully. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
external-asset withdraw/XCM returned FailedToConvertAsset whenever the oracle route was missing.
Adding onchain route is a quick fix, but better to add conversion using the fallback price if no oracle price can be retrieved