Skip to content

Commit

Permalink
chore: transition crates to stable rust, unify version
Browse files Browse the repository at this point in the history
  • Loading branch information
Riateche committed Oct 30, 2024
1 parent 28aff03 commit fffcd42
Show file tree
Hide file tree
Showing 25 changed files with 218 additions and 202 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: cargo-clippy-remote-executor
name: Cargo clippy for remote executor
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: governance/remote_executor
# Hooks for cosmwasm contract
Expand All @@ -43,7 +43,7 @@ repos:
- id: cargo-clippy-cosmwasm
name: Cargo clippy for cosmwasm contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: target_chains/cosmwasm
# Hooks for Hermes
Expand All @@ -56,7 +56,7 @@ repos:
- id: cargo-clippy-hermes
name: Cargo clippy for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: apps/hermes
# Hooks for Fortuna
Expand All @@ -76,7 +76,7 @@ repos:
- id: cargo-clippy-message-buffer
name: Cargo clippy for message buffer contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged --features test-bpf -- -D warnings
entry: cargo clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged --features test-bpf -- -D warnings
pass_filenames: false
files: pythnet/message_buffer
# Hooks for pythnet_sdk
Expand All @@ -89,7 +89,7 @@ repos:
- id: cargo-clippy-pythnet-sdk
name: Cargo clippy for pythnet SDK
language: "rust"
entry: cargo +nightly-2024-08-04 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: pythnet/pythnet_sdk
# Hooks for solana receiver contract
Expand All @@ -102,7 +102,7 @@ repos:
- id: cargo-clippy-pyth-solana-receiver
name: Cargo clippy for solana target chain contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo clippy --manifest-path ./target_chains/solana/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: target_chains/solana
# For express relay python files
Expand Down
1 change: 0 additions & 1 deletion apps/fortuna/rust-toolchain

This file was deleted.

8 changes: 4 additions & 4 deletions apps/hermes/server/Cargo.lock

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

2 changes: 0 additions & 2 deletions apps/hermes/server/rust-toolchain

This file was deleted.

3 changes: 0 additions & 3 deletions apps/hermes/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(never_type)]
#![feature(btree_cursors)]

use {
anyhow::Result,
clap::{
Expand Down
2 changes: 1 addition & 1 deletion apps/hermes/server/src/network/pythnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async fn fetch_bridge_data(
}
}

pub async fn run<S>(store: Arc<S>, pythnet_ws_endpoint: String) -> Result<!>
pub async fn run<S>(store: Arc<S>, pythnet_ws_endpoint: String) -> Result<()>
where
S: Aggregates,
S: Wormhole,
Expand Down
2 changes: 1 addition & 1 deletion apps/hermes/server/src/network/wormhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ where
}

#[tracing::instrument(skip(opts, state))]
async fn run<S>(opts: RunOptions, state: Arc<S>) -> Result<!>
async fn run<S>(opts: RunOptions, state: Arc<S>) -> Result<()>
where
S: Wormhole,
S: Send + Sync + 'static,
Expand Down
6 changes: 2 additions & 4 deletions apps/hermes/server/src/state/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use {
HashMap,
HashSet,
},
ops::Bound,
sync::Arc,
},
strum::IntoEnumIterator,
Expand Down Expand Up @@ -300,8 +299,8 @@ async fn retrieve_message_state(

// Get the first element that is greater than or equal to the lookup time.
key_cache
.lower_bound(Bound::Included(&lookup_time))
.peek_next()
.range(lookup_time..)
.next()
.map(|(_, v)| v)
.cloned()
}
Expand Down Expand Up @@ -594,7 +593,6 @@ mod test {
);
}


#[tokio::test]
pub async fn test_store_and_retrieve_first_after_message_state_fails_for_past_time() {
// Initialize state with a cache size of 2 per key.
Expand Down
1 change: 1 addition & 0 deletions governance/remote_executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"programs/*",
"cli/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,9 @@ impl From<ExecutorError> for TransactionError {
fn from(val: ExecutorError) -> Self {
TransactionError::InstructionError(
0,
InstructionError::try_from(u64::from(ProgramError::from(
InstructionError::from(u64::from(ProgramError::from(
anchor_lang::prelude::Error::from(val),
)))
.unwrap(),
))),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ impl IntoTransactionError for ErrorCode {
fn into_transation_error(self) -> TransactionError {
TransactionError::InstructionError(
0,
InstructionError::try_from(u64::from(ProgramError::from(
InstructionError::from(u64::from(ProgramError::from(
anchor_lang::prelude::Error::from(self),
)))
.unwrap(),
))),
)
}
}
Expand Down
2 changes: 0 additions & 2 deletions governance/remote_executor/rust-toolchain.toml

This file was deleted.

Loading

0 comments on commit fffcd42

Please sign in to comment.