diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index e84517396..9d1924d9c 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -22,6 +22,7 @@ import ( builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/lib/must" ) var ( @@ -157,13 +158,14 @@ type EthBlock struct { var ( EmptyEthBloom = [256]byte{} EmptyEthHash = EthHash{} + NoUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) EmptyEthInt = EthUint64(0) EmptyEthNonce = [8]byte{0, 0, 0, 0, 0, 0, 0, 0} ) func NewEthBlock() EthBlock { return EthBlock{ - Sha3Uncles: EmptyEthHash, + Sha3Uncles: NoUncleHash, StateRoot: EmptyEthHash, TransactionsRoot: EmptyEthHash, ReceiptsRoot: EmptyEthHash, diff --git a/lib/must/must.go b/lib/must/must.go new file mode 100644 index 000000000..e072b4e04 --- /dev/null +++ b/lib/must/must.go @@ -0,0 +1,9 @@ +package must + +func One[R any](r R, err error) R { + if err != nil { + panic(err) + } + + return r +}