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

Commit

Permalink
Move away from deprecated timestamp() function (#342)
Browse files Browse the repository at this point in the history
* Move away from deprecated timestamp() function

* Move to v0.1.4
  • Loading branch information
deekerno authored Nov 16, 2022
1 parent ffd5d2a commit cc976f9
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 28 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion fuel-indexer-api-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-api-server"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-database"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-database/database-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-database-types"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-database/postgres/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-postgres"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-database/sqlite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-sqlite"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-lib"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-macros"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-plugin"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-schema"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
Binary file modified fuel-indexer-tests/assets/explorer_index.wasm
Binary file not shown.
Binary file modified fuel-indexer-tests/assets/fuel_indexer_test.wasm
Binary file not shown.
Binary file modified fuel-indexer-tests/assets/simple_wasm.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion fuel-indexer-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer-types"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
6 changes: 5 additions & 1 deletion fuel-indexer-types/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ impl Default for TransactionStatus {
fn default() -> Self {
Self::Success {
block_id: "0".into(),
time: DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(0, 0), Utc),
time: DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(0, 0)
.expect("Failed to create timestamp"),
Utc,
),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuel-indexer"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
license = "BUSL-1.1"
repository = "https://github.com/FuelLabs/fuel-indexer"
Expand Down
20 changes: 17 additions & 3 deletions fuel-indexer/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ fn make_task<T: 'static + Executor + Send + Sync>(
..
} => TransactionStatus::Success {
block_id,
time: Utc.timestamp(time.to_unix(), 0),
time: Utc
.timestamp_opt(time.to_unix(), 0)
.single()
.expect(
"Failed to parse transaction timestamp",
),
},
GqlTransactionStatus::Failure {
block_id,
Expand All @@ -203,13 +208,22 @@ fn make_task<T: 'static + Executor + Send + Sync>(
..
} => TransactionStatus::Failure {
block_id,
time: Utc.timestamp(time.to_unix(), 0),
time: Utc
.timestamp_opt(time.to_unix(), 0)
.single()
.expect(
"Failed to parse transaction timestamp",
),
reason,
},
GqlTransactionStatus::Submitted { submitted_at } => {
TransactionStatus::Submitted {
submitted_at: Utc
.timestamp(submitted_at.to_unix(), 0),
.timestamp_opt(submitted_at.to_unix(), 0)
.single()
.expect(
"Failed to parse transaction timestamp"
),
}
}
GqlTransactionStatus::SqueezedOut { reason } => {
Expand Down

0 comments on commit cc976f9

Please sign in to comment.