Skip to content

Commit d34061c

Browse files
authored
fix liquidations fork test fail (#1646)
1 parent a88b2ee commit d34061c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

test/integration/behaviors/liquidations.behavior.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ function itCanLiquidate({ ctx }) {
8484
});
8585

8686
describe('getting liquidated', () => {
87-
let beforeDebt;
88-
let beforeBalance;
87+
let beforeDebt, beforeDebttedSnx;
88+
let beforeBalance, beforeCredittedSnx;
8989

9090
before('otherUser calls liquidateDelinquentAccount', async () => {
9191
beforeDebt = (
9292
await Synthetix.debtBalanceOf(someUser.address, toBytes32('sUSD'))
9393
).toString();
94+
beforeDebttedSnx = await Synthetix.balanceOf(someUser.address);
95+
beforeCredittedSnx = await Synthetix.balanceOf(otherUser.address);
9496
beforeBalance = await SynthsUSD.balanceOf(otherUser.address);
9597

9698
await Synthetix.connect(otherUser).liquidateDelinquentAccount(
@@ -99,11 +101,6 @@ function itCanLiquidate({ ctx }) {
99101
);
100102
});
101103

102-
it('is liquidated', async () => {
103-
// = sUSD liquidated / SNX Price * 1.1
104-
assert.bnLt(await Synthetix.balanceOf(someUser.address), '100000000000000000000');
105-
});
106-
107104
it('deducts sUSD debt from the liquidated', async () => {
108105
assert.bnLt(
109106
await Synthetix.debtBalanceOf(someUser.address, toBytes32('sUSD')),
@@ -114,6 +111,16 @@ function itCanLiquidate({ ctx }) {
114111
it('burns sUSD from otherUser', async () => {
115112
assert.bnLt(await SynthsUSD.balanceOf(otherUser.address), beforeBalance);
116113
});
114+
115+
it('transfers SNX from otherUser', async () => {
116+
const amountSent = beforeDebttedSnx.sub(await Synthetix.balanceOf(someUser.address));
117+
118+
assert.bnNotEqual(amountSent, '0');
119+
assert.bnEqual(
120+
await Synthetix.balanceOf(otherUser.address),
121+
beforeCredittedSnx.add(amountSent)
122+
);
123+
});
117124
});
118125
});
119126
});

0 commit comments

Comments
 (0)