fix: Add workspace dependencies for vendored pezkuwi-subxt and zombienet-sdk
- Add all missing workspace dependencies required by vendor crates - Include external crates: scale-*, sp-core, sc-chain-spec, kube, etc. - Include subxt dependencies: smoldot, web-time, wasm-bindgen, etc. - Regenerate umbrella crate with updated dependencies - Apply zepter std feature propagation fixes to vendor crates - Apply rustfmt formatting to vendor and pezframe files
This commit is contained in:
+10
@@ -29,6 +29,16 @@ std = [
|
||||
"serde?/std",
|
||||
"serde_json?/std",
|
||||
"sha2/std",
|
||||
"bip32?/std",
|
||||
"getrandom?/std",
|
||||
"hex/std",
|
||||
"keccak-hash?/std",
|
||||
"codec/std",
|
||||
"pezkuwi-subxt-core?/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-crypto-hashing/std",
|
||||
"pezsp-keyring/std",
|
||||
"zeroize/std"
|
||||
]
|
||||
|
||||
# Pick the signer implementation(s) you need by enabling the
|
||||
|
||||
@@ -94,6 +94,10 @@ impl<T: AsRef<str>> From<T> for DeriveJunction {
|
||||
DeriveJunction::soft(code)
|
||||
};
|
||||
|
||||
if hard { res.harden() } else { res }
|
||||
if hard {
|
||||
res.harden()
|
||||
} else {
|
||||
res
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ mod secret_uri;
|
||||
mod seed_from_entropy;
|
||||
|
||||
pub use derive_junction::DeriveJunction;
|
||||
pub use secret_uri::{DEV_PHRASE, SecretUri, SecretUriError};
|
||||
pub use secret_uri::{SecretUri, SecretUriError, DEV_PHRASE};
|
||||
|
||||
#[cfg(any(feature = "sr25519", feature = "ecdsa"))]
|
||||
pub use seed_from_entropy::seed_from_entropy;
|
||||
|
||||
+5
-4
@@ -5,10 +5,10 @@
|
||||
//! An ecdsa keypair implementation.
|
||||
use codec::Encode;
|
||||
|
||||
use crate::crypto::{DeriveJunction, SecretUri, seed_from_entropy};
|
||||
use crate::crypto::{seed_from_entropy, DeriveJunction, SecretUri};
|
||||
use core::str::FromStr;
|
||||
use hex::FromHex;
|
||||
use secp256k1::{Message, Secp256k1, SecretKey, ecdsa::RecoverableSignature};
|
||||
use secp256k1::{ecdsa::RecoverableSignature, Message, Secp256k1, SecretKey};
|
||||
use secrecy::ExposeSecret;
|
||||
|
||||
use thiserror::Error as DeriveError;
|
||||
@@ -135,9 +135,10 @@ impl Keypair {
|
||||
for junction in junctions {
|
||||
match junction {
|
||||
DeriveJunction::Soft(_) => return Err(Error::SoftJunction),
|
||||
DeriveJunction::Hard(junction_bytes) =>
|
||||
DeriveJunction::Hard(junction_bytes) => {
|
||||
acc = ("Secp256k1HDKD", acc, junction_bytes)
|
||||
.using_encoded(pezsp_crypto_hashing::blake2_256),
|
||||
.using_encoded(pezsp_crypto_hashing::blake2_256)
|
||||
},
|
||||
}
|
||||
}
|
||||
Self::from_secret_key(acc)
|
||||
|
||||
+2
-2
@@ -106,7 +106,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)
|
||||
}
|
||||
|
||||
@@ -576,7 +576,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, "account ID mismatch in {case_idx}");
|
||||
assert_eq!(exp_priv_key, act_priv_key, "private key mismatch in {case_idx}");
|
||||
|
||||
+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::{DEV_PHRASE, DeriveJunction, SecretUri, SecretUriError};
|
||||
pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE};
|
||||
|
||||
+10
-10
@@ -6,8 +6,8 @@
|
||||
|
||||
use base64::Engine;
|
||||
use crypto_secretbox::{
|
||||
Key, Nonce, XSalsa20Poly1305,
|
||||
aead::{Aead, KeyInit},
|
||||
Key, Nonce, XSalsa20Poly1305,
|
||||
};
|
||||
use pezkuwi_subxt_core::utils::AccountId32;
|
||||
use serde::Deserialize;
|
||||
@@ -86,11 +86,11 @@ impl KeyringPairJson {
|
||||
fn decrypt(self, password: &str) -> Result<sr25519::Keypair, Error> {
|
||||
// Check encoding.
|
||||
// https://github.com/pezkuwi-js/common/blob/37fa211fdb141d4f6eb32e8f377a4651ed2d9068/packages/keyring/src/keyring.ts#L166
|
||||
if self.encoding.version != "3" ||
|
||||
!self.encoding.content.contains(&"pkcs8".to_owned()) ||
|
||||
!self.encoding.content.contains(&"sr25519".to_owned()) ||
|
||||
!self.encoding.r#type.contains(&"scrypt".to_owned()) ||
|
||||
!self.encoding.r#type.contains(&"xsalsa20-poly1305".to_owned())
|
||||
if self.encoding.version != "3"
|
||||
|| !self.encoding.content.contains(&"pkcs8".to_owned())
|
||||
|| !self.encoding.content.contains(&"sr25519".to_owned())
|
||||
|| !self.encoding.r#type.contains(&"scrypt".to_owned())
|
||||
|| !self.encoding.r#type.contains(&"xsalsa20-poly1305".to_owned())
|
||||
{
|
||||
return Err(Error::UnsupportedEncoding);
|
||||
}
|
||||
@@ -139,8 +139,8 @@ impl KeyringPairJson {
|
||||
let div = &plaintext[80..85];
|
||||
let public_key = &plaintext[85..117];
|
||||
|
||||
if header != [48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32] ||
|
||||
div != [161, 35, 3, 33, 0]
|
||||
if header != [48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32]
|
||||
|| div != [161, 35, 3, 33, 0]
|
||||
{
|
||||
return Err(Error::InvalidKeys);
|
||||
}
|
||||
@@ -149,8 +149,8 @@ impl KeyringPairJson {
|
||||
let keypair = sr25519::Keypair::from_ed25519_bytes(secret_key)?;
|
||||
|
||||
// Ensure keys are correct.
|
||||
if keypair.public_key().0 != public_key ||
|
||||
keypair.public_key().to_account_id() != self.address
|
||||
if keypair.public_key().0 != public_key
|
||||
|| keypair.public_key().to_account_id() != self.address
|
||||
{
|
||||
return Err(Error::InvalidKeys);
|
||||
}
|
||||
|
||||
+3
-3
@@ -10,12 +10,12 @@
|
||||
|
||||
use core::str::FromStr;
|
||||
|
||||
use crate::crypto::{DeriveJunction, SecretUri, seed_from_entropy};
|
||||
use crate::crypto::{seed_from_entropy, DeriveJunction, SecretUri};
|
||||
|
||||
use hex::FromHex;
|
||||
use schnorrkel::{
|
||||
ExpansionMode, MiniSecretKey,
|
||||
derive::{ChainCode, Derivation},
|
||||
ExpansionMode, MiniSecretKey,
|
||||
};
|
||||
use secrecy::ExposeSecret;
|
||||
|
||||
@@ -283,9 +283,9 @@ mod subxt_compat {
|
||||
use super::*;
|
||||
|
||||
use pezkuwi_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