11
11
12
12
extern crate alloc;
13
13
14
- use alloc:: { fmt:: Debug , string:: String , sync :: Arc , vec:: Vec } ;
14
+ use alloc:: { fmt:: Debug , string:: String , vec:: Vec } ;
15
15
use alloy_consensus:: Header ;
16
16
use alloy_primitives:: { BlockHash , BlockNumber , Bloom , B256 , U256 } ;
17
17
use reth_execution_types:: BlockExecutionResult ;
@@ -32,7 +32,7 @@ pub mod test_utils;
32
32
/// [`Consensus`] implementation which knows full node primitives and is able to validation block's
33
33
/// execution outcome.
34
34
#[ auto_impl:: auto_impl( & , Arc ) ]
35
- pub trait FullConsensus < N : NodePrimitives > : AsConsensus < N :: Block > {
35
+ pub trait FullConsensus < N : NodePrimitives > : Consensus < N :: Block > {
36
36
/// Validate a block considering world state, i.e. things that can not be checked before
37
37
/// execution.
38
38
///
@@ -48,7 +48,7 @@ pub trait FullConsensus<N: NodePrimitives>: AsConsensus<N::Block> {
48
48
49
49
/// Consensus is a protocol that chooses canonical chain.
50
50
#[ auto_impl:: auto_impl( & , Arc ) ]
51
- pub trait Consensus < B : Block > : AsHeaderValidator < B :: Header > {
51
+ pub trait Consensus < B : Block > : HeaderValidator < B :: Header > {
52
52
/// The error type related to consensus.
53
53
type Error ;
54
54
@@ -135,40 +135,6 @@ pub trait HeaderValidator<H = Header>: Debug + Send + Sync {
135
135
) -> Result < ( ) , ConsensusError > ;
136
136
}
137
137
138
- /// Helper trait to cast `Arc<dyn Consensus>` to `Arc<dyn HeaderValidator>`
139
- pub trait AsHeaderValidator < H > : HeaderValidator < H > {
140
- /// Converts the [`Arc`] of self to [`Arc`] of [`HeaderValidator`]
141
- fn as_header_validator < ' a > ( self : Arc < Self > ) -> Arc < dyn HeaderValidator < H > + ' a >
142
- where
143
- Self : ' a ;
144
- }
145
-
146
- impl < T : HeaderValidator < H > , H > AsHeaderValidator < H > for T {
147
- fn as_header_validator < ' a > ( self : Arc < Self > ) -> Arc < dyn HeaderValidator < H > + ' a >
148
- where
149
- Self : ' a ,
150
- {
151
- self
152
- }
153
- }
154
-
155
- /// Helper trait to cast `Arc<dyn FullConsensus>` to `Arc<dyn Consensus>`
156
- pub trait AsConsensus < B : Block > : Consensus < B > {
157
- /// Converts the [`Arc`] of self to [`Arc`] of [`HeaderValidator`]
158
- fn as_consensus < ' a > ( self : Arc < Self > ) -> Arc < dyn Consensus < B , Error = Self :: Error > + ' a >
159
- where
160
- Self : ' a ;
161
- }
162
-
163
- impl < T : Consensus < B > , B : Block > AsConsensus < B > for T {
164
- fn as_consensus < ' a > ( self : Arc < Self > ) -> Arc < dyn Consensus < B , Error = Self :: Error > + ' a >
165
- where
166
- Self : ' a ,
167
- {
168
- self
169
- }
170
- }
171
-
172
138
/// Consensus Errors
173
139
#[ derive( Debug , PartialEq , Eq , Clone , thiserror:: Error ) ]
174
140
pub enum ConsensusError {
0 commit comments