Add SignatureBouncer test for when msg.data is too short (#1360)

* add test for msg.data too short

* fix test to hit that branch

* Update SignatureBouncer.test.js

(cherry picked from commit 1a4e5346ed)
This commit is contained in:
Francisco Giordano
2018-09-27 19:40:18 -03:00
committed by Nicolás Venturo
parent fa5ecd03cb
commit 8c394de450
2 changed files with 13 additions and 0 deletions

View File

@ -64,4 +64,11 @@ contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
{
}
function tooShortMsgData()
public
onlyValidSignatureAndData("")
view
{
}
}

View File

@ -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 })
);
});
});
});