Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proportional mode #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add test to check that the app can be initialized with proportional mode
  • Loading branch information
pinglu-pingu committed Sep 24, 2023
commit 287c42b4d60678b5795a5f3fe859f79123a4f305
15 changes: 15 additions & 0 deletions test/voting_aggregator.js
Original file line number Diff line number Diff line change
@@ -109,6 +109,21 @@ contract('VotingAggregator', ([_, root, unprivileged, eoa, user1, user2, someone
})
})

describe('App can initialize with proportional mode', () => {
const name = 'Voting Aggregator'
const symbol = 'VA'
const decimals = 18

it('initializes app with proportional mode activated', async () => {
await votingAggregator.initialize(name, symbol, decimals, true)
assert.isTrue(await votingAggregator.hasInitialized(), 'not initialized')
assert.equal(await votingAggregator.name(), name, 'name mismatch')
assert.equal(await votingAggregator.symbol(), symbol, 'symbol mismatch')
assert.equal((await votingAggregator.decimals()).toString(), decimals, 'decimals mismatch')
assert.equal(await votingAggregator.useProportionalMode(), true, 'use proportional mode mismatch')
})
})

describe('App is initialized', () => {
let token