@@ -35,9 +35,10 @@ pub struct ServerStandardChannelInfo {
3535 pub nominal_hashrate : Option < f32 > ,
3636 pub target_hex : String ,
3737 pub extranonce_prefix_hex : String ,
38- pub shares_accepted : u32 ,
39- pub share_work_sum : f64 ,
38+ pub shares_acknowledged : u32 ,
4039 pub shares_submitted : u32 ,
40+ pub shares_rejected : u32 ,
41+ pub share_work_sum : f64 ,
4142 pub best_diff : f64 ,
4243 pub blocks_found : u32 ,
4344}
@@ -134,14 +135,26 @@ mod tests {
134135 nominal_hashrate : hashrate,
135136 target_hex : "00ff" . into ( ) ,
136137 extranonce_prefix_hex : "bb" . into ( ) ,
137- shares_accepted : 20 ,
138- share_work_sum : 200.0 ,
138+ shares_acknowledged : 20 ,
139139 shares_submitted : 22 ,
140+ shares_rejected : 1 ,
141+ share_work_sum : 200.0 ,
140142 best_diff : 80.0 ,
141143 blocks_found : 0 ,
142144 }
143145 }
144146
147+ #[ test]
148+ fn server_standard_channel_info_serializes_share_accounting_fields ( ) {
149+ let channel = create_server_standard_channel_info ( 7 , Some ( 50.0 ) ) ;
150+ let json = serde_json:: to_value ( channel) . unwrap ( ) ;
151+
152+ assert_eq ! ( json[ "shares_acknowledged" ] , 20 ) ;
153+ assert_eq ! ( json[ "shares_rejected" ] , 1 ) ;
154+ assert_eq ! ( json[ "share_work_sum" ] , 200.0 ) ;
155+ assert ! ( json. get( "shares_accepted" ) . is_none( ) ) ;
156+ }
157+
145158 // ── ServerInfo unit tests ───────────────────────────────────────
146159
147160 #[ test]
0 commit comments