Renamed constants in test wallet/validator
This commit is contained in:
@@ -25,15 +25,15 @@ contract TestValidator is
|
||||
{
|
||||
|
||||
// The single valid signer for this wallet.
|
||||
address validSigner;
|
||||
address VALID_SIGNER;
|
||||
|
||||
/// @dev constructs a new `TestValidator` with a single valid signer.
|
||||
/// @param _validSigner The sole, valid signer.
|
||||
constructor (address _validSigner) public {
|
||||
validSigner = _validSigner;
|
||||
/// @param validSigner The sole, valid signer.
|
||||
constructor (address validSigner) public {
|
||||
VALID_SIGNER = validSigner;
|
||||
}
|
||||
|
||||
/// @dev Verifies that a signature is valid. `signer` must match `validSigner`.
|
||||
/// @dev Verifies that a signature is valid. `signer` must match `VALID_SIGNER`.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signer Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
@@ -47,6 +47,6 @@ contract TestValidator is
|
||||
view
|
||||
returns (bool isValid)
|
||||
{
|
||||
return (signer == validSigner);
|
||||
return (signer == VALID_SIGNER);
|
||||
}
|
||||
}
|
||||
|
@@ -29,12 +29,12 @@ contract TestWallet is
|
||||
string constant LENGTH_65_REQUIRED = "LENGTH_65_REQUIRED";
|
||||
|
||||
// The owner of this wallet.
|
||||
address walletOwner;
|
||||
address WALLET_OWNER;
|
||||
|
||||
/// @dev constructs a new `TestWallet` with a single owner.
|
||||
/// @param _walletOwner The owner of this wallet.
|
||||
constructor (address _walletOwner) public {
|
||||
walletOwner = _walletOwner;
|
||||
/// @param walletOwner The owner of this wallet.
|
||||
constructor (address walletOwner) public {
|
||||
WALLET_OWNER = walletOwner;
|
||||
}
|
||||
|
||||
/// @dev Validates an EIP712 signature.
|
||||
@@ -59,7 +59,7 @@ contract TestWallet is
|
||||
bytes32 r = readBytes32(eip712Signature, 1);
|
||||
bytes32 s = readBytes32(eip712Signature, 33);
|
||||
address recoveredAddress = ecrecover(hash, v, r, s);
|
||||
isValid = walletOwner == recoveredAddress;
|
||||
isValid = WALLET_OWNER == recoveredAddress;
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user