From e299a7950e31f35809339316dbbda894c6b52e01 Mon Sep 17 00:00:00 2001 From: Chenyang Wu Date: Wed, 21 Mar 2018 17:38:31 -0700 Subject: [PATCH] Change ECRecovery recover method's visibility to internal (#818) * Change ECRecovery recover method's visibility to internal * Adopt the test * Remove unused imports --- contracts/ECRecovery.sol | 2 +- test/library/ECRecovery.test.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/contracts/ECRecovery.sol b/contracts/ECRecovery.sol index 9af0100f4..e3a716883 100644 --- a/contracts/ECRecovery.sol +++ b/contracts/ECRecovery.sol @@ -14,7 +14,7 @@ library ECRecovery { * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ - function recover(bytes32 hash, bytes sig) public pure returns (address) { + function recover(bytes32 hash, bytes sig) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; diff --git a/test/library/ECRecovery.test.js b/test/library/ECRecovery.test.js index 56852adf0..04fb6d199 100644 --- a/test/library/ECRecovery.test.js +++ b/test/library/ECRecovery.test.js @@ -1,5 +1,4 @@ var ECRecoveryMock = artifacts.require('ECRecoveryMock'); -var ECRecoveryLib = artifacts.require('ECRecovery'); var hashMessage = require('../helpers/hashMessage.js'); @@ -8,8 +7,6 @@ contract('ECRecovery', function (accounts) { const TEST_MESSAGE = 'OpenZeppelin'; before(async function () { - const ecRecoveryLib = await ECRecoveryLib.new(); - ECRecoveryMock.link('ECRecovery', ecRecoveryLib.address); ecrecovery = await ECRecoveryMock.new(); });