mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'master' into fix/12
This commit is contained in:
commit
511096382f
|
@ -555,7 +555,7 @@ contract AToken is ERC20 {
|
||||||
|
|
||||||
bool fromIndexReset = false;
|
bool fromIndexReset = false;
|
||||||
//reset the user data if the remaining balance is 0
|
//reset the user data if the remaining balance is 0
|
||||||
if (fromBalance.sub(_value) == 0) {
|
if (fromBalance.sub(_value) == 0 && _from != _to) {
|
||||||
fromIndexReset = resetDataOnZeroBalanceInternal(_from);
|
fromIndexReset = resetDataOnZeroBalanceInternal(_from);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,4 +188,19 @@ makeSuite('AToken: Transfer', (testEnv: TestEnv) => {
|
||||||
INVALID_REDIRECTED_BALANCE_AFTER_TRANSFER
|
INVALID_REDIRECTED_BALANCE_AFTER_TRANSFER
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('User 1 transfers the whole amount to himself', async () => {
|
||||||
|
const {users, pool, aDai, dai} = testEnv;
|
||||||
|
|
||||||
|
const user1BalanceBefore = await aDai.balanceOf(users[1].address);
|
||||||
|
|
||||||
|
await aDai.connect(users[1].signer).transfer(users[1].address, user1BalanceBefore);
|
||||||
|
|
||||||
|
const user1BalanceAfter = await aDai.balanceOf(users[1].address);
|
||||||
|
|
||||||
|
expect(user1BalanceAfter.toString()).to.be.equal(
|
||||||
|
user1BalanceBefore,
|
||||||
|
INVALID_REDIRECTED_BALANCE_AFTER_TRANSFER
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user