Skip to content

Commit

Permalink
chore: update rust toolchain in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Riateche committed Oct 31, 2024
1 parent fffcd42 commit 148cfd9
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-fortuna.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/ci-hermes-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-message-buffer-idl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-remote-executor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-starknet-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pyth-price-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pyth-solana-receiver-state.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
20 changes: 10 additions & 10 deletions target_chains/cosmwasm/contracts/pyth/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn update_price_feeds(
data: &[Binary],
) -> StdResult<Response<MsgWrapper>> {
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)?;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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(())
}
Expand All @@ -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(())
}
Expand Down Expand Up @@ -533,7 +533,7 @@ fn parse_accumulator(deps: &Deps, env: &Env, data: &[u8]) -> StdResult<Vec<Price
for update in updates {
let message_vec = Vec::from(update.message);
if !root.check(update.proof, &message_vec) {
Err(PythContractError::InvalidMerkleProof)?;
return Err(PythContractError::InvalidMerkleProof)?;
}

let msg = from_slice::<BigEndian, Message>(&message_vec)
Expand Down Expand Up @@ -683,7 +683,7 @@ pub fn parse_price_feed_updates(
) -> StdResult<Response<MsgWrapper>> {
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<PriceFeed>)> =
Expand All @@ -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
Expand Down Expand Up @@ -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]),
Expand Down

0 comments on commit 148cfd9

Please sign in to comment.