change HashFor to HashingFor (#14483)

* change HashFor to HashingFor

* fmt

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
Marijn Schouten
2023-07-25 18:24:14 +02:00
committed by GitHub
parent 00787a10e9
commit c9b54e10ff
26 changed files with 180 additions and 161 deletions
+14 -14
View File
@@ -25,7 +25,7 @@ use parking_lot::RwLock;
use sp_consensus::BlockOrigin;
use sp_core::offchain::OffchainStorage;
use sp_runtime::{
traits::{Block as BlockT, HashFor, NumberFor},
traits::{Block as BlockT, HashingFor, NumberFor},
Justification, Justifications, StateVersion, Storage,
};
use sp_state_machine::{
@@ -42,7 +42,7 @@ pub use sp_state_machine::{Backend as StateBackend, KeyValueStates};
pub type StateBackendFor<B, Block> = <B as Backend<Block>>::State;
/// Extracts the transaction for the given state backend.
pub type TransactionForSB<B, Block> = <B as StateBackend<HashFor<Block>>>::Transaction;
pub type TransactionForSB<B, Block> = <B as StateBackend<HashingFor<Block>>>::Transaction;
/// Extracts the transaction for the given backend.
pub type TransactionFor<B, Block> = TransactionForSB<StateBackendFor<B, Block>, Block>;
@@ -161,7 +161,7 @@ impl NewBlockState {
/// Keeps hold if the inserted block state and data.
pub trait BlockImportOperation<Block: BlockT> {
/// Associated state backend type.
type State: StateBackend<HashFor<Block>>;
type State: StateBackend<HashingFor<Block>>;
/// Returns pending state.
///
@@ -315,16 +315,16 @@ pub trait AuxStore {
/// An `Iterator` that iterates keys in a given block under a prefix.
pub struct KeysIter<State, Block>
where
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
Block: BlockT,
{
inner: <State as StateBackend<HashFor<Block>>>::RawIter,
inner: <State as StateBackend<HashingFor<Block>>>::RawIter,
state: State,
}
impl<State, Block> KeysIter<State, Block>
where
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
Block: BlockT,
{
/// Create a new iterator over storage keys.
@@ -361,7 +361,7 @@ where
impl<State, Block> Iterator for KeysIter<State, Block>
where
Block: BlockT,
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
{
type Item = StorageKey;
@@ -373,17 +373,17 @@ where
/// An `Iterator` that iterates keys and values in a given block under a prefix.
pub struct PairsIter<State, Block>
where
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
Block: BlockT,
{
inner: <State as StateBackend<HashFor<Block>>>::RawIter,
inner: <State as StateBackend<HashingFor<Block>>>::RawIter,
state: State,
}
impl<State, Block> Iterator for PairsIter<State, Block>
where
Block: BlockT,
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
{
type Item = (StorageKey, StorageData);
@@ -397,7 +397,7 @@ where
impl<State, Block> PairsIter<State, Block>
where
State: StateBackend<HashFor<Block>>,
State: StateBackend<HashingFor<Block>>,
Block: BlockT,
{
/// Create a new iterator over storage key and value pairs.
@@ -506,11 +506,11 @@ pub trait Backend<Block: BlockT>: AuxStore + Send + Sync {
/// Associated blockchain backend type.
type Blockchain: BlockchainBackend<Block>;
/// Associated state backend type.
type State: StateBackend<HashFor<Block>>
type State: StateBackend<HashingFor<Block>>
+ Send
+ AsTrieBackend<
HashFor<Block>,
TrieBackendStorage = <Self::State as StateBackend<HashFor<Block>>>::TrieBackendStorage,
HashingFor<Block>,
TrieBackendStorage = <Self::State as StateBackend<HashingFor<Block>>>::TrieBackendStorage,
>;
/// Offchain workers local storage.
type OffchainStorage: OffchainStorage;