mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 11:31:05 +00:00
BEEFY: Define a BeefyVerify trait for signatures (#12299)
* Define CustomVerify trait Signed-off-by: Serban Iorga <serban@parity.io> * Use ECDSA CustomVerify for MultiSignature Signed-off-by: Serban Iorga <serban@parity.io> * beefy: small simplifications Signed-off-by: Serban Iorga <serban@parity.io> * Revert "Use ECDSA CustomVerify for MultiSignature" This reverts commit 136cff82505662dd92c864491814629d2bc349f0. * Revert "Define CustomVerify trait" This reverts commit adf91e9e6d1bdea6f00831f6067b74c3d945f9a2. * Define BeefyAuthorityId and BeefyVerify traits * Improve BeefyVerify unit tests Co-authored-by: Robert Hambrock <roberthambrock@gmail.com> * fmt & import sp_core::blake2_256 * Renamings * remove SignerToAccountId * fix Signed-off-by: Serban Iorga <serban@parity.io> Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
This commit is contained in:
@@ -73,12 +73,8 @@ where
|
||||
/// Convert BEEFY secp256k1 public keys into Ethereum addresses
|
||||
pub struct BeefyEcdsaToEthereum;
|
||||
impl Convert<beefy_primitives::crypto::AuthorityId, Vec<u8>> for BeefyEcdsaToEthereum {
|
||||
fn convert(a: beefy_primitives::crypto::AuthorityId) -> Vec<u8> {
|
||||
sp_core::ecdsa::Public::try_from(a.as_ref())
|
||||
.map_err(|_| {
|
||||
log::error!(target: "runtime::beefy", "Invalid BEEFY PublicKey format!");
|
||||
})
|
||||
.unwrap_or(sp_core::ecdsa::Public::from_raw([0u8; 33]))
|
||||
fn convert(beefy_id: beefy_primitives::crypto::AuthorityId) -> Vec<u8> {
|
||||
sp_core::ecdsa::Public::from(beefy_id)
|
||||
.to_eth_address()
|
||||
.map(|v| v.to_vec())
|
||||
.map_err(|_| {
|
||||
|
||||
Reference in New Issue
Block a user