1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use serde::Serialize;

/// Transaction status in the transaction pool.
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub enum TransactionStatus {
    Packed,
    Ready,
    Pending(PendingReason),
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub enum PendingReason {
    FutureNonce,
    NotEnoughCash,
    OldEpochHeight,
    // The tx status in the pool is inaccurate due to chain switch or sponsor
    // balance change. This tx will not be packed even if it should have
    // been ready, and the user needs to send a new transaction to trigger
    // the status change.
    OutdatedStatus,
}