Skip to content

Commit b85e13a

Browse files
authored
Merge pull request #125 from ampleforth/naguib-mock-fix
UFragments mock fix
2 parents 166347f + 3c9a219 commit b85e13a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

contracts/mocks/MockUFragments.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ contract MockUFragments is Mock {
2424
int256[] memory intVals = new int256[](1);
2525
intVals[0] = supplyDelta;
2626
emit FunctionArguments(uintVals, intVals);
27-
_supply++;
28-
return _supply;
27+
return uint256(int256(_supply) + int256(supplyDelta));
2928
}
3029

3130
function totalSupply()

test/unit/UFragmentsPolicy.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,9 @@ contract('UFragmentsPolicy:Rebase', async function (accounts) {
352352
await mockExternalData(INITIAL_RATE_2X, INITIAL_CPI, MAX_SUPPLY);
353353
});
354354

355-
it('should fail', async function () {
356-
expect(
357-
await chain.isEthException(uFragmentsPolicy.rebase())
358-
).to.be.true;
355+
it('should not grow', async function () {
356+
r = await uFragmentsPolicy.rebase();
357+
r.logs[0].args.requestedSupplyAdjustment.should.be.bignumber.eq(0);
359358
});
360359
});
361360
});

0 commit comments

Comments
 (0)