diff options
Diffstat (limited to 'migrator/e2e-test.js')
| -rw-r--r-- | migrator/e2e-test.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/migrator/e2e-test.js b/migrator/e2e-test.js index 714e7a4..244b106 100644 --- a/migrator/e2e-test.js +++ b/migrator/e2e-test.js @@ -66,11 +66,14 @@ check('info names both servers', info.oldServerPubkey && info.newServerPubkey && console.log('\n[1] fund the migrator float on the new server'); const fb = await api('/admin/board', { amountSat: 500000 }, true); check('admin board returns a funding address', !!fb.fundingAddress, fb.error || ''); +// change FIRST: the board output lands at vout 1, as an ordinary wallet might send it const raw = sh(`${BCLI} createrawtransaction '[]' '[{"${fb.fundingAddress}":0.00500000}]'`); -const funded = JSON.parse(sh(`${BCLI} fundrawtransaction ${raw} '{"changePosition":1}'`)); +const funded = JSON.parse(sh(`${BCLI} fundrawtransaction ${raw} '{"changePosition":0}'`)); const signed = JSON.parse(sh(`${BCLI} signrawtransactionwithwallet ${funded.hex}`)); const ftx = sh(`${BCLI} sendrawtransaction ${signed.hex}`); -await api('/admin/board/complete', { actionId: fb.actionId, txid: ftx }, true); +let bc1; +for (let i = 0; i < 15; i++) { bc1 = await api('/admin/board/complete', { actionId: fb.actionId, txid: ftx }, true); if (bc1.status !== 409) break; await sleep(1000); } +check('board output found at vout 1', bc1.vout === 1, JSON.stringify(bc1)); mine(3); let sum; for (let i = 0; i < 30; i++) { await sleep(2000); await api('/admin/board/complete', { actionId: fb.actionId, txid: ftx }, true); sum = await api('/admin/summary', null, true); if (sum.float.spendableSat > 0) break; } |
