Skip to content

Commit 1bd193e

Browse files
committed
correct PendingTransaction struct field types
1 parent 45a58f3 commit 1bd193e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

crates/sage-api/src/records/pending_transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ use crate::Amount;
77
pub struct PendingTransactionRecord {
88
pub transaction_id: String,
99
pub fee: Amount,
10-
pub submitted_at: Option<String>,
10+
pub submitted_at: Option<u64>,
1111
}

crates/sage-database/src/tables/mempool_items.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct MempoolItem {
1111
pub hash: Bytes32,
1212
pub aggregated_signature: Signature,
1313
pub fee: u64,
14-
pub submitted_timestamp: i64,
14+
pub submitted_timestamp: Option<u64>,
1515
}
1616

1717
impl Database {
@@ -188,7 +188,7 @@ async fn mempool_items_to_submit(
188188
hash: row.hash.convert()?,
189189
aggregated_signature: row.aggregated_signature.convert()?,
190190
fee: row.fee.convert()?,
191-
submitted_timestamp: row.submitted_timestamp.unwrap_or(0),
191+
submitted_timestamp: row.submitted_timestamp.map(|ts| ts as u64),
192192
})
193193
})
194194
.collect()
@@ -328,7 +328,7 @@ async fn mempool_items(conn: impl SqliteExecutor<'_>) -> Result<Vec<MempoolItem>
328328
hash: row.hash.convert()?,
329329
aggregated_signature: row.aggregated_signature.convert()?,
330330
fee: row.fee.convert()?,
331-
submitted_timestamp: row.submitted_timestamp.unwrap_or(0),
331+
submitted_timestamp: row.submitted_timestamp.map(|ts| ts as u64),
332332
})
333333
})
334334
.collect()

crates/sage/src/endpoints/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ impl Sage {
494494
Result::Ok(PendingTransactionRecord {
495495
transaction_id: hex::encode(tx.hash),
496496
fee: Amount::u64(tx.fee),
497-
submitted_at: Some(tx.submitted_timestamp.to_string()),
497+
submitted_at: tx.submitted_timestamp,
498498
})
499499
})
500500
.collect::<Result<Vec<_>>>()?;

src/bindings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export type OptionAsset = { asset_id: string | null; amount: Amount }
523523
export type OptionRecord = { launcher_id: string; name: string | null; visible: boolean; coin_id: string; address: string; amount: Amount; underlying_asset: Asset; underlying_amount: Amount; underlying_coin_id: string; strike_asset: Asset; strike_amount: Amount; expiration_seconds: number; created_height: number | null; created_timestamp: number | null }
524524
export type OptionSortMode = "name" | "created_height" | "expiration_seconds"
525525
export type PeerRecord = { ip_addr: string; port: number; peak_height: number; user_managed: boolean }
526-
export type PendingTransactionRecord = { transaction_id: string; fee: Amount; submitted_at: string | null }
526+
export type PendingTransactionRecord = { transaction_id: string; fee: Amount; submitted_at: number | null }
527527
export type PerformDatabaseMaintenance = { force_vacuum: boolean }
528528
export type PerformDatabaseMaintenanceResponse = { vacuum_duration_ms: number; analyze_duration_ms: number; wal_checkpoint_duration_ms: number; total_duration_ms: number; pages_vacuumed: number; wal_pages_checkpointed: number }
529529
export type RedownloadNft = { nft_id: string }

0 commit comments

Comments
 (0)