From 26f8d0767f7678aa46e548237f2ab36a1e217357 Mon Sep 17 00:00:00 2001 From: zhx Date: Tue, 14 Jul 2026 16:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=81=E5=95=86=E5=85=85=E5=80=BC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0C2C=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- finance/src/constants.js | 1 + finance/src/format.test.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/finance/src/constants.js b/finance/src/constants.js index f837a32..54905a1 100644 --- a/finance/src/constants.js +++ b/finance/src/constants.js @@ -22,6 +22,7 @@ export const COIN_SELLER_RECHARGE_PROVIDERS = [ ]; export const COIN_SELLER_RECHARGE_CHAINS = [ + ["C2C", "C2C"], ["TRON", "TRON"], ["BSC", "BSC"], ]; diff --git a/finance/src/format.test.js b/finance/src/format.test.js index cc8f372..1190742 100644 --- a/finance/src/format.test.js +++ b/finance/src/format.test.js @@ -107,6 +107,13 @@ test("builds validates and normalizes coin seller recharge orders", () => { providerCurrencyCode: "PHP", usdAmount: 10.5, }); + expect( + buildCoinSellerRechargeReceiptPayload({ + ...payload, + chain: "c2c", + providerCode: "usdt", + }), + ).toMatchObject({ chain: "C2C", providerCode: "usdt" }); expect(validateCoinSellerRechargeOrderPayload(payload)).toBe(""); expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerCurrencyCode: "" })).toBe("请填写币种"); expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerAmountMinor: 0 })).toBe( @@ -228,7 +235,9 @@ test("builds validates and normalizes coin seller recharge orders", () => { }); test("builds coin seller recharge quotes and validates exchange rate config", () => { - expect(buildCoinSellerRechargeQuotePayload({ appCode: " lalu ", targetUserId: " 123456 ", usdAmount: "150" })).toEqual({ + expect( + buildCoinSellerRechargeQuotePayload({ appCode: " lalu ", targetUserId: " 123456 ", usdAmount: "150" }), + ).toEqual({ appCode: "lalu", targetUserId: "123456", usdAmount: 150, @@ -251,10 +260,7 @@ test("builds coin seller recharge quotes and validates exchange rate config", () expect( validateCoinSellerRechargeExchangeRatePayload({ ...payload, - tiers: [ - payload.tiers[0], - { minUsdAmount: 200, maxUsdAmount: 300, coinsPerUsd: 90000 }, - ], + tiers: [payload.tiers[0], { minUsdAmount: 200, maxUsdAmount: 300, coinsPerUsd: 90000 }], }), ).toBe("USD 金额区间不能重叠"); });