From e80483e5c8e4f04c6102a0d3bdd60a207a07cc68 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Tue, 14 Jun 2022 11:41:11 +0200 Subject: [PATCH] general renaming in FixedRateExchange --- src/contracts/pools/FixedRateExchange.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/contracts/pools/FixedRateExchange.ts b/src/contracts/pools/FixedRateExchange.ts index 758b1642..bdcf5c3c 100644 --- a/src/contracts/pools/FixedRateExchange.ts +++ b/src/contracts/pools/FixedRateExchange.ts @@ -388,7 +388,7 @@ export class FixedRateExchange extends SmartContractWithAddress { consumeMarketFee: string = '0' ): Promise { const exchange = await this.getExchange(exchangeId) - const result = await this.contract.methods + const amount = await this.contract.methods .calcBaseOutGivenInDT( exchangeId, await this.amountToUnits( @@ -400,7 +400,7 @@ export class FixedRateExchange extends SmartContractWithAddress { ) .call() - return await this.unitsToAmount(exchange.baseToken, result[0], +exchange.btDecimals) + return await this.unitsToAmount(exchange.baseToken, amount[0], +exchange.btDecimals) } /** @@ -696,13 +696,13 @@ export class FixedRateExchange extends SmartContractWithAddress { * @return {String} */ async getOPCCollector(): Promise { - let result = null + let address = null try { - result = await this.contract.methods.opcCollector().call() + address = await this.contract.methods.opcCollector().call() } catch (e) { LoggerInstance.error(`ERROR: Failed to get OPC Collector address: ${e.message}`) } - return result + return address } /** @@ -710,13 +710,13 @@ export class FixedRateExchange extends SmartContractWithAddress { * @return {String} */ public async getRouter(): Promise { - let result = null + let address = null try { - result = await this.contract.methods.router().call() + address = await this.contract.methods.router().call() } catch (e) { LoggerInstance.error(`ERROR: Failed to get Router address: ${e.message}`) } - return result + return address } /** @@ -725,13 +725,13 @@ export class FixedRateExchange extends SmartContractWithAddress { * @return {String} return exchange owner */ async getExchangeOwner(exchangeId: string): Promise { - let result = null + let address = null try { - result = await (await this.getExchange(exchangeId)).exchangeOwner + address = await (await this.getExchange(exchangeId)).exchangeOwner } catch (e) { LoggerInstance.error(`ERROR: Failed to get OPF Collector address: ${e.message}`) } - return result + return address } /**