-
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 decay computation #1334
Add Mana decay computation #1334
Conversation
let mut epochs_to_decay = remaining_epochs; | ||
|
||
if epochs_to_decay > 365 { | ||
epochs_to_decay = 365 | ||
} |
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.
let mut epochs_to_decay = remaining_epochs; | |
if epochs_to_decay > 365 { | |
epochs_to_decay = 365 | |
} | |
let epochs_to_decay = remaining_epochs.max(365); |
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.
or should this be using decay_factors.len()
?
} | ||
|
||
// combine both uint64 variables to get the actual value | ||
value_hi << 32 + value_lo |
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.
value_hi << 32 + value_lo | |
value_hi << 32 | value_lo |
v = v << (64 - n); | ||
v >> (64 - n) |
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.
v = v << (64 - n); | |
v >> (64 - n) | |
v & 0xFFFFFFFF |
Closing in favour of #1376 |
https://github.com/iotaledger/tips-draft/blob/tip39/tips/TIP-0039/tip-0039.md#how-to-use-the-lookup-table