libsv / go-bt

The go-to Bitcoin Transaction (BT) Go library.
https://pkg.go.dev/mod/github.com/libsv/go-bt
ISC License
66 stars 26 forks source link

Remove overflow warning when running on 32 bit architecture #132

Closed ordishs closed 1 year ago

ordishs commented 1 year ago

When using go-bt with a 32 bit architecture we are checking if len([]byte) > 0xffffffff which can never be the case. This causes a compile warning:

bscript/script.go:432:32: 0xffffffff (untyped int constant 4294967295) overflows int

This check only needs to be done on a 64 bit architecture where the length of a byte slice can be 0xffffffffffffffff, but OP_PUSHDATA4 is the largest of the PUSH opcodes in bitcoin.

codecov-commenter commented 1 year ago

Codecov Report

Base: 83.70% // Head: 83.70% // No change to project coverage :thumbsup:

Coverage data is based on head (3743c11) compared to base (4766f6a). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #132 +/- ## ======================================= Coverage 83.70% 83.70% ======================================= Files 34 34 Lines 3701 3701 ======================================= Hits 3098 3098 Misses 434 434 Partials 169 169 ``` | [Impacted Files](https://codecov.io/gh/libsv/go-bt/pull/132?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=libsv) | Coverage Δ | | |---|---|---| | [bscript/script.go](https://codecov.io/gh/libsv/go-bt/pull/132/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=libsv#diff-YnNjcmlwdC9zY3JpcHQuZ28=) | `65.25% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=libsv). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=libsv)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mergify[bot] commented 1 year ago

This pull request looks stale. Feel free to reopen it if you think it's a mistake.