File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/consensus/parlia/tests Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ fn test_snapshot_with_validators() {
5151 expected_validators. sort ( ) ;
5252 assert_eq ! ( snapshot. validators, expected_validators) ;
5353
54- // Check validator map entries - when vote_addrs is None, ValidatorInfo uses Default
55- // which sets index=0 and vote_addr=VoteAddress::default()
56- for validator in expected_validators. iter ( ) {
54+ // Check validator map entries - when vote_addrs is None, indices are 1-based
55+ // Index is based on sorted position: 1, 2, 3, ...
56+ for ( idx , validator) in expected_validators. iter ( ) . enumerate ( ) {
5757 let info = snapshot. validators_map . get ( validator) . unwrap ( ) ;
58- // When no vote_addrs provided, Default::default() is used which has index=0
59- assert_eq ! ( info. index, 0 ) ;
60- assert_eq ! ( info. vote_addr, VoteAddress :: default ( ) ) ;
58+ // When no vote_addrs provided, indices are assigned as (sorted_position + 1)
59+ assert_eq ! ( info. index, ( idx + 1 ) as u64 ) ;
60+ assert_eq ! ( info. vote_addr, VoteAddress :: ZERO ) ;
6161 }
6262}
6363
You can’t perform that action at this time.
0 commit comments