From 2da74794a865b253d233b696cbcbcd28392bba83 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Sat, 21 Sep 2024 23:51:57 +0800 Subject: [PATCH] Complete get-transaction rpc, resolve nervosnetwork/ckb-cli#615 --- src/utils/rpc/types.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/rpc/types.rs b/src/utils/rpc/types.rs index f2bfc3c3..06eaaf2d 100644 --- a/src/utils/rpc/types.rs +++ b/src/utils/rpc/types.rs @@ -381,8 +381,14 @@ pub struct TransactionWithStatus { pub transaction: Option, /// The transaction consumed cycles. pub cycles: Option, + /// If the transaction is in tx-pool, `time_added_to_pool` represent when it enters the tx-pool. unit: Millisecond + pub time_added_to_pool: Option, /// The Transaction status. pub tx_status: TxStatus, + /// The transaction fee of the transaction + pub fee: Option, + /// The minimal fee required to replace this transaction + pub min_replace_fee: Option, } impl TryFrom for TransactionWithStatus { type Error = String; @@ -407,7 +413,12 @@ impl TryFrom for TransactionWithStatus }) .transpose()?, cycles: json.cycles.map(|c| c.into()), + time_added_to_pool: json.time_added_to_pool.map(|time| time.into()), tx_status: json.tx_status, + fee: json.fee.map(|fee| fee.into()), + min_replace_fee: json + .min_replace_fee + .map(|min_replace_fee| min_replace_fee.into()), }) } }