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

common: add Address.Big #26132

Merged
merged 1 commit into from
Nov 8, 2022
Merged

common: add Address.Big #26132

merged 1 commit into from
Nov 8, 2022

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Nov 7, 2022

Many of the other types have a function to convert the type to a big.Int but the Address is missing this function. It is useful to be able to turn an Address into a big.Int when doing EVM-like computations natively in Go. Sometimes a Solidity address type is casted to a uint256 and having a Big method on the Address type makes this easy.

Can follow up with tests if desired

Many of the other types have a function to convert the type
to a `big.Int` but the `Address` is missing this function.
It is useful to be able to turn an `Address` into a `big.Int`
when doing EVM-like computations natively in Go. Sometimes
a Solidity `address` type is casted to a `uint256` and having
a `Big` method on the `Address` type makes this easy.
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@fjl fjl merged commit a609e7b into ethereum:master Nov 8, 2022
@fjl fjl changed the title common/types: add Address.Big common: add Address.Big Nov 8, 2022
@tynes tynes deleted the feat/address-to-big branch November 10, 2022 13:53
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
Many of the other types have a function to convert the type to a big.Int,
but Address was missing this function.

It is useful to be able to turn an Address into a big.Int when doing
EVM-like computations natively in Go. Sometimes a Solidity address
type is casted to a uint256 and having a Big method on the Address
type makes this easy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants