mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-12-16 08:44:09 -05:00
test that trade completes after payment received
This commit is contained in:
parent
8fc4e1045e
commit
2f708ee60c
1 changed files with 6 additions and 5 deletions
|
|
@ -1267,7 +1267,7 @@ test("Can complete a trade", async () => {
|
||||||
HavenoUtils.log(1, "user2 confirming payment received");
|
HavenoUtils.log(1, "user2 confirming payment received");
|
||||||
await user2.confirmPaymentReceived(trade.getTradeId());
|
await user2.confirmPaymentReceived(trade.getTradeId());
|
||||||
fetchedTrade = await user2.getTrade(trade.getTradeId());
|
fetchedTrade = await user2.getTrade(trade.getTradeId());
|
||||||
expect(fetchedTrade.getPhase()).toEqual("PAYMENT_RECEIVED"); // TODO (woodser): may be PAYOUT_PUBLISHED if seller sends multisig info after confirmation
|
expect(fetchedTrade.getPhase()).toEqual("PAYOUT_PUBLISHED");
|
||||||
|
|
||||||
// user1 notified trade is complete and of balance changes
|
// user1 notified trade is complete and of balance changes
|
||||||
await wait(TestConfig.maxWalletStartupMs + TestConfig.walletSyncPeriodMs * 2);
|
await wait(TestConfig.maxWalletStartupMs + TestConfig.walletSyncPeriodMs * 2);
|
||||||
|
|
@ -1325,15 +1325,15 @@ test("Can go offline while completing a trade", async () => {
|
||||||
// mine until deposit txs unlock
|
// mine until deposit txs unlock
|
||||||
await waitForUnlockedTxs(...[trade.getMakerDepositTxId(), trade.getTakerDepositTxId()]);
|
await waitForUnlockedTxs(...[trade.getMakerDepositTxId(), trade.getTakerDepositTxId()]);
|
||||||
|
|
||||||
// wait for notifications
|
|
||||||
await wait(TestConfig.walletSyncPeriodMs * 2);
|
|
||||||
|
|
||||||
// buyer comes online
|
// buyer comes online
|
||||||
traders[0] = await initHaveno({appName: buyerAppName});
|
traders[0] = await initHaveno({appName: buyerAppName});
|
||||||
|
expect((await traders[0].getTrade(offer.getId())).getPhase()).toEqual("DEPOSITS_UNLOCKED");
|
||||||
|
|
||||||
|
// wait for processing
|
||||||
|
await wait(TestConfig.walletSyncPeriodMs * 2);
|
||||||
|
|
||||||
// confirm payment sent
|
// confirm payment sent
|
||||||
HavenoUtils.log(1, "Confirming payment sent");
|
HavenoUtils.log(1, "Confirming payment sent");
|
||||||
expect((await traders[0].getTrade(offer.getId())).getPhase()).toEqual("DEPOSITS_UNLOCKED");
|
|
||||||
await traders[0].confirmPaymentStarted(offer.getId());
|
await traders[0].confirmPaymentStarted(offer.getId());
|
||||||
expect((await traders[0].getTrade(offer.getId())).getPhase()).toEqual("PAYMENT_SENT");
|
expect((await traders[0].getTrade(offer.getId())).getPhase()).toEqual("PAYMENT_SENT");
|
||||||
|
|
||||||
|
|
@ -1429,6 +1429,7 @@ test("Can resolve disputes", async () => {
|
||||||
|
|
||||||
// mine until deposit txs unlock
|
// mine until deposit txs unlock
|
||||||
await waitForUnlockedTxs(...depositTxIds);
|
await waitForUnlockedTxs(...depositTxIds);
|
||||||
|
await GenUtils.waitFor(TestConfig.walletSyncPeriodMs); // might need more time if unlocked very soon after confirmed
|
||||||
|
|
||||||
// open disputes
|
// open disputes
|
||||||
HavenoUtils.log(1, "Opening disputes");
|
HavenoUtils.log(1, "Opening disputes");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue