From b5e0849ea380d6608a312209ca6b1f7ade5d0ef1 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 8 Apr 2022 18:33:37 -0400 Subject: [PATCH] add test "Can prepare for trading" --- src/haveno.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/haveno.test.ts b/src/haveno.test.ts index 24d5585c..c177e9c8 100644 --- a/src/haveno.test.ts +++ b/src/haveno.test.ts @@ -909,6 +909,23 @@ test("Can post and remove an offer", async () => { expect(BigInt((await alice.getBalances()).getUnlockedBalance())).toEqual(unlockedBalanceBefore); }); +test("Can prepare for trading", async () => { + + // create ethereum and revolut payment accounts + await createPaymentAccount(alice, "eth"); + await createRevolutPaymentAccount(alice); + await createPaymentAccount(bob, "eth"); + await createRevolutPaymentAccount(bob); + + // fund alice and bob with at least 5 outputs of 0.5 XMR + let numOutputs = 5; + let outputAmt = BigInt("500000000000"); + let walletsToFund = []; + if (!await hasUnlockedOutputs(aliceWallet, outputAmt, numOutputs)) walletsToFund.push(aliceWallet); + if (!await hasUnlockedOutputs(bobWallet, outputAmt, numOutputs)) walletsToFund.push(bobWallet); + await fundWallets(walletsToFund, outputAmt, numOutputs); +}); + // TODO (woodser): test grpc notifications test("Can complete a trade", async () => {