Skip to content

Commit

Permalink
chore: remove process exit (#4166)
Browse files Browse the repository at this point in the history
* chore: remove process exit

* chore: fix issues

* chore: fix lint

* chore: reorder tests
  • Loading branch information
albert-llimos authored Oct 26, 2023
1 parent 28109c5 commit 0afe022
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion bouncer/shared/gaslimit_ccm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ export async function testGasLimitCcmSwaps() {
// Wait for the fees to increase to the stable expected amount
let i = 0;
while ((await getChainFees()).priorityFee < MIN_PRIORITY_FEE) {
console.log(i);
if (++i > LOOP_TIMEOUT) {
spam = false;
await spamming;
Expand Down
10 changes: 8 additions & 2 deletions bouncer/shared/lp_api_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ async function testRegisterWithExistingLpAccount() {
}

/// Test lp_set_range_order and lp_update_range_order by minting, updating, and burning a range order.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function testRangeOrder() {
const range = { start: 1, end: 2 };
const orderId = 74398; // Arbitrary order id so it does not interfere with other tests
Expand Down Expand Up @@ -227,6 +228,7 @@ async function testGetOpenSwapChannels() {
}

/// Test lp_set_limit_order and lp_update_limit_order by minting, updating, and burning a limit order.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function testLimitOrder() {
const orderId = 98432; // Arbitrary order id so it does not interfere with other tests
const tick = 2;
Expand Down Expand Up @@ -292,6 +294,8 @@ async function testLimitOrder() {

/// Runs all of the LP commands via the LP API Json RPC Server that is running and checks that the returned data is as expected
export async function testLpApi() {
console.log('=== Starting LP API test ===');

// Provide the amount of eth needed for the tests
await provideLiquidityAndTestAssetBalances();

Expand All @@ -300,8 +304,10 @@ export async function testLpApi() {
testLiquidityDeposit(),
testWithdrawAsset(),
testRegisterWithExistingLpAccount(),
testRangeOrder(),
testLimitOrder(),
// testRangeOrder(),
// testLimitOrder(),
testGetOpenSwapChannels(),
]);

console.log('=== LP API test complete ===');
}
1 change: 0 additions & 1 deletion bouncer/shared/multiple_members_governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@ export async function testMultipleMembersGovernance() {
await submitWithMultipleGovernanceMembers();

console.log('=== Multiple members governance test complete ===');
process.exit(0);
}
4 changes: 2 additions & 2 deletions bouncer/shared/redeem_flip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function redeemFlip(

const delay = await getRedemptionDelay(networkOptions);
console.log(`Waiting for ${delay}s before we can execute redemption`);
await sleep(delay * 1000);
await sleep(Number(delay) * 1000);

console.log(`Executing redemption`);

Expand All @@ -96,7 +96,7 @@ export async function redeemFlip(
(event) => event.data[0] === flipWallet.address,
);

await executeRedemption(accountIdHex, networkOptions, { nonce: BigInt(nonce) });
await executeRedemption(accountIdHex, networkOptions, { nonce });
const redemptionExecutedAmount = (await redemptionExecutedHandle).data[1];
console.log('Observed RedemptionSettled event: ', redemptionExecutedAmount);
assert.strictEqual(
Expand Down
2 changes: 0 additions & 2 deletions bouncer/tests/lp_api_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { testLpApi } from '../shared/lp_api_test';
import { runWithTimeout } from '../shared/utils';

async function main(): Promise<void> {
console.log('=== Starting LP API test ===');
await testLpApi();
console.log('=== LP API test complete ===');
process.exit(0);
}

Expand Down

0 comments on commit 0afe022

Please sign in to comment.