mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
@@ -91,7 +91,7 @@ impl BabePreDigest {
|
||||
}
|
||||
|
||||
/// The prefix used by BABE for its VRF keys.
|
||||
pub const BABE_VRF_PREFIX: &'static [u8] = b"substrate-babe-vrf";
|
||||
pub const BABE_VRF_PREFIX: &[u8] = b"substrate-babe-vrf";
|
||||
|
||||
/// A raw version of `BabePreDigest`, usable on `no_std`.
|
||||
#[derive(Copy, Clone, Encode, Decode)]
|
||||
|
||||
@@ -38,7 +38,7 @@ fn load_decode<B, T>(backend: &B, key: &[u8]) -> ClientResult<Option<T>>
|
||||
T: Decode,
|
||||
{
|
||||
let corrupt = |e: codec::Error| {
|
||||
ClientError::Backend(format!("BABE DB is corrupted. Decode error: {}", e.what())).into()
|
||||
ClientError::Backend(format!("BABE DB is corrupted. Decode error: {}", e.what()))
|
||||
};
|
||||
match backend.get_aux(key)? {
|
||||
None => Ok(None),
|
||||
|
||||
@@ -38,7 +38,7 @@ fn load_decode<C, T>(backend: &C, key: &[u8]) -> ClientResult<Option<T>>
|
||||
None => Ok(None),
|
||||
Some(t) => T::decode(&mut &t[..])
|
||||
.map_err(
|
||||
|e| ClientError::Backend(format!("Slots DB is corrupted. Decode error: {}", e.what())).into(),
|
||||
|e| ClientError::Backend(format!("Slots DB is corrupted. Decode error: {}", e.what())),
|
||||
)
|
||||
.map(Some)
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ pub trait SimpleSlotWorker<B: BlockT> {
|
||||
logs,
|
||||
},
|
||||
remaining_duration,
|
||||
).map_err(|e| consensus_common::Error::ClientImport(format!("{:?}", e)).into()),
|
||||
).map_err(|e| consensus_common::Error::ClientImport(format!("{:?}", e))),
|
||||
Delay::new(remaining_duration)
|
||||
.map_err(|err| consensus_common::Error::FaultyTimer(err).into())
|
||||
.map_err(consensus_common::Error::FaultyTimer)
|
||||
).map(|v| match v {
|
||||
futures::future::Either::Left((b, _)) => b.map(|b| (b, claim)),
|
||||
futures::future::Either::Right((Ok(_), _)) =>
|
||||
@@ -220,9 +220,9 @@ pub trait SimpleSlotWorker<B: BlockT> {
|
||||
}
|
||||
|
||||
let (header, body) = block.deconstruct();
|
||||
let header_num = header.number().clone();
|
||||
let header_num = *header.number();
|
||||
let header_hash = header.hash();
|
||||
let parent_hash = header.parent_hash().clone();
|
||||
let parent_hash = *header.parent_hash();
|
||||
|
||||
let block_import_params = block_import_params_maker(
|
||||
header,
|
||||
@@ -401,9 +401,8 @@ impl<T: Clone> SlotDuration<T> {
|
||||
.map_err(|_| {
|
||||
client::error::Error::Backend({
|
||||
error!(target: "slots", "slot duration kept in invalid format");
|
||||
format!("slot duration kept in invalid format")
|
||||
"slot duration kept in invalid format".to_string()
|
||||
})
|
||||
.into()
|
||||
}),
|
||||
None => {
|
||||
use sr_primitives::traits::Zero;
|
||||
|
||||
Reference in New Issue
Block a user