2020-06-08 12:03:40 +00:00
|
|
|
{
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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)",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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"
|
|
|
|
},
|
2020-06-08 12:03:40 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
"amount": "1",
|
2020-08-17 11:48:23 +00:00
|
|
|
"user": "1"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "borrow",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "100",
|
|
|
|
"user": "1",
|
|
|
|
"borrowRateMode": "stable"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-07-13 08:54:08 +00:00
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
"amount": "-1",
|
|
|
|
"user": "1"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
2020-07-13 08:54:08 +00:00
|
|
|
"expected": "revert",
|
|
|
|
"revertMessage": "Transfer cannot be allowed."
|
|
|
|
}
|
2020-06-08 12:03:40 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|