diff --git a/.github/workflows/ci-fortuna.yml b/.github/workflows/ci-fortuna.yml index bdff0b9d39..762522b773 100644 --- a/.github/workflows/ci-fortuna.yml +++ b/.github/workflows/ci-fortuna.yml @@ -14,7 +14,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-07-23 + toolchain: 1.82.0 override: true - name: Run executor tests run: cargo test --manifest-path ./apps/fortuna/Cargo.toml diff --git a/.github/workflows/ci-hermes-server.yml b/.github/workflows/ci-hermes-server.yml index 58312c6799..86a002a8a2 100644 --- a/.github/workflows/ci-hermes-server.yml +++ b/.github/workflows/ci-hermes-server.yml @@ -14,7 +14,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2024-03-26 + toolchain: 1.82.0 components: rustfmt, clippy override: true - name: Install protoc diff --git a/.github/workflows/ci-message-buffer-idl.yml b/.github/workflows/ci-message-buffer-idl.yml index ce86c05c0a..65c58102fe 100644 --- a/.github/workflows/ci-message-buffer-idl.yml +++ b/.github/workflows/ci-message-buffer-idl.yml @@ -21,7 +21,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-03-01 + toolchain: 1.82.0 components: rustfmt, clippy - name: Install Solana run: | diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index dbe39baa5b..bd590de8d1 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -20,22 +20,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-03-01 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-07-23 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2024-03-26 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2024-08-04 + toolchain: 1.82.0 components: rustfmt, clippy - name: Install protoc uses: arduino/setup-protoc@v3 diff --git a/.github/workflows/ci-remote-executor.yml b/.github/workflows/ci-remote-executor.yml index 1275c049a6..0258235883 100644 --- a/.github/workflows/ci-remote-executor.yml +++ b/.github/workflows/ci-remote-executor.yml @@ -15,7 +15,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.66.1 + toolchain: 1.82.0 components: rustfmt, clippy override: true - name: Install Solana diff --git a/.github/workflows/ci-starknet-tools.yml b/.github/workflows/ci-starknet-tools.yml index 754ae6c4b4..a08e4fa8bd 100644 --- a/.github/workflows/ci-starknet-tools.yml +++ b/.github/workflows/ci-starknet-tools.yml @@ -14,7 +14,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.78.0 + toolchain: 1.82.0 components: rustfmt, clippy override: true - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-pyth-price-store.yml b/.github/workflows/publish-pyth-price-store.yml index 316cb470cc..111b5bd0a3 100644 --- a/.github/workflows/publish-pyth-price-store.yml +++ b/.github/workflows/publish-pyth-price-store.yml @@ -14,7 +14,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.82.0 default: true profile: minimal - name: Publish diff --git a/.github/workflows/publish-pyth-solana-receiver-state.yml b/.github/workflows/publish-pyth-solana-receiver-state.yml index f85182e5ac..64ab90c190 100644 --- a/.github/workflows/publish-pyth-solana-receiver-state.yml +++ b/.github/workflows/publish-pyth-solana-receiver-state.yml @@ -14,11 +14,11 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.82.0 default: true profile: minimal - - run: cargo +stable-x86_64-unknown-linux-gnu publish --token ${CARGO_REGISTRY_TOKEN} + - run: cargo publish --token ${CARGO_REGISTRY_TOKEN} env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} working-directory: "target_chains/solana/pyth_solana_receiver_sdk" diff --git a/target_chains/cosmwasm/contracts/pyth/src/contract.rs b/target_chains/cosmwasm/contracts/pyth/src/contract.rs index 2b3c0cb67e..b91a79596f 100644 --- a/target_chains/cosmwasm/contracts/pyth/src/contract.rs +++ b/target_chains/cosmwasm/contracts/pyth/src/contract.rs @@ -261,7 +261,7 @@ fn update_price_feeds( data: &[Binary], ) -> StdResult> { if !is_fee_sufficient(&deps.as_ref(), info, data)? { - Err(PythContractError::InsufficientFee)?; + return Err(PythContractError::InsufficientFee)?; } let (num_total_attestations, total_new_feeds) = apply_updates(&mut deps, &env, data)?; @@ -308,7 +308,7 @@ fn execute_governance_instruction( // Governance messages must be applied in order. This check prevents replay attacks where // previous messages are re-applied. if vaa.sequence <= state.governance_sequence_number { - Err(PythContractError::OldGovernanceMessage)?; + return Err(PythContractError::OldGovernanceMessage)?; } else { updated_config.governance_sequence_number = vaa.sequence; } @@ -320,13 +320,13 @@ fn execute_governance_instruction( // Check that the instruction is intended for this chain. // chain_id = 0 means the instruction applies to all chains if instruction.target_chain_id != state.chain_id && instruction.target_chain_id != 0 { - Err(PythContractError::InvalidGovernancePayload)?; + return Err(PythContractError::InvalidGovernancePayload)?; } // Check that the instruction is intended for this target chain contract (as opposed to // other Pyth contracts that may live on the same chain). if instruction.module != GovernanceModule::Target { - Err(PythContractError::InvalidGovernancePayload)?; + return Err(PythContractError::InvalidGovernancePayload)?; } let response = match instruction.action { @@ -463,7 +463,7 @@ fn verify_vaa_from_data_source(state: &ConfigInfo, vaa: &ParsedVAA) -> StdResult chain_id: vaa.emitter_chain, }; if !state.data_sources.contains(&vaa_data_source) { - Err(PythContractError::InvalidUpdateEmitter)?; + return Err(PythContractError::InvalidUpdateEmitter)?; } Ok(()) } @@ -475,7 +475,7 @@ fn verify_vaa_from_governance_source(state: &ConfigInfo, vaa: &ParsedVAA) -> Std chain_id: vaa.emitter_chain, }; if state.governance_source != vaa_data_source { - Err(PythContractError::InvalidUpdateEmitter)?; + return Err(PythContractError::InvalidUpdateEmitter)?; } Ok(()) } @@ -533,7 +533,7 @@ fn parse_accumulator(deps: &Deps, env: &Env, data: &[u8]) -> StdResult(&message_vec) @@ -683,7 +683,7 @@ pub fn parse_price_feed_updates( ) -> StdResult> { let _config = config_read(deps.storage).load()?; if !is_fee_sufficient(&deps.as_ref(), info, updates)? { - Err(PythContractError::InsufficientFee)?; + return Err(PythContractError::InsufficientFee)?; } let mut found_feeds = 0; let mut results: Vec<(Identifier, Option)> = @@ -709,7 +709,7 @@ pub fn parse_price_feed_updates( } } if found_feeds != price_feeds.len() { - Err(PythContractError::InvalidUpdatePayload)?; + return Err(PythContractError::InvalidUpdatePayload)?; } let _unwrapped_feeds = results @@ -1894,7 +1894,7 @@ mod test { }) .unwrap(); - let updates = [Binary::from([1u8]), Binary::from([2u8])]; + let updates = vec![Binary::from([1u8]), Binary::from([2u8])]; assert_eq!( get_update_fee(&deps.as_ref(), &updates[0..0]),