Fixes borrow-repay-stable scenario

This commit is contained in:
emilio 2020-08-13 16:15:02 +02:00
parent 8af0e9fd11
commit 991fba36c3
2 changed files with 110 additions and 13 deletions

View File

@ -3,7 +3,7 @@
"description": "Test cases for the borrow function, stable mode.",
"stories": [
{
"description": "User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and borrows 100 DAI at stable rate",
"description": "User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and borrows 100 DAI at stable rate",
"actions": [
{
"name": "mint",
@ -31,6 +31,23 @@
},
"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": {
@ -190,14 +207,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"
},
@ -212,14 +245,30 @@
},
"expected": "success"
},
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "2"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "2"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "2",
"sendValue": "1"
"user": "2"
},
"expected": "success"
},
@ -234,14 +283,30 @@
},
"expected": "success"
},
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "3"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "3"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "3",
"sendValue": "1"
"user": "3"
},
"expected": "success"
},
@ -256,14 +321,30 @@
},
"expected": "success"
},
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "4"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "4"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "4",
"sendValue": "1"
"user": "4"
},
"expected": "success"
},
@ -406,7 +487,7 @@
]
},
{
"description": "User 0 deposits 1000 DAI, user 1 deposits 2 ETH and borrow 100 DAI at stable rate first, then 100 DAI at variable rate, repays everything. User 0 redeems",
"description": "User 0 deposits 1000 DAI, user 1 deposits 2 WETH and borrow 100 DAI at stable rate first, then 100 DAI at variable rate, repays everything. User 0 redeems",
"actions": [
{
"name": "mint",
@ -434,14 +515,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[] = ['borrow-negatives.json'];
const selectedScenarios: string[] = ['borrow-repay-stable.json'];
fs.readdirSync(scenarioFolder).forEach((file) => {
if (selectedScenarios.length > 0 && !selectedScenarios.includes(file)) return;