Skip to content

Commit

Permalink
get rid of all vars
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshkshah1992 committed Jul 10, 2024
1 parent 4754e7c commit c0cd375
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions chain/types/ethtypes/eth_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,31 +188,24 @@ type EthBlock struct {
const EthBloomSize = 2048

var (
EmptyEthBloom = [EthBloomSize / 8]byte{}
FullEthBloom = [EthBloomSize / 8]byte{}
EmptyEthHash = EthHash{}
EmptyUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) // Keccak-256 of an RLP of an empty array
EmptyRootHash = must.One(ParseEthHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")) // Keccak-256 hash of the RLP of null
EmptyEthInt = EthUint64(0)
EmptyEthNonce = [8]byte{0, 0, 0, 0, 0, 0, 0, 0}
)

func init() {
for i := range FullEthBloom {
FullEthBloom[i] = 0xff
}
}

func NewEmptyEthBloom() []byte {
b := make([]byte, len(EmptyEthBloom))
copy(b, EmptyEthBloom[:])
return b
eb := [EthBloomSize / 8]byte{}
return eb[:]
}

func NewFullEthBloom() []byte {
b := make([]byte, len(FullEthBloom))
copy(b, FullEthBloom[:])
return b
fb := [EthBloomSize / 8]byte{}
for i := range fb {
fb[i] = 0xff
}
return fb[:]
}

func NewEthBlock(hasTransactions bool, tipsetLen int) EthBlock {
Expand Down

0 comments on commit c0cd375

Please sign in to comment.