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

eth unit converter #97

Open
pcppcp opened this issue Oct 23, 2018 · 3 comments
Open

eth unit converter #97

pcppcp opened this issue Oct 23, 2018 · 3 comments
Labels
good first issue Good for newcomers

Comments

@pcppcp
Copy link
Member

pcppcp commented Oct 23, 2018

We'll need a helper function that can convert between different ethereum units.

The function should take an uint256 as an input, and convert & format it to a desired unit type.

int eth_convert(const uint256_t *amount, enum unit from, enum unit to, char *buf, size_t buf_size);

example

>> eth_convert(0x2406d0096ba0007624, ETH_UNIT_WEI, ETH_UNIT_ETH, out, out_size);
>> print out
664.5736893707777777
@pcppcp pcppcp added the good first issue Good for newcomers label Oct 23, 2018
@mislavn
Copy link

mislavn commented Dec 10, 2018

Hi @pcppcp I would like to implement the eth unit converter.
I intend to put the function in `src/web3.h' and add unit tests.

@pcppcp
Copy link
Member Author

pcppcp commented Dec 10, 2018

Hi @mislavn !
Feel free to take on the task, and whenever you are ready, please create a PR!
If you have any questions regarding the build, our slack is a best place to ask.

@mislavn
Copy link

mislavn commented Dec 18, 2018

Hi @pcppcp,
do you want me to do any other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants