:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
Addresses #6080. This makes it so that fields in Log or Transaction that previously were number are now number | string | bigint, and fields that were number | null are now number | string | bigint | null.
Most of these fields are ignored, so the type is changed and that's all.
The one changed field that's actually used is blockNumber, so I just changed things so that if we get that and it's not null, we convert it to a number.
I do have to also discuss what happened to the DecodedLog type. For simplicity, DecodedLog extends Log. However, Log has just had its type broadened. But while that's fine for Log, because it's an input type, DecodedLog is an output type. So to broaden its type would be a breaking change. So I re-narrowed the types of the appropriate fields to prevent that.
Anyway that's it (aside from tests); this is pretty simple.
Testing instructions
I altered some decoder tests so that they pass in strings for the block number (the only part that matters), I think that should be sufficient.
PR description
Addresses #6080. This makes it so that fields in
Log
orTransaction
that previously werenumber
are nownumber | string | bigint
, and fields that werenumber | null
are nownumber | string | bigint | null
.Most of these fields are ignored, so the type is changed and that's all.
The one changed field that's actually used is
blockNumber
, so I just changed things so that if we get that and it's not null, we convert it to a number.I do have to also discuss what happened to the
DecodedLog
type. For simplicity,DecodedLog
extendsLog
. However,Log
has just had its type broadened. But while that's fine forLog
, because it's an input type,DecodedLog
is an output type. So to broaden its type would be a breaking change. So I re-narrowed the types of the appropriate fields to prevent that.Anyway that's it (aside from tests); this is pretty simple.
Testing instructions
I altered some decoder tests so that they pass in strings for the block number (the only part that matters), I think that should be sufficient.