@@ -7,15 +7,19 @@ use crate::lotus_json::lotus_json_with_self;
77use schemars:: JsonSchema ;
88use serde:: { Deserialize , Serialize } ;
99
10- #[ derive( Debug , Default , Clone , Serialize , Deserialize , PartialEq , Eq , JsonSchema ) ]
10+ #[ derive(
11+ Debug , Default , Clone , Serialize , Deserialize , PartialEq , Eq , JsonSchema , derive_more:: Display ,
12+ ) ]
1113#[ serde( rename_all = "PascalCase" ) ]
1214pub enum SnapshotProgressState {
1315 #[ default]
16+ #[ display( "🔄 Initializing (Checking if snapshot is needed)" ) ]
1417 Initializing ,
15- InProgress {
16- message : String ,
17- } ,
18+ # [ display ( "🌳 In Progress: {message}" ) ]
19+ InProgress { message : String } ,
20+ # [ display ( "✅ Recently Completed! Chain will start syncing shortly" ) ]
1821 Completed ,
22+ #[ display( "⏳ Not Required (Snapshot is not needed)" ) ]
1923 NotRequired ,
2024}
2125
@@ -41,25 +45,6 @@ impl SnapshotProgressState {
4145 }
4246}
4347
44- impl std:: fmt:: Display for SnapshotProgressState {
45- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
46- match self {
47- Self :: Initializing => {
48- write ! ( f, "🔄 Initializing (Checking if snapshot is needed)" )
49- }
50- Self :: InProgress { message } => {
51- write ! ( f, "🌳 In Progress: {message}" )
52- }
53- Self :: Completed => {
54- write ! ( f, "✅ Recently Completed! Chain will start syncing shortly" )
55- }
56- Self :: NotRequired => {
57- write ! ( f, "⏳ Not Required (Snapshot is not needed)" )
58- }
59- }
60- }
61- }
62-
6348lotus_json_with_self ! ( SnapshotProgressState ) ;
6449
6550#[ derive( Default , Clone ) ]
0 commit comments