@@ -58,7 +58,7 @@ pub trait Kind: 'static + Sized + Send + Sync {
58
58
type Verified : Sized + Send + BlockLike + HeapSizeOf ;
59
59
60
60
/// Attempt to create the `Unverified` item from the input.
61
- fn create ( input : Self :: Input , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Unverified , Error > ;
61
+ fn create ( input : Self :: Input , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Unverified , ( Self :: Input , Error ) > ;
62
62
63
63
/// Attempt to verify the `Unverified` item using the given engine.
64
64
fn verify ( unverified : Self :: Unverified , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Verified , Error > ;
@@ -86,16 +86,16 @@ pub mod blocks {
86
86
type Unverified = Unverified ;
87
87
type Verified = PreverifiedBlock ;
88
88
89
- fn create ( input : Self :: Input , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Unverified , Error > {
89
+ fn create ( input : Self :: Input , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Unverified , ( Self :: Input , Error ) > {
90
90
match verify_block_basic ( & input, engine, check_seal) {
91
91
Ok ( ( ) ) => Ok ( input) ,
92
92
Err ( Error ( ErrorKind :: Block ( BlockError :: TemporarilyInvalid ( oob) ) , _) ) => {
93
93
debug ! ( target: "client" , "Block received too early {}: {:?}" , input. hash( ) , oob) ;
94
- Err ( BlockError :: TemporarilyInvalid ( oob) . into ( ) )
94
+ Err ( ( input , BlockError :: TemporarilyInvalid ( oob) . into ( ) ) )
95
95
} ,
96
96
Err ( e) => {
97
97
warn ! ( target: "client" , "Stage 1 block verification failed for {}: {:?}" , input. hash( ) , e) ;
98
- Err ( e )
98
+ Err ( ( input , e ) )
99
99
}
100
100
}
101
101
}
@@ -209,8 +209,11 @@ pub mod headers {
209
209
type Unverified = Header ;
210
210
type Verified = Header ;
211
211
212
- fn create ( input : Self :: Input , engine : & EthEngine , _check_seal : bool ) -> Result < Self :: Unverified , Error > {
213
- verify_header_params ( & input, engine, true ) . map ( |_| input)
212
+ fn create ( input : Self :: Input , engine : & EthEngine , _check_seal : bool ) -> Result < Self :: Unverified , ( Self :: Input , Error ) > {
213
+ match verify_header_params ( & input, engine, true ) {
214
+ Ok ( _) => Ok ( input) ,
215
+ Err ( err) => Err ( ( input, err) )
216
+ }
214
217
}
215
218
216
219
fn verify ( unverified : Self :: Unverified , engine : & EthEngine , check_seal : bool ) -> Result < Self :: Verified , Error > {
0 commit comments