Skip to content

Commit

Permalink
unify with NumberU64
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed Sep 25, 2024
1 parent 80b529e commit 4761c1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ func (h *Header) Hash() common.Hash {
return rlpHash(h)
}

func (h *Header) NumberU64() uint64 {
return h.Number.Uint64()
}

var headerSize = common.StorageSize(reflect.TypeOf(Header{}).Size())

// Size returns the approximate memory used by all internal contents. It is used
Expand Down Expand Up @@ -400,7 +404,7 @@ func (b *Block) GasUsed() uint64 { return b.header.GasUsed }
func (b *Block) Difficulty() *big.Int { return new(big.Int).Set(b.header.Difficulty) }
func (b *Block) Time() uint64 { return b.header.Time }

func (b *Block) NumberU64() uint64 { return b.header.Number.Uint64() }
func (b *Block) NumberU64() uint64 { return b.header.NumberU64() }
func (b *Block) MixDigest() common.Hash { return b.header.MixDigest }
func (b *Block) Nonce() uint64 { return binary.BigEndian.Uint64(b.header.Nonce[:]) }
func (b *Block) Bloom() Bloom { return b.header.Bloom }
Expand Down

0 comments on commit 4761c1d

Please sign in to comment.