Skip to content

Commit

Permalink
fix prettier error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Nov 27, 2023
1 parent 89b5e03 commit d7ea0d1
Show file tree
Hide file tree
Showing 14 changed files with 22,963 additions and 68 deletions.
4 changes: 2 additions & 2 deletions common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function getRecipientClaimData(
const spentProof: MerkleProof = spentTree.genMerklePath(recipientIndex)

const resultsCommitment = genTallyResultCommitment(
tally.results.tally.map(x => BigInt(x)),
tally.results.tally.map((x) => BigInt(x)),
BigInt(tally.results.salt),
recipientTreeDepth
)
Expand All @@ -112,7 +112,7 @@ export function getRecipientClaimData(
return [
recipientIndex,
spent,
spentProof.pathElements.map(x => x.map(y => y.toString())),
spentProof.pathElements.map((x) => x.map((y) => y.toString())),
spentSalt,
resultsCommitment,
spentVoiceCreditsCommitment,
Expand Down
20 changes: 3 additions & 17 deletions contracts/cli/addContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,8 @@ program
.parse()

async function main(args: any) {
const [
signer,
,
,
,
,
,
,
,
,
,
,
,
contributor1,
contributor2,
] = await ethers.getSigners()
const [signer, , , , , , , , , , , , contributor1, contributor2] =
await ethers.getSigners()
console.log('Adding contributors by', signer.address)

const clrfundContract = await ethers.getContractAt('ClrFund', args[0], signer)
Expand All @@ -57,7 +43,7 @@ main(program.args)
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/addRecipients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ main(program.args)
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function main(args: any) {

main(program.opts())
.then(() => process.exit(0))
.catch(error => {
.catch((error) => {
console.error(error)
process.exit(1)
})
20 changes: 3 additions & 17 deletions contracts/cli/contribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ program
.parse()

async function main(args: any) {
const [
,
,
,
,
,
,
,
,
,
,
,
,
contributor1,
contributor2,
] = await ethers.getSigners()
const [, , , , , , , , , , , , contributor1, contributor2] =
await ethers.getSigners()

const stateFile = args[0]
if (!isPathExist(stateFile)) {
Expand Down Expand Up @@ -103,7 +89,7 @@ main(program.args)
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/finalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function main(args: any) {

main(program.opts())
.then(() => process.exit(0))
.catch(error => {
.catch((error) => {
console.error(error)
process.exit(1)
})
7 changes: 3 additions & 4 deletions contracts/cli/newClrFund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ async function main(args: any) {
})
userRegistryAddress = userRegistryContract.address
}
const setUserRegistryTx = await clrfundContract.setUserRegistry(
userRegistryAddress
)
const setUserRegistryTx =
await clrfundContract.setUserRegistry(userRegistryAddress)
await setUserRegistryTx.wait()
console.log(
`Set ${args.userRegistryType} user registry: ${userRegistryAddress}`
Expand Down Expand Up @@ -177,7 +176,7 @@ main(program.opts())
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/newDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ main(program.opts())
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/newRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ main(program.opts())
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
2 changes: 1 addition & 1 deletion contracts/cli/tally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async function main(args: any) {

main(program.opts())
.then(() => process.exit(0))
.catch(error => {
.catch((error) => {
console.error(error)
process.exit(1)
})
2 changes: 1 addition & 1 deletion contracts/cli/timeTravel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ main(program.args)
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
20 changes: 3 additions & 17 deletions contracts/cli/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,8 @@ async function main(args: any) {
throw Error('Env. variable COORDINATOR_MACISK not set')
}

const [
,
,
,
,
,
,
,
,
,
,
,
,
contributor1,
contributor2,
] = await ethers.getSigners()
const [, , , , , , , , , , , , contributor1, contributor2] =
await ethers.getSigners()

const state = JSONFile.read(stateFile)
const coordinatorKeyPair = new Keypair(PrivKey.unserialize(coordinatorMacisk))
Expand Down Expand Up @@ -115,7 +101,7 @@ main(program.args)
.then(() => {
process.exit(0)
})
.catch(err => {
.catch((err) => {
console.error(err)
process.exit(-1)
})
8 changes: 4 additions & 4 deletions contracts/utils/maci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function getRecipientTallyResult(
recipientIndex,
result,
proof: resultProof.pathElements.map((x: bigint[]) =>
x.map(y => y.toString())
x.map((y) => y.toString())
),
}
}
Expand All @@ -92,9 +92,9 @@ export function getRecipientTallyResultsBatch(
}

return [
tallyData.map(item => item.recipientIndex),
tallyData.map(item => item.result),
tallyData.map(item => item.proof),
tallyData.map((item) => item.recipientIndex),
tallyData.map((item) => item.result),
tallyData.map((item) => item.proof),
]
}

Expand Down
Loading

0 comments on commit d7ea0d1

Please sign in to comment.