mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
refactor constants
This commit is contained in:
parent
0ecc973e08
commit
08552eb446
@ -25,6 +25,17 @@ describe('Router unit test', () => {
|
||||
const FEE = '0.001'
|
||||
const FEE_ZERO = '0'
|
||||
const DAI_AMOUNT = web3.utils.toWei('2')
|
||||
const CAP_AMOUNT = '1000000'
|
||||
const VESTING_AMOUNT = '10000'
|
||||
const TOKEN_DECIMALS = 18
|
||||
const VESTED_BLOCKS = 2500000
|
||||
const BASE_TOKEN_LIQUIDITY = '2000'
|
||||
const EXCHANGE_IDS = keccak256('0x00')
|
||||
const AMOUNTS_IN = web3.utils.toWei('1')
|
||||
const AMOUNTS_OUT = web3.utils.toWei('0.1')
|
||||
const MAX_PRICE = web3.utils.toWei('10')
|
||||
const SWAP_MARKET_FEE = web3.utils.toWei('0.1')
|
||||
|
||||
|
||||
const NFT_DATA: NftCreateData = {
|
||||
name: NFT_NAME,
|
||||
@ -104,7 +115,7 @@ describe('Router unit test', () => {
|
||||
paymentCollector: user2,
|
||||
mpFeeAddress: factoryOwner,
|
||||
feeToken: ZERO_ADDRESS,
|
||||
cap: '0',
|
||||
cap: CAP_AMOUNT,
|
||||
feeAmount: FEE_ZERO,
|
||||
name: ERC20_NAME,
|
||||
symbol: ERC20_SYMBOL
|
||||
@ -118,10 +129,10 @@ describe('Router unit test', () => {
|
||||
marketFeeCollector: factoryOwner,
|
||||
poolTemplateAddress: contracts.poolTemplateAddress,
|
||||
rate: RATE,
|
||||
baseTokenDecimals: 18,
|
||||
vestingAmount: '10000',
|
||||
vestedBlocks: 2500000,
|
||||
initialBaseTokenLiquidity: '2000',
|
||||
baseTokenDecimals: TOKEN_DECIMALS,
|
||||
vestingAmount: VESTING_AMOUNT,
|
||||
vestedBlocks: VESTED_BLOCKS,
|
||||
initialBaseTokenLiquidity: BASE_TOKEN_LIQUIDITY,
|
||||
swapFeeLiquidityProvider: FEE,
|
||||
swapFeeMarketRunner: FEE
|
||||
}
|
||||
@ -160,28 +171,28 @@ describe('Router unit test', () => {
|
||||
// 2 - FixedRateExchange
|
||||
// 3 - Dispenser
|
||||
const operations1: Operation = {
|
||||
exchangeIds: keccak256('0x00'), // used only for FixedRate or Dispenser, but needs to be filled even for pool
|
||||
exchangeIds: EXCHANGE_IDS, // used only for FixedRate or Dispenser, but needs to be filled even for pool
|
||||
source: pool1, // pool Address
|
||||
operation: 0, // swapExactAmountIn
|
||||
tokenIn: contracts.daiAddress,
|
||||
amountsIn: web3.utils.toWei('1'), // when swapExactAmountIn is EXACT amount IN
|
||||
amountsIn: AMOUNTS_IN, // when swapExactAmountIn is EXACT amount IN
|
||||
tokenOut: erc20TokenAddress,
|
||||
amountsOut: web3.utils.toWei('0.1'), // when swapExactAmountIn is MIN amount OUT
|
||||
maxPrice: web3.utils.toWei('10'), // max price (only for pools),
|
||||
swapMarketFee: web3.utils.toWei('0.1'),
|
||||
amountsOut: AMOUNTS_OUT, // when swapExactAmountIn is MIN amount OUT
|
||||
maxPrice: MAX_PRICE, // max price (only for pools),
|
||||
swapMarketFee: SWAP_MARKET_FEE,
|
||||
marketFeeAddress: factoryOwner
|
||||
}
|
||||
|
||||
const operations2: Operation = {
|
||||
exchangeIds: keccak256('0x00'), // used only for FixedRate or Dispenser, but needs to be filled even for pool
|
||||
exchangeIds: EXCHANGE_IDS, // used only for FixedRate or Dispenser, but needs to be filled even for pool
|
||||
source: pool2, // pool Address
|
||||
operation: 0, // swapExactAmountIn
|
||||
tokenIn: contracts.daiAddress,
|
||||
amountsIn: web3.utils.toWei('1'), // when swapExactAmountIn is EXACT amount IN
|
||||
amountsIn: AMOUNTS_IN, // when swapExactAmountIn is EXACT amount IN
|
||||
tokenOut: erc20Token2Address,
|
||||
amountsOut: web3.utils.toWei('0.1'), // when swapExactAmountIn is MIN amount OUT
|
||||
maxPrice: web3.utils.toWei('10'), // max price (only for pools)
|
||||
swapMarketFee: web3.utils.toWei('0.1'),
|
||||
amountsOut: AMOUNTS_OUT, // when swapExactAmountIn is MIN amount OUT
|
||||
maxPrice: MAX_PRICE, // max price (only for pools),
|
||||
swapMarketFee: SWAP_MARKET_FEE,
|
||||
marketFeeAddress: factoryOwner
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user