Closed DavidCai1111 closed 1 year ago
ey @DavidCai1111 thank you very much for your contribution! what's the scope of this fix?
it'd be nice to add a test that would fail without this fix, so that if we remove that line we can see it fail, and we have already a playground to try different scenarios and how this feature would affect, would you be willing to add them to the PR?
closing this issue in favour of #160
Description When giving
padNumHexSlotValue
a SHA3 hash value, like0xc1a82511edc30899b6306d233aa7b486fccf85b7c19d075b994557efe2bbe150
, sincebigNumberToHex
will add leading zeros,bigNumberToHex(bn)
will return00c1a82511edc30899b6306d233aa7b486fccf85b7c19d075b994557efe2bbe150
, which will lead to a wrong output(0x00c1a82511edc30899b6306d233aa7b486fccf85b7c19d075b994557efe2bbe150
). This PR tries to fix this error by removing the leading zeros and then letpadStart
to do the padding job.