Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit ddd464c

Browse files
committed
spelling
1 parent 0afaf2c commit ddd464c

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

frame/example-offchain-worker/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ use frame_support::traits::Get;
5353
use sp_core::crypto::KeyTypeId;
5454
use sp_runtime::{
5555
RuntimeDebug,
56-
offchain::{http, Duration, storage::{MutateStorageError, StorageRetrivalError, StorageValueRef}},
56+
offchain::{http, Duration, storage::{MutateStorageError, StorageRetrievalError, StorageValueRef}},
5757
traits::Zero,
5858
transaction_validity::{InvalidTransaction, ValidTransaction, TransactionValidity},
5959
};
@@ -366,7 +366,7 @@ impl<T: Config> Pallet<T> {
366366
// low-level method of local storage API, which means that only one worker
367367
// will be able to "acquire a lock" and send a transaction if multiple workers
368368
// happen to be executed concurrently.
369-
let res = val.mutate(|last_send: Result<Option<T::BlockNumber>, StorageRetrivalError>| {
369+
let res = val.mutate(|last_send: Result<Option<T::BlockNumber>, StorageRetrievalError>| {
370370
match last_send {
371371
// If we already have a value in storage and the block number is recent enough
372372
// we avoid sending another transaction at this time.

frame/im-online/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use sp_core::offchain::OpaqueNetworkState;
8080
use sp_std::prelude::*;
8181
use sp_std::convert::TryInto;
8282
use sp_runtime::{
83-
offchain::storage::{MutateStorageError, StorageRetrivalError, StorageValueRef},
83+
offchain::storage::{MutateStorageError, StorageRetrievalError, StorageValueRef},
8484
traits::{AtLeast32BitUnsigned, Convert, Saturating, TrailingZeroInput},
8585
Perbill, Permill, PerThing, RuntimeDebug, SaturatedConversion,
8686
};
@@ -720,7 +720,7 @@ impl<T: Config> Pallet<T> {
720720
};
721721
let storage = StorageValueRef::persistent(&key);
722722
let res = storage.mutate(
723-
|status: Result<Option<HeartbeatStatus<T::BlockNumber>>, StorageRetrivalError>| {
723+
|status: Result<Option<HeartbeatStatus<T::BlockNumber>>, StorageRetrievalError>| {
724724
// Check if there is already a lock for that particular block.
725725
// This means that the heartbeat has already been sent, and we are just waiting
726726
// for it to be included. However if it doesn't get included for INCLUDE_THRESHOLD

frame/session/src/historical/offchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//! the off-chain indexing API.
2727
2828
use sp_runtime::{
29-
offchain::storage::{MutateStorageError, StorageRetrivalError, StorageValueRef},
29+
offchain::storage::{MutateStorageError, StorageRetrievalError, StorageValueRef},
3030
KeyTypeId
3131
};
3232
use sp_session::MembershipProof;
@@ -104,7 +104,7 @@ pub fn prove_session_membership<T: Config, D: AsRef<[u8]>>(
104104
pub fn prune_older_than<T: Config>(first_to_keep: SessionIndex) {
105105
let derived_key = shared::LAST_PRUNE.to_vec();
106106
let entry = StorageValueRef::persistent(derived_key.as_ref());
107-
match entry.mutate(|current: Result<Option<SessionIndex>, StorageRetrivalError>| -> Result<_, ()> {
107+
match entry.mutate(|current: Result<Option<SessionIndex>, StorageRetrievalError>| -> Result<_, ()> {
108108
match current {
109109
Ok(Some(current)) if current < first_to_keep => Ok(first_to_keep),
110110
// do not move the cursor, if the new one would be behind ours

primitives/runtime/src/offchain/storage.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ impl<'a> StorageValueRef<'a> {
8181
///
8282
/// Returns the value if stored.
8383
/// Returns an error if the value could not be decoded.
84-
pub fn get<T: codec::Decode>(&self) -> Result<Option<T>, StorageRetrivalError> {
84+
pub fn get<T: codec::Decode>(&self) -> Result<Option<T>, StorageRetrievalError> {
8585
sp_io::offchain::local_storage_get(self.kind, self.key)
8686
.map(|val| T::decode(&mut &*val)
87-
.map_err(|_| StorageRetrivalError::Undecodable))
87+
.map_err(|_| StorageRetrievalError::Undecodable))
8888
.transpose()
8989
}
9090

@@ -100,13 +100,13 @@ impl<'a> StorageValueRef<'a> {
100100
/// 3. `Err(MutateStorageError::ValueFunctionFailed(_))` in case `mutate_val` returns an error.
101101
pub fn mutate<T, E, F>(&self, mutate_val: F) -> Result<T, MutateStorageError<T,E>> where
102102
T: codec::Codec,
103-
F: FnOnce(Result<Option<T>, StorageRetrivalError>) -> Result<T, E>
103+
F: FnOnce(Result<Option<T>, StorageRetrievalError>) -> Result<T, E>
104104
{
105105
let value = sp_io::offchain::local_storage_get(self.kind, self.key);
106106
let decoded = value.as_deref()
107107
.map(|mut bytes| {
108108
T::decode(&mut bytes)
109-
.map_err(|_| StorageRetrivalError::Undecodable)
109+
.map_err(|_| StorageRetrievalError::Undecodable)
110110
}).transpose();
111111

112112
let val = mutate_val(decoded).map_err(|err| MutateStorageError::ValueFunctionFailed(err))?;
@@ -150,7 +150,7 @@ mod tests {
150150
val.set(&15_u32);
151151

152152
assert_eq!(val.get::<u32>(), Ok(Some(15_u32)));
153-
assert_eq!(val.get::<Vec<u8>>(), Err(StorageRetrivalError::Undecodable));
153+
assert_eq!(val.get::<Vec<u8>>(), Err(StorageRetrievalError::Undecodable));
154154
assert_eq!(
155155
state.read().persistent_storage.get(b"testval"),
156156
Some(vec![15_u8, 0, 0, 0])

primitives/runtime/src/offchain/storage_lock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
//! }
6262
//! ```
6363
64-
use crate::offchain::storage::{StorageRetrivalError, MutateStorageError, StorageValueRef};
64+
use crate::offchain::storage::{StorageRetrievalError, MutateStorageError, StorageValueRef};
6565
use crate::traits::AtLeast32BitUnsigned;
6666
use codec::{Codec, Decode, Encode};
6767
use sp_core::offchain::{Duration, Timestamp};
@@ -280,7 +280,7 @@ impl<'a, L: Lockable> StorageLock<'a, L> {
280280
/// Extend active lock's deadline
281281
fn extend_active_lock(&mut self) -> Result<<L as Lockable>::Deadline, ()> {
282282
let res = self.value_ref.mutate(
283-
|s: Result<Option<L::Deadline>, StorageRetrivalError>| -> Result<<L as Lockable>::Deadline, ()> {
283+
|s: Result<Option<L::Deadline>, StorageRetrievalError>| -> Result<<L as Lockable>::Deadline, ()> {
284284
match s {
285285
// lock is present and is still active, extend the lock.
286286
Ok(Some(deadline)) if !<L as Lockable>::has_expired(&deadline) =>
@@ -302,7 +302,7 @@ impl<'a, L: Lockable> StorageLock<'a, L> {
302302
new_deadline: L::Deadline,
303303
) -> Result<(), <L as Lockable>::Deadline> {
304304
let res = self.value_ref.mutate(
305-
|s: Result<Option<L::Deadline>, StorageRetrivalError>|
305+
|s: Result<Option<L::Deadline>, StorageRetrievalError>|
306306
-> Result<<L as Lockable>::Deadline, <L as Lockable>::Deadline> {
307307
match s {
308308
// no lock set, we can safely acquire it

0 commit comments

Comments
 (0)