From 94b8f877118b3e8ee2487f3e361e3ebb0f1e1dde Mon Sep 17 00:00:00 2001 From: Taylor Brent Date: Tue, 17 Oct 2023 12:46:42 -0400 Subject: [PATCH] fix Main.test.ts --- test/Main.test.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/Main.test.ts b/test/Main.test.ts index 7556200088..de7d519b73 100644 --- a/test/Main.test.ts +++ b/test/Main.test.ts @@ -71,6 +71,7 @@ import { IMPLEMENTATION, ORACLE_ERROR, ORACLE_TIMEOUT, + ORACLE_TIMEOUT_PRE_BUFFER, PRICE_TIMEOUT, REVENUE_HIDING, } from './fixtures' @@ -1181,7 +1182,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: newToken.address, maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: await ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral0.delayUntilDefault(), @@ -1203,7 +1204,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: newToken.address, maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: await ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral0.delayUntilDefault(), @@ -1229,7 +1230,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await gasGuzzlingColl.erc20(), maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: await ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral0.delayUntilDefault(), @@ -1628,7 +1629,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: erc20s[5].address, maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -1724,7 +1725,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: eurToken.address, maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('EUR'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral1.delayUntilDefault(), @@ -1947,7 +1948,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral0.erc20(), maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('NEW_TARGET'), defaultThreshold: fp('0.01'), delayUntilDefault: await collateral0.delayUntilDefault(), @@ -2802,7 +2803,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral2.erc20(), maxTradeVolume: await collateral2.maxTradeVolume(), - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -2837,7 +2838,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral2.erc20(), maxTradeVolume: await collateral2.maxTradeVolume(), - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -2862,7 +2863,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral2.erc20(), maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -3084,7 +3085,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral2.erc20(), maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -3128,7 +3129,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: await collateral2.erc20(), maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral2.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: ethers.utils.formatBytes32String('USD'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral2.delayUntilDefault(), @@ -3158,7 +3159,7 @@ describe(`MainP${IMPLEMENTATION} contract`, () => { oracleError: ORACLE_ERROR, erc20: token0.address, maxTradeVolume: config.rTokenMaxTradeVolume, - oracleTimeout: await collateral0.oracleTimeout(), + oracleTimeout: ORACLE_TIMEOUT_PRE_BUFFER, targetName: await ethers.utils.formatBytes32String('NEW TARGET'), defaultThreshold: DEFAULT_THRESHOLD, delayUntilDefault: await collateral0.delayUntilDefault(),