mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
use decimals() in Pool
This commit is contained in:
parent
b3102c78c1
commit
2b3b5c871d
@ -1,5 +1,4 @@
|
|||||||
import { assert, expect } from 'chai'
|
import { assert, expect } from 'chai'
|
||||||
import { Contract } from 'web3-eth-contract'
|
|
||||||
import { deployContracts, Addresses } from '../../../TestContractHandler'
|
import { deployContracts, Addresses } from '../../../TestContractHandler'
|
||||||
import { web3 } from '../../../config'
|
import { web3 } from '../../../config'
|
||||||
import {
|
import {
|
||||||
@ -12,7 +11,8 @@ import {
|
|||||||
unitsToAmount,
|
unitsToAmount,
|
||||||
ZERO_ADDRESS,
|
ZERO_ADDRESS,
|
||||||
balance,
|
balance,
|
||||||
transfer
|
transfer,
|
||||||
|
decimals
|
||||||
} from '../../../../src'
|
} from '../../../../src'
|
||||||
import {
|
import {
|
||||||
PoolCreationParams,
|
PoolCreationParams,
|
||||||
@ -515,7 +515,7 @@ describe('Pool unit test', () => {
|
|||||||
marketFeeCollector: factoryOwner,
|
marketFeeCollector: factoryOwner,
|
||||||
poolTemplateAddress: contracts.poolTemplateAddress,
|
poolTemplateAddress: contracts.poolTemplateAddress,
|
||||||
rate: '1',
|
rate: '1',
|
||||||
baseTokenDecimals: 6,
|
baseTokenDecimals: await decimals(web3, contracts.usdcAddress),
|
||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: await unitsToAmount(
|
initialBaseTokenLiquidity: await unitsToAmount(
|
||||||
@ -728,10 +728,10 @@ describe('Pool unit test', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('#swapExactAmountOut - should swap', async () => {
|
it('#swapExactAmountOut - should swap', async () => {
|
||||||
|
await approve(web3, user1, contracts.usdcAddress, poolAddress, '100')
|
||||||
expect(await balance(web3, contracts.usdcAddress, user1)).to.equal(
|
expect(await balance(web3, contracts.usdcAddress, user1)).to.equal(
|
||||||
(await amountToUnits(web3, contracts.usdcAddress, '990')).toString()
|
(await amountToUnits(web3, contracts.usdcAddress, '990')).toString()
|
||||||
)
|
)
|
||||||
await approve(web3, user1, contracts.usdcAddress, poolAddress, '100')
|
|
||||||
const tokenInOutMarket: TokenInOutMarket = {
|
const tokenInOutMarket: TokenInOutMarket = {
|
||||||
tokenIn: contracts.usdcAddress,
|
tokenIn: contracts.usdcAddress,
|
||||||
tokenOut: erc20Token,
|
tokenOut: erc20Token,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user