2020-06-08 12:03:40 +00:00
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"title": "LendingPool: Deposit",
|
|
|
|
"description": "Test cases for the deposit function.",
|
|
|
|
"stories": [
|
|
|
|
{
|
|
|
|
"description": "User 0 Deposits 1000 DAI in an empty reserve",
|
|
|
|
"actions": [
|
2020-06-08 12:03:40 +00:00
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "User 1 deposits 1000 DAI after user 1",
|
|
|
|
"actions": [
|
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "User 0 deposits 1000 USDC in an empty reserve",
|
|
|
|
"actions": [
|
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "User 1 deposits 1000 USDC after user 0",
|
|
|
|
"actions": [
|
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-13 08:54:08 +00:00
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "1000",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"description": "User 0 deposits 1 WETH in an empty reserve",
|
2020-07-13 08:54:08 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"name": "mint",
|
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",
|
2020-08-13 12:32:41 +00:00
|
|
|
"user": "0"
|
2020-07-13 08:54:08 +00:00
|
|
|
},
|
|
|
|
"expected": "success"
|
2020-08-13 12:32:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-07-13 08:54:08 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
"amount": "1",
|
2020-08-13 12:32:41 +00:00
|
|
|
"user": "0"
|
2020-07-13 08:54:08 +00:00
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"description": "User 1 deposits 1 WETH after user 0",
|
2020-07-13 08:54:08 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"name": "mint",
|
2020-07-13 08:54:08 +00:00
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
2020-08-13 12:32:41 +00:00
|
|
|
"amount": "1",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-08-13 11:06:23 +00:00
|
|
|
|
2020-08-13 12:32:41 +00:00
|
|
|
{
|
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
2020-07-13 08:54:08 +00:00
|
|
|
"user": "1"
|
|
|
|
},
|
2020-08-13 12:32:41 +00:00
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-07-13 08:54:08 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 12:32:41 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
"amount": "1",
|
2020-07-13 08:54:08 +00:00
|
|
|
"user": "1"
|
|
|
|
},
|
2020-08-13 12:32:41 +00:00
|
|
|
"expected": "success"
|
2020-07-13 08:54:08 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"description": "User 1 deposits 0 ETH (revert expected)",
|
2020-07-13 08:54:08 +00:00
|
|
|
"actions": [
|
2020-08-13 12:32:41 +00:00
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"amount": "1",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-07-13 08:54:08 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-08-13 12:32:41 +00:00
|
|
|
"amount": "0",
|
|
|
|
"user": "1"
|
2020-07-13 08:54:08 +00:00
|
|
|
},
|
|
|
|
"expected": "revert",
|
2020-08-13 12:32:41 +00:00
|
|
|
"revertMessage": "Amount must be greater than 0"
|
2020-07-13 08:54:08 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-13 12:32:41 +00:00
|
|
|
"description": "User 1 deposits 0 DAI",
|
2020-07-13 08:54:08 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 12:32:41 +00:00
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "0",
|
|
|
|
"user": "1"
|
2020-07-13 08:54:08 +00:00
|
|
|
},
|
|
|
|
"expected": "revert",
|
2020-08-13 12:32:41 +00:00
|
|
|
"revertMessage": "Amount must be greater than 0"
|
2020-06-08 12:03:40 +00:00
|
|
|
}
|
2020-07-13 08:54:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|