The assert conditions failed when I try to liquidate 1000000 ETH in unit test in test_dsce.py in brownie framework,
testing def test_user_still_has_some_eth_after_liquidation(liquidated_dsce, account):
assert (
expected_user_collateral_value_in_usd - 1000
<= user_collateral_value_in_usd
<= expected_user_collateral_value_in_usd + 1000
)
E assert (7000000000000000010000010 - 1000) <= 7000000000000000000000020
AMOUNT_COLLATERAL = web3.toWei(1000000, "ether")
AMOUNT_DSC_TO_MINT = web3.toWei(101000000, "ether")
COLLATERAL_TO_COVER = web3.toWei(21000000, "ether")
LIQUIDATION_THRESHOLD = 50
expected_user_collateral_value_in_usd is a bit different from the user_collateral_value_in_usd from the account.
brownie unit test
Set a maximum amount of ETH to liquidate one time might be safer.
This unit test passed with I test with 1 eth instead of a big amount.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.