Skip to content

Commit

Permalink
Add SignatureBouncer test for when msg.data is too short (OpenZeppeli…
Browse files Browse the repository at this point in the history
…n#1360)

* add test for msg.data too short

* fix test to hit that branch

* Update SignatureBouncer.test.js
  • Loading branch information
frangio authored and nventuro committed Sep 27, 2018
1 parent 536262f commit 1a4e534
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/mocks/SignatureBouncerMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
{

}

function tooShortMsgData()
public
onlyValidSignatureAndData("")
view
{
}
}
6 changes: 6 additions & 0 deletions test/drafts/SignatureBouncer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ contract('SignatureBouncer', function ([_, signer, otherSigner, anyone, authoriz
)
);
});

it('does not allow msg.data shorter than SIGNATURE_SIZE', async function () {
await assertRevert(
this.sigBouncer.tooShortMsgData({ from: authorizedUser })
);
});
});
});

Expand Down

0 comments on commit 1a4e534

Please sign in to comment.