Fixes remaining tests

This commit is contained in:
emilio 2020-08-17 13:48:23 +02:00
parent 142cec24e7
commit d7656839fa
8 changed files with 99 additions and 26 deletions

View File

@ -123,8 +123,7 @@
"reserve": "WETH",
"amount": "1",
"user": "1",
"sendValue": "1"
"user": "1"
},
"expected": "success"
},

View File

@ -54,8 +54,7 @@
"reserve": "WETH",
"amount": "1",
"user": "1",
"sendValue": "1"
"user": "1"
},
"expected": "success"
},

View File

@ -220,7 +220,7 @@
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"amount": "0.001",
"user": "2"
},
"expected": "success"
@ -239,8 +239,7 @@
"reserve": "WETH",
"amount": "0.001",
"user": "2",
"sendValue": "0.001"
"user": "2"
},
"expected": "success"
}
@ -327,8 +326,7 @@
"amount": "0",
"user": "1",
"onBehalfOf": "1",
"borrowRateMode": "variable",
"sendValue": "0"
"borrowRateMode": "variable"
},
"expected": "revert",
"revertMessage": "Amount must be greater than 0"
@ -797,8 +795,7 @@
"reserve": "WETH",
"amount": "0.1",
"user": "3",
"sendValue": "0.1"
"user": "3"
},
"expected": "success"
},
@ -882,8 +879,7 @@
"reserve": "WETH",
"amount": "2",
"user": "6",
"sendValue": "2"
"user": "6"
},
"expected": "success"
},

View File

@ -45,14 +45,30 @@
{
"description": "User 1 deposits 1 ETH, borrows 100 DAI, repays after one year. Users 0 deposits another 1000 DAI. Redirected balance of user 2 is updated",
"actions": [
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "2",
"user": "1"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "1"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "2",
"user": "1",
"sendValue": "2"
"user": "1"
},
"expected": "success"
},

View File

@ -47,14 +47,30 @@
},
"expected": "success"
},
{
"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"
},
@ -108,14 +124,30 @@
{
"description": "User 2 deposits ETH and borrows the remaining DAI, causing the stable rates to rise (liquidity rate < user 1 borrow rate). User 0 tries to rebalance user 1 (revert expected)",
"actions": [
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "5",
"user": "2"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "2"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "5",
"user": "2",
"sendValue": "5"
"user": "2"
},
"expected": "success"
},
@ -144,14 +176,30 @@
{
"description": "User 2 borrows more DAI, causing the liquidity rate to rise above user 1 stable borrow rate User 0 rebalances user 1",
"actions": [
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "3",
"user": "2"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "2"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "3",
"user": "2",
"sendValue": "3"
"user": "2"
},
"expected": "success"
},

View File

@ -85,8 +85,7 @@
"reserve": "WETH",
"amount": "1",
"user": "1",
"sendValue": "1"
"user": "1"
},
"expected": "success"
},

View File

@ -61,14 +61,30 @@
},
"expected": "success"
},
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "2",
"user": "1"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "1"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "2",
"user": "1",
"sendValue": "2"
"user": "1"
},
"expected": "success"
},

View File

@ -12,7 +12,7 @@ BigNumber.config({DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_DOWN});
const scenarioFolder = './test/helpers/scenarios/';
const selectedScenarios: string[] = ['set-use-as-collateral.json'];
const selectedScenarios: string[] = [];
fs.readdirSync(scenarioFolder).forEach((file) => {
if (selectedScenarios.length > 0 && !selectedScenarios.includes(file)) return;