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

Upgrade ConditionalOptions variables to type math.HexOrDecimal64 to support eth_sendRawTransactionConditional #252

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

ganeshvanahalli
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the s CLA signed label Aug 30, 2023
@ganeshvanahalli ganeshvanahalli changed the title Add new type Uint64OrHex to support ConditionalOptions for eth_sendRawTransactionConditional Upgrade ConditionalOptions variables to type math.HexOrDecimal64 to support eth_sendRawTransactionConditional Aug 31, 2023
Copy link
Collaborator

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

LGTM -- I'm going to merge this despite my comment on the test so we can get this into the next beta release

{input: `"0x2F2"`, want: uint64(0x2f2)},
{input: `"0x1122aaff"`, want: uint64(0x1122aaff)},
{input: `"0xbbb"`, want: uint64(0xbbb)},
{input: `"0xffffffffffffffff"`, want: uint64(0xffffffffffffffff)},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the hex based inputs should be "\"0x2\"" for example, as the strings are supposed to be JSON, but this doesn't matter with the current implementation of HexOrDecimal64. A follow-up PR to fix this might still be good :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

That, or we could call UnmarshalText instead of UnmarshalJSON in the test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, the previous tests covered UnmarshalText so I wanted to test for JSON too, I'll put a followup PR to fix the inputs

@PlasmaPower PlasmaPower merged commit 819425c into master Sep 1, 2023
2 checks passed
@PlasmaPower PlasmaPower deleted the upgrade-type-conditionaloptions branch September 1, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants