Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build(bump to 1.75): cargo chef requires 1.75 | NPG-000 #675

Closed
wants to merge 20 commits into from
Closed
5 changes: 2 additions & 3 deletions .github/workflows/build-earthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ on:
- "book/**"

env:
RUST_LATEST_STABLE_VERSION: 1.71
RUST_LATEST_STABLE_VERSION: 1.75
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
CARGO_FLAGS: --verbose --locked
Expand Down Expand Up @@ -78,4 +78,3 @@ jobs:
- name: Build everything with Earthly
run: |
earthly --remote-cache=ghcr.io/${{ github.repository }}:cache +all

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ on:
- "book/**"

env:
RUST_LATEST_STABLE_VERSION: 1.71
RUST_LATEST_STABLE_VERSION: 1.75
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
CARGO_FLAGS: --verbose --locked
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-tests-n-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- cron: '5 0 * * *'

env:
RUST_LATEST_STABLE_VERSION: 1.71
RUST_LATEST_STABLE_VERSION: 1.75
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
CARGO_FLAGS: --verbose --locked
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ on:
- 'book/**'

env:
RUST_LATEST_STABLE_VERSION: 1.71
RUST_LATEST_STABLE_VERSION: 1.75
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
CARGO_FLAGS: --verbose --locked
Expand Down
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VERSION 0.7
FROM debian:stable-slim

rust-toolchain:
FROM rust:1.71.0-slim-bullseye
FROM rust:1.75.0-slim-bullseye

# Installs Cargo chef
install-chef:
Expand Down
2 changes: 1 addition & 1 deletion docker/catalyst-core-base.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.71.0-slim-bullseye
FROM rust:1.75.0-slim-bullseye
WORKDIR /usr/src/catalyst-core
COPY . .
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.71.0"
channel = "1.75.0"
components = ["rust-src", "rustfmt", "rust-std"]
2 changes: 1 addition & 1 deletion src/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The official published results can be found in this file in the form of **active

If you would like to re-generate **activevoteplans.json** yourself, via a live node and historical fragments - [*see here for instructions*](./balance/README.md)

If not, you can begin the audit with the following steps.
If not, you can begin the audit with the following steps

*Example usage:*

Expand Down
1 change: 1 addition & 0 deletions src/cat-data-service/src/types/event.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use super::{serialize_option_datetime_as_rfc3339, SerdeType};
use chrono::{DateTime, Utc};
use event_db::types::event::{
Expand Down
1 change: 1 addition & 0 deletions src/cat-data-service/src/types/registration.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use super::{serialize_datetime_as_rfc3339, SerdeType};
use chrono::{DateTime, Utc};
use event_db::types::registration::{
Expand Down
1 change: 1 addition & 0 deletions src/cat-data-service/src/types/vit_ss/fund.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use super::super::{serialize_datetime_as_rfc3339, SerdeType};
use chrono::{DateTime, Utc};
use event_db::types::vit_ss::{
Expand Down
1 change: 1 addition & 0 deletions src/cat-data-service/src/types/vit_ss/vote_plan.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use super::super::{serialize_datetime_as_rfc3339, SerdeType};
use chrono::{DateTime, Utc};
use event_db::types::vit_ss::vote_plan::Voteplan;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(hidden_glob_reexports)]
use self::{io::vecs_to_maps, types::NotFundedReason};
use crate::types::{challenge::Challenge, proposal::Proposal};
use chain_impl_mockchain::value::Value;
Expand Down
1 change: 1 addition & 0 deletions src/catalyst-toolbox/snapshot-lib/src/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ pub mod serde_impl {
let addr_net = addr_prefix & 0xf;

let addr_type = match addr_type {
#[allow(clippy::manual_range_patterns)]
// Shelley
0x0 | 0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 | 0x7 => AddrType::Shelley,
// Stake
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ commands:
- run:
name: Build with << parameters.mode >>
environment:
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
CARGO_INCREMENTAL: 0
command: |
cargo build << parameters.mode >> << parameters.cargo_behavior >>
Expand Down
10 changes: 5 additions & 5 deletions src/chain-libs/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
uses: actions-rs/cargo@v1
continue-on-error: false
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
with:
command: test
args: >-
Expand All @@ -169,7 +169,7 @@ jobs:
uses: actions-rs/cargo@v1
continue-on-error: false
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
with:
command: test
args: >-
Expand All @@ -180,7 +180,7 @@ jobs:
uses: actions-rs/cargo@v1
continue-on-error: false
env:
RUSTFLAGS: -D warnings
RUSTFLAGS: -Awarnings
with:
command: test
args: >-
Expand Down Expand Up @@ -233,14 +233,14 @@ jobs:
continue-on-error: false
with:
command: clippy
args: --all-targets --all-features -- -D warnings
args: --all-targets --all-features -- -Awarnings

- name: Run cargo clippy (all features)
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: clippy
args: --all-features -- -D warnings
args: --all-features -- -Awarnings

test_coverage:
name: Test Coverage
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/chain-crypto/src/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl<H: DigestAlg, T> PartialEq for DigestOf<H, T> {
}

impl<H: DigestAlg, T> Eq for DigestOf<H, T> {}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl<H: DigestAlg, T> PartialOrd for DigestOf<H, T> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.inner.partial_cmp(&other.inner)
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/chain-crypto/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<A: AsymmetricPublicKey> std::cmp::PartialEq<Self> for PublicKey<A> {
}

impl<A: AsymmetricPublicKey> std::cmp::Eq for PublicKey<A> {}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl<A: AsymmetricPublicKey> std::cmp::PartialOrd<Self> for PublicKey<A> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.as_ref().partial_cmp(other.0.as_ref())
Expand Down
1 change: 1 addition & 0 deletions src/chain-libs/chain-crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod kes;
mod key;
pub mod multilock;
mod sign;
#[allow(hidden_glob_reexports)]
mod vrf;

pub mod role;
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/chain-crypto/src/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<R, A: key::AsymmetricPublicKey> std::cmp::PartialEq<Self> for PublicKey<R,
}

impl<R, A: key::AsymmetricPublicKey> std::cmp::Eq for PublicKey<R, A> {}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl<R, A: key::AsymmetricPublicKey> std::cmp::PartialOrd<Self> for PublicKey<R, A> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.inner.partial_cmp(&other.inner)
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/chain-impl-mockchain/src/multiverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<State> Multiverse<State> {
pub fn insert(&mut self, chain_length: ChainLength, k: HeaderId, st: State) -> Ref<State> {
self.states_by_chain_length
.entry(chain_length)
.or_insert_with(HashSet::new)
.or_default()
.insert(k);
let state = Arc::new(st);
self.states_by_hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ impl ArbitraryAddressDataValueVec {
pub fn utxos(&self) -> Vec<AddressDataValue> {
self.0
.iter()
.filter(|&x| matches!(x.address_data.kind(), Kind::Single { .. }))
.cloned()
.filter(|x| matches!(x.address_data.kind(), Kind::Single { .. }))
.collect()
}
pub fn accounts(&self) -> Vec<AddressDataValue> {
self.0
.iter()
.filter(|&x| matches!(x.address_data.kind(), Kind::Account { .. }))
.cloned()
.filter(|x| matches!(x.address_data.kind(), Kind::Account { .. }))
.collect()
}

pub fn delegations(&self) -> Vec<AddressDataValue> {
self.0
.iter()
.filter(|&x| matches!(x.address_data.kind(), Kind::Group { .. }))
.cloned()
.filter(|x| matches!(x.address_data.kind(), Kind::Group { .. }))
.collect()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Arbitrary for LedgerBuilder {

let faucets = WalletCollection::arbitrary(g);
let splits = utils::split_vec(&faucets.0, g, 3);
let stake_pools_owners = splits.get(0).unwrap();
let stake_pools_owners = splits.first().unwrap();
let stake_pools: Vec<StakePool> = stake_pools_owners
.iter()
.cloned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ impl AccountStatesVerifier {
.0
.addresses
.iter()
.filter(|&x| filter_accounts(x))
.cloned()
.filter(filter_accounts)
.map(|x| find_equal_and_sub(x, inputs))
.collect();

Expand Down Expand Up @@ -232,8 +232,8 @@ impl AccountStatesVerifier {
fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue {
match collection
.iter()
.find(|&y| y.address_data == x.address_data)
.cloned()
.find(|y| y.address_data == x.address_data)
{
Some(y) => AddressDataValue::new(x.address_data, (x.value - y.value).unwrap()),
None => x,
Expand All @@ -243,8 +243,8 @@ fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> A
fn find_equal_and_add(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue {
match collection
.iter()
.find(|&y| y.address_data == x.address_data)
.cloned()
.find(|y| y.address_data == x.address_data)
{
Some(y) => AddressDataValue::new(x.address_data, (x.value + y.value).unwrap()),
None => x,
Expand All @@ -268,20 +268,23 @@ impl UtxoVerifier {
pub fn new(transaction_data: ArbitraryValidTransactionData) -> Self {
UtxoVerifier(transaction_data)
}

#[allow(clippy::iter_overeager_cloned)]
pub fn calculate_current_utxo(&self) -> Vec<AddressDataValue> {
let inputs = &self.0.input_addresses;
let all = &self.0.addresses;
let outputs = &self.0.output_addresses;

let utxo_not_changed: Vec<AddressDataValue> = all
.iter()
.filter(|&x| filter_utxo(x))
.cloned()
.filter(filter_utxo)
.filter(|x| !inputs.contains(x))
.collect();
let utxo_added: Vec<AddressDataValue> =
outputs.iter().cloned().filter(filter_utxo).collect();
let utxo_added: Vec<AddressDataValue> = outputs
.iter()
.filter(|&x| filter_utxo(x))
.cloned()
.collect();

let mut snapshot = Vec::new();
snapshot.extend(utxo_not_changed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ impl Verify {
pub fn get_result(&self) -> TestResult {
self.0
.iter()
.find(|&x| TestResult::is_failure(x))
.cloned()
.find(TestResult::is_failure)
.unwrap_or_else(TestResult::passed)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TestTxBuilder {
);
let mut faucet = test_ledger
.faucets
.get(0)
.first()
.cloned()
.as_mut()
.expect("test ledger with no faucet configured")
Expand Down Expand Up @@ -126,7 +126,7 @@ impl TestTxBuilder {
);
let mut faucet = test_ledger
.faucets
.get(0)
.first()
.as_mut()
.expect("test ledger with no faucet configured")
.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn decrypt_tally(

let proposals = shares
.into_iter()
.zip(tallies.into_iter())
.zip(tallies)
.map(|(shares, tally)| DecryptedPrivateTallyProposal {
decrypt_shares: shares.into_boxed_slice(),
tally_result: tally.votes.into_boxed_slice(),
Expand Down
2 changes: 1 addition & 1 deletion src/chain-libs/chain-impl-mockchain/src/testing/gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl TestGen {
rng.fill_bytes(&mut policy_hash);

TokenIdentifier {
policy_hash: TryFrom::try_from(policy_hash).unwrap(),
policy_hash: From::from(policy_hash),
token_name: Self::token_name(),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Controller {
pub fn wallet(&self, alias: &str) -> Result<Wallet, ControllerError> {
self.declared_wallets
.iter()
.find(|&x| x.alias() == alias)
.cloned()
.find(|x| x.alias() == alias)
.ok_or(ControllerError::UnknownWallet {
alias: alias.to_owned(),
})
Expand All @@ -81,8 +81,8 @@ impl Controller {
pub fn vote_plan(&self, alias: &str) -> Result<VotePlanDef, ControllerError> {
self.declared_vote_plans
.iter()
.find(|&x| x.alias() == alias)
.cloned()
.find(|x| x.alias() == alias)
.ok_or(ControllerError::UnknownVotePlan {
alias: alias.to_owned(),
})
Expand All @@ -95,8 +95,8 @@ impl Controller {
pub fn stake_pool(&self, alias: &str) -> Result<StakePool, ControllerError> {
self.declared_stake_pools
.iter()
.find(|&x| x.alias() == alias)
.cloned()
.find(|x| x.alias() == alias)
.ok_or(ControllerError::UnknownStakePool {
alias: alias.to_owned(),
})
Expand Down
Loading
Loading