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 mana calculations #1376

Merged
merged 26 commits into from
Oct 13, 2023
Merged

Add mana calculations #1376

merged 26 commits into from
Oct 13, 2023

Conversation

DaughterOfMars
Copy link

Description of change

Adds mana calculations

Links to any relevant issues

Closes #1366

@DaughterOfMars DaughterOfMars marked this pull request as draft October 2, 2023 17:19
@DaughterOfMars DaughterOfMars marked this pull request as ready for review October 2, 2023 19:00
},
};

impl Client {
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't put this in the client. All mana calculations should be in the types module, if possible in the mana module.

Copy link
Author

Choose a reason for hiding this comment

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

The problem is the necessity of the epochs iter. We need the client to do that calculation anyway

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@DaughterOfMars DaughterOfMars linked an issue Oct 3, 2023 that may be closed by this pull request
impl ProtocolParameters {
/// Calculates the potential mana that is generated by holding `amount` tokens from `slot_index_created` to
/// `slot_index_target` and applies the decay to the result
pub fn potential_mana(&self, amount: u64, slot_index_created: SlotIndex, slot_index_target: SlotIndex) -> u64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Into dyn index ?

Copy link
Author

Choose a reason for hiding this comment

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

k

kwek20
kwek20 previously approved these changes Oct 11, 2023
Alex6323
Alex6323 previously approved these changes Oct 12, 2023
@Thoralf-M Thoralf-M merged commit de89ba4 into 2.0 Oct 13, 2023
28 of 31 checks passed
@Thoralf-M Thoralf-M deleted the feat/mana-calculations branch October 13, 2023 14:02
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.

Add mana calculations
5 participants