2021-02-07 03:10:29 +00:00
{
"title" : "LendingPool: credit delegation" ,
"description" : "Test cases for the credit delegation related functions." ,
"stories" : [
{
2021-02-08 16:24:01 +00:00
"description" : "User 3 deposits 1000 WETH. User 0 deposits 1000 LPDAI, user 0 delegates borrowing of 1 WETH on variable to user 4, user 4 borrows 1 WETH variable on behalf of user 0" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "3"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"user" : "3"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "3"
} ,
"expected" : "success"
} ,
{
"name" : "mint" ,
"args" : {
2021-02-08 16:24:01 +00:00
"reserve" : "LPDAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-08 16:24:01 +00:00
"reserve" : "LPDAI" ,
2021-02-07 03:10:29 +00:00
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-08 16:24:01 +00:00
"reserve" : "LPDAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "delegateBorrowAllowance" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "2" ,
"user" : "0" ,
"borrowRateMode" : "variable" ,
"toUser" : "4"
} ,
"expected" : "success"
} ,
{
"name" : "borrow" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "4" ,
"onBehalfOf" : "0" ,
"borrowRateMode" : "variable"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "User 4 trying to borrow 1 WETH stable on behalf of user 0, revert expected" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "borrow" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "4" ,
"onBehalfOf" : "0" ,
"borrowRateMode" : "stable"
} ,
"expected" : "revert" ,
"revertMessage" : "59"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "User 0 delegates borrowing of 1 WETH to user 4, user 4 borrows 3 WETH variable on behalf of user 0, revert expected" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "delegateBorrowAllowance" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "0" ,
"borrowRateMode" : "variable" ,
"toUser" : "4"
} ,
"expected" : "success"
} ,
{
"name" : "borrow" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "3" ,
"user" : "4" ,
"onBehalfOf" : "0" ,
"borrowRateMode" : "variable"
} ,
"expected" : "revert" ,
"revertMessage" : "59"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "User 0 delegates borrowing of 1 WETH on stable to user 2, user 2 borrows 1 WETH stable on behalf of user 0" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "delegateBorrowAllowance" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "0" ,
"borrowRateMode" : "stable" ,
"toUser" : "2"
} ,
"expected" : "success"
} ,
{
"name" : "borrow" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "2" ,
"onBehalfOf" : "0" ,
"borrowRateMode" : "stable"
} ,
"expected" : "success"
}
]
}
]
}