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

@ -34,8 +34,8 @@ contract SignatureBouncer is Ownable, RBAC {
string public constant ROLE_BOUNCER = "bouncer";
uint constant METHOD_ID_SIZE = 4;
// (signature length size) 32 bytes + (signature size 65 bytes padded) 96 bytes
uint constant SIGNATURE_SIZE = 128;
// signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes
uint constant SIGNATURE_SIZE = 96;
/**
* @dev requires that a valid signature of a bouncer was provided

View File

@ -36,7 +36,12 @@ contract SignatureBouncerMock is SignatureBouncer {
}
function checkValidSignatureAndData(address _address, bytes _bytes, uint _val, bytes _sig)
function checkValidSignatureAndData(
address _address,
bytes,
uint,
bytes _sig
)
public
view
returns (bool)
@ -44,11 +49,18 @@ contract SignatureBouncerMock is SignatureBouncer {
return isValidSignatureAndData(_address, _sig);
}
function onlyWithValidSignatureAndData(uint _val, bytes _sig)
function onlyWithValidSignatureAndData(uint, bytes _sig)
onlyValidSignatureAndData(_sig)
public
view
{
}
function theWrongMethod(bytes)
public
pure
{
}
}