mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 07:27:55 +00:00
Use sign_with in consensus (#6008)
* Add derive_more to sp_core * Convert Vec to Signature * Use sign_with in AURA and BABE * Signing errors * Update slots to return consensus result * Fix use * Clone public key * Match block_params * WIP * Use to_public_crypto_pair * Pass public key only to block import params * Address PR review * Fix consensus RPC * Fix babe tests * adjust uses * Fix line widths
This commit is contained in:
@@ -34,7 +34,11 @@ pub use codec;
|
||||
#[cfg(feature = "std")]
|
||||
pub use serde;
|
||||
#[doc(hidden)]
|
||||
pub use sp_std::{ops::Deref, vec::Vec};
|
||||
pub use sp_std::{
|
||||
convert::TryFrom,
|
||||
ops::Deref,
|
||||
vec::Vec,
|
||||
};
|
||||
|
||||
pub mod ed25519;
|
||||
pub mod sr25519;
|
||||
@@ -457,6 +461,14 @@ macro_rules! app_crypto_signature_common {
|
||||
impl $crate::AppSignature for Signature {
|
||||
type Generic = $sig;
|
||||
}
|
||||
|
||||
impl $crate::TryFrom<$crate::Vec<u8>> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: $crate::Vec<u8>) -> Result<Self, Self::Error> {
|
||||
Ok(<$sig>::try_from(data.as_slice())?.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user