-
Notifications
You must be signed in to change notification settings - Fork 310
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
Rename uint256be to bytes32 #152
Conversation
include/evmc/evmc.h
Outdated
/** | ||
* The alias for evmc_bytes32 to represent a big-endian 256-bit integer. | ||
*/ | ||
typedef struct evmc_bytes32 evmc_uint256be; |
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.
So I am thinking perhaps we should have struct __evmc_bytes32 {..}
and then two typedefs (and the same applies to evmc_address
) so that it is consistent requiring (or not) struct
in further use cases.
Right now it is weird that one has to use struct evmc_bytes32 a;
and evmc_uint256be a;
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.
Also wonder if we do have the shared underlying type, operators applied to them propagate to the two typedefs?
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.
These are the same types effectively. Yes, it feels weird to me too.
|
||
/** | ||
* The optional value used in new contract address construction. | ||
* | ||
* Ignored unless kind is EVMC_CREATE2. | ||
*/ | ||
struct evmc_uint256be create2_salt; | ||
evmc_bytes32 create2_salt; | ||
}; | ||
|
||
|
||
/** The transaction and block data for execution. */ | ||
struct evmc_tx_context |
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.
Maybe typedef this one, too, to write evmc_tx_context
instead od struct evmc_tx_context
?
Closes #121
Some things to consider
evmc_hash256
for explicit crypto-hashes.evmc_bytes32
andevmc_address
to avoidstruct
prefix.