1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge branch 'v4main' into issue-1356-rewrite-testcontracthandler-helper-class

This commit is contained in:
Miquel A. Cabot 2022-03-24 16:14:02 +01:00
commit 159270889e
3 changed files with 5 additions and 10 deletions

View File

@ -1,6 +1,4 @@
import defaultFixedRateExchangeAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/fixedRate/FixedRateExchange.sol/FixedRateExchange.json' import defaultFixedRateExchangeAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/fixedRate/FixedRateExchange.sol/FixedRateExchange.json'
import defaultErc20Abi from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json'
import BigNumber from 'bignumber.js'
import { TransactionReceipt } from 'web3-core' import { TransactionReceipt } from 'web3-core'
import { Contract } from 'web3-eth-contract' import { Contract } from 'web3-eth-contract'
import { AbiItem } from 'web3-utils/types' import { AbiItem } from 'web3-utils/types'
@ -48,10 +46,12 @@ export interface FixedPriceSwap {
datatokenAmount: string datatokenAmount: string
} }
/* eslint-disable no-unused-vars */
export enum FixedRateCreateProgressStep { export enum FixedRateCreateProgressStep {
CreatingExchange, CreatingExchange,
ApprovingDatatoken ApprovingDatatoken
} }
/* eslint-enable no-unused-vars */
export class FixedRateExchange { export class FixedRateExchange {
public GASLIMIT_DEFAULT = 1000000 public GASLIMIT_DEFAULT = 1000000
@ -457,7 +457,6 @@ export class FixedRateExchange {
const exchange = await this.getExchange(exchangeId) const exchange = await this.getExchange(exchangeId)
if (!exchange) return null if (!exchange) return null
if (exchange.active === true) return null if (exchange.active === true) return null
const gasLimitDefault = this.GASLIMIT_DEFAULT
const estGas = await this.estActivate(address, exchangeId) const estGas = await this.estActivate(address, exchangeId)
const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({ const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({
@ -743,7 +742,6 @@ export class FixedRateExchange {
const exchange = await this.getExchange(exchangeId) const exchange = await this.getExchange(exchangeId)
if (!exchange) return null if (!exchange) return null
if (exchange.withMint === true) return null if (exchange.withMint === true) return null
const gasLimitDefault = this.GASLIMIT_DEFAULT
const estGas = await this.estActivateMint(address, exchangeId) const estGas = await this.estActivateMint(address, exchangeId)
const trxReceipt = await this.contract.methods const trxReceipt = await this.contract.methods

View File

@ -2,12 +2,7 @@ import Web3 from 'web3'
import { AbiItem } from 'web3-utils/types' import { AbiItem } from 'web3-utils/types'
import { TransactionReceipt } from 'web3-core' import { TransactionReceipt } from 'web3-core'
import { Contract } from 'web3-eth-contract' import { Contract } from 'web3-eth-contract'
import { import { LoggerInstance, getFairGasPrice, configHelperNetworks } from '../../utils'
LoggerInstance,
getFairGasPrice,
ConfigHelper,
configHelperNetworks
} from '../../utils'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import SideStakingTemplate from '@oceanprotocol/contracts/artifacts/contracts/pools/ssContracts/SideStaking.sol/SideStaking.json' import SideStakingTemplate from '@oceanprotocol/contracts/artifacts/contracts/pools/ssContracts/SideStaking.sol/SideStaking.json'
import defaultErc20Abi from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json' import defaultErc20Abi from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json'

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
export enum LogLevel { export enum LogLevel {
None = -1, None = -1,
Error = 0, Error = 0,
@ -5,6 +6,7 @@ export enum LogLevel {
Log = 2, Log = 2,
Verbose = 3 Verbose = 3
} }
/* eslint-enable no-unused-vars */
export class Logger { export class Logger {
constructor(private logLevel: LogLevel = LogLevel.Error) {} constructor(private logLevel: LogLevel = LogLevel.Error) {}