@0x/contracts-staking: Add another LibFixedMath.add() test.

This commit is contained in:
Lawrence Forman 2019-10-10 09:31:53 +09:00
parent 063d6ff24e
commit 22fc0b4337
2 changed files with 15 additions and 0 deletions

View File

@ -1,4 +1,13 @@
[
{
"version": "1.1.0-beta.1",
"changes": [
{
"note": "Add more overflow safeguards to `LibFixedMath`",
"pr": "TODO"
}
]
},
{
"version": "1.1.0-beta.0",
"changes": [

View File

@ -291,6 +291,12 @@ blockchainTests('LibFixedMath unit tests', env => {
const r = await testContract.add.callAsync(a, b);
expect(r).to.bignumber.eq(-1);
});
it('MAX_FIXED + (MIN_FIXED + int(1)) == 0', async () => {
const [a, b] = [MAX_FIXED_VALUE, MIN_FIXED_VALUE.plus(1)];
const r = await testContract.add.callAsync(a, b);
expect(r).to.bignumber.eq(0);
});
});
describe('sub()', () => {