AustEcon / bitsv

BitSV: Bitcoin made easy. Documentation:
https://AustEcon.github.io/bitsv
MIT License
96 stars 28 forks source link

Fix bug of 76 bytes pushdata #71

Closed gitzhou closed 4 years ago

gitzhou commented 4 years ago

If there is a 76 bytes pushdata opreturn will get 4c ...... which is incorrect, should be 4c 4c ...... instead

incorrect txid example

006a223136377731676f5453454c615479416d7968485841376e4c445275335474386f43430a31353836323434303636
4c
7b2261223a202259414f222c202271223a2022e6b58be8af95e4b880e4b88b222c2022736e223a202259414f222c2022736964223a2022777869645f716568646e6a697a617239713231227d

correct txid example

006a223136377731676f5453454c615479416d7968485841376e4c445275335474386f43430a31353836323530333838
4c4c
7b2261223a202259414f222c202271223a2022e6b58be8af95e4b880e4b88b222c2022736e223a202259414f222c2022736964223a2022777869645f716568646e6a697a617239713231227d
ghost commented 4 years ago

Nice catch. I feel like something this serious should be caught with a test case. What do you think?

gitzhou commented 4 years ago

Nice catch. I feel like something this serious should be caught with a test case. What do you think?

Seems we don't have test cases of OP_RETURN

AustEcon commented 4 years ago

Thanks @gitzhou!

Yes better test coverage would be good to have but for now I will only merge the fix until one of us get more time.