From bf3b3f5d37f4f5d2b93c43c02c18a799a5a4a4a6 Mon Sep 17 00:00:00 2001 From: DhananjayPurohit Date: Fri, 28 Jun 2024 15:17:46 +0530 Subject: [PATCH] debug: coin validation on sign second interrupt --- clients/apps/nodejs/test_basic_workflow2.js | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/clients/apps/nodejs/test_basic_workflow2.js b/clients/apps/nodejs/test_basic_workflow2.js index fd74d1be..883926e2 100644 --- a/clients/apps/nodejs/test_basic_workflow2.js +++ b/clients/apps/nodejs/test_basic_workflow2.js @@ -688,7 +688,27 @@ async function interruptBeforeSignSecond(clientConfig, wallet_1_name, wallet_2_n // const new_x1 = await get_new_x1(clientConfig, statechain_id, signed_statechain_id, new_auth_pubkey, batchId); - coin = await new_transaction(clientConfig, electrumClient, coin, transfer_address.transfer_receive, isWithdrawal, qtBackupTx, block_height, wallet.network); + const signed_tx = await new_transaction(clientConfig, electrumClient, coin, transfer_address.transfer_receive, isWithdrawal, qtBackupTx, block_height, wallet.network); + + // Coin withdrawal is working fine + // let withdraw_address = "bcrt1qgh48u8aj4jvjkalc28lqujyx2wveck4jsm59x9"; + + // let txid = await mercurynodejslib.withdrawCoin(clientConfig, wallet_1_name, coin.statechain_id, withdraw_address, null); + + // console.log("txid: ", txid); + + transfer_address = await mercurynodejslib.newTransferAddress(clientConfig, wallet_2_name, null); + + coin = await mercurynodejslib.transferSend(clientConfig, wallet_1_name, coin.statechain_id, transfer_address.transfer_receive); + + console.log("coin ", coin); + + let received_statechain_ids = await mercurynodejslib.transferReceive(clientConfig, wallet_2_name); + + console.log("received_statechain_ids: ", received_statechain_ids); + + assert(received_statechain_ids.length > 0); + assert(received_statechain_ids[0] == coin.statechain_id); } async function interruptSignWithElectrumUnavailability(clientConfig, wallet_1_name, wallet_2_name) {