Revert fillBytes method to bigIntToBytes for lower golang version#3498
Revert fillBytes method to bigIntToBytes for lower golang version#3498jannotti merged 4 commits intoalgorand:masterfrom
fillBytes method to bigIntToBytes for lower golang version#3498Conversation
jannotti
left a comment
There was a problem hiding this comment.
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.
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.