Skip to content

Commit

Permalink
feat: Testing minting and burning are deined (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
CjHare authored Sep 10, 2021
1 parent 9a4b44c commit 7fd0ea9
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/bitdao.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import 'hardhat'
import '@nomiclabs/hardhat-ethers'
// End - Support direct Mocha run & debug

import {expect} from 'chai'
import chai, {expect} from 'chai'
import {ethers} from 'hardhat'
import {before} from 'mocha'
import {solidity} from 'ethereum-waffle'
import {BitDAO} from '../typechain'

chai.use(solidity)

const TEN_OCTILLIAN = 10000000000000000000000000000n
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'

describe('BitDAO token contract', async () => {
before(async () => {
Expand All @@ -32,6 +36,18 @@ describe('BitDAO token contract', async () => {
expect(await dao.balanceOf(admin)).to.equal(TEN_OCTILLIAN)
})

it('minting BIT not allowed', async () => {
expect(dao.transferFrom(ZERO_ADDRESS, admin, 5)).to.be.revertedWith(
'ERC20: transfer from the zero address'
)
})

it('burning BIT not allowed', async () => {
expect(dao.transferFrom(admin, ZERO_ADDRESS, 5)).to.be.revertedWith(
'ERC20: transfer to the zero address'
)
})

describe('delegate', async () => {
beforeEach(async () => {
admin = await signer(0)
Expand Down Expand Up @@ -72,8 +88,6 @@ describe('BitDAO token contract', async () => {
})
})

//TODO test minting (might not work)
//TODO test burning (might not work)
//TODO verify emitted events

let admin: string
Expand Down

0 comments on commit 7fd0ea9

Please sign in to comment.