From b6f6a00b4922e94a5d89c0dc96d4afe36688f561 Mon Sep 17 00:00:00 2001 From: homura Date: Thu, 28 Sep 2023 12:49:31 +0800 Subject: [PATCH] fix(rpc): lack of the `reason` field in `TxStatus` --- packages/rpc/src/resultFormatter.ts | 3 +++ packages/rpc/src/types/rpc.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/rpc/src/resultFormatter.ts b/packages/rpc/src/resultFormatter.ts index 7aa189dd1..c5384210e 100644 --- a/packages/rpc/src/resultFormatter.ts +++ b/packages/rpc/src/resultFormatter.ts @@ -333,6 +333,9 @@ const toTransactionWithStatus = ( txStatus: { blockHash, status, + ...("reason" in txWithStatus.tx_status + ? { reason: txWithStatus.tx_status.reason } + : {}), }, timeAddedToPool: time_added_to_pool, ...rest, diff --git a/packages/rpc/src/types/rpc.ts b/packages/rpc/src/types/rpc.ts index 29bfb3315..3eaff27ba 100644 --- a/packages/rpc/src/types/rpc.ts +++ b/packages/rpc/src/types/rpc.ts @@ -125,6 +125,7 @@ export namespace RPC { | TransactionStatus.Proposed | TransactionStatus.Rejected | TransactionStatus.Unknown; + reason?: string; }; time_added_to_pool: Uint64 | null; cycles: Uint64 | null;