Skip to content

Commit

Permalink
fix: mercury and electrum unavailability tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DhananjayPurohit committed Jun 12, 2024
1 parent 0d12e1a commit 67e0c2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions clients/apps/nodejs/test_basic_workflow2.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@ async function interruptTransferReceiveWithElectrumUnavailability(clientConfig,

coin = await mercurynodejslib.transferSend(clientConfig, wallet_1_name, coin.statechain_id, transfer_address.transfer_receive);

console.log("Disconnect mercurylayer_mercury_1 from network");
await exec("docker network disconnect mercurylayer_default mercurylayer_electrumx_1");

try {
let received_statechain_ids = await mercurynodejslib.transferReceive(clientConfig, wallet_2_name);
assert.fail("Expected error when receiving into wallet two, but no error was thrown");
Expand All @@ -754,6 +757,8 @@ async function interruptTransferReceiveWithElectrumUnavailability(clientConfig,
assert(error.message.includes("Error getting fee rate from electrum server"),
`Unexpected error message: ${error.message}`);
}
console.log("Connect mercurylayer_mercury_1 from network");
await exec("docker network connect mercurylayer_default mercurylayer_electrumx_1");
}

async function interruptTransferReceiveWithMercuryServerUnavailability(clientConfig, wallet_1_name, wallet_2_name) {
Expand Down Expand Up @@ -800,6 +805,9 @@ async function interruptTransferReceiveWithMercuryServerUnavailability(clientCon

coin = await mercurynodejslib.transferSend(clientConfig, wallet_1_name, coin.statechain_id, transfer_address.transfer_receive);

console.log("Disconnect mercurylayer_mercury_1 from network");
await exec("docker network disconnect mercurylayer_default mercurylayer_mercury_1");

try {
let received_statechain_ids = await mercurynodejslib.transferReceive(clientConfig, wallet_2_name);
assert.fail("Expected error when receiving into wallet two, but no error was thrown");
Expand All @@ -808,6 +816,8 @@ async function interruptTransferReceiveWithMercuryServerUnavailability(clientCon
assert(error.message.includes("Failed to get message address from mercury server"),
`Unexpected error message: ${error.message}`);
}
console.log("Connect mercurylayer_mercury_1 from network");
await exec("docker network connect mercurylayer_default mercurylayer_mercury_1");
}

(async () => {
Expand Down

0 comments on commit 67e0c2d

Please sign in to comment.