Skip to content

Commit

Permalink
[dev] update rust toolchain to 1.63 (#3679)
Browse files Browse the repository at this point in the history
* [dev] update toolchain from 1.62 to 1.63

* clippy

* update

* update

* chore: fixup
  • Loading branch information
jiangying000 authored Aug 22, 2022
1 parent 266659e commit 5ad8a48
Show file tree
Hide file tree
Showing 33 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion account/api/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use starcoin_types::account_config::token_code::TokenCode;
use starcoin_types::sign_message::{SignedMessage, SigningMessage};
use starcoin_types::transaction::{RawUserTransaction, SignedUserTransaction};

#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AccountProviderStrategy {
RPC,
Local,
Expand Down
12 changes: 6 additions & 6 deletions cmd/miner_client/src/stratum_client_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum PendingRequest {
SubmitSealRequest(oneshot::Sender<()>),
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
#[serde(untagged)]
pub enum Response {
Expand All @@ -48,7 +48,7 @@ pub enum Response {
}

/// Represents jsonrpc request which is a notification.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct JobNotification {
/// A String specifying the version of the JSON-RPC protocol.
Expand All @@ -59,7 +59,7 @@ pub struct JobNotification {
pub params: StratumJob,
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
#[serde(untagged)]
#[allow(clippy::large_enum_variant)]
Expand All @@ -69,7 +69,7 @@ pub enum OutputResponse {
}

/// Successful response
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Output {
/// Protocol version
Expand All @@ -83,7 +83,7 @@ pub struct Output {
pub error: Option<ResponseError>,
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Failure {
pub id: u32,
Expand All @@ -92,7 +92,7 @@ pub struct Failure {
pub error: ResponseError,
}

#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ResponseError {
pub code: u32,
Expand Down
4 changes: 2 additions & 2 deletions cmd/starcoin/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ pub struct AccountWithStateView {
pub balances: HashMap<TokenCode, u128>,
}

#[derive(Clone, Debug, Serialize, PartialEq)]
#[derive(Clone, Debug, Serialize, PartialEq, Eq)]
pub struct EventView {
pub key: EventKey,
pub sequence_number: u64,
pub data: EventDataView,
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "type")]
pub enum EventDataView {
#[serde(rename = "mint")]
Expand Down
2 changes: 1 addition & 1 deletion config/src/account_provider_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::sync::Arc;

pub const G_ENV_PRIVATE_KEY: &str = "STARCOIN_PRIVATE_KEY";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Parser)]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Parser)]
pub struct AccountProviderConfig {
/// Path to the local account provider dir, load the accounts from local dir path
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion config/src/api_quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::de::Error;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::num::NonZeroU32;
use std::str::FromStr;
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ApiQuotaConfig {
pub max_burst: NonZeroU32,
pub duration: QuotaDuration,
Expand Down
10 changes: 5 additions & 5 deletions config/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl From<BuiltinNetworkID> for ChainNetwork {
}
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
#[allow(clippy::upper_case_acronyms)]
pub struct CustomNetworkID {
chain_name: String,
Expand Down Expand Up @@ -256,7 +256,7 @@ impl FromStr for CustomNetworkID {
}
}

#[derive(Clone, Debug, PartialEq, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, JsonSchema)]
#[allow(clippy::upper_case_acronyms)]
pub enum ChainNetworkID {
Builtin(BuiltinNetworkID),
Expand Down Expand Up @@ -563,7 +563,7 @@ pub trait FutureBlockParameterResolver {
fn resolve(&self, parameter: &FutureBlockParameter) -> Result<GenesisBlockParameter>;
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct GenesisBlockParameter {
/// Genesis block parent hash
pub parent_hash: HashValue,
Expand All @@ -573,13 +573,13 @@ pub struct GenesisBlockParameter {
pub difficulty: U256,
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct FutureBlockParameter {
pub network: BuiltinNetworkID,
pub block_number: u64,
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub enum GenesisBlockParameterConfig {
Static(GenesisBlockParameter),
FutureBlock(FutureBlockParameter),
Expand Down
2 changes: 1 addition & 1 deletion config/src/metrics_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub static G_DEFAULT_METRIC_PUSH_AUTH_PASSWORD: &str = "";

pub static G_DEFAULT_METRIC_NAMESPACE: &str = "starcoin";

#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize, Parser)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Eq, Serialize, Parser)]
#[serde(deny_unknown_fields)]
pub struct PushParameterConfig {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion config/src/miner_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl MinerConfig {
}
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct MinerClientConfig {
pub server: Option<String>,
pub plugin_path: Option<String>,
Expand Down
4 changes: 2 additions & 2 deletions config/src/network_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::sync::Arc;
pub static G_DEFAULT_NETWORK_PORT: u16 = 9840;
static G_NETWORK_KEY_FILE: Lazy<PathBuf> = Lazy::new(|| PathBuf::from("network_key"));

#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, Parser)]
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize, Parser)]
pub struct NetworkRpcQuotaConfiguration {
#[serde(skip_serializing_if = "Option::is_none")]
#[clap(
Expand Down Expand Up @@ -119,7 +119,7 @@ impl NetworkRpcQuotaConfiguration {
}
//for avoid conflict between seed vec and subcommand, so define a custom type to parse seeds.
//https://github.com/TeXitoi/clap/issues/367
#[derive(Default, Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Default, Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct Seeds(pub Vec<MultiaddrWithPeerId>);
impl Seeds {
pub fn into_vec(self) -> Vec<MultiaddrWithPeerId> {
Expand Down
2 changes: 1 addition & 1 deletion config/src/rpc_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl IpcConfiguration {
}
}

#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, Parser)]
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize, Parser)]
pub struct ApiQuotaConfiguration {
#[serde(skip_serializing_if = "Option::is_none")]
#[clap(
Expand Down
2 changes: 1 addition & 1 deletion config/src/storage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::sync::Arc;
/// https://github.com/facebook/rocksdb/wiki/WAL-Performance
/// wal_bytes_per_sync, bytes_per_sync see https://github.com/facebook/rocksdb/wiki/IO#range-sync
/// for detailed explanations.
#[derive(Copy, Clone, Debug, Deserialize, PartialEq, Serialize, Parser)]
#[derive(Copy, Clone, Debug, Deserialize, PartialEq, Eq, Serialize, Parser)]
#[serde(default, deny_unknown_fields)]
pub struct RocksdbConfig {
#[clap(name = "rocksdb-max-open-files", long, help = "rocksdb max open files")]
Expand Down
2 changes: 1 addition & 1 deletion config/src/sync_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use network_api::PeerStrategy;
use serde::{Deserialize, Serialize};
use std::sync::Arc;

#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize, Parser)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Eq, Serialize, Parser)]
#[serde(deny_unknown_fields)]
pub struct SyncConfig {
/// peer select strategy
Expand Down
2 changes: 1 addition & 1 deletion network-p2p/peerset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl PeersetHandle {
}

/// Message that can be sent by the peer set manager (PSM).
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum Message {
/// Request to open a connection to the given peer. From the point of view of the PSM, we are
/// immediately connected.
Expand Down
5 changes: 2 additions & 3 deletions network-p2p/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,12 @@ impl NetworkConfiguration {
/// Create new default configuration for localhost-only connection with random port (useful for
/// testing)
pub fn new_local() -> NetworkConfiguration {
let config = NetworkConfiguration {
NetworkConfiguration {
listen_addresses: vec![iter::once(Protocol::Ip4(Ipv4Addr::new(127, 0, 0, 1)))
.chain(iter::once(Protocol::Tcp(0)))
.collect()],
..Default::default()
};
config
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions network-p2p/types/src/network_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use std::{
/// Meant for general diagnostic purposes.
///
/// **Warning**: This API is not stable.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct NetworkState {
/// PeerId of the local node.
Expand All @@ -51,7 +51,7 @@ pub struct NetworkState {
}

/// Part of the `NetworkState` struct. Unstable.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct Peer {
/// How we are connected to the node.
Expand All @@ -65,7 +65,7 @@ pub struct Peer {
}

/// Part of the `NetworkState` struct. Unstable.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct NotConnectedPeer {
/// List of addresses known for this node.
Expand All @@ -77,7 +77,7 @@ pub struct NotConnectedPeer {
}

/// Part of the `NetworkState` struct. Unstable.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum PeerEndpoint {
/// We are dialing the given address.
Expand Down
2 changes: 1 addition & 1 deletion network-rpc/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl IntoIterator for GetBlockHeadersByNumber {
}
}

#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)]
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug)]
pub struct GetAccumulatorNodeByNodeHash {
pub node_hash: HashValue,
pub accumulator_storage_type: AccumulatorStoreType,
Expand Down
2 changes: 1 addition & 1 deletion network-rpc/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub enum RpcErrorCode {
Unknown = 1000,
}

#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct NetRpcError {
error_code: u32,
Expand Down
2 changes: 1 addition & 1 deletion network/api/src/peer_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl From<(PeerInfo, u64)> for PeerDetail {
}
}

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)]
pub enum PeerStrategy {
Random,
WeightedRandom,
Expand Down
3 changes: 1 addition & 2 deletions node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ impl ServiceHandler<Self, NodeRequest> for NodeService {
let connect_service = ctx.service_ref::<BlockConnectorService>()?.clone();
let fut = async move {
info!("Prepare to reset node startup info to {}", block_hash);
let result = connect_service.send(ResetRequest { block_hash }).await?;
result
connect_service.send(ResetRequest { block_hash }).await?
};
let receiver = ctx.exec(fut);
NodeResponse::AsyncResult(receiver)
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.62.0
1.63.0
10 changes: 5 additions & 5 deletions stratum/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ pub struct SubmitResult {
pub result: Status,
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
pub struct KeepalivedResult {
pub result: Status,
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
pub struct Status {
pub status: String,
}
Expand Down Expand Up @@ -145,7 +145,7 @@ impl StratumRpcImpl {
}
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct LoginRequest {
pub login: String,
pub pass: String,
Expand Down Expand Up @@ -174,7 +174,7 @@ impl LoginRequest {
}
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct StratumJobResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub login: Option<LoginRequest>,
Expand All @@ -183,7 +183,7 @@ pub struct StratumJobResponse {
pub job: StratumJob,
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct StratumJob {
pub height: u64,
pub id: String,
Expand Down
2 changes: 1 addition & 1 deletion txpool/src/pool/local_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use tx_pool::{self, VerifiedTransaction};
/// Status of local transaction.
/// Can indicate that the transaction is currently part of the queue (`Pending/Future`)
/// or gives a reason why the transaction was removed.
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Status {
/// The transaction is currently in the transaction queue.
Pending(Arc<Transaction>),
Expand Down
2 changes: 1 addition & 1 deletion txpool/src/pool/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::sync::{atomic::AtomicUsize, Arc};
use types::transaction;

/// Verification options.
#[derive(Debug, Clone, PartialEq, Default)]
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct Options {
/// Skip checks for early rejection, to make sure that local transactions are always imported.
pub no_early_reject: bool,
Expand Down
2 changes: 1 addition & 1 deletion types/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::contract_event::ContractEvent;
use crate::event::EventKey;
use crate::language_storage::TypeTag;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Filter {
/// Blockchain will be searched from this block.
pub from_block: BlockNumber,
Expand Down
2 changes: 1 addition & 1 deletion vm/move-prover/tests/testsuite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fn test_runner_for_feature(path: &Path, feature: &Feature) -> datatest_stable::R
Err(err) => format!("Move prover returns: {}\n", err),
};
if baseline_valid {
diags += &String::from_utf8_lossy(&error_writer.into_inner()).to_string();
diags += &String::from_utf8_lossy(&error_writer.into_inner());
if let Some(ref path) = baseline_path {
verify_or_update_baseline(path.as_path(), &diags)?
} else if !diags.is_empty() {
Expand Down
Loading

0 comments on commit 5ad8a48

Please sign in to comment.