Changed before for beforeAll, refactored Bouncer tests. (#1094)

* Changed before for beforeAll, refactored Bouncer tests.

* Fixed linter errors.

* fix: updates for SignatureBouncer tests and voucher construction
This commit is contained in:
Nicolás Venturo
2018-07-20 12:25:40 -03:00
committed by GitHub
parent ce0c3274ee
commit 67b67b791e
16 changed files with 338 additions and 310 deletions

View File

@ -11,7 +11,7 @@ contract('ECRecovery', function (accounts) {
let ecrecovery;
const TEST_MESSAGE = 'OpenZeppelin';
before(async function () {
beforeEach(async function () {
ecrecovery = await ECRecoveryMock.new();
});
@ -37,7 +37,7 @@ contract('ECRecovery', function (accounts) {
it('recover using web3.eth.sign()', async function () {
// Create the signature using account[0]
const signature = signMessage(accounts[0], TEST_MESSAGE);
const signature = signMessage(accounts[0], web3.sha3(TEST_MESSAGE));
// Recover the signer address from the generated message and signature.
const addrRecovered = await ecrecovery.recover(
@ -49,7 +49,7 @@ contract('ECRecovery', function (accounts) {
it('recover using web3.eth.sign() should return wrong signer', async function () {
// Create the signature using account[0]
const signature = signMessage(accounts[0], TEST_MESSAGE);
const signature = signMessage(accounts[0], web3.sha3(TEST_MESSAGE));
// Recover the signer address from the generated message and wrong signature.
const addrRecovered = await ecrecovery.recover(hashMessage('Nope'), signature);