From d78bcbbae5db87a7240ef410eda34397d87b09b8 Mon Sep 17 00:00:00 2001 From: AugustoL Date: Wed, 3 Jan 2018 13:23:59 -0300 Subject: [PATCH] change web3.eth.accounts for accounts in ECRecovery test --- test/ECRecovery.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/ECRecovery.test.js b/test/ECRecovery.test.js index 3b0d486c7..3ecb684e9 100644 --- a/test/ECRecovery.test.js +++ b/test/ECRecovery.test.js @@ -34,25 +34,25 @@ contract('ECRecovery', function (accounts) { it('recover using web3.eth.sign()', async function () { // Create the signature using account[0] - const signature = web3.eth.sign(web3.eth.accounts[0], web3.sha3('OpenZeppelin')); + const signature = web3.eth.sign(accounts[0], web3.sha3('OpenZeppelin')); // Recover the signer address form the generated message and signature. await ecrecovery.recover(hashMessage('OpenZeppelin'), signature); - assert.equal(web3.eth.accounts[0], await ecrecovery.addrRecovered()); + assert.equal(accounts[0], await ecrecovery.addrRecovered()); }); it('recover using web3.eth.sign() should return wrong signer', async function () { // Create the signature using account[0] - const signature = web3.eth.sign(web3.eth.accounts[0], web3.sha3('OpenZeppelin')); + const signature = web3.eth.sign(accounts[0], web3.sha3('OpenZeppelin')); // Recover the signer address form the generated message and wrong signature. await ecrecovery.recover(hashMessage('Test'), signature); - assert.notEqual(web3.eth.accounts[0], await ecrecovery.addrRecovered()); + assert.notEqual(accounts[0], await ecrecovery.addrRecovered()); }); it('recover should fail when a wrong hash is sent', async function () { // Create the signature using account[0] - let signature = web3.eth.sign(web3.eth.accounts[0], web3.sha3('OpenZeppelin')); + let signature = web3.eth.sign(accounts[0], web3.sha3('OpenZeppelin')); // Recover the signer address form the generated message and wrong signature. await ecrecovery.recover(hashMessage('OpenZeppelin').substring(2), signature);