mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ethclient/simulated: added comments
This commit is contained in:
parent
12c05b9c02
commit
a3276479b2
2 changed files with 5 additions and 5 deletions
|
|
@ -144,9 +144,9 @@ func (c *SimulatedBeacon) Stop() error {
|
|||
|
||||
// sealBlock initiates payload building for a new block and creates a new block
|
||||
// with the completed payload.
|
||||
func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, tstamp uint64) error {
|
||||
if tstamp <= c.lastBlockTime {
|
||||
tstamp = c.lastBlockTime + 1
|
||||
func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp uint64) error {
|
||||
if timestamp <= c.lastBlockTime {
|
||||
timestamp = c.lastBlockTime + 1
|
||||
}
|
||||
c.feeRecipientLock.Lock()
|
||||
feeRecipient := c.feeRecipient
|
||||
|
|
@ -161,7 +161,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, tstamp uint
|
|||
var random [32]byte
|
||||
rand.Read(random[:])
|
||||
fcResponse, err := c.engineAPI.ForkchoiceUpdatedV2(c.curForkchoiceState, &engine.PayloadAttributes{
|
||||
Timestamp: tstamp,
|
||||
Timestamp: timestamp,
|
||||
SuggestedFeeRecipient: feeRecipient,
|
||||
Withdrawals: withdrawals,
|
||||
Random: random,
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ func (n *Backend) Fork(parentHash common.Hash) error {
|
|||
return n.beacon.Fork(parentHash)
|
||||
}
|
||||
|
||||
// AdjustTime changes the block timestamp.
|
||||
// AdjustTime changes the block timestamp and creates a new block.
|
||||
// It can only be called on empty blocks.
|
||||
func (n *Backend) AdjustTime(adjustment time.Duration) error {
|
||||
return n.beacon.AdjustTime(adjustment)
|
||||
|
|
|
|||
Loading…
Reference in a new issue