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

165 lines
3.8 KiB
JSON

{
"title": "LendingPool: Redeem negative test cases",
"description": "Redeem function.",
"stories": [
{
"description": "Users 0 Deposits 1000 LPDAI and tries to redeem 0 LPDAI (revert expected)",
"actions": [
{
"name": "mint",
"args": {
"reserve": "LPDAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "LPDAI",
"user": "0"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "LPDAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "withdraw",
"args": {
"reserve": "LPDAI",
"amount": "0",
"user": "0"
},
"expected": "revert",
"revertMessage": "Amount to redeem needs to be > 0"
}
]
},
{
"description": "Users 0 tries to redeem 1100 LPDAI from the 1000 LPDAI deposited (revert expected)",
"actions": [
{
"name": "withdraw",
"args": {
"reserve": "LPDAI",
"amount": "1100",
"user": "0"
},
"expected": "revert",
"revertMessage": "User cannot redeem more than the available balance"
}
]
},
{
"description": "Users 1 deposits 1 WETH, borrows 100 LPDAI stable (revert expected), redeems the 1 WETH deposited",
"actions": [
{
"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",
"user": "1"
},
"expected": "success"
},
{
"name": "borrow",
"args": {
"reserve": "LPDAI",
"amount": "100",
"user": "1",
"borrowRateMode": "stable"
},
"expected": "revert"
},
{
"name": "withdraw",
"args": {
"reserve": "WETH",
"amount": "-1",
"user": "1"
},
"expected": "success"
}
]
},
{
"description": "Users 1 deposits 1 WETH, borrows 100 LPDAI at variable rate, tries to redeem the 1 WETH deposited (revert expected)",
"actions": [
{
"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",
"user": "1"
},
"expected": "success"
},
{
"name": "borrow",
"args": {
"reserve": "LPDAI",
"amount": "100",
"user": "1",
"borrowRateMode": "variable"
},
"expected": "success"
},
{
"name": "withdraw",
"args": {
"reserve": "WETH",
"amount": "-1",
"user": "1"
},
"expected": "revert",
"revertMessage": "Transfer cannot be allowed."
}
]
}
]
}