33use serde:: { Deserialize , Serialize } ;
44
55use {
6- crate :: {
7- certificate:: { CertificateMessage , CertificateType } ,
8- vote:: Vote ,
9- } ,
6+ crate :: { certificate:: Certificate , vote:: Vote } ,
107 bitvec:: prelude:: * ,
118 solana_bls:: Signature as BLSSignature ,
12- solana_hash:: Hash ,
13- solana_program:: clock:: Slot ,
149} ;
1510
1611#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
@@ -25,6 +20,18 @@ pub struct VoteMessage {
2520 pub rank : u16 ,
2621}
2722
23+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
24+ #[ derive( Clone , Debug , PartialEq ) ]
25+ /// BLS vote message, we need rank to look up pubkey
26+ pub struct CertificateMessage {
27+ /// The certificate
28+ pub certificate : Certificate ,
29+ /// The signature
30+ pub signature : BLSSignature ,
31+ /// The bitmap for validators, little endian byte order
32+ pub bitmap : BitVec < u8 , Lsb0 > ,
33+ }
34+
2835#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
2936#[ derive( Clone , Debug , PartialEq ) ]
3037#[ allow( clippy:: large_enum_variant) ]
@@ -48,18 +55,12 @@ impl BLSMessage {
4855
4956 /// Create a new certificate message
5057 pub fn new_certificate (
51- certificate_type : CertificateType ,
52- slot : Slot ,
53- block_id : Option < Hash > ,
54- replayed_bank_hash : Option < Hash > ,
58+ certificate : Certificate ,
5559 bitmap : BitVec < u8 , Lsb0 > ,
5660 signature : BLSSignature ,
5761 ) -> Self {
5862 Self :: Certificate ( CertificateMessage {
59- certificate_type,
60- slot,
61- block_id,
62- replayed_bank_hash,
63+ certificate,
6364 signature,
6465 bitmap,
6566 } )
0 commit comments