Skip to content

Commit

Permalink
feat: basic multiprover test
Browse files Browse the repository at this point in the history
  • Loading branch information
vp4242 committed Mar 20, 2024
1 parent 082db04 commit a76a1aa
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/0.8.9/oracle/multiprover.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { contract, artifacts, ethers } = require('hardhat')
const { assert } = require('../../helpers/assert')

const { EvmSnapshot } = require('../../helpers/blockchain')

// npx hardhat test --grep "Multiprover"
const Multiprover = artifacts.require('Multiprover')

contract('Multiprover', ([deployer]) => {
let multiprover
let snapshot

const log = console.log
// const log = () => {}

before('Deploy multiprover', async function () {
multiprover = await Multiprover.new(deployer)
log('multiprover address', multiprover.address)

snapshot = new EvmSnapshot(ethers.provider)
await snapshot.make()
})

afterEach(async () => {
await snapshot.rollback()
})

describe('Multiprover is functional', () => {
it(`have zero members`, async () => {
const members = await multiprover.getMembers()
assert.equal(members.length, 0)
log('members', members)
})
it(`can add members`, async () => {
const role = await multiprover.MANAGE_MEMBERS_AND_QUORUM_ROLE()
log('role', role)
await multiprover.grantRole(role, deployer)

await multiprover.addMember(deployer, 1)

const members = await multiprover.getMembers()
log('members', members)
})
})
})

0 comments on commit a76a1aa

Please sign in to comment.