File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
core-consensus/src/handle Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 62
62
Ok ( result)
63
63
}
64
64
65
+ // NOTE: Will be used again in #997
66
+ #[ allow( dead_code) ]
65
67
pub async fn verify_polka_certificate < Ctx > (
66
68
co : & Co < Ctx > ,
67
69
certificate : PolkaCertificate < Ctx > ,
Original file line number Diff line number Diff line change @@ -457,6 +457,8 @@ impl Codec<CommitCertificate<MockContext>> for ProtobufCodec {
457
457
}
458
458
}
459
459
460
+ // NOTE: Will be used again in #997
461
+ #[ allow( dead_code) ]
460
462
pub ( crate ) fn encode_polka_certificate (
461
463
certificate : & PolkaCertificate < MockContext > ,
462
464
) -> Result < proto:: sync:: PolkaCertificate , ProtoError > {
@@ -480,6 +482,8 @@ pub(crate) fn encode_polka_certificate(
480
482
} )
481
483
}
482
484
485
+ // NOTE: Will be used again in #997
486
+ #[ allow( dead_code) ]
483
487
pub ( crate ) fn decode_polka_certificate (
484
488
certificate : proto:: sync:: PolkaCertificate ,
485
489
) -> Result < PolkaCertificate < MockContext > , ProtoError > {
@@ -558,10 +562,14 @@ impl Codec<sync::RawDecidedValue<MockContext>> for ProtobufCodec {
558
562
}
559
563
}
560
564
565
+ // NOTE: Will be used again in #997
566
+ #[ allow( dead_code) ]
561
567
pub ( crate ) fn encode_vote ( vote : & SignedVote < MockContext > ) -> Result < proto:: Vote , ProtoError > {
562
568
vote. message . to_proto ( )
563
569
}
564
570
571
+ // NOTE: Will be used again in #997
572
+ #[ allow( dead_code) ]
565
573
pub ( crate ) fn decode_vote ( msg : proto:: Vote ) -> Result < SignedVote < MockContext > , ProtoError > {
566
574
let signature = Signature :: test ( ) ;
567
575
let vote = Vote :: from_proto ( msg) ?;
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ impl State {
410
410
/// validators from the genesis validator set.
411
411
pub fn get_validator_set ( & self , height : Height ) -> ValidatorSet {
412
412
let num_validators = self . genesis . validator_set . len ( ) ;
413
- let selection_size = ( num_validators + 1 ) / 2 ;
413
+ let selection_size = num_validators. div_ceil ( 2 ) ;
414
414
415
415
if num_validators <= selection_size {
416
416
return self . genesis . validator_set . clone ( ) ;
You can’t perform that action at this time.
0 commit comments