mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
general renaming in Pool
This commit is contained in:
parent
83b8d1dce3
commit
eb41dfc7ef
@ -169,7 +169,7 @@ export class Pool extends SmartContract {
|
||||
* @param {String} poolAddress
|
||||
* @return {String}
|
||||
*/
|
||||
async getBaseToken(poolAddress: string): Promise<string> {
|
||||
async getBasetoken(poolAddress: string): Promise<string> {
|
||||
const pool = this.getContract(poolAddress)
|
||||
let result = null
|
||||
try {
|
||||
@ -599,7 +599,7 @@ export class Pool extends SmartContract {
|
||||
|
||||
const maxPrice = amountsInOutMaxFee.maxPrice
|
||||
? await this.amountToUnits(
|
||||
await this.getBaseToken(poolAddress),
|
||||
await this.getBasetoken(poolAddress),
|
||||
amountsInOutMaxFee.maxPrice
|
||||
)
|
||||
: MAX_UINT_256
|
||||
@ -686,7 +686,7 @@ export class Pool extends SmartContract {
|
||||
|
||||
const maxPrice = amountsInOutMaxFee.maxPrice
|
||||
? this.amountToUnits(
|
||||
await this.getBaseToken(poolAddress),
|
||||
await this.getBasetoken(poolAddress),
|
||||
amountsInOutMaxFee.maxPrice
|
||||
)
|
||||
: MAX_UINT_256
|
||||
@ -755,7 +755,7 @@ export class Pool extends SmartContract {
|
||||
): Promise<G extends false ? TransactionReceipt : number> {
|
||||
const pool = this.getContract(poolAddress)
|
||||
let result = null
|
||||
const tokenIn = await this.getBaseToken(poolAddress)
|
||||
const tokenIn = await this.getBasetoken(poolAddress)
|
||||
const maxSwap = await this.getMaxAddLiquidity(poolAddress, tokenIn)
|
||||
if (new Decimal(tokenAmountIn).greaterThan(maxSwap)) {
|
||||
throw new Error(`tokenAmountOut is greater than ${maxSwap.toString()}`)
|
||||
@ -803,7 +803,7 @@ export class Pool extends SmartContract {
|
||||
* @param {number} poolDecimals optional number of decimals of the poool
|
||||
* @return {TransactionReceipt}
|
||||
*/
|
||||
async exitswapPoolAmountIn<G extends boolean = false>(
|
||||
async exitSwapPoolAmountIn<G extends boolean = false>(
|
||||
account: string,
|
||||
poolAddress: string,
|
||||
poolAmountIn: string,
|
||||
@ -813,7 +813,7 @@ export class Pool extends SmartContract {
|
||||
): Promise<G extends false ? TransactionReceipt : number> {
|
||||
const pool = this.getContract(poolAddress)
|
||||
let result = null
|
||||
const tokenOut = await this.getBaseToken(poolAddress)
|
||||
const tokenOut = await this.getBasetoken(poolAddress)
|
||||
|
||||
const tokenAmountOut = await this.calcSingleOutGivenPoolIn(
|
||||
poolAddress,
|
||||
@ -827,7 +827,7 @@ export class Pool extends SmartContract {
|
||||
}
|
||||
|
||||
const minTokenOutFormatted = await this.amountToUnits(
|
||||
await this.getBaseToken(poolAddress),
|
||||
await this.getBasetoken(poolAddress),
|
||||
minTokenAmountOut,
|
||||
poolDecimals
|
||||
)
|
||||
|
@ -215,8 +215,8 @@ describe('Pool unit test', () => {
|
||||
expect(await pool.getDenormalizedWeight(poolAddress, datatoken)).to.equal('5')
|
||||
})
|
||||
|
||||
it('#getBaseToken - should return the baseToken address', async () => {
|
||||
expect(await pool.getBaseToken(poolAddress)).to.equal(contracts.daiAddress)
|
||||
it('#getBasetoken - should return the baseToken address', async () => {
|
||||
expect(await pool.getBasetoken(poolAddress)).to.equal(contracts.daiAddress)
|
||||
})
|
||||
|
||||
it('#getDatatoken - should return the datatoken address', async () => {
|
||||
@ -301,11 +301,11 @@ describe('Pool unit test', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('#exitswapPoolAmountIn- user2 exit the pool receiving only DAI', async () => {
|
||||
it('#exitSwapPoolAmountIn- user2 exit the pool receiving only DAI', async () => {
|
||||
const BPTAmountIn = '0.5'
|
||||
const minDAIOut = '0.5'
|
||||
|
||||
const tx = await pool.exitswapPoolAmountIn(
|
||||
const tx = await pool.exitSwapPoolAmountIn(
|
||||
user1,
|
||||
poolAddress,
|
||||
BPTAmountIn,
|
||||
@ -324,7 +324,7 @@ describe('Pool unit test', () => {
|
||||
const maxBTPIn = '0.5'
|
||||
const exactDAIOut = '1'
|
||||
|
||||
const tx = await pool.exitswapPoolAmountIn(
|
||||
const tx = await pool.exitSwapPoolAmountIn(
|
||||
user1,
|
||||
poolAddress,
|
||||
maxBTPIn,
|
||||
@ -673,8 +673,8 @@ describe('Pool unit test', () => {
|
||||
expect(await pool.getDenormalizedWeight(poolAddress, datatoken)).to.equal('5')
|
||||
})
|
||||
|
||||
it('#getBaseToken - should return the baseToken address', async () => {
|
||||
expect(await pool.getBaseToken(poolAddress)).to.equal(contracts.usdcAddress)
|
||||
it('#getBasetoken - should return the baseToken address', async () => {
|
||||
expect(await pool.getBasetoken(poolAddress)).to.equal(contracts.usdcAddress)
|
||||
})
|
||||
|
||||
it('#getDatatoken - should return the datatoken address', async () => {
|
||||
@ -758,11 +758,11 @@ describe('Pool unit test', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('#exitswapPoolAmountIn- user2 exit the pool receiving only USDC', async () => {
|
||||
it('#exitSwapPoolAmountIn- user2 exit the pool receiving only USDC', async () => {
|
||||
const BPTAmountIn = '0.5'
|
||||
const minUSDCOut = '0.5'
|
||||
|
||||
const tx = await pool.exitswapPoolAmountIn(
|
||||
const tx = await pool.exitSwapPoolAmountIn(
|
||||
user1,
|
||||
poolAddress,
|
||||
BPTAmountIn,
|
||||
|
Loading…
x
Reference in New Issue
Block a user