Skip to content

Commit 0d38b0c

Browse files
authored
eth/catalyst: fix (*SimulatedBeacon).AdjustTime() conversion (#30138)
1 parent 71210b0 commit 0d38b0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

eth/catalyst/simulated_beacon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (c *SimulatedBeacon) AdjustTime(adjustment time.Duration) error {
302302
return errors.New("parent not found")
303303
}
304304
withdrawals := c.withdrawals.gatherPending(10)
305-
return c.sealBlock(withdrawals, parent.Time+uint64(adjustment))
305+
return c.sealBlock(withdrawals, parent.Time+uint64(adjustment/time.Second))
306306
}
307307

308308
func RegisterSimulatedBeaconAPIs(stack *node.Node, sim *SimulatedBeacon) {

ethclient/simulated/backend_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestAdjustTime(t *testing.T) {
106106
block2, _ := client.BlockByNumber(context.Background(), nil)
107107
prevTime := block1.Time()
108108
newTime := block2.Time()
109-
if newTime-prevTime != uint64(time.Minute) {
109+
if newTime-prevTime != 60 {
110110
t.Errorf("adjusted time not equal to 60 seconds. prev: %v, new: %v", prevTime, newTime)
111111
}
112112
}

0 commit comments

Comments
 (0)