1
- use ed25519_dalek:: { SignatureError , Signer , SigningKey } ;
1
+ use ed25519_dalek:: { Signer , SigningKey } ;
2
2
use rand_chacha:: rand_core:: { self , CryptoRng , RngCore , SeedableRng } ;
3
3
use rand_chacha:: ChaCha20Rng ;
4
4
use serde:: { Deserialize , Serialize } ;
5
5
use thiserror:: Error ;
6
6
7
+ use crate :: { StdError , StdResult } ;
8
+
7
9
use super :: ProtocolKey ;
8
10
9
11
/// Wrapper of [Ed25519:PublicKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.VerifyingKey.html).
@@ -20,7 +22,7 @@ pub type EraMarkersVerifierSignature = ProtocolKey<ed25519_dalek::Signature>;
20
22
pub enum EraMarkersVerifierError {
21
23
/// Error raised when a Signature verification fail
22
24
#[ error( "era markers signature verification error: '{0}'" ) ]
23
- SignatureVerification ( # [ from ] SignatureError ) ,
25
+ SignatureVerification ( StdError ) ,
24
26
}
25
27
26
28
/// A cryptographic signer that is responsible for signing the EraMarkers
@@ -85,11 +87,7 @@ impl EraMarkersVerifier {
85
87
}
86
88
87
89
/// Verifies the signature of a message
88
- pub fn verify (
89
- & self ,
90
- message : & [ u8 ] ,
91
- signature : & EraMarkersVerifierSignature ,
92
- ) -> Result < ( ) , EraMarkersVerifierError > {
90
+ pub fn verify ( & self , message : & [ u8 ] , signature : & EraMarkersVerifierSignature ) -> StdResult < ( ) > {
93
91
Ok ( self . verification_key . verify_strict ( message, signature) ?)
94
92
}
95
93
}
0 commit comments