Skip to content

Commit

Permalink
upgrade rust to 1.75.0
Browse files Browse the repository at this point in the history
1. silence `default-features=false` warnings
2. silence some clippy warnings
3. fix consensus test case
4. remove some unused imports
5. silence non ffi-safe warning
  • Loading branch information
simonjiao committed Apr 2, 2024
1 parent 216781c commit 60df70e
Show file tree
Hide file tree
Showing 113 changed files with 303 additions and 328 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion account/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
parking_lot = { workspace = true }
rand = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions account/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
schemars = { workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
serde_bytes = { workspace = true }
serde_json = { workspace = true }
starcoin-crypto = { workspace = true }
Expand Down
8 changes: 3 additions & 5 deletions account/api/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ use starcoin_types::sign_message::{SignedMessage, SigningMessage};
use starcoin_types::transaction::{RawUserTransaction, SignedUserTransaction};

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Default)]
pub enum AccountProviderStrategy {
#[default]
RPC,
Local,
PrivateKey,
}

impl Default for AccountProviderStrategy {
fn default() -> Self {
AccountProviderStrategy::RPC
}
}

pub trait AccountProvider {
fn create_account(&self, password: String) -> Result<AccountInfo>;

Expand Down
2 changes: 1 addition & 1 deletion account/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
starcoin-account = { workspace = true }
starcoin-account-api = { features = ["mock"], workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ rust-version = { workspace = true }
[dependencies]
anyhow = { workspace = true }
criterion = { workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
starcoin-crypto = { workspace = true }
forkable-jellyfish-merkle = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
proptest = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-config = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-genesis = { workspace = true }
network-api = { workspace = true }
starcoin-service-registry = { workspace = true }
Expand Down
14 changes: 7 additions & 7 deletions block-relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
network-api = { package = "network-api", workspace = true }
starcoin-logger = { workspace = true }
network-api = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-metrics = { workspace = true }
starcoin-network = { workspace = true }
starcoin-network-rpc-api = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-sync = { package = "starcoin-sync", workspace = true }
starcoin-sync-api = { package = "starcoin-sync-api", workspace = true }
starcoin-sync = { workspace = true }
starcoin-sync-api = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-txpool = { workspace = true }
starcoin-txpool-api = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-config = { workspace = true }

[dev-dependencies]
Expand Down
20 changes: 9 additions & 11 deletions chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[dependencies]
anyhow = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
proptest = { default-features = false, optional = true, workspace = true }
proptest-derive = { default-features = false, optional = true, workspace = true }
starcoin-crypto = { workspace = true }
starcoin-logger = { workspace = true }
proptest = { features = ["std"], optional = true, workspace = true }
proptest-derive = { optional = true, workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
sp-utils = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-config = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-open-block = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-storage = { workspace = true }
thiserror = { workspace = true }
Expand All @@ -34,9 +34,7 @@ starcoin-chain-mock = { workspace = true }
starcoin-genesis = { workspace = true }
starcoin-resource-viewer = { workspace = true }
starcoin-transaction-builder = { workspace = true }
starcoin-types = { package = "starcoin-types", features = [
"fuzzing",
], workspace = true }
starcoin-types = { features = [ "fuzzing" ], workspace = true }
stdlib = { workspace = true }
stest = { workspace = true }
test-helper = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions chain/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
anyhow = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
network-api = { package = "network-api", workspace = true }
network-api = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-crypto = { workspace = true }
starcoin-service-registry = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion chain/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::arithmetic_side_effects)]

use anyhow::{bail, format_err, Result};
use serde::{Deserialize, Serialize};
Expand Down
16 changes: 8 additions & 8 deletions chain/mock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
proptest = { default-features = false, optional = true, workspace = true }
proptest-derive = { default-features = false, optional = true, workspace = true }
proptest = { features = ["std"], optional = true, workspace = true }
proptest-derive = { optional = true, workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-config = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-genesis = { workspace = true }
starcoin-open-block = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
thiserror = { workspace = true }

Expand Down
10 changes: 5 additions & 5 deletions chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion chain/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ async-trait = { workspace = true }
futures = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
starcoin-chain = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-config = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,9 @@ impl BlockChain {
.map(|status| status.total_difficulty())
.unwrap_or_default();

let total_difficulty = pre_total_difficulty + header.difficulty();
let total_difficulty = pre_total_difficulty
.checked_add(header.difficulty())
.ok_or(format_err!("failed to calculate total difficulty"))?;

block_accumulator.append(&[block_id])?;
block_accumulator.flush()?;
Expand Down
2 changes: 1 addition & 1 deletion chain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::arithmetic_side_effects)]
mod chain;
pub mod verifier;
pub use chain::BlockChain;
Expand Down
2 changes: 1 addition & 1 deletion cmd/airdrop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async fn main() -> Result<()> {
.map(|r| r.sequence_number())
.unwrap_or_default()
};
for (i, airdrops) in airdrop_infos.chunks(batch_size).into_iter().enumerate() {
for (i, airdrops) in airdrop_infos.chunks(batch_size).enumerate() {
let addresses = MoveValue::Vector(
airdrops
.iter()
Expand Down
6 changes: 3 additions & 3 deletions cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ path = "src/main.rs"
[dependencies]
anyhow = { workspace = true }
atomic-counter = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
csv = { workspace = true }
hex = { workspace = true }
indicatif = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
serde = { workspace = true }
serde_json = { features = ["arbitrary_precision"], workspace = true }
tokio = { features = ["full"], workspace = true }
move-binary-format = { workspace = true }
move-bytecode-verifier = { workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-config = { workspace = true }
starcoin-consensus = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ascii = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
hex = { default-features = false, workspace = true }
hex = { features = ["serde"], workspace = true }
once_cell = { workspace = true }
rust-embed = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ anyhow = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
hex = { default-features = false, workspace = true }
hex = { features = ["serde"], workspace = true }
scmd = { workspace = true }
serde = { workspace = true }
serde_json = { features = ["arbitrary_precision"], workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/merkle-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[dependencies]
anyhow = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
csv = { workspace = true }
hex = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions cmd/miner_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ actix = { workspace = true }
actix-rt = { workspace = true }
anyhow = { workspace = true }
async-std = { workspace = true }
starcoin-consensus = { package = "starcoin-consensus", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
starcoin-consensus = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
futures-channel = { workspace = true }
jsonrpc-core = { features = ["arbitrary_precision"], workspace = true }
jsonrpc-core-client = { workspace = true }
jsonrpc-server-utils = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
starcoin-config = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-types = { workspace = true }
Expand All @@ -24,7 +24,7 @@ byteorder = { workspace = true }
clap = { features = ["derive"], workspace = true }
dyn-clone = { workspace = true }
futures-timer = { workspace = true }
hex = { default-features = false, workspace = true }
hex = { features = ["serde"], workspace = true }
libloading = { workspace = true }
parking_lot = { workspace = true }
rand = { workspace = true }
Expand Down
Loading

0 comments on commit 60df70e

Please sign in to comment.