mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +00:00
Update to 2024 edition (#2001)
* Update to 2024 edition * Update to 2024 edition; fmt, use<> and remove refs * async functions
This commit is contained in:
@@ -65,7 +65,7 @@ impl DeriveJunction {
|
||||
/// Get a reference to the inner junction id.
|
||||
pub fn inner(&self) -> &[u8; JUNCTION_ID_LEN] {
|
||||
match self {
|
||||
DeriveJunction::Hard(ref c) | DeriveJunction::Soft(ref c) => c,
|
||||
DeriveJunction::Hard(c) | DeriveJunction::Soft(c) => c,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,10 +97,6 @@ impl<T: AsRef<str>> From<T> for DeriveJunction {
|
||||
DeriveJunction::soft(code)
|
||||
};
|
||||
|
||||
if hard {
|
||||
res.harden()
|
||||
} else {
|
||||
res
|
||||
}
|
||||
if hard { res.harden() } else { res }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ mod secret_uri;
|
||||
mod seed_from_entropy;
|
||||
|
||||
pub use derive_junction::DeriveJunction;
|
||||
pub use secret_uri::{SecretUri, SecretUriError, DEV_PHRASE};
|
||||
pub use secret_uri::{DEV_PHRASE, SecretUri, SecretUriError};
|
||||
|
||||
#[cfg(any(feature = "sr25519", feature = "ecdsa"))]
|
||||
pub use seed_from_entropy::seed_from_entropy;
|
||||
|
||||
+2
-2
@@ -5,10 +5,10 @@
|
||||
//! An ecdsa keypair implementation.
|
||||
use codec::Encode;
|
||||
|
||||
use crate::crypto::{seed_from_entropy, DeriveJunction, SecretUri};
|
||||
use crate::crypto::{DeriveJunction, SecretUri, seed_from_entropy};
|
||||
use core::str::FromStr;
|
||||
use hex::FromHex;
|
||||
use secp256k1::{ecdsa::RecoverableSignature, Message, Secp256k1, SecretKey};
|
||||
use secp256k1::{Message, Secp256k1, SecretKey, ecdsa::RecoverableSignature};
|
||||
use secrecy::ExposeSecret;
|
||||
|
||||
use thiserror::Error as DeriveError;
|
||||
|
||||
+3
-3
@@ -105,7 +105,7 @@ impl Keypair {
|
||||
|
||||
/// Obtain the [`eth::PublicKey`] of this keypair.
|
||||
pub fn public_key(&self) -> PublicKey {
|
||||
let uncompressed = self.0 .0.public_key().serialize_uncompressed();
|
||||
let uncompressed = self.0.0.public_key().serialize_uncompressed();
|
||||
PublicKey(uncompressed)
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ mod test {
|
||||
|
||||
for (case_idx, (keypair, exp_account_id, exp_priv_key)) in cases.into_iter().enumerate() {
|
||||
let act_account_id = keypair.public_key().to_account_id().checksum();
|
||||
let act_priv_key = format!("0x{}", &keypair.0 .0.display_secret());
|
||||
let act_priv_key = format!("0x{}", &keypair.0.0.display_secret());
|
||||
|
||||
assert_eq!(
|
||||
exp_account_id, act_account_id,
|
||||
@@ -563,7 +563,7 @@ mod test {
|
||||
(
|
||||
"void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold",
|
||||
"01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998",
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
for (idx, (m, s)) in mnemonics_and_seeds.into_iter().enumerate() {
|
||||
|
||||
+1
-1
@@ -52,4 +52,4 @@ pub use secrecy::{ExposeSecret, SecretString};
|
||||
|
||||
// SecretUri's can be parsed from strings and used to generate key pairs.
|
||||
// DeriveJunctions are the "path" part of these SecretUris.
|
||||
pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE};
|
||||
pub use crypto::{DEV_PHRASE, DeriveJunction, SecretUri, SecretUriError};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
use base64::Engine;
|
||||
use crypto_secretbox::{
|
||||
aead::{Aead, KeyInit},
|
||||
Key, Nonce, XSalsa20Poly1305,
|
||||
aead::{Aead, KeyInit},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use subxt_core::utils::AccountId32;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
use core::str::FromStr;
|
||||
|
||||
use crate::crypto::{seed_from_entropy, DeriveJunction, SecretUri};
|
||||
use crate::crypto::{DeriveJunction, SecretUri, seed_from_entropy};
|
||||
|
||||
use hex::FromHex;
|
||||
use schnorrkel::{
|
||||
derive::{ChainCode, Derivation},
|
||||
ExpansionMode, MiniSecretKey,
|
||||
derive::{ChainCode, Derivation},
|
||||
};
|
||||
use secrecy::ExposeSecret;
|
||||
|
||||
@@ -292,9 +292,9 @@ mod subxt_compat {
|
||||
use super::*;
|
||||
|
||||
use subxt_core::{
|
||||
Config,
|
||||
tx::signer::Signer as SignerT,
|
||||
utils::{AccountId32, MultiAddress, MultiSignature},
|
||||
Config,
|
||||
};
|
||||
|
||||
impl From<Signature> for MultiSignature {
|
||||
|
||||
Reference in New Issue
Block a user