aave-protocol-v2/test/helpers/scenarios/withdraw-negatives.json

117 lines
2.6 KiB
JSON
Raw Normal View History

{
"title": "LendingPool: Redeem negative test cases",
"description": "Redeem function.",
"stories": [
{
"description": "Users 0 Deposits 1000 DAI and tries to redeem 0 DAI (revert expected)",
"actions": [
{
"name": "mint",
"args": {
"reserve": "DAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "DAI",
"user": "0"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "DAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "withdraw",
"args": {
"reserve": "DAI",
"amount": "0",
"user": "0"
},
"expected": "revert",
"revertMessage": "Amount to redeem needs to be > 0"
}
]
},
{
"description": "Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected)",
"actions": [
{
"name": "withdraw",
"args": {
"reserve": "DAI",
"amount": "1100",
"user": "0"
},
"expected": "revert",
"revertMessage": "User cannot redeem more than the available balance"
}
]
},
{
2020-08-13 13:37:11 +00:00
"description": "Users 1 deposits 1 WETH, borrows 100 DAI, tries to redeem the 1 WETH deposited (revert expected)",
"actions": [
2020-08-13 13:37:11 +00:00
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "1"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "1"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
2020-08-17 11:48:23 +00:00
"user": "1"
},
"expected": "success"
},
{
2020-07-13 08:54:08 +00:00
"name": "borrow",
"args": {
"reserve": "DAI",
"amount": "100",
"user": "1",
"borrowRateMode": "stable"
},
"expected": "success"
},
{
"name": "withdraw",
2020-07-13 08:54:08 +00:00
"args": {
"reserve": "WETH",
2020-07-13 08:54:08 +00:00
"amount": "-1",
"user": "1"
},
2020-07-13 08:54:08 +00:00
"expected": "revert",
"revertMessage": "Transfer cannot be allowed."
}
]
}
]
}