Skip to content

Commit

Permalink
add logs to start and end of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs committed Feb 6, 2024
1 parent 6fe8c03 commit 19e0aec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bouncer/shared/lp_api_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ async function testLiquidityDeposit() {
}

async function testWithdrawAsset() {
console.log('=== Starting testWithdrawAsset ===');
const oldBalance = await getBalance(testAsset, testAddress);

const result = await lpApiRpc(`lp_withdraw_asset`, [
Expand All @@ -133,9 +134,11 @@ async function testWithdrawAsset() {
assert(egressId > 0, `Unexpected egressId: ${egressId}`);

await observeBalanceIncrease(testAsset, testAddress, oldBalance);
console.log('=== testWithdrawAsset complete ===');
}

async function testRegisterWithExistingLpAccount() {
console.log('=== Starting testWithdrawAsset ===');
try {
await lpApiRpc(`lp_register_account`, []);
throw new Error(`Unexpected lp_register_account result`);
Expand All @@ -147,11 +150,13 @@ async function testRegisterWithExistingLpAccount() {
throw new Error(`Unexpected lp_register_account error: ${error}`);
}
}
console.log('=== testRegisterWithExistingLpAccount complete ===');
}

/// Test lp_set_range_order and lp_update_range_order by minting, updating, and burning a range order.

async function testRangeOrder() {
console.log('=== Starting testRangeOrder ===')
const range = { start: 1, end: 2 };
const orderId = 74398; // Arbitrary order id so it does not interfere with other tests
const zeroAssetAmounts = {
Expand Down Expand Up @@ -245,19 +250,24 @@ async function testRangeOrder() {
}
});
assert.strictEqual(matchBurn, true, `Expected burn of range order to decrease liquidity to 0`);

console.log('=== testRangeOrder complete ===');
}

async function testGetOpenSwapChannels() {
console.log('=== Starting testGetOpenSwapChannels ===')
// TODO: Test with some SwapChannelInfo data
const openSwapChannels = await lpApiRpc(`lp_get_open_swap_channels`, []);
assert(openSwapChannels.ethereum, `Missing ethereum swap channel info`);
assert(openSwapChannels.polkadot, `Missing polkadot swap channel info`);
assert(openSwapChannels.bitcoin, `Missing bitcoin swap channel info`);
console.log('=== testGetOpenSwapChannels complete ===')
}

/// Test lp_set_limit_order and lp_update_limit_order by minting, updating, and burning a limit order.

async function testLimitOrder() {
console.log('=== Starting testLimitOrder ===');
const orderId = 98432; // Arbitrary order id so it does not interfere with other tests
const tick = 2;

Expand Down Expand Up @@ -336,6 +346,8 @@ async function testLimitOrder() {
}
});
assert.strictEqual(matchBurn, true, `Expected burn of limit order to decrease liquidity to 0`);

console.log('=== testLimitOrder complete ===');
}

/// 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
Expand Down

0 comments on commit 19e0aec

Please sign in to comment.