Skip to content

Commit

Permalink
build(deps): bump chrono from 0.4.34 to 0.4.37 (solana-labs#603)
Browse files Browse the repository at this point in the history
* build(deps): bump chrono from 0.4.34 to 0.4.37

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.34 to 0.4.37.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.34...v0.4.37)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* update deprecated functions

* add test_unix_timestamp_to_string

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: yihau <yihau.chen@icloud.com>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent e09541a commit 948caeb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ bzip2 = "0.4.4"
caps = "0.5.5"
cargo_metadata = "0.15.4"
cc = "1.0.83"
chrono = { version = "0.4.34", default-features = false }
chrono = { version = "0.4.37", default-features = false }
chrono-humanize = "0.2.3"
clap = "2.33.1"
console = "0.15.8"
Expand Down
13 changes: 8 additions & 5 deletions cli-output/src/display.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::cli_output::CliSignatureVerificationStatus,
base64::{prelude::BASE64_STANDARD, Engine},
chrono::{Local, NaiveDateTime, SecondsFormat, TimeZone, Utc},
chrono::{DateTime, Local, SecondsFormat, TimeZone, Utc},
console::style,
indicatif::{ProgressBar, ProgressStyle},
solana_cli_config::SettingType,
Expand Down Expand Up @@ -715,10 +715,8 @@ pub fn new_spinner_progress_bar() -> ProgressBar {
}

pub fn unix_timestamp_to_string(unix_timestamp: UnixTimestamp) -> String {
match NaiveDateTime::from_timestamp_opt(unix_timestamp, 0) {
Some(ndt) => Utc
.from_utc_datetime(&ndt)
.to_rfc3339_opts(SecondsFormat::Secs, true),
match DateTime::from_timestamp(unix_timestamp, 0) {
Some(ndt) => ndt.to_rfc3339_opts(SecondsFormat::Secs, true),
None => format!("UnixTimestamp {unix_timestamp}"),
}
}
Expand Down Expand Up @@ -976,4 +974,9 @@ Rewards:
"abcdefghijklmnopqrstuvwxyz12345 (1111..1111)"
);
}

#[test]
fn test_unix_timestamp_to_string() {
assert_eq!(unix_timestamp_to_string(1628633791), "2021-08-10T22:16:31Z");
}
}
4 changes: 2 additions & 2 deletions programs/sbf/Cargo.lock

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

0 comments on commit 948caeb

Please sign in to comment.