-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Refactors and enhancements (#525)
* tests: refactors and enhancements * helpers: split assert and getter events files
- Loading branch information
1 parent
220b6b1
commit d10d195
Showing
27 changed files
with
345 additions
and
562 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
const namehash = require('eth-ens-namehash').hash | ||
const { hash } = require('eth-ens-namehash') | ||
const APMNamehashMock = artifacts.require('APMNamehashMock') | ||
|
||
contract('APM Name Hash', accounts => { | ||
contract('APM Name Hash', () => { | ||
let apmNamehashMock | ||
|
||
before(async() => { | ||
//console.log("eth: " + namehash('eth')) | ||
//console.log("aragonpm.eth: " + namehash('aragonpm.eth')) | ||
apmNamehashMock = await APMNamehashMock.new() | ||
}) | ||
|
||
const checkName = async (name) => { | ||
const node = namehash(name + '.aragonpm.eth') | ||
//await apmNamehashMock.getAPMNamehash(name) | ||
const assertNamehash = async (name) => { | ||
const node = hash(name + '.aragonpm.eth') | ||
const apmNamehash = await apmNamehashMock.getAPMNamehash(name) | ||
//console.log("node: " + node) | ||
return apmNamehash.toString() == node | ||
assert.equal(node, apmNamehash.toString(), 'hashes do not match') | ||
} | ||
|
||
it('Kernel name hash matches', async () => { | ||
assert.isTrue(await checkName('kernel'), 'hashes should match') | ||
await assertNamehash('kernel') | ||
}) | ||
|
||
it('ACL name hash matches', async () => { | ||
assert.isTrue(await checkName('acl'), 'hashes should match') | ||
await assertNamehash('acl') | ||
}) | ||
|
||
it('EVM Registry name hash matches', async () => { | ||
assert.isTrue(await checkName('evmreg'), 'hashes should match') | ||
await assertNamehash('evmreg') | ||
}) | ||
}) |
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
Oops, something went wrong.