Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
J committed Oct 15, 2024
1 parent 47d0ed9 commit 1b2608c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/alerting/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fn check_pyth_push_oracle(
pyth_sponsered_oracle_address,
])?;

match (accounts.get(0).cloned(), accounts.get(1).cloned()) {
match (accounts.first().cloned(), accounts.get(1).cloned()) {
(Some(Some(account)), _) => account,
(_, Some(Some(account))) => account,
_ => anyhow::bail!("Oracle account for bank {} not found", address),
Expand Down Expand Up @@ -503,13 +503,12 @@ fn clear_stale_oracle_alert(context: &AlertingContext, address: &Pubkey) -> anyh
}

fn get_oracle_dedup_key(address: &Pubkey) -> String {
format!("stale-oracle-{}", address.to_string())
format!("stale-oracle-{}", address)
}

fn get_current_unix_timestamp_secs() -> i64 {
let now = SystemTime::now()
SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time went backwards")
.as_secs() as i64;
now
.as_secs() as i64
}

0 comments on commit 1b2608c

Please sign in to comment.