Skip to content

Commit 11296ce

Browse files
committed
make format
1 parent 287354f commit 11296ce

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

apps/randomness/monitor-randomness.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { abis, deployment } from "@happy.tech/contracts/random/anvil"
12
import { http, type Block, type Hex, createPublicClient, encodeAbiParameters, encodePacked, keccak256 } from "viem"
23
import { anvil } from "viem/chains"
34
import { z } from "zod"
4-
import { abis, deployment } from "@happy.tech/contracts/random/anvil"
55

66
const RANDOMNESS_CONTRACT_ABI = abis.Random
7-
const RANDOMNESS_CONTRACT_ADDRESS = deployment.Random;
7+
const RANDOMNESS_CONTRACT_ADDRESS = deployment.Random
88

99
const DRAND_SERVICE_URL = "https://api.drand.sh/v2/beacons/evmnet"
1010

@@ -99,14 +99,16 @@ async function onNewBlock(block: Block<bigint, false, "latest">) {
9999

100100
const drandRandomness = await getDrandRandomnessForRound(expectedDrandRound)
101101

102-
const revealedValueForBlock = await client.readContract({
103-
address: RANDOMNESS_CONTRACT_ADDRESS,
104-
abi: RANDOMNESS_CONTRACT_ABI,
105-
functionName: "getRevealedValue",
106-
args: [block.number],
107-
}).catch((error) => {
108-
console.error("Error reading revealed value", error)
109-
})
102+
const revealedValueForBlock = await client
103+
.readContract({
104+
address: RANDOMNESS_CONTRACT_ADDRESS,
105+
abi: RANDOMNESS_CONTRACT_ABI,
106+
functionName: "getRevealedValue",
107+
args: [block.number],
108+
})
109+
.catch((error) => {
110+
console.error("Error reading revealed value", error)
111+
})
110112

111113
if (!revealedValueForBlock) {
112114
return

0 commit comments

Comments
 (0)