mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
chore: rename sp-core-hashing to sp-crypto-hashing (#1490)
* rename sp-core-hashing to sp-crypto-hashing * fmt
This commit is contained in:
@@ -5,12 +5,12 @@ updates:
|
||||
schedule:
|
||||
interval: weekly
|
||||
ignore:
|
||||
# these need to be updated together, so dependabot PRs
|
||||
# these need to be updated together, so dependabot PRs
|
||||
# are just noise. So, ignore them:
|
||||
- dependency-name: sp-core
|
||||
- dependency-name: sp-keyring
|
||||
- dependency-name: sp-runtime
|
||||
- dependency-name: sp-core-hashing
|
||||
- dependency-name: sp-crypto-hashing
|
||||
- dependency-name: sp-version
|
||||
- package-ecosystem: github-actions
|
||||
directory: '/'
|
||||
|
||||
Generated
+17
-3
@@ -4150,6 +4150,20 @@ dependencies = [
|
||||
"twox-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-crypto-hashing"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb"
|
||||
dependencies = [
|
||||
"blake2b_simd",
|
||||
"byteorder",
|
||||
"digest 0.10.7",
|
||||
"sha2 0.10.8",
|
||||
"sha3",
|
||||
"twox-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-debug-derive"
|
||||
version = "14.0.0"
|
||||
@@ -4539,7 +4553,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sp-core",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"sp-keyring",
|
||||
"sp-runtime",
|
||||
"subxt-lightclient",
|
||||
@@ -4653,7 +4667,7 @@ dependencies = [
|
||||
"hashbrown 0.14.3",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4674,7 +4688,7 @@ dependencies = [
|
||||
"secrecy",
|
||||
"sha2 0.10.8",
|
||||
"sp-core",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"sp-keyring",
|
||||
"subxt",
|
||||
"zeroize",
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ tokio-util = "0.7.10"
|
||||
|
||||
# Substrate crates:
|
||||
sp-core = { version = "28.0.0", default-features = false }
|
||||
sp-core-hashing = { version = "15.0.0", default-features = false }
|
||||
sp-crypto-hashing = { version = "0.1.0", default-features = false }
|
||||
sp-runtime = "31.0.0"
|
||||
sp-keyring = "31.0.0"
|
||||
|
||||
|
||||
Generated
+4
-4
@@ -2512,7 +2512,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-core-hashing"
|
||||
name = "sp-crypto-hashing"
|
||||
version = "13.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2"
|
||||
@@ -2573,7 +2573,7 @@ dependencies = [
|
||||
"scale-value",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"subxt-lightclient",
|
||||
"subxt-macro",
|
||||
"subxt-metadata",
|
||||
@@ -2637,7 +2637,7 @@ dependencies = [
|
||||
"frame-metadata 16.0.0",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
@@ -2655,7 +2655,7 @@ dependencies = [
|
||||
"secp256k1",
|
||||
"secrecy",
|
||||
"sha2 0.10.8",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"subxt",
|
||||
"thiserror",
|
||||
"zeroize",
|
||||
|
||||
Generated
+3
-3
@@ -2460,7 +2460,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-core-hashing"
|
||||
name = "sp-crypto-hashing"
|
||||
version = "15.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0"
|
||||
@@ -2522,7 +2522,7 @@ dependencies = [
|
||||
"scale-value",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"subxt-lightclient",
|
||||
"subxt-macro",
|
||||
"subxt-metadata",
|
||||
@@ -2598,7 +2598,7 @@ dependencies = [
|
||||
"hashbrown 0.14.3",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ std = ["scale-info/std", "frame-metadata/std"]
|
||||
scale-info = { workspace = true, default-features = false }
|
||||
frame-metadata = { workspace = true, default-features = false, features = ["current", "decode"] }
|
||||
codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] }
|
||||
sp-core-hashing = { workspace = true }
|
||||
sp-crypto-hashing = { workspace = true }
|
||||
hashbrown = { workspace = true }
|
||||
derive_more = { workspace = true }
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ enum TypeBeingHashed {
|
||||
|
||||
/// Hashing function utilized internally.
|
||||
fn hash(data: &[u8]) -> Hash {
|
||||
sp_core_hashing::twox_256(data)
|
||||
sp_crypto_hashing::twox_256(data)
|
||||
}
|
||||
|
||||
/// XOR two hashes together. Only use this when you don't care about the order
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ keywords = ["parity", "subxt", "extrinsic", "signer"]
|
||||
|
||||
[features]
|
||||
default = ["sr25519", "ecdsa", "subxt", "std", "native"]
|
||||
std = ["regex/std", "sp-core-hashing/std", "pbkdf2/std", "sha2/std", "hmac/std", "bip39/std", "schnorrkel/std", "secp256k1/std", "sp-core/std"]
|
||||
std = ["regex/std", "sp-crypto-hashing/std", "pbkdf2/std", "sha2/std", "hmac/std", "bip39/std", "schnorrkel/std", "secp256k1/std", "sp-core/std"]
|
||||
|
||||
# Pick the signer implementation(s) you need by enabling the
|
||||
# corresponding features. Note: I had more difficulties getting
|
||||
@@ -40,7 +40,7 @@ regex = { workspace = true, features = ["unicode"] }
|
||||
hex = { workspace = true }
|
||||
cfg-if = { workspace = true }
|
||||
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
|
||||
sp-core-hashing = { workspace = true }
|
||||
sp-crypto-hashing = { workspace = true }
|
||||
derive_more = { workspace = true }
|
||||
pbkdf2 = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
|
||||
@@ -40,7 +40,7 @@ impl DeriveJunction {
|
||||
let mut cc: [u8; JUNCTION_ID_LEN] = Default::default();
|
||||
index.using_encoded(|data| {
|
||||
if data.len() > JUNCTION_ID_LEN {
|
||||
cc.copy_from_slice(&sp_core_hashing::blake2_256(data));
|
||||
cc.copy_from_slice(&sp_crypto_hashing::blake2_256(data));
|
||||
} else {
|
||||
cc[0..data.len()].copy_from_slice(data);
|
||||
}
|
||||
|
||||
+4
-4
@@ -144,7 +144,7 @@ impl Keypair {
|
||||
DeriveJunction::Soft(_) => return Err(Error::SoftJunction),
|
||||
DeriveJunction::Hard(junction_bytes) => {
|
||||
acc = ("Secp256k1HDKD", acc, junction_bytes)
|
||||
.using_encoded(sp_core_hashing::blake2_256)
|
||||
.using_encoded(sp_crypto_hashing::blake2_256)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ impl Keypair {
|
||||
/// Sign some message. These bytes can be used directly in a Substrate `MultiSignature::Ecdsa(..)`.
|
||||
pub fn sign(&self, message: &[u8]) -> Signature {
|
||||
// From sp_core::ecdsa::sign:
|
||||
let message_hash = sp_core_hashing::blake2_256(message);
|
||||
let message_hash = sp_crypto_hashing::blake2_256(message);
|
||||
// From sp_core::ecdsa::sign_prehashed:
|
||||
let wrapped = Message::from_digest_slice(&message_hash).expect("Message is 32 bytes; qed");
|
||||
let recsig: RecoverableSignature =
|
||||
@@ -194,7 +194,7 @@ pub fn verify<M: AsRef<[u8]>>(sig: &Signature, message: M, pubkey: &PublicKey) -
|
||||
let Ok(public) = secp256k1::PublicKey::from_slice(&pubkey.0) else {
|
||||
return false;
|
||||
};
|
||||
let message_hash = sp_core_hashing::blake2_256(message.as_ref());
|
||||
let message_hash = sp_crypto_hashing::blake2_256(message.as_ref());
|
||||
let wrapped = Message::from_digest_slice(&message_hash).expect("Message is 32 bytes; qed");
|
||||
|
||||
Secp256k1::verification_only()
|
||||
@@ -299,7 +299,7 @@ mod subxt_compat {
|
||||
/// We often want this type, and using this method avoids any
|
||||
/// ambiguous type resolution issues.
|
||||
pub fn to_account_id(self) -> AccountId32 {
|
||||
AccountId32(sp_core_hashing::blake2_256(&self.0))
|
||||
AccountId32(sp_crypto_hashing::blake2_256(&self.0))
|
||||
}
|
||||
/// A shortcut to obtain a [`MultiAddress`] from a [`PublicKey`].
|
||||
/// We often want this type, and using this method avoids any
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ instant = { workspace = true }
|
||||
# Provides some deserialization, types like U256/H256 and hashing impls like twox/blake256:
|
||||
impl-serde = { workspace = true }
|
||||
primitive-types = { workspace = true, features = ["codec", "scale-info", "serde"] }
|
||||
sp-core-hashing = { workspace = true }
|
||||
sp-crypto-hashing = { workspace = true }
|
||||
|
||||
# For ss58 encoding AccountId32 to serialize them properly:
|
||||
base58 = { workspace = true }
|
||||
|
||||
@@ -42,7 +42,7 @@ pub struct BlakeTwo256;
|
||||
impl Hasher for BlakeTwo256 {
|
||||
type Output = H256;
|
||||
fn hash(s: &[u8]) -> Self::Output {
|
||||
sp_core_hashing::blake2_256(s).into()
|
||||
sp_crypto_hashing::blake2_256(s).into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ where
|
||||
|
||||
// The storage key needed to access events.
|
||||
fn system_events_key() -> [u8; 32] {
|
||||
let a = sp_core_hashing::twox_128(b"System");
|
||||
let b = sp_core_hashing::twox_128(b"Events");
|
||||
let a = sp_crypto_hashing::twox_128(b"System");
|
||||
let b = sp_crypto_hashing::twox_128(b"Events");
|
||||
let mut res = [0; 32];
|
||||
res[0..16].clone_from_slice(&a);
|
||||
res[16..32].clone_from_slice(&b);
|
||||
|
||||
@@ -287,8 +287,10 @@ where
|
||||
// construct the storage key. This is done similarly in `frame_support::traits::metadata::StorageVersion::storage_key()`.
|
||||
pub const STORAGE_VERSION_STORAGE_KEY_POSTFIX: &[u8] = b":__STORAGE_VERSION__:";
|
||||
let mut key_bytes: Vec<u8> = vec![];
|
||||
key_bytes.extend(&sp_core_hashing::twox_128(pallet_name.as_ref().as_bytes()));
|
||||
key_bytes.extend(&sp_core_hashing::twox_128(
|
||||
key_bytes.extend(&sp_crypto_hashing::twox_128(
|
||||
pallet_name.as_ref().as_bytes(),
|
||||
));
|
||||
key_bytes.extend(&sp_crypto_hashing::twox_128(
|
||||
STORAGE_VERSION_STORAGE_KEY_POSTFIX,
|
||||
));
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ pub fn write_storage_address_root_bytes<Address: StorageAddress>(
|
||||
addr: &Address,
|
||||
out: &mut Vec<u8>,
|
||||
) {
|
||||
out.extend(sp_core_hashing::twox_128(addr.pallet_name().as_bytes()));
|
||||
out.extend(sp_core_hashing::twox_128(addr.entry_name().as_bytes()));
|
||||
out.extend(sp_crypto_hashing::twox_128(addr.pallet_name().as_bytes()));
|
||||
out.extend(sp_crypto_hashing::twox_128(addr.entry_name().as_bytes()));
|
||||
}
|
||||
|
||||
/// Outputs the [`storage_address_root_bytes`] as well as any additional bytes that represent
|
||||
@@ -44,16 +44,16 @@ pub fn storage_address_root_bytes<Address: StorageAddress>(addr: &Address) -> Ve
|
||||
pub fn hash_bytes(input: &[u8], hasher: StorageHasher, bytes: &mut Vec<u8>) {
|
||||
match hasher {
|
||||
StorageHasher::Identity => bytes.extend(input),
|
||||
StorageHasher::Blake2_128 => bytes.extend(sp_core_hashing::blake2_128(input)),
|
||||
StorageHasher::Blake2_128 => bytes.extend(sp_crypto_hashing::blake2_128(input)),
|
||||
StorageHasher::Blake2_128Concat => {
|
||||
bytes.extend(sp_core_hashing::blake2_128(input));
|
||||
bytes.extend(sp_crypto_hashing::blake2_128(input));
|
||||
bytes.extend(input);
|
||||
}
|
||||
StorageHasher::Blake2_256 => bytes.extend(sp_core_hashing::blake2_256(input)),
|
||||
StorageHasher::Twox128 => bytes.extend(sp_core_hashing::twox_128(input)),
|
||||
StorageHasher::Twox256 => bytes.extend(sp_core_hashing::twox_256(input)),
|
||||
StorageHasher::Blake2_256 => bytes.extend(sp_crypto_hashing::blake2_256(input)),
|
||||
StorageHasher::Twox128 => bytes.extend(sp_crypto_hashing::twox_128(input)),
|
||||
StorageHasher::Twox256 => bytes.extend(sp_crypto_hashing::twox_256(input)),
|
||||
StorageHasher::Twox64Concat => {
|
||||
bytes.extend(sp_core_hashing::twox_64(input));
|
||||
bytes.extend(sp_crypto_hashing::twox_64(input));
|
||||
bytes.extend(input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::{
|
||||
};
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use derivative::Derivative;
|
||||
use sp_core_hashing::blake2_256;
|
||||
use sp_crypto_hashing::blake2_256;
|
||||
|
||||
/// A client for working with transactions.
|
||||
#[derive(Derivative)]
|
||||
|
||||
Generated
+3
-3
@@ -496,7 +496,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-core-hashing"
|
||||
name = "sp-crypto-hashing"
|
||||
version = "15.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0"
|
||||
@@ -540,7 +540,7 @@ dependencies = [
|
||||
"hashbrown",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -558,7 +558,7 @@ dependencies = [
|
||||
"schnorrkel",
|
||||
"secrecy",
|
||||
"sha2",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
|
||||
+3
-3
@@ -2272,7 +2272,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-core-hashing"
|
||||
name = "sp-crypto-hashing"
|
||||
version = "15.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0"
|
||||
@@ -2334,7 +2334,7 @@ dependencies = [
|
||||
"scale-value",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"subxt-lightclient",
|
||||
"subxt-macro",
|
||||
"subxt-metadata",
|
||||
@@ -2410,7 +2410,7 @@ dependencies = [
|
||||
"hashbrown",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Generated
+3
-3
@@ -2294,7 +2294,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sp-core-hashing"
|
||||
name = "sp-crypto-hashing"
|
||||
version = "13.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2"
|
||||
@@ -2362,7 +2362,7 @@ dependencies = [
|
||||
"scale-value",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"subxt-lightclient",
|
||||
"subxt-macro",
|
||||
"subxt-metadata",
|
||||
@@ -2434,7 +2434,7 @@ dependencies = [
|
||||
"frame-metadata 16.0.0",
|
||||
"parity-scale-codec",
|
||||
"scale-info",
|
||||
"sp-core-hashing",
|
||||
"sp-crypto-hashing",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user