-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b36ce4
commit da99eeb
Showing
9 changed files
with
254 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { buildHelper } = require('../helpers/court')(web3, artifacts) | ||
const { NOW, ONE_DAY } = require('../helpers/time') | ||
const { assertRevert } = require('@aragon/os/test/helpers/assertThrow') | ||
|
||
contract('Court', () => { | ||
let courtHelper | ||
|
||
beforeEach('create court helper', async () => { | ||
courtHelper = buildHelper() | ||
}) | ||
|
||
describe('initialization', () => { | ||
it('cannot use a term duration greater than the first term start time', async () => { | ||
await assertRevert(courtHelper.deploy({ mockedTimestamp: NOW, firstTermStartTime: ONE_DAY, termDuration: ONE_DAY + 1 }), 'CT_BAD_FIRST_TERM_START_TIME') | ||
}) | ||
|
||
it('cannot use a first term start time in the past', async () => { | ||
await assertRevert(courtHelper.deploy({ mockedTimestamp: NOW, firstTermStartTime: NOW - 1, termDuration: ONE_DAY }), 'CT_BAD_FIRST_TERM_START_TIME') | ||
}) | ||
|
||
it('cannot use a penalty pct lower than 1% (1/10,000) ', async () => { | ||
await assertRevert(courtHelper.deploy({ penaltyPct: 99 }), 'CTBAD_PENALTY') | ||
|
||
const court = await courtHelper.deploy({ penaltyPct: 100 }) | ||
const penaltyPct = (await court.courtConfigs(1))[9] // config ID 0 is used for undefined | ||
assert.equal(penaltyPct.toString(), 100, 'penalty pct does not match') | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.