Skip to content

Commit 72d43d6

Browse files
committed
make format, make check
1 parent 1db1f3a commit 72d43d6

2 files changed

Lines changed: 14 additions & 12 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
const DRAND_SERVICE_URL = "https://api.drand.sh/v2/beacons/evmnet"
99

1010
const client = createPublicClient({
@@ -98,14 +98,16 @@ async function onNewBlock(block: Block<bigint, false, "latest">) {
9898

9999
const drandRandomness = await getDrandRandomnessForRound(expectedDrandRound)
100100

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

110112
if (!revealedValueForBlock) {
111113
return

contracts/src/randomness/RandomCommitment.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ contract RandomCommitment is Ownable {
3131
error InvalidReveal();
3232
error RevealedValueNotAvailable();
3333

34-
constructor(address _owner, uint256 _precommit_delay_blocks) Ownable(_owner) {
35-
PRECOMMIT_DELAY_BLOCKS = _precommit_delay_blocks;
34+
constructor(address _owner, uint256 _precommitDelayBlocks) Ownable(_owner) {
35+
PRECOMMIT_DELAY_BLOCKS = _precommitDelayBlocks;
3636
}
3737

3838
/**

0 commit comments

Comments
 (0)