From 0dee99c256ddd20624239d25a00c48cfecede717 Mon Sep 17 00:00:00 2001 From: kylezs Date: Wed, 27 Sep 2023 11:11:28 +0200 Subject: [PATCH] chore: remove now-invalid bouncer test --- bouncer/shared/lp_deposit_expiry.ts | 47 --------------------------- bouncer/tests/all_concurrent_tests.ts | 2 -- bouncer/tests/lp_deposit_expiry.ts | 13 -------- 3 files changed, 62 deletions(-) delete mode 100644 bouncer/shared/lp_deposit_expiry.ts delete mode 100755 bouncer/tests/lp_deposit_expiry.ts diff --git a/bouncer/shared/lp_deposit_expiry.ts b/bouncer/shared/lp_deposit_expiry.ts deleted file mode 100644 index 065a17767e1..00000000000 --- a/bouncer/shared/lp_deposit_expiry.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Keyring } from '@polkadot/keyring'; -import { cryptoWaitReady } from '@polkadot/util-crypto'; -import { observeEvent, getChainflipApi, lpMutex } from '../shared/utils'; -import { sendBtc } from '../shared/send_btc'; -import { submitGovernanceExtrinsic } from '../shared/cf_governance'; - -export async function testLpDepositExpiry() { - await cryptoWaitReady(); - const keyring = new Keyring({ type: 'sr25519' }); - const lpUri = process.env.LP_URI ?? '//LP_1'; - const lp = keyring.createFromUri(lpUri); - - const chainflip = await getChainflipApi(); - - console.log('=== Testing expiry of funded LP deposit address ==='); - const originalExpiryTime = Number(await chainflip.query.liquidityProvider.lpTTL()); - console.log('Setting expiry time for LP addresses to 10 blocks'); - - await submitGovernanceExtrinsic(chainflip.tx.liquidityProvider.setLpTtl(10)); - await observeEvent('liquidityProvider:LpTtlSet', chainflip); - - console.log('Requesting new BTC LP deposit address'); - lpMutex.runExclusive(async () => { - await chainflip.tx.liquidityProvider - .requestLiquidityDepositAddress('Btc') - .signAndSend(lp, { nonce: -1 }); - }); - - const depositEventResult = await observeEvent( - 'liquidityProvider:LiquidityDepositAddressReady', - chainflip, - (event) => event.data.depositAddress.Btc, - ); - const ingressAddress = depositEventResult.data.depositAddress.Btc; - - console.log('Funding BTC LP deposit address of ' + ingressAddress + ' with 1 BTC'); - - await sendBtc(ingressAddress, 1); - await observeEvent('liquidityProvider:LiquidityDepositAddressExpired', chainflip); - - console.log('Restoring expiry time for LP addresses to ' + originalExpiryTime + ' blocks'); - await submitGovernanceExtrinsic(chainflip.tx.liquidityProvider.setLpTtl(originalExpiryTime)); - - await observeEvent('liquidityProvider:LpTtlSet', chainflip); - - console.log('=== LP deposit expiry test complete ==='); -} diff --git a/bouncer/tests/all_concurrent_tests.ts b/bouncer/tests/all_concurrent_tests.ts index 3dc31084bf6..692dda35697 100755 --- a/bouncer/tests/all_concurrent_tests.ts +++ b/bouncer/tests/all_concurrent_tests.ts @@ -1,5 +1,4 @@ #!/usr/bin/env -S pnpm tsx -import { testLpDepositExpiry } from '../shared/lp_deposit_expiry'; import { testAllSwaps } from '../shared/swapping'; import { testEthereumDeposits } from '../shared/ethereum_deposits'; import { runWithTimeout, observeBadEvents } from '../shared/utils'; @@ -13,7 +12,6 @@ async function runAllConcurrentTests() { await Promise.all([ testAllSwaps(), - testLpDepositExpiry(), testEthereumDeposits(), testFundRedeem('redeem'), testMultipleMembersGovernance(), diff --git a/bouncer/tests/lp_deposit_expiry.ts b/bouncer/tests/lp_deposit_expiry.ts deleted file mode 100755 index 7820d2a1456..00000000000 --- a/bouncer/tests/lp_deposit_expiry.ts +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env -S pnpm tsx -import { testLpDepositExpiry } from '../shared/lp_deposit_expiry'; -import { runWithTimeout } from '../shared/utils'; - -async function main(): Promise { - await testLpDepositExpiry(); - process.exit(0); -} - -runWithTimeout(main(), 120000).catch((error) => { - console.error(error); - process.exit(-1); -});