-
Notifications
You must be signed in to change notification settings - Fork 768
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
implement ConversionToAssetBalance in asset-rate #2903
implement ConversionToAssetBalance in asset-rate #2903
Conversation
@@ -246,3 +246,20 @@ where | |||
pallet::ConversionRateToNative::<T>::set(asset_id.clone(), Some(1.into())); | |||
} | |||
} | |||
|
|||
/// Exposes conversion of an native balance to an asset balance. |
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.
/// Exposes conversion of an native balance to an asset balance. | |
/// Exposes conversion of a native balance to an asset balance. |
@girazoki can you please provide a prdoc - https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/prdoc.md |
Do not merge yet as I have to take into account the case in which we set a 0 conversion and therefore there is an overflow |
Done :) |
Is there any issue finally merging this? |
@gpestana I think we nede one more review |
…sset-balance-in-asset-rate
@bkchr can we get one more review on this PR please? |
You have all the required reviews. Just no one pressed the merge button. |
Ah sorry, I though I needed one more! Thanks! |
I dont think I broke the westend runtime upgrade with this PR no? |
5f8b6f3
Implements the `ConversionToAssetBalance` trait to asset-rate by doing `1/rate*(balance)`.
Implements the `ConversionToAssetBalance` trait to asset-rate by doing `1/rate*(balance)`.
Implements the
ConversionToAssetBalance
trait to asset-rate by doing1/rate*(balance)
.