Skip to content

Commit

Permalink
eth/catalyst: fix (*SimulatedBeacon).AdjustTime() conversion (ethereu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Jul 16, 2024
1 parent 71210b0 commit 0d38b0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eth/catalyst/simulated_beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/time.Second))
}

func RegisterSimulatedBeaconAPIs(stack *node.Node, sim *SimulatedBeacon) {
Expand Down
2 changes: 1 addition & 1 deletion ethclient/simulated/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 0d38b0c

Please sign in to comment.