File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,11 @@ pub trait ConsensusEngine: Sync + Send {
221221 /// Stops any services that the may hold the Engine and makes it safe to drop.
222222 fn stop ( & self ) { }
223223
224+ /// Block transformation functions, before the transactions.
225+ fn on_open_block ( & self , _block : & mut ExecutedBlock ) -> Result < ( ) , Error > {
226+ Ok ( ( ) )
227+ }
228+
224229 /// Block transformation functions, after the transactions.
225230 fn on_close_block (
226231 & self ,
Original file line number Diff line number Diff line change @@ -134,6 +134,15 @@ impl ConsensusEngine for Tendermint {
134134
135135 fn stop ( & self ) { }
136136
137+ /// Block transformation functions, before the transactions.
138+ fn on_open_block ( & self , block : & mut ExecutedBlock ) -> Result < ( ) , Error > {
139+ let metadata = block. state ( ) . metadata ( ) ?. expect ( "Metadata must exist" ) ;
140+ if block. header ( ) . number ( ) == metadata. last_term_finished_block_num ( ) + 1 {
141+ // FIXME: on_term_open
142+ }
143+ Ok ( ( ) )
144+ }
145+
137146 fn on_close_block (
138147 & self ,
139148 block : & mut ExecutedBlock ,
You can’t perform that action at this time.
0 commit comments