test zelle and revolut in 'can complete trades' test

This commit is contained in:
woodser 2023-11-13 10:41:17 -05:00
parent de0e4ab7cd
commit 5d55a0bd4f

View File

@ -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 () => {