Skip to content

Commit

Permalink
Bump rust version up to 1.43.0 (exonum#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Anyshchenko committed May 19, 2020
1 parent f8b6c32 commit fbc3d17
Show file tree
Hide file tree
Showing 158 changed files with 656 additions and 546 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ addons:
- zlib1g-dev

rust:
- 1.42.0
- 1.43.0

cache:
npm: true
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- npm run cspell
- npm run md
# Clippy lints.
- cargo clippy --all --tests --examples --benches --all-features
- cargo clippy --all-targets --all-features
# Other cargo lints.
- cargo fmt --all -- --check
- cargo clean --doc
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![Docs.rs](https://docs.rs/exonum/badge.svg)](https://docs.rs/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](LICENSE.md)
[![LoC](https://tokei.rs/b1/github/exonum/exonum)](https://github.com/exonum/exonum)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

**Community:**
[![Join the chat at https://gitter.im/exonum/exonum](https://img.shields.io/gitter/room/exonum/exonum.svg?label=Chat)](https://gitter.im/exonum/exonum)
Expand Down Expand Up @@ -91,7 +91,7 @@ versioning limitations.

## Supported Rust Versions

The Exonum crates are built against a specific stable Rust version (1.42.0).
The Exonum crates are built against a specific stable Rust version (1.43.0).
Newer stable versions are supported as a result. (Feel free to file an issue
if any Exonum crate does not build on a newer stable version.)
Newer beta and nightly versions *should* be supported as well,
Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

`exonum-cli` crate provides an extensible command line interface for Exonum
nodes.
Expand Down
3 changes: 1 addition & 2 deletions cli/src/command/generate_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ use anyhow::Error;
use exonum::blockchain::ConsensusConfig;
use exonum_supervisor::mode::Mode as SupervisorMode;
use serde_derive::{Deserialize, Serialize};
use structopt::StructOpt;

use std::path::PathBuf;
use structopt::StructOpt;

use crate::{
command::{ExonumCommand, StandardResult},
Expand Down
3 changes: 1 addition & 2 deletions cli/src/command/maintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ use exonum::merkledb::{migration::rollback_migration, Database, RocksDB};
use exonum::runtime::remove_local_migration_result;
use exonum_node::helpers::clear_consensus_messages_cache;
use serde_derive::{Deserialize, Serialize};
use structopt::StructOpt;

use std::path::{Path, PathBuf};
use structopt::StructOpt;

use crate::{
command::{ExonumCommand, StandardResult},
Expand Down
3 changes: 1 addition & 2 deletions cli/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
use anyhow::Error;
use exonum::keys::{read_keys_from_file, Keys};
use serde_derive::{Deserialize, Serialize};
use structopt::StructOpt;

use std::{
net::SocketAddr,
path::{Path, PathBuf},
};
use structopt::StructOpt;

use crate::{
command::{ExonumCommand, StandardResult},
Expand Down
3 changes: 1 addition & 2 deletions cli/src/command/run_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
use anyhow::{Context, Error};
use exonum_supervisor::mode::Mode as SupervisorMode;
use serde_derive::{Deserialize, Serialize};
use structopt::StructOpt;

use std::{fs, net::SocketAddr, path::PathBuf, str::FromStr};
use structopt::StructOpt;

use crate::command::{
finalize::Finalize,
Expand Down
1 change: 0 additions & 1 deletion cli/src/config_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use exonum_node::{ConfigManager, ConnectListConfig};
use log::error;

use std::{path::Path, sync::mpsc, thread};

use crate::{
Expand Down
1 change: 0 additions & 1 deletion cli/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use anyhow::{Context, Error};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

use std::{
fs::{self, File},
io::{Read, Write},
Expand Down
2 changes: 1 addition & 1 deletion components/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

`exonum-api` crate provides an extensible interface for building backend-agnostic
HTTP APIs.
Expand Down
1 change: 0 additions & 1 deletion components/api/src/cors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use anyhow::bail;
use serde::{de, ser};

use std::{fmt, str::FromStr};

/// CORS header specification.
Expand Down
3 changes: 1 addition & 2 deletions components/api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ pub use actix_web::http::{
HeaderMap, StatusCode as HttpStatusCode,
};
use serde::{Deserialize, Serialize};
use thiserror::Error;

use std::fmt;
use thiserror::Error;

/// API HTTP error struct.
#[derive(Error, Debug)]
Expand Down
1 change: 0 additions & 1 deletion components/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ mod manager;
mod with;

use serde::{de::DeserializeOwned, Serialize};

use std::{collections::BTreeMap, fmt, future::Future};

use crate::backends::actix;
Expand Down
2 changes: 1 addition & 1 deletion components/api/src/with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use chrono::{DateTime, Utc};

use std::{future::Future, marker::PhantomData};

use super::{error, EndpointMutability};
use crate::{error, EndpointMutability};

/// Type alias for the usual synchronous result.
pub type Result<I> = std::result::Result<I, error::Error>;
Expand Down
2 changes: 1 addition & 1 deletion components/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

This crate simplifies writing build scripts for Exonum and Exonum services.

Expand Down
5 changes: 2 additions & 3 deletions components/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@
use proc_macro2::{Ident, Span, TokenStream};
use protoc_rust::Customize;
use quote::{quote, ToTokens};
use walkdir::WalkDir;

use std::collections::HashSet;
use std::{
collections::HashSet,
env,
fs::File,
io::{Read, Write},
path::{Path, PathBuf},
};
use walkdir::WalkDir;

/// Enum representing various sources of Protobuf files.
#[derive(Debug, Copy, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion components/crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

`exonum-crypto` provides a high-level API for work with various cryptography tasks.

Expand Down
6 changes: 5 additions & 1 deletion components/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,11 @@ fn verify_keys_match(public_key: &PublicKey, secret_key: &SecretKey) -> bool {

#[cfg(test)]
mod tests {
use super::*;
use super::{
fmt, gen_keypair, hash, Hash, HashStream, KeyPair, PublicKey, SecretKey, Seed, Serialize,
SignStream, Signature, HASH_SIZE, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SEED_LENGTH,
SIGNATURE_LENGTH,
};

use hex::FromHex;
use serde::de::DeserializeOwned;
Expand Down
2 changes: 1 addition & 1 deletion components/derive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

This crate provides several procedural macros for Exonum core and Exonum services.

Expand Down
2 changes: 1 addition & 1 deletion components/derive/src/execution_fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use syn::{Attribute, Data, DeriveInput, Expr, Lit, Meta, MetaNameValue, Variant}

use std::convert::TryFrom;

use super::{find_meta_attrs, MainCratePath};
use crate::{find_meta_attrs, MainCratePath};

#[derive(Debug, FromMeta)]
#[darling(default)]
Expand Down
7 changes: 2 additions & 5 deletions components/derive/src/exonum_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ use darling::{self, FromMeta};
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::{quote, ToTokens};
use std::{collections::HashSet, convert::TryFrom, str::FromStr};
use syn::{
parse_macro_input, spanned::Spanned, Attribute, AttributeArgs, FnArg, Ident, ItemTrait, Lit,
NestedMeta, Receiver, ReturnType, TraitItem, TraitItemMethod, Type,
};

use std::collections::HashSet;
use std::convert::TryFrom;
use std::str::FromStr;

use super::{find_meta_attrs, RustRuntimeCratePath};
use crate::{find_meta_attrs, RustRuntimeCratePath};

#[derive(Debug)]
struct ServiceMethodDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion components/derive/src/service_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use syn::{DeriveInput, Generics, Ident, Lit, Meta, NestedMeta, Path};

use super::RustRuntimeCratePath;
use crate::RustRuntimeCratePath;

#[derive(Debug)]
struct ServiceInterface {
Expand Down
2 changes: 1 addition & 1 deletion components/derive/src/service_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use quote::{quote, ToTokens};
use semver::Version;
use syn::{DeriveInput, Generics, Ident, Path};

use super::RustRuntimeCratePath;
use crate::RustRuntimeCratePath;

fn is_allowed_artifact_name_char(c: u8) -> bool {
match c {
Expand Down
2 changes: 1 addition & 1 deletion components/explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

`exonum-explorer` provides explorer API
for the [Exonum blockchain framework](https://exonum.com/). For example,
Expand Down
4 changes: 3 additions & 1 deletion components/explorer/examples/explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ use serde_json::json;

use std::{collections::BTreeMap, iter};

use exonum_explorer::*;
use exonum_explorer::{
BlockInfo, BlockWithTransactions, BlockchainExplorer, CommittedTransaction, TransactionInfo,
};

#[path = "../tests/blockchain/mod.rs"]
mod blockchain;
Expand Down
1 change: 0 additions & 1 deletion components/explorer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use exonum::{
runtime::{AnyTx, CallInfo, ExecutionStatus, InstanceId},
};
use serde_derive::{Deserialize, Serialize};

use std::ops::Range;

use crate::median_precommits_time;
Expand Down
4 changes: 1 addition & 3 deletions components/explorer/src/api/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ use exonum::{
runtime::{ExecutionStatus, InstanceId, MethodId},
};
use serde_derive::{Deserialize, Serialize};

use std::fmt;

use super::TransactionHex;
use crate::median_precommits_time;
use crate::{api::TransactionHex, median_precommits_time};

/// Messages proactively sent by WebSocket clients to the server.
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions components/explorer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ use exonum::{
runtime::{ExecutionError, ExecutionStatus},
};
use serde::{Serialize, Serializer};
use serde_derive::*;

use serde_derive::Deserialize;
use std::{
cell::{Ref, RefCell},
collections::{BTreeMap, Bound},
Expand Down
7 changes: 4 additions & 3 deletions components/explorer/tests/explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ use exonum::{
messages::{AnyTx, Verified},
runtime::{ErrorKind, SnapshotExt},
};
use exonum_explorer::{
BlockInfo, BlockWithTransactions, BlockchainExplorer, CommittedTransaction, TransactionInfo,
};
use serde_json::json;

use std::iter;

use exonum_explorer::*;

mod blockchain;

use self::blockchain::{
create_block, create_blockchain, CreateWallet, ExplorerTransactions, Transfer, SERVICE_ID,
};
Expand Down
2 changes: 1 addition & 1 deletion components/keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/blob/master/LICENSE)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)

`exonum-keys` provides tools for storing and loading encrypted keys for
Exonum nodes.
Expand Down
4 changes: 2 additions & 2 deletions components/keys/examples/key_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use exonum_keys::*;
use hex;
use exonum_keys::generate_keys_from_seed;
use serde_json::json;
use structopt::StructOpt;

Expand Down Expand Up @@ -56,6 +55,7 @@ fn generate_json(passphrase: &str, seed: &str) -> anyhow::Result<serde_json::Val

#[test]
fn test_key_generator() {
use exonum_keys::read_keys_from_file;
#[cfg(unix)]
use std::os::unix::fs::OpenOptionsExt;
use std::{fs::OpenOptions, io::Write};
Expand Down
5 changes: 4 additions & 1 deletion components/keys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ pub fn read_keys_from_file<P: AsRef<Path>, W: AsRef<[u8]>>(

#[cfg(test)]
mod tests {
use super::*;
use super::{
generate_keys, read_keys_from_file, thread_rng, validate_file_mode, EncryptedMasterKey,
SecretTree,
};
use tempdir::TempDir;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion components/merkledb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Travis Build Status](https://img.shields.io/travis/exonum/exonum/master.svg?label=Linux%20Build)](https://travis-ci.com/exonum/exonum)
[![Docs.rs](https://docs.rs/exonum-merkledb/badge.svg)](https://docs.rs/exonum-merkledb)
![rust 1.42.0+ required](https://img.shields.io/badge/rust-1.42.0+-blue.svg?label=Required%20Rust)
![rust 1.43.0+ required](https://img.shields.io/badge/rust-1.43.0+-blue.svg?label=Required%20Rust)
[![License: Apache-2.0](https://img.shields.io/github/license/exonum/exonum.svg)](https://github.com/exonum/exonum/components/merkledb/blob/master/LICENSE)

**MerkleDB** is a document-oriented persistent storage
Expand Down
2 changes: 1 addition & 1 deletion components/merkledb/examples/manual_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
use exonum_merkledb::{
access::Prefixed, migration::Migration, Database, Fork, ObjectHash, ReadonlyFork,
};

use std::sync::Arc;

mod migration;

use crate::migration::{perform_migration, v1, v2};

/// Provides migration of wallets with schema.
Expand Down
Loading

0 comments on commit fbc3d17

Please sign in to comment.