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

This commit is contained in:
Jordan Krage 2024-07-10 09:42:37 -05:00
parent 37590b2c55
commit 7707d10d3d
No known key found for this signature in database
GPG key ID: FE7D884E2656D771
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -106,7 +106,7 @@ func TestAdjustTime(t *testing.T) {
block2, _ := client.BlockByNumber(context.Background(), nil)
prevTime := block1.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)
}
}