From fcf44f3abb94b5240a8d94b754f1d3fe035f151e Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Fri, 5 Feb 2021 17:21:22 -0500 Subject: [PATCH] Fixed some test descriptions and removed redundancies --- test/helpers/scenarios/borrow-negatives.json | 2 -- .../scenarios/borrow-repay-stable.json | 9 ++------ .../scenarios/borrow-repay-variable.json | 15 ------------ test/helpers/scenarios/credit-delegation.json | 2 +- test/helpers/scenarios/deposit.json | 5 ++-- .../scenarios/rebalance-stable-rate.json | 14 +++++------ .../scenarios/set-use-as-collateral.json | 11 +-------- test/helpers/scenarios/swap-rate-mode.json | 1 - .../helpers/scenarios/withdraw-negatives.json | 2 -- test/helpers/scenarios/withdraw.json | 23 +------------------ 10 files changed, 13 insertions(+), 71 deletions(-) diff --git a/test/helpers/scenarios/borrow-negatives.json b/test/helpers/scenarios/borrow-negatives.json index 6a8ceb66..03f4d005 100644 --- a/test/helpers/scenarios/borrow-negatives.json +++ b/test/helpers/scenarios/borrow-negatives.json @@ -52,7 +52,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, @@ -121,7 +120,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, diff --git a/test/helpers/scenarios/borrow-repay-stable.json b/test/helpers/scenarios/borrow-repay-stable.json index 3f472387..bdbf1aff 100644 --- a/test/helpers/scenarios/borrow-repay-stable.json +++ b/test/helpers/scenarios/borrow-repay-stable.json @@ -88,7 +88,7 @@ ] }, { - "description": "User 1 repays the half of the DAI borrow after one year", + "description": "User 1 repays half of the DAI borrow after one year", "actions": [ { "name": "mint", @@ -170,7 +170,7 @@ ] }, { - "description": "User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected)", + "description": "User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected) User 1 withdrawws", "actions": [ { "name": "mint", @@ -270,7 +270,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, @@ -308,7 +307,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "2" }, @@ -346,7 +344,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "3" }, @@ -384,7 +381,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "4" }, @@ -578,7 +574,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "2", "user": "1" }, diff --git a/test/helpers/scenarios/borrow-repay-variable.json b/test/helpers/scenarios/borrow-repay-variable.json index 46c17610..3c4ce368 100644 --- a/test/helpers/scenarios/borrow-repay-variable.json +++ b/test/helpers/scenarios/borrow-repay-variable.json @@ -83,7 +83,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, @@ -205,7 +204,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "1" }, @@ -237,7 +235,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "0.001", "user": "2" }, @@ -269,7 +266,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "0" }, @@ -306,7 +302,6 @@ "name": "borrow", "args": { "reserve": "WETH", - "amount": "0.5", "borrowRateMode": "variable", "user": "1", @@ -340,7 +335,6 @@ "name": "repay", "args": { "reserve": "WETH", - "amount": "-1", "user": "2", "borrowRateMode": "variable", @@ -375,7 +369,6 @@ "name": "repay", "args": { "reserve": "WETH", - "amount": "0.2", "user": "3", "borrowRateMode": "variable", @@ -409,7 +402,6 @@ "name": "repay", "args": { "reserve": "WETH", - "amount": "-1", "borrowRateMode": "variable", "user": "1", @@ -426,7 +418,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "0" }, @@ -530,7 +521,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, @@ -693,7 +683,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "0.1", "user": "3" }, @@ -719,7 +708,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "3" }, @@ -793,7 +781,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "0.1", "user": "3" }, @@ -819,7 +806,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "3" }, @@ -877,7 +863,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "2", "user": "6" }, diff --git a/test/helpers/scenarios/credit-delegation.json b/test/helpers/scenarios/credit-delegation.json index 0d15d7f1..2efabeb1 100644 --- a/test/helpers/scenarios/credit-delegation.json +++ b/test/helpers/scenarios/credit-delegation.json @@ -3,7 +3,7 @@ "description": "Test cases for the credit delegation related functions.", "stories": [ { - "description": "User 0 deposits 1000 DAI, user 0 delegates borrowing of 1 WETH on variable to user 4, user 4 borrows 1 WETH variable on behalf of user 0", + "description": "User 3 deposits 1000 WETH. User 0 deposits 1000 DAI, user 0 delegates borrowing of 1 WETH on variable to user 4, user 4 borrows 1 WETH variable on behalf of user 0", "actions": [ { "name": "mint", diff --git a/test/helpers/scenarios/deposit.json b/test/helpers/scenarios/deposit.json index 2456d931..b4b73879 100644 --- a/test/helpers/scenarios/deposit.json +++ b/test/helpers/scenarios/deposit.json @@ -34,7 +34,7 @@ ] }, { - "description": "User 1 deposits 1000 DAI after user 1", + "description": "User 1 deposits 1000 DAI after user 0", "actions": [ { "name": "mint", @@ -150,7 +150,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "0" }, @@ -191,7 +190,7 @@ ] }, { - "description": "User 1 deposits 0 ETH (revert expected)", + "description": "User 1 deposits 0 WETH (revert expected)", "actions": [ { "name": "mint", diff --git a/test/helpers/scenarios/rebalance-stable-rate.json b/test/helpers/scenarios/rebalance-stable-rate.json index 1da9a376..79c224f8 100644 --- a/test/helpers/scenarios/rebalance-stable-rate.json +++ b/test/helpers/scenarios/rebalance-stable-rate.json @@ -10,8 +10,7 @@ "args": { "reserve": "USDC", "user": "0", - "target": "1", - "borrowRateMode": "variable" + "target": "1" }, "expected": "revert", "revertMessage": "User does not have any stable rate loan for this reserve" @@ -19,7 +18,7 @@ ] }, { - "description": "User 0 deposits 1000 USDC, user 1 deposits 5 ETH, borrows 250 USDC at a stable rate, user 0 rebalances user 1 (revert expected)", + "description": "User 0 deposits 1000 USDC, user 1 deposits 7 WETH, borrows 250 USDC at a stable rate, user 0 rebalances user 1 (revert expected)", "actions": [ { "name": "mint", @@ -68,7 +67,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "7", "user": "1" }, @@ -97,7 +95,7 @@ ] }, { - "description": "User 1 borrows another 200 at stable, user 0 tries to rebalance but the conditions are not met (revert expected)", + "description": "User 1 borrows another 200 at variable, user 0 tries to rebalance but the conditions are not met (revert expected)", "actions": [ { "name": "borrow", @@ -122,7 +120,7 @@ ] }, { - "description": "User 1 borrows another 200 at stable, user 0 tries to rebalance but the conditions are not met (revert expected)", + "description": "User 1 borrows another 200 at variable, user 0 tries to rebalance but the conditions are not met (revert expected)", "actions": [ { "name": "borrow", @@ -147,7 +145,7 @@ ] }, { - "description": "User 1 borrows another 100 at stable, user 0 tries to rebalance but the conditions are not met (revert expected)", + "description": "User 1 borrows another 100 at variable, user 0 tries to rebalance but the conditions are not met (revert expected)", "actions": [ { "name": "borrow", @@ -173,7 +171,7 @@ }, { - "description": "User 0 borrows the remaining USDC (usage ratio = 100%). User 0 rebalances user 1", + "description": "User 1 borrows the remaining USDC (usage ratio = 100%) at variable. User 0 rebalances user 1", "actions": [ { "name": "borrow", diff --git a/test/helpers/scenarios/set-use-as-collateral.json b/test/helpers/scenarios/set-use-as-collateral.json index 53b5128e..2a206bb9 100644 --- a/test/helpers/scenarios/set-use-as-collateral.json +++ b/test/helpers/scenarios/set-use-as-collateral.json @@ -66,7 +66,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "2", "user": "1" }, @@ -76,7 +75,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "WETH", - "user": "1", "useAsCollateral": "false" }, @@ -126,7 +124,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "WETH", - "user": "1", "useAsCollateral": "false" }, @@ -136,7 +133,7 @@ ] }, { - "description": "User 1 Deposits 1000 AAVE, disables WETH as collateral. Should revert as 1000 AAVE are not enough to cover the debt (revert expected)", + "description": "User 1 Deposits 10 AAVE, disables WETH as collateral. Should revert as 10 AAVE are not enough to cover the debt (revert expected)", "actions": [ { "name": "mint", @@ -159,7 +156,6 @@ "name": "deposit", "args": { "reserve": "AAVE", - "amount": "10", "user": "1" }, @@ -169,7 +165,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "WETH", - "user": "1", "useAsCollateral": "false" }, @@ -193,7 +188,6 @@ "name": "deposit", "args": { "reserve": "AAVE", - "amount": "640", "user": "1" }, @@ -203,7 +197,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "WETH", - "user": "1", "useAsCollateral": "false" }, @@ -218,7 +211,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "AAVE", - "user": "1", "useAsCollateral": "false" }, @@ -233,7 +225,6 @@ "name": "setUseAsCollateral", "args": { "reserve": "WETH", - "user": "1", "useAsCollateral": "true" }, diff --git a/test/helpers/scenarios/swap-rate-mode.json b/test/helpers/scenarios/swap-rate-mode.json index e2612586..e966af9a 100644 --- a/test/helpers/scenarios/swap-rate-mode.json +++ b/test/helpers/scenarios/swap-rate-mode.json @@ -82,7 +82,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "2", "user": "1" }, diff --git a/test/helpers/scenarios/withdraw-negatives.json b/test/helpers/scenarios/withdraw-negatives.json index 1fb070f5..fbc5c308 100644 --- a/test/helpers/scenarios/withdraw-negatives.json +++ b/test/helpers/scenarios/withdraw-negatives.json @@ -83,7 +83,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" }, @@ -103,7 +102,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "1" }, diff --git a/test/helpers/scenarios/withdraw.json b/test/helpers/scenarios/withdraw.json index 436984fc..5f183eca 100644 --- a/test/helpers/scenarios/withdraw.json +++ b/test/helpers/scenarios/withdraw.json @@ -144,7 +144,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "0" }, @@ -153,13 +152,12 @@ ] }, { - "description": "User 0 withdraws half of the deposited ETH", + "description": "User 0 withdraws half of the deposited WETH", "actions": [ { "name": "withdraw", "args": { "reserve": "WETH", - "amount": "0.5", "user": "0" }, @@ -174,7 +172,6 @@ "name": "withdraw", "args": { "reserve": "WETH", - "amount": "-1", "user": "0" }, @@ -243,23 +240,6 @@ { "description": "Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI. User 1 tries to withdraw all the USDC", "actions": [ - { - "name": "mint", - "args": { - "reserve": "DAI", - "amount": "1000", - "user": "1" - }, - "expected": "success" - }, - { - "name": "approve", - "args": { - "reserve": "DAI", - "user": "1" - }, - "expected": "success" - }, { "name": "deposit", "args": { @@ -316,7 +296,6 @@ "name": "deposit", "args": { "reserve": "WETH", - "amount": "1", "user": "1" },