Skip to content

Commit 564db9a

Browse files
authored
core: add Timestamp method in BlockGen (#26844)
Since forks are now scheduled by block time, it can be necessary to check the timestamp of a block while generating transactions.
1 parent 051493d commit 564db9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/chain_makers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ func (b *BlockGen) Number() *big.Int {
156156
return new(big.Int).Set(b.header.Number)
157157
}
158158

159+
// Timestamp returns the timestamp of the block being generated.
160+
func (b *BlockGen) Timestamp() uint64 {
161+
return b.header.Time
162+
}
163+
159164
// BaseFee returns the EIP-1559 base fee of the block being generated.
160165
func (b *BlockGen) BaseFee() *big.Int {
161166
return new(big.Int).Set(b.header.BaseFee)

0 commit comments

Comments
 (0)