Skip to content

Commit

Permalink
Simplify secFromSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed May 9, 2022
1 parent 2f4cc3f commit ca51c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lodestar/src/chain/clock/LocalClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export class LocalClock implements IBeaconClock {
});
}

secFromSlot(slot: Slot, toSec?: number): number {
return (toSec ?? Date.now() / 1000) - (this.genesisTime + slot * this.config.SECONDS_PER_SLOT);
secFromSlot(slot: Slot, toSec = Date.now() / 1000): number {
return toSec - (this.genesisTime + slot * this.config.SECONDS_PER_SLOT);
}

private onNextSlot = (slot?: Slot): void => {
Expand Down

0 comments on commit ca51c87

Please sign in to comment.