Skip to content

Commit 7d22163

Browse files
chore(randomness): change to cammelCase getDrandInfo
1 parent de838e4 commit 7d22163

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

apps/randomness/monitor-randomness.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ const getDrandInfo = async () => {
2626

2727
const data = await response.json()
2828

29-
const genesisTime = data.genesis_time
30-
const period = data.period
29+
const dataParsed = drandInfoSchema.parse(data)
3130

32-
return drandInfoSchema.parse({
33-
genesis_time: genesisTime,
34-
period: period,
35-
})
31+
return {
32+
genesisTime: dataParsed.genesis_time,
33+
period: dataParsed.period,
34+
}
3635
}
3736
const drandRoundSchema = z.object({
3837
round: z.number().transform((value) => BigInt(value)),
@@ -64,7 +63,7 @@ const getDrandRandomnessForRound = async (round: bigint) => {
6463
}
6564

6665
const drandTimestampToRound = (timestamp: bigint) => {
67-
return (timestamp - drandInfo.genesis_time) / drandInfo.period + 1n
66+
return (timestamp - drandInfo.genesisTime) / drandInfo.period + 1n
6867
}
6968

7069
const drandInfo = await getDrandInfo()

0 commit comments

Comments
 (0)