-
Notifications
You must be signed in to change notification settings - Fork 64
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 value/numValidators for ValidatorsExit transactions mappings #1880
Add value/numValidators for ValidatorsExit transactions mappings #1880
Conversation
Pull Request Test Coverage Report for Build 10639604127Details
💛 - Coveralls |
private getValueFromDataDecoded(data: DataDecoded, chain: Chain): number { | ||
if (data.method === 'requestValidatorsExit') { | ||
const publicKeys = | ||
data.parameters?.filter( | ||
(parameter) => parameter.name === '_publicKeys', | ||
) ?? []; | ||
const decimals = chain.nativeCurrency.decimals; | ||
return ( | ||
publicKeys.length * | ||
Math.pow(10, decimals) * | ||
NativeStakingMapper.ETH_ETHERS_PER_VALIDATOR | ||
); | ||
} | ||
|
||
return 0; | ||
} |
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.
Nit: we should add a comment/test for this as it's very intricate.
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've included some documentation here: #1884
Please let me know if you find it's not clear enough. Thanks!
…e-global#1880) Adds `value` and `numValidators` calculations based on the transaction data.
Summary
This PR adds missing fields to transaction mappings for the history/queue of Native Staking Validators Exit transactions.
Changes
value
andnumValidators
calculations based on the transaction data.