-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add mana calculations #1376
Conversation
sdk/src/client/api/mana.rs
Outdated
}, | ||
}; | ||
|
||
impl Client { |
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.
I wouldn't put this in the client. All mana calculations should be in the types module, if possible in the mana module.
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.
The problem is the necessity of the epochs iter. We need the client to do that calculation anyway
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.
Fixed
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 { |
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.
Into dyn index ?
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.
k
Description of change
Adds mana calculations
Links to any relevant issues
Closes #1366