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

util: Change withdrawal amount representation from Wei to Gwei #2483

Merged
merged 6 commits into from
Jan 17, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jan 13, 2023

@g11tech g11tech changed the title util: Change withdrawal amount representation for Wei to Gwei util: Change withdrawal amount representation from Wei to Gwei Jan 13, 2023
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #2483 (9b14652) into master (9b14652) will not change coverage.
The diff coverage is n/a.

❗ Current head 9b14652 differs from pull request most recent head 8a20fa2. Consider uploading reports for the commit 8a20fa2 to get more accurate results

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 89.57% <0.00%> (ø)
blockchain 90.04% <0.00%> (ø)
client 87.91% <0.00%> (ø)
common 95.89% <0.00%> (ø)
devp2p 91.62% <0.00%> (ø)
ethash ∅ <0.00%> (∅)
evm 79.73% <0.00%> (ø)
rlp ∅ <0.00%> (∅)
statemanager 89.61% <0.00%> (ø)
trie 90.66% <0.00%> (ø)
tx 97.80% <0.00%> (ø)
util 84.74% <0.00%> (ø)
vm 85.77% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Hmm, given that we had these endless discussions and drafts on unit conversion, latest with #1842, I would feel uneasy if we now side introduce such a constant GWEI_TO_WEI, and then even in the withdrawals Util module.

On the other hand I agree that this is super-helful, even in this raw "just the factor" constant. 😋

Can we at least move this to a dedicated new module units, where we can eventually expand from, maybe add 1-2 other small helper methods e.g. (and level down a bit from our previous ambitions)?

That would feel better to me, having this in withdrawals would cause some level of technical debt - since people might directly import - if we finally want to expand a bit on the topic and include in a release.

@g11tech
Copy link
Contributor Author

g11tech commented Jan 13, 2023

Hmm, given that we had these endless discussions and drafts on unit conversion, latest with #1842, I would feel uneasy if we now side introduce such a constant GWEI_TO_WEI, and then even in the withdrawals Util module.

On the other hand I agree that this is super-helful, even in this raw "just the factor" constant. yum

Can we at least move this to a dedicated new module units, where we can eventually expand from, maybe add 1-2 other small helper methods e.g. (and level down a bit from our previous ambitions)?

That would feel better to me, having this in withdrawals would cause some level of technical debt - since people might directly import - if we finally want to expand a bit on the topic and include in a release.

sounds good!

@g11tech
Copy link
Contributor Author

g11tech commented Jan 14, 2023

@holgerd77 i have created a minimal module @ethereumjs/units and move the GWEI_TO_WEI constant there, for now i guess this should be sufficient and can extend withdrawal along the way if needed

@g11tech
Copy link
Contributor Author

g11tech commented Jan 14, 2023

rebased via ui

@g11tech g11tech force-pushed the g11tech/withdrawal-amount-gwei branch 2 times, most recently from f603a0a to 572ebae Compare January 17, 2023 08:00
@holgerd77 holgerd77 force-pushed the g11tech/withdrawal-amount-gwei branch from 011823e to 8a20fa2 Compare January 17, 2023 08:37
@holgerd77
Copy link
Member

Rebased this via UI

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Looks good now! 👍

@g11tech g11tech merged commit 64d8d3c into master Jan 17, 2023
@holgerd77 holgerd77 deleted the g11tech/withdrawal-amount-gwei branch January 17, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants