File tree Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -462,30 +462,19 @@ pub fn get_burnchain_signer() -> Option<BurnchainSigner> {
462
462
None
463
463
}
464
464
465
- pub enum MinerStopReason {
466
- NoTransactions ,
467
- Preempted ,
468
- LimitReached ,
469
- DeadlineReached ,
470
- }
471
-
472
- impl MinerStopReason {
473
- pub fn as_str ( & self ) -> & ' static str {
474
- match self {
475
- MinerStopReason :: NoTransactions => "no_transactions" ,
476
- MinerStopReason :: Preempted => "preempted" ,
477
- MinerStopReason :: LimitReached => "limit_reached" ,
478
- MinerStopReason :: DeadlineReached => "deadline_reached" ,
479
- }
480
- }
481
- }
465
+ define_named_enum ! ( MinerStopReason {
466
+ NoTransactions ( "no_transactions" ) ,
467
+ Preempted ( "preempted" ) ,
468
+ LimitReached ( "limit_reached" ) ,
469
+ DeadlineReached ( "deadline_reached" ) ,
470
+ } ) ;
482
471
483
472
// Increment the counter for the given miner stop reason.
484
473
#[ allow( unused_variables) ]
485
474
pub fn increment_miner_stop_reason ( reason : MinerStopReason ) {
486
475
#[ cfg( feature = "monitoring_prom" ) ]
487
476
prometheus:: MINER_STOP_REASON_TOTAL
488
- . with_label_values ( & [ reason. as_str ( ) ] )
477
+ . with_label_values ( & [ reason. get_name_str ( ) ] )
489
478
. inc ( ) ;
490
479
}
491
480
You can’t perform that action at this time.
0 commit comments