File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ enum CheckAction {
262262 /// No check necessary.
263263 NoAction ,
264264 /// Check a given block height.
265- Check ( i64 ) ,
265+ Check ( u64 ) ,
266266 /// The action been taken.
267267 AlreadySuspended ,
268268}
@@ -302,10 +302,8 @@ impl Service {
302302 mut shutdown_recv : broadcast:: Receiver < ( ) > ,
303303 ) -> ( bool , Option < <Self as tower:: Service < Request > >:: Future > ) {
304304 let hght = match check {
305- CheckAction :: AlreadySuspended => BlockHeight :: from ( u64:: MAX ) ,
306- CheckAction :: Check ( hght) => BlockHeight :: from (
307- u64:: try_from ( hght) . expect ( "Height cannot be negative" ) ,
308- ) ,
305+ CheckAction :: AlreadySuspended => BlockHeight ( u64:: MAX ) ,
306+ CheckAction :: Check ( hght) => BlockHeight ( hght) ,
309307 CheckAction :: NoAction => BlockHeight :: default ( ) ,
310308 } ;
311309 match action_at_height {
@@ -417,7 +415,7 @@ impl Service {
417415 fn get_action ( & self , req : & Request ) -> Option < CheckAction > {
418416 match req {
419417 Request :: PrepareProposal ( req) => {
420- Some ( CheckAction :: Check ( req. height . into ( ) ) ) // TODO switch to u64?
418+ Some ( CheckAction :: Check ( req. height . into ( ) ) )
421419 }
422420 Request :: ProcessProposal ( req) => {
423421 Some ( CheckAction :: Check ( req. height . into ( ) ) )
You can’t perform that action at this time.
0 commit comments