fix: ethtypes: Correct 'no uncles' hash in NewEthBlock

This commit is contained in:
Łukasz Magiera 2023-02-06 14:38:48 +01:00
parent bca48dd1eb
commit 424824019b
2 changed files with 12 additions and 1 deletions

View File

@ -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,

9
lib/must/must.go Normal file
View File

@ -0,0 +1,9 @@
package must
func One[R any](r R, err error) R {
if err != nil {
panic(err)
}
return r
}