eth/catalyst: fix (*SimulatedBeacon).AdjustTime() conversion (#30138)

pull/30172/head
Jordan Krage 4 months ago committed by GitHub
parent 71210b0630
commit 0d38b0cd34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      eth/catalyst/simulated_beacon.go
  2. 2
      ethclient/simulated/backend_test.go

@ -302,7 +302,7 @@ func (c *SimulatedBeacon) AdjustTime(adjustment time.Duration) error {
return errors.New("parent not found") return errors.New("parent not found")
} }
withdrawals := c.withdrawals.gatherPending(10) withdrawals := c.withdrawals.gatherPending(10)
return c.sealBlock(withdrawals, parent.Time+uint64(adjustment)) return c.sealBlock(withdrawals, parent.Time+uint64(adjustment/time.Second))
} }
func RegisterSimulatedBeaconAPIs(stack *node.Node, sim *SimulatedBeacon) { func RegisterSimulatedBeaconAPIs(stack *node.Node, sim *SimulatedBeacon) {

@ -106,7 +106,7 @@ func TestAdjustTime(t *testing.T) {
block2, _ := client.BlockByNumber(context.Background(), nil) block2, _ := client.BlockByNumber(context.Background(), nil)
prevTime := block1.Time() prevTime := block1.Time()
newTime := block2.Time() newTime := block2.Time()
if newTime-prevTime != uint64(time.Minute) { if newTime-prevTime != 60 {
t.Errorf("adjusted time not equal to 60 seconds. prev: %v, new: %v", prevTime, newTime) t.Errorf("adjusted time not equal to 60 seconds. prev: %v, new: %v", prevTime, newTime)
} }
} }

Loading…
Cancel
Save