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

(cherry picked from commit 1a4e534)
  • Loading branch information
frangio committed Sep 28, 2018
1 parent fa5ecd0 commit ec1ddc8
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 @@ -64,4 +64,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 ec1ddc8

Please sign in to comment.