Allow manual payment tx submission during transient validation

This commit is contained in:
2569718930@qq.com
2026-06-24 17:03:45 +08:00
parent 51b0e41c0f
commit 07c5451f1d
4 changed files with 98 additions and 14 deletions
@@ -94,6 +94,12 @@ export function runTests() {
paymentFlowSource.includes("/validate"),
"manual payment flow must validate tx hashes with the backend before submission",
);
assert(
paymentFlowSource.includes("confirmRes.status === 503") &&
paymentFlowSource.includes('lowerRaw.includes("cannot connect payment rpc")') &&
paymentFlowSource.includes('lowerRaw.includes("payment rpc chain mismatch")'),
"manual payment confirm must treat transient payment RPC failures as pending after tx hash submission",
);
assert(
paymentFlowSource.includes("await waitForReceipt(txHashNorm, eth)") &&
paymentFlowSource.indexOf("await waitForReceipt(txHashNorm, eth)") <
@@ -826,6 +826,9 @@ export function usePaymentFlow(params: UsePaymentFlowParams) {
const lowerRaw = raw.toLowerCase();
const maybePending =
confirmRes.status === 408 ||
(confirmRes.status === 503 &&
(lowerRaw.includes("cannot connect payment rpc") ||
lowerRaw.includes("payment rpc chain mismatch"))) ||
(confirmRes.status === 409 && (lowerRaw.includes("confirmations not enough") || lowerRaw.includes("tx indexed partially")));
if (maybePending) {
setPaymentInfo(`交易已提交: ${shortAddress(txHashNorm)},等待链上确认中...`);