1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! ProvenTxReq table struct.
//!
//! Maps to TS `TableProvenTxReq` in `wallet-toolbox/src/storage/schema/tables/TableProvenTxReq.ts`.
use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};
use sqlx::FromRow;
use crate::status::ProvenTxReqStatus;
/// A request to prove a transaction on-chain.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FromRow)]
#[serde(rename_all = "camelCase")]
#[sqlx(rename_all = "camelCase")]
pub struct ProvenTxReq {
/// When this record was created.
#[sqlx(rename = "created_at")]
#[serde(
rename = "created_at",
alias = "createdAt",
with = "crate::serde_datetime"
)]
pub created_at: NaiveDateTime,
/// When this record was last updated.
#[sqlx(rename = "updated_at")]
#[serde(
rename = "updated_at",
alias = "updatedAt",
with = "crate::serde_datetime"
)]
pub updated_at: NaiveDateTime,
/// Primary key.
pub proven_tx_req_id: i64,
/// Associated proven transaction, once proof is acquired.
#[serde(skip_serializing_if = "Option::is_none")]
pub proven_tx_id: Option<i64>,
/// Current processing status.
pub status: ProvenTxReqStatus,
/// Number of broadcast/proof-fetch attempts made.
pub attempts: i32,
/// Whether the caller has been notified of completion.
pub notified: bool,
/// Transaction ID hex string.
pub txid: String,
/// Batch identifier for grouped processing.
#[serde(skip_serializing_if = "Option::is_none")]
pub batch: Option<String>,
/// JSON-encoded history of processing attempts.
pub history: String,
/// JSON-encoded notification configuration.
pub notify: String,
/// Raw serialized transaction bytes.
pub raw_tx: Vec<u8>,
/// Input BEEF data for transaction context.
#[serde(rename = "inputBEEF", skip_serializing_if = "Option::is_none")]
#[sqlx(rename = "inputBEEF")]
pub input_beef: Option<Vec<u8>>,
}