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

implement ConversionToAssetBalance in asset-rate #2903

Merged

Conversation

girazoki
Copy link
Contributor

Implements the ConversionToAssetBalance trait to asset-rate by doing 1/rate*(balance).

@girazoki girazoki requested review from a team January 10, 2024 12:01
@paritytech-review-bot paritytech-review-bot bot requested a review from a team January 10, 2024 12:01
@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Exposes conversion of an native balance to an asset balance.
/// Exposes conversion of a native balance to an asset balance.

@muharem muharem added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Jan 11, 2024
@muharem
Copy link
Contributor

muharem commented Jan 11, 2024

@girazoki can you please provide a prdoc - https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/prdoc.md

@girazoki
Copy link
Contributor Author

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

@girazoki
Copy link
Contributor Author

Done :)

prdoc/pr_2903.prdoc Outdated Show resolved Hide resolved
prdoc/pr_2903.prdoc Outdated Show resolved Hide resolved
substrate/frame/asset-rate/src/lib.rs Outdated Show resolved Hide resolved
substrate/frame/asset-rate/src/lib.rs Outdated Show resolved Hide resolved
@girazoki
Copy link
Contributor Author

Is there any issue finally merging this?

@girazoki
Copy link
Contributor Author

@gpestana I think we nede one more review

@girazoki girazoki requested a review from a team as a code owner February 20, 2024 13:18
@girazoki
Copy link
Contributor Author

@bkchr can we get one more review on this PR please?

@bkchr bkchr enabled auto-merge February 20, 2024 13:26
@bkchr
Copy link
Member

bkchr commented Feb 20, 2024

You have all the required reviews. Just no one pressed the merge button.

@girazoki
Copy link
Contributor Author

You have all the required reviews. Just no one pressed the merge button.

Ah sorry, I though I needed one more! Thanks!

@girazoki
Copy link
Contributor Author

You have all the required reviews. Just no one pressed the merge button.

I dont think I broke the westend runtime upgrade with this PR no?

@bkchr bkchr added this pull request to the merge queue Feb 20, 2024
Merged via the queue into paritytech:master with commit 5f8b6f3 Feb 20, 2024
129 of 130 checks passed
girazoki added a commit to moondance-labs/polkadot-sdk that referenced this pull request Feb 22, 2024
Implements the `ConversionToAssetBalance` trait to asset-rate by doing
`1/rate*(balance)`.
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
Implements the `ConversionToAssetBalance` trait to asset-rate by doing
`1/rate*(balance)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants