From 547c95dc1a0328d1792f63bcff4caaf7e718c5ad Mon Sep 17 00:00:00 2001 From: emilio Date: Thu, 13 Aug 2020 14:32:41 +0200 Subject: [PATCH] Updated deposit scenarios --- test/helpers/scenarios/deposit.json | 89 ++++++++++++++++------------- test/scenario.spec.ts | 2 +- 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/test/helpers/scenarios/deposit.json b/test/helpers/scenarios/deposit.json index de9e381c..34f9c9e9 100644 --- a/test/helpers/scenarios/deposit.json +++ b/test/helpers/scenarios/deposit.json @@ -127,32 +127,64 @@ ] }, { - "description": "User 0 deposits 1 ETH in an empty reserve", + "description": "User 0 deposits 1 WETH in an empty reserve", "actions": [ + { + "name": "mint", + "args": { + "reserve": "WETH", + "amount": "1", + "user": "0" + }, + "expected": "success" + }, + { + "name": "approve", + "args": { + "reserve": "WETH", + "user": "0" + }, + "expected": "success" + }, { "name": "deposit", "args": { "reserve": "WETH", "amount": "1", - "user": "0", - "sendValue": "1" + "user": "0" }, "expected": "success" } ] }, { - "description": "User 1 deposits 1 ETH after user 0", + "description": "User 1 deposits 1 WETH after user 0", "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", - "sendValue": "1" + "user": "1" }, "expected": "success" } @@ -161,6 +193,15 @@ { "description": "User 1 deposits 0 ETH (revert expected)", "actions": [ + { + "name": "mint", + "args": { + "reserve": "WETH", + "amount": "1", + "user": "0" + }, + "expected": "success" + }, { "name": "deposit", "args": { @@ -188,40 +229,6 @@ "revertMessage": "Amount must be greater than 0" } ] - }, - { - "description": "User 1 tries to deposit ETH without sending any value", - "actions": [ - { - "name": "deposit", - "args": { - "reserve": "WETH", - - "amount": "1", - "user": "1", - "sendValue": "0" - }, - "expected": "revert", - "revertMessage": "The amount and the value sent to deposit do not match" - } - ] - }, - { - "description": "User 1 tries to deposit ETH by sending less value than required", - "actions": [ - { - "name": "deposit", - "args": { - "reserve": "WETH", - - "amount": "1", - "user": "1", - "sendValue": "0.5" - }, - "expected": "revert", - "revertMessage": "The amount and the value sent to deposit do not match" - } - ] } ] } diff --git a/test/scenario.spec.ts b/test/scenario.spec.ts index 5d449d76..ff6382bd 100644 --- a/test/scenario.spec.ts +++ b/test/scenario.spec.ts @@ -12,7 +12,7 @@ BigNumber.config({DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_DOWN}); const scenarioFolder = './test/helpers/scenarios/'; -const selectedScenarios: string[] = []; +const selectedScenarios: string[] = ['deposit.json']; fs.readdirSync(scenarioFolder).forEach((file) => { if (selectedScenarios.length > 0 && !selectedScenarios.includes(file)) return;