Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Add created_at timestamp to transaction #134

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
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
67 changes: 67 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "MIT OR Apache-2.0"
base64 = "0.21.7"
bincode = "1.3"
blake3 = "1.5"
chrono = { version = "0.4", features = [ "serde" ] }
ecies = { version = "0.2", default-features = false, features = ["pure"] }
eyre = "0.6.8"
hex = "0.4"
Expand All @@ -19,7 +20,7 @@ reqwest = { version = "0.11", features = [ "gzip", "stream" ] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "^1.0.9"
sha3 = "0.10"
sqlx = { version = "0.7", features = ["postgres", "migrate", "runtime-tokio", "rust_decimal", "time", "tls-rustls", "uuid"] }
sqlx = { version = "0.7", features = ["chrono", "postgres", "migrate", "runtime-tokio", "rust_decimal", "time", "tls-rustls", "uuid"] }
thiserror = "1"
tokio = { version = "1", features = ["full", "io-util", "tracing"] }
tracing = "0.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE transaction ADD COLUMN created_at TIMESTAMPTZ DEFAULT NOW();
2 changes: 2 additions & 0 deletions crates/node/src/storage/database/entity/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct Transaction {
pub signature: Signature,
pub propagated: bool,
pub executed: bool,
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
}

impl From<&types::Transaction<transaction::Validated>> for Transaction {
Expand All @@ -52,6 +53,7 @@ impl From<&types::Transaction<transaction::Validated>> for Transaction {
signature: value.signature,
propagated: value.propagated,
executed: value.executed,
created_at: None,
}
}
}
Expand Down
Loading