From 525ca3bb84b26fd79a3e6dc3de491bdbd51c542c Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 23 Dec 2019 22:40:08 +0300 Subject: [PATCH] removed parts param --- abis/PriceOracle.abi.json | 7 +------ config.js | 2 +- src/Fetcher.js | 12 ++++-------- src/utils.js | 4 +--- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/abis/PriceOracle.abi.json b/abis/PriceOracle.abi.json index ac5be41..5b9f897 100644 --- a/abis/PriceOracle.abi.json +++ b/abis/PriceOracle.abi.json @@ -11,11 +11,6 @@ "internalType": "uint256[]", "name": "oneUnitAmounts", "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "parts", - "type": "uint256[]" } ], "name": "getPricesInETH", @@ -30,4 +25,4 @@ "stateMutability": "view", "type": "function" } -] +] \ No newline at end of file diff --git a/config.js b/config.js index ed4b53c..0c88d0c 100644 --- a/config.js +++ b/config.js @@ -6,7 +6,7 @@ module.exports = { redisUrl: process.env.REDIS_URL, rpcUrl: process.env.RPC_URL || 'https://kovan.infura.io/', oracleRpcUrl: process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/', - oracleAddress: '0x5c4c5622670423b8ee5F3A02F505D139fbAfb618', + oracleAddress: '0xB5eE7907FF5f4c1FC9086Fc117E6c397431F39ad', privateKey: process.env.PRIVATE_KEY, mixers: { netId1: { diff --git a/src/Fetcher.js b/src/Fetcher.js index 08bc1f1..240acfa 100644 --- a/src/Fetcher.js +++ b/src/Fetcher.js @@ -19,25 +19,21 @@ class Fetcher { } this.tokenAddresses this.oneUintAmount - this.parts this.currencyLookup this.gasPrices = { fast: defaultGasPrice } - const { tokenAddresses, oneUintAmount, parts, currencyLookup } = getArgsForOracle() + const { tokenAddresses, oneUintAmount, currencyLookup } = getArgsForOracle() this.tokenAddresses = tokenAddresses this.oneUintAmount = oneUintAmount - this.parts = parts this.currencyLookup = currencyLookup } async fetchPrices() { try { - let prices = await this.oracle.methods.getPricesInETH( - this.tokenAddresses, - this.oneUintAmount, - this.parts - ).call() + let prices = await this.oracle.methods + .getPricesInETH(this.tokenAddresses, this.oneUintAmount) + .call() this.ethPrices = prices.reduce((acc, price, i) => { acc[this.currencyLookup[this.tokenAddresses[i]]] = price return acc diff --git a/src/utils.js b/src/utils.js index 6dd1a63..d788a30 100644 --- a/src/utils.js +++ b/src/utils.js @@ -142,7 +142,6 @@ function getArgsForOracle() { const tokens = mixers['netId1'] const tokenAddresses = [] const oneUintAmount = [] - const parts = [] // this is probably should be removed const currencyLookup = {} Object.entries(tokens).map(([currency, data]) => { if (currency !== 'eth') { @@ -152,11 +151,10 @@ function getArgsForOracle() { .pow(toBN(data.decimals.toString())) .toString() ) - parts.push('1') currencyLookup[data.tokenAddress] = currency } }) - return { tokenAddresses, oneUintAmount, parts, currencyLookup } + return { tokenAddresses, oneUintAmount, currencyLookup } } function getMixers() {