-
Notifications
You must be signed in to change notification settings - Fork 524
Revert fillBytes method to bigIntToBytes for lower golang version
#3498
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
Conversation
jannotti
left a comment
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.
I might have preferred a fill-in method with the exact same signature and semantics as FillBytes, so the change would be even smaller, but I'mm totally fine with this.
Let's merge after checks pass.
For what it's worth, emulating FillBytes exactly would be annoying, as it is willing to take a buffer of any size that's big enough. Our use case only needs to work on exactly the right size buffer. |
jasonpaulos
left a comment
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.
Looks correct. I agree with the earlier comments about copy and I left another, but they are minor
|
I tried to emulate a method like FillBytes before, but we would need to introduce new type alias for The current fix should be sufficient for the purpose of casting |
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #3498 +/- ##
==========================================
- Coverage 47.67% 47.64% -0.03%
==========================================
Files 370 370
Lines 59832 59841 +9
==========================================
- Hits 28522 28514 -8
- Misses 28002 28011 +9
- Partials 3308 3316 +8
Continue to review full report at Codecov.
|
Summary
We are probably not going to higher golang version (1.15+) at this point, while
fillBytesfrombig.Intis introduced in 1.15.Changing all the
fillBytesinABIto self-madebigIntToBytesin favor of lower go version.