Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete get-transaction rpc subcommand #616

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/utils/rpc/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,14 @@ pub struct TransactionWithStatus {
pub transaction: Option<TransactionView>,
/// The transaction consumed cycles.
pub cycles: Option<Cycle>,
/// 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<Uint64>,
/// The Transaction status.
pub tx_status: TxStatus,
/// The transaction fee of the transaction
pub fee: Option<Capacity>,
/// The minimal fee required to replace this transaction
pub min_replace_fee: Option<Capacity>,
}
impl TryFrom<rpc_types::TransactionWithStatusResponse> for TransactionWithStatus {
type Error = String;
Expand All @@ -407,7 +413,12 @@ impl TryFrom<rpc_types::TransactionWithStatusResponse> 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()),
})
}
}
Expand Down
Loading