|
|
@ -15,7 +15,7 @@ let hackerclient |
|
|
|
let semaphoreAddress |
|
|
|
let semaphoreAddress |
|
|
|
let CCIPBNM |
|
|
|
let CCIPBNM |
|
|
|
let proof: SemaphoreProof |
|
|
|
let proof: SemaphoreProof |
|
|
|
let _paymentChainSelector = '16015286601757825753' |
|
|
|
const _paymentChainSelector = '16015286601757825753' |
|
|
|
let _receiver |
|
|
|
let _receiver |
|
|
|
let cid |
|
|
|
let cid |
|
|
|
const router = ethers.Wallet.createRandom() // some random address uses instead of the CCIP router
|
|
|
|
const router = ethers.Wallet.createRandom() // some random address uses instead of the CCIP router
|
|
|
@ -82,8 +82,8 @@ describe('Hackerclient', function () { |
|
|
|
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
|
|
|
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
|
|
|
const contract = await ethers.getContractAt('HackerGroup', hackergroup.address, signer) |
|
|
|
const contract = await ethers.getContractAt('HackerGroup', hackergroup.address, signer) |
|
|
|
|
|
|
|
|
|
|
|
let eventFilter = contract.filters.bugCreated() |
|
|
|
const eventFilter = contract.filters.bugCreated() |
|
|
|
let bugs = await contract.queryFilter(eventFilter) |
|
|
|
const bugs = await contract.queryFilter(eventFilter) |
|
|
|
expect(bugs.length).to.equal(1) |
|
|
|
expect(bugs.length).to.equal(1) |
|
|
|
|
|
|
|
|
|
|
|
console.log('bugs created') |
|
|
|
console.log('bugs created') |
|
|
@ -116,7 +116,7 @@ describe('Hackerclient', function () { |
|
|
|
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
|
|
|
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
|
|
|
const contract = await ethers.getContractAt('HackerGroup', hackergroup.address, signer) |
|
|
|
const contract = await ethers.getContractAt('HackerGroup', hackergroup.address, signer) |
|
|
|
|
|
|
|
|
|
|
|
let eventFilter = contract.filters.TokensTransferred(null) |
|
|
|
const eventFilter = contract.filters.TokensTransferred(null) |
|
|
|
const tokens = await contract.queryFilter(eventFilter) |
|
|
|
const tokens = await contract.queryFilter(eventFilter) |
|
|
|
expect(tokens.length).to.equal(1) |
|
|
|
expect(tokens.length).to.equal(1) |
|
|
|
|
|
|
|
|
|
|
@ -136,8 +136,8 @@ describe('Hackerclient', function () { |
|
|
|
|
|
|
|
|
|
|
|
//console.log(contract.filters)
|
|
|
|
//console.log(contract.filters)
|
|
|
|
|
|
|
|
|
|
|
|
let eventFilter = contract.filters.ProofVerified() |
|
|
|
const eventFilter = contract.filters.ProofVerified() |
|
|
|
let proofs_verified = await contract.queryFilter(eventFilter) |
|
|
|
const proofs_verified = await contract.queryFilter(eventFilter) |
|
|
|
|
|
|
|
|
|
|
|
// write it to the filesystem
|
|
|
|
// write it to the filesystem
|
|
|
|
await remix.call('fileManager', 'setFile', './build/proofs_verified.json', JSON.stringify(proofs_verified, null, '\t')) |
|
|
|
await remix.call('fileManager', 'setFile', './build/proofs_verified.json', JSON.stringify(proofs_verified, null, '\t')) |
|
|
@ -147,7 +147,7 @@ describe('Hackerclient', function () { |
|
|
|
const cids = [] |
|
|
|
const cids = [] |
|
|
|
|
|
|
|
|
|
|
|
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
|
|
|
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
|
|
|
for (let proof of verified_proofs) { |
|
|
|
for (const proof of verified_proofs) { |
|
|
|
const cid = BigNumberToSignal(proof.args[3].hex) |
|
|
|
const cid = BigNumberToSignal(proof.args[3].hex) |
|
|
|
const signal = proof.args[4].hex |
|
|
|
const signal = proof.args[4].hex |
|
|
|
cids.push({ |
|
|
|
cids.push({ |
|
|
@ -165,9 +165,9 @@ describe('Hackerclient', function () { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
it('writes bugs to file', async () => { |
|
|
|
it('writes bugs to file', async () => { |
|
|
|
let bugs = [] |
|
|
|
const bugs = [] |
|
|
|
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
|
|
|
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
|
|
|
for (let proof of verified_proofs) { |
|
|
|
for (const proof of verified_proofs) { |
|
|
|
const cid = BigNumberToSignal(proof.args[3].hex) |
|
|
|
const cid = BigNumberToSignal(proof.args[3].hex) |
|
|
|
const externalNullifier = proof.args[3].hex |
|
|
|
const externalNullifier = proof.args[3].hex |
|
|
|
console.log(externalNullifier) |
|
|
|
console.log(externalNullifier) |
|
|
|