Update rust edition to 2021 (#749)

* build: update rust edition 2021

* cargo: format all

* build: fix tests and warnings
This commit is contained in:
ardocrat
2026-05-14 13:58:22 +03:00
committed by GitHub
parent a3e71a8b2d
commit 602d79e868
17 changed files with 25 additions and 18 deletions
Generated
-1
View File
@@ -1485,7 +1485,6 @@ dependencies = [
"grin_core",
"grin_util",
"grin_wallet_util",
"log",
"pretty_assertions",
"rand 0.6.5",
"serde",
+1 -1
View File
@@ -9,7 +9,7 @@ keywords = [ "crypto", "grin", "mimblewimble" ]
readme = "README.md"
exclude = ["**/*.grin", "**/*.grin2"]
build = "src/build/build.rs"
edition = "2018"
edition = "2021"
[[bin]]
name = "grin-wallet"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
exclude = ["**/*.grin", "**/*.grin2"]
edition = "2018"
edition = "2021"
[dependencies]
log = "0.4"
+2 -2
View File
@@ -147,7 +147,7 @@ where
/// // These traits can be replaced with alternative implementations if desired
///
/// let mut wallet = Box::new(DefaultWalletImpl::<'static, HTTPNodeClient>::new(node_client.clone()).unwrap())
/// as Box<WalletInst<'static, DefaultLCProvider<HTTPNodeClient, ExtKeychain>, HTTPNodeClient, ExtKeychain>>;
/// as Box<dyn WalletInst<'static, DefaultLCProvider<HTTPNodeClient, ExtKeychain>, HTTPNodeClient, ExtKeychain>>;
///
/// // Wallet LifeCycle Provider provides all functions init wallet and work with seeds, etc...
/// let lc = wallet.lc_provider().unwrap();
@@ -500,7 +500,7 @@ macro_rules! doctest_helper_setup_doc_env_foreign {
DefaultWalletImpl::<'static, HTTPNodeClient>::new(node_client.clone()).unwrap(),
)
as Box<
WalletInst<
dyn WalletInst<
'static,
DefaultLCProvider<HTTPNodeClient, ExtKeychain>,
HTTPNodeClient,
+2 -2
View File
@@ -152,7 +152,7 @@ where
/// // These traits can be replaced with alternative implementations if desired
///
/// let mut wallet = Box::new(DefaultWalletImpl::<'static, HTTPNodeClient>::new(node_client.clone()).unwrap())
/// as Box<WalletInst<'static, DefaultLCProvider<HTTPNodeClient, ExtKeychain>, HTTPNodeClient, ExtKeychain>>;
/// as Box<dyn WalletInst<'static, DefaultLCProvider<HTTPNodeClient, ExtKeychain>, HTTPNodeClient, ExtKeychain>>;
///
/// // Wallet LifeCycle Provider provides all functions init wallet and work with seeds, etc...
/// let lc = wallet.lc_provider().unwrap();
@@ -2628,7 +2628,7 @@ macro_rules! doctest_helper_setup_doc_env {
DefaultWalletImpl::<'static, HTTPNodeClient>::new(node_client.clone()).unwrap(),
)
as Box<
WalletInst<
dyn WalletInst<
'static,
DefaultLCProvider<HTTPNodeClient, ExtKeychain>,
HTTPNodeClient,
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
rand = "0.6"
+1 -1
View File
@@ -476,4 +476,4 @@ impl GlobalWalletConfig {
.replace("WARN", "Warning")
.replace("ERROR", "Error")
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
exclude = ["**/*.grin", "**/*.grin2"]
#build = "src/build/build.rs"
edition = "2018"
edition = "2021"
[dependencies]
futures = "0.3"
+1 -1
View File
@@ -82,7 +82,7 @@ where
C: NodeClient + 'static,
K: keychain::Keychain + 'static,
{
// Assume global chain type has already been initialized.
// Assume global chain type has already been initialized.
let chain_type = global::get_chain_type();
let mut w_lock = owner_api.wallet_inst.lock();
+6 -2
View File
@@ -96,8 +96,12 @@ pub fn setup_global_chain_type() {
pub fn create_wallet_proxy(
test_dir: &str,
) -> WalletProxy<DefaultLCProvider<LocalWalletClient, ExtKeychain>, LocalWalletClient, ExtKeychain>
{
) -> WalletProxy<
'_,
DefaultLCProvider<'_, LocalWalletClient, ExtKeychain>,
LocalWalletClient,
ExtKeychain,
> {
WalletProxy::new(test_dir)
}
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
exclude = ["**/*.grin", "**/*.grin2"]
edition = "2018"
edition = "2021"
[dependencies]
blake2-rfc = "0.2"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
hyper = "0.12"
+1 -1
View File
@@ -8,7 +8,7 @@ repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
exclude = ["**/*.grin", "**/*.grin2"]
#build = "src/build/build.rs"
edition = "2018"
edition = "2021"
[dependencies]
blake2-rfc = "0.2"
@@ -117,11 +117,13 @@ impl Writeable for DalekPublicKey {
}
/// Encapsulates an ed25519_dalek::Signature and provides (de-)serialization
#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq)]
pub struct DalekSignature(Signature);
impl DalekSignature {
/// Convert hex string to DalekSignature.
#[allow(dead_code)]
pub fn from_hex(hex: &str) -> Result<Self, DalekError> {
let bytes = grin_util::from_hex(hex)
.map_err(|_| DalekError::HexError(format!("failed to decode {}", hex)))?;
@@ -131,6 +133,7 @@ impl DalekSignature {
}
/// Verifies DalekSignature
#[allow(dead_code)]
pub fn verify(&self, pk: &DalekPublicKey, msg: &[u8]) -> Result<(), DalekError> {
pk.as_ref()
.verify(&msg, &self.0)
+1 -1
View File
@@ -1,2 +1,2 @@
hard_tabs = true
edition = "2018"
edition = "2021"
+1
View File
@@ -494,4 +494,5 @@ impl From<grin_wallet_controller::Error> for WalletAPIReturnError {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[allow(dead_code)]
pub struct RetrieveSummaryInfoResp(pub bool, pub WalletInfo);
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
rand = "0.6"