@@ -9,21 +9,23 @@ mod slashes;
99mod transfer_limit;
1010mod tx;
1111
12+ use std:: fmt:: Display ;
13+
1214use async_trait:: async_trait;
13- use halt:: HaltCheck ;
1415
1516pub use crate :: config:: AppConfig ;
1617pub use crate :: state:: State ;
1718use crate :: {
1819 checks:: {
19- block:: BlockCheck , fees:: FeeCheck , gas:: GasCheck , ibc:: IbcCheck , ibc_limit:: IbcLimitCheck ,
20- pos:: PoSCheck , slashes:: SlashCheck , transfer_limit:: TransferLimitCheck , tx:: TxCheck ,
20+ block:: BlockCheck , fees:: FeeCheck , gas:: GasCheck , halt:: HaltCheck , ibc:: IbcCheck ,
21+ ibc_limit:: IbcLimitCheck , pos:: PoSCheck , slashes:: SlashCheck ,
22+ transfer_limit:: TransferLimitCheck , tx:: TxCheck ,
2123 } ,
2224 shared:: alert:: Alert ,
2325} ;
2426
2527#[ async_trait]
26- pub trait CheckTrait : Send + Sync {
28+ pub trait CheckTrait : Send + Sync + Display {
2729 async fn check ( & self , state : & State ) -> Vec < Alert > ;
2830 fn is_continous ( & self ) -> bool ;
2931}
@@ -69,4 +71,17 @@ impl CheckManager {
6971 }
7072 results
7173 }
74+
75+ pub fn get_checks ( & self ) -> & Vec < Box < dyn CheckTrait > > {
76+ & self . checks
77+ }
78+ }
79+
80+ impl Display for CheckManager {
81+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
82+ for check in & self . checks {
83+ write ! ( f, "{}" , check) ?;
84+ }
85+ write ! ( f, "CheckManager with {} checks" , self . checks. len( ) )
86+ }
7287}
0 commit comments