Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cryptographic hashing procedures to crypto folder. #2306

Merged
merged 18 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 60 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ members = [
"substrate/client/transaction-pool",
"substrate/client/transaction-pool/api",
"substrate/client/utils",
"substrate/deprecated/hashing",
"substrate/deprecated/hashing/proc-macro",
"substrate/frame",
"substrate/frame/alliance",
"substrate/frame/asset-conversion",
Expand Down Expand Up @@ -432,9 +434,9 @@ members = [
"substrate/primitives/consensus/slots",
"substrate/primitives/core",
"substrate/primitives/core/fuzz",
"substrate/primitives/core/hashing",
"substrate/primitives/core/hashing/proc-macro",
"substrate/primitives/crypto/ec-utils",
"substrate/primitives/crypto/hashing",
"substrate/primitives/crypto/hashing/proc-macro",
"substrate/primitives/database",
"substrate/primitives/debug-derive",
"substrate/primitives/externalities",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ hex-literal = { version = "0.4.1" }
env_logger = "0.9"
hex = "0.4"
array-bytes = "4.1"
sp-crypto-hashing = { path = "../../../../../../substrate/primitives/crypto/hashing" }

[features]
default = ["std"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ where
mod tests {
use super::*;
use hex_literal::hex;
use sp_core::keccak_256;
use sp_crypto_hashing::keccak_256;
use sp_runtime::traits::Keccak256;

fn make_leaves(count: u64) -> Vec<H256> {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/parachain-inherent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tracing = { version = "0.1.37" }
# Substrate
sc-client-api = { path = "../../../substrate/client/api" }
sp-api = { path = "../../../substrate/primitives/api" }
sp-core = { path = "../../../substrate/primitives/core" }
sp-crypto-hashing = { path = "../../../substrate/primitives/crypto/hashing" }
sp-inherents = { path = "../../../substrate/primitives/inherents" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-state-machine = { path = "../../../substrate/primitives/state-machine" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/parachain-inherent/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use cumulus_primitives_core::{
};
use cumulus_primitives_parachain_inherent::MessageQueueChain;
use sc_client_api::{Backend, StorageProvider};
use sp_core::twox_128;
use sp_crypto_hashing::twox_128;
use sp_inherents::{InherentData, InherentDataProvider};
use sp_runtime::traits::Block;
use std::collections::BTreeMap;
Expand Down
1 change: 1 addition & 0 deletions cumulus/pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ futures = "0.3.28"
# Substrate
sc-client-api = { path = "../../../substrate/client/api" }
sp-keyring = { path = "../../../substrate/primitives/keyring" }
sp-crypto-hashing = { path = "../../../substrate/primitives/crypto/hashing" }
sp-tracing = { path = "../../../substrate/primitives/tracing" }
sp-version = { path = "../../../substrate/primitives/version" }

Expand Down
2 changes: 1 addition & 1 deletion cumulus/pallets/parachain-system/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ fn upgrade_version_checks_should_work() {
ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(read_runtime_version));
ext.execute_with(|| {
let new_code = vec![1, 2, 3, 4];
let new_code_hash = H256(sp_core::blake2_256(&new_code));
let new_code_hash = H256(sp_crypto_hashing::blake2_256(&new_code));

#[allow(deprecated)]
let _authorize = ParachainSystem::authorize_upgrade(RawOrigin::Root.into(), new_code_hash, true);
Expand Down
Loading