From aea699dfe300c74460d77fbf10192e8e9de01332 Mon Sep 17 00:00:00 2001 From: Fuxing Loh Date: Tue, 25 May 2021 17:45:18 +0800 Subject: [PATCH] fixed failing test --- .../txn/txn_builder_account_account_to_account.test.ts | 1 - .../__tests__/txn/txn_builder_dex_poolswap.test.ts | 7 ++++--- .../txn/txn_builder_liq_pool_add_liquidity.test.ts | 1 - packages/testcontainers/__tests__/index.test.ts | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_account_account_to_account.test.ts b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_account_account_to_account.test.ts index 307e9cc673..99d00a72af 100644 --- a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_account_account_to_account.test.ts +++ b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_account_account_to_account.test.ts @@ -50,7 +50,6 @@ beforeEach(async () => { builder = new P2WPKHTransactionBuilder(providers.fee, providers.prevout, providers.elliptic) // Fund 10 DFI TOKEN - await fundEllipticPair(container, providers.ellipticPair, 10) await providers.setupMocks() // required to move utxos await utxosToAccount(container, 10, { address: await providers.getAddress() }) diff --git a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_dex_poolswap.test.ts b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_dex_poolswap.test.ts index 24eb4da5b7..bfd507d9cc 100644 --- a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_dex_poolswap.test.ts +++ b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_dex_poolswap.test.ts @@ -77,14 +77,15 @@ describe('DFI to DOG', () => { }) it('should poolSwap from DFI to DOG', async () => { - // Fund 10 DFI UTXO - await fundEllipticPair(container, providers.ellipticPair, 10) - // Fund 10 DFI TOKEN + // Fund 100 DFI TOKEN await providers.setupMocks() // required to move utxos await utxosToAccount(container, 100, { address: await providers.getAddress() }) // Fund 10 DOG TOKEN await sendTokensToAddress(container, await providers.getAddress(), 10, 'DOG') + // Fund 10 DFI UTXO + await fundEllipticPair(container, providers.ellipticPair, 10) + // Perform SWAP const script = await providers.elliptic.script() const txn = await builder.dex.poolSwap({ diff --git a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_liq_pool_add_liquidity.test.ts b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_liq_pool_add_liquidity.test.ts index 104962a185..7d5b5d086a 100644 --- a/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_liq_pool_add_liquidity.test.ts +++ b/packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_liq_pool_add_liquidity.test.ts @@ -49,7 +49,6 @@ beforeEach(async () => { builder = new P2WPKHTransactionBuilder(providers.fee, providers.prevout, providers.elliptic) // Fund 100 DFI TOKEN - await fundEllipticPair(container, providers.ellipticPair, 100) await providers.setupMocks() // required to move utxos await utxosToAccount(container, 100, { address: await providers.getAddress() }) diff --git a/packages/testcontainers/__tests__/index.test.ts b/packages/testcontainers/__tests__/index.test.ts index dbb855c2ed..1d5b102b9c 100644 --- a/packages/testcontainers/__tests__/index.test.ts +++ b/packages/testcontainers/__tests__/index.test.ts @@ -55,16 +55,16 @@ describe('regtest', () => { }) describe('regtest: override docker image', () => { - const container = new RegTestContainer('defi/defichain:1.6.0') + const container = new TestNetContainer('defi/defichain:1.6.4') afterAll(async () => { await container.stop() }) - it('should be able to getmintinginfo and chain should be regtest', async () => { + it('should be able to getmintinginfo and chain should be test', async () => { await container.start() await container.waitForReady() const { chain } = await container.getMintingInfo() - expect(chain).toStrictEqual('regtest') + expect(chain).toStrictEqual('test') }) })