mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2024-10-01 01:35:42 -04:00
test zelle and revolut in 'can complete trades' test
This commit is contained in:
parent
de0e4ab7cd
commit
5d55a0bd4f
@ -1555,7 +1555,7 @@ test("Can complete a trade within a range", async () => {
|
|||||||
// create payment accounts
|
// create payment accounts
|
||||||
let paymentMethodId = "cash_at_atm";
|
let paymentMethodId = "cash_at_atm";
|
||||||
let assetCode = "aud";
|
let assetCode = "aud";
|
||||||
let makerPaymentAccount = await createPaymentAccount(user1, assetCode, paymentMethodId);
|
let makerPaymentAccount = await createPaymentAccount(user1, assetCode, paymentMethodId); // TODO: support getPaymentAccount() which gets or creates
|
||||||
let takerPaymentAccount = await createPaymentAccount(user2, assetCode, paymentMethodId);
|
let takerPaymentAccount = await createPaymentAccount(user2, assetCode, paymentMethodId);
|
||||||
|
|
||||||
// execute trade
|
// execute trade
|
||||||
@ -1573,9 +1573,20 @@ test("Can complete a trade within a range", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Can complete trades at the same time (CI, sanity check)", async () => {
|
test("Can complete trades at the same time (CI, sanity check)", async () => {
|
||||||
|
|
||||||
|
// create trade contexts with customized payment methods
|
||||||
const ctxs = getTradeContexts(TestConfig.assetCodes.length);
|
const ctxs = getTradeContexts(TestConfig.assetCodes.length);
|
||||||
for (let i = 0; i < ctxs.length; i++) ctxs[i].assetCode = TestConfig.assetCodes[i]; // test each asset code
|
for (let i = 0; i < ctxs.length; i++) {
|
||||||
await executeTrades(ctxs, {maxConcurrency: TestConfig.trade.maxConcurrencyCI}); // cap concurrency for CI tests
|
ctxs[i].assetCode = TestConfig.assetCodes[i]; // test each asset code
|
||||||
|
let paymentMethodId;
|
||||||
|
if (ctxs[i].assetCode === "USD") paymentMethodId = "zelle";
|
||||||
|
if (ctxs[i].assetCode === "EUR") paymentMethodId = "revolut";
|
||||||
|
ctxs[i].makerPaymentAccountId = (await createPaymentAccount(ctxs[i].maker.havenod!, ctxs[i].assetCode!, paymentMethodId)).getId();
|
||||||
|
ctxs[i].takerPaymentAccountId = (await createPaymentAccount(ctxs[i].taker.havenod!, ctxs[i].assetCode!, paymentMethodId)).getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute trades with capped concurrency for CI tests
|
||||||
|
await executeTrades(ctxs, {maxConcurrency: TestConfig.trade.maxConcurrencyCI});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Can complete all trade combinations (stress)", async () => {
|
test("Can complete all trade combinations (stress)", async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user