@@ -54,7 +54,7 @@ impl ConsensusMsg {
5454
5555 match self {
5656 Self :: Proposal ( proposal) => {
57- let canonical = proto:: types:: v1 :: CanonicalProposal {
57+ let canonical = proto:: types:: v1beta1 :: CanonicalProposal {
5858 chain_id : chain_id. to_string ( ) ,
5959 r#type : ConsensusMsgType :: Proposal . into ( ) ,
6060 height : proposal. height . into ( ) ,
@@ -70,7 +70,7 @@ impl ConsensusMsg {
7070 canonical. encode_length_delimited ( & mut bytes) ?;
7171 }
7272 Self :: Vote ( vote) => {
73- let canonical = proto:: types:: v1 :: CanonicalVote {
73+ let canonical = proto:: types:: v1beta1 :: CanonicalVote {
7474 r#type : vote. vote_type . into ( ) ,
7575 height : vote. height . into ( ) ,
7676 round : vote. round . value ( ) . into ( ) ,
@@ -94,7 +94,7 @@ impl ConsensusMsg {
9494 // Only sign extension if it's a precommit for a non-nil block.
9595 // Note that extension can be empty.
9696 ( vote:: Type :: Precommit , Some ( _) ) => {
97- let canonical = proto:: types :: v1 :: CanonicalVoteExtension {
97+ let canonical = proto:: v0_38 :: types :: CanonicalVoteExtension {
9898 extension : v. extension . clone ( ) ,
9999 height : v. height . into ( ) ,
100100 round : v. round . value ( ) . into ( ) ,
@@ -171,18 +171,18 @@ impl From<Vote> for ConsensusMsg {
171171 }
172172}
173173
174- impl TryFrom < proto:: types:: v1 :: Proposal > for ConsensusMsg {
174+ impl TryFrom < proto:: types:: v1beta1 :: Proposal > for ConsensusMsg {
175175 type Error = Error ;
176176
177- fn try_from ( proposal : proto:: types:: v1 :: Proposal ) -> Result < Self , Self :: Error > {
177+ fn try_from ( proposal : proto:: types:: v1beta1 :: Proposal ) -> Result < Self , Self :: Error > {
178178 Proposal :: try_from ( proposal) . map ( Self :: Proposal )
179179 }
180180}
181181
182- impl TryFrom < proto:: types:: v1 :: Vote > for ConsensusMsg {
182+ impl TryFrom < proto:: types:: v1beta1 :: Vote > for ConsensusMsg {
183183 type Error = Error ;
184184
185- fn try_from ( vote : proto:: types:: v1 :: Vote ) -> Result < Self , Self :: Error > {
185+ fn try_from ( vote : proto:: types:: v1beta1 :: Vote ) -> Result < Self , Self :: Error > {
186186 Vote :: try_from ( vote) . map ( Self :: Vote )
187187 }
188188}
@@ -225,24 +225,24 @@ impl From<ConsensusMsgType> for SignedMsgCode {
225225 }
226226}
227227
228- impl From < ConsensusMsgType > for proto:: types:: v1 :: SignedMsgType {
229- fn from ( msg_type : ConsensusMsgType ) -> proto:: types:: v1 :: SignedMsgType {
228+ impl From < ConsensusMsgType > for proto:: types:: v1beta1 :: SignedMsgType {
229+ fn from ( msg_type : ConsensusMsgType ) -> proto:: types:: v1beta1 :: SignedMsgType {
230230 match msg_type {
231- ConsensusMsgType :: Unknown => proto:: types:: v1 :: SignedMsgType :: Unknown ,
232- ConsensusMsgType :: Prevote => proto:: types:: v1 :: SignedMsgType :: Prevote ,
233- ConsensusMsgType :: Precommit => proto:: types:: v1 :: SignedMsgType :: Precommit ,
234- ConsensusMsgType :: Proposal => proto:: types:: v1 :: SignedMsgType :: Proposal ,
231+ ConsensusMsgType :: Unknown => proto:: types:: v1beta1 :: SignedMsgType :: Unknown ,
232+ ConsensusMsgType :: Prevote => proto:: types:: v1beta1 :: SignedMsgType :: Prevote ,
233+ ConsensusMsgType :: Precommit => proto:: types:: v1beta1 :: SignedMsgType :: Precommit ,
234+ ConsensusMsgType :: Proposal => proto:: types:: v1beta1 :: SignedMsgType :: Proposal ,
235235 }
236236 }
237237}
238238
239- impl From < proto:: types:: v1 :: SignedMsgType > for ConsensusMsgType {
240- fn from ( proto : proto:: types:: v1 :: SignedMsgType ) -> ConsensusMsgType {
239+ impl From < proto:: types:: v1beta1 :: SignedMsgType > for ConsensusMsgType {
240+ fn from ( proto : proto:: types:: v1beta1 :: SignedMsgType ) -> ConsensusMsgType {
241241 match proto {
242- proto:: types:: v1 :: SignedMsgType :: Unknown => Self :: Unknown ,
243- proto:: types:: v1 :: SignedMsgType :: Prevote => Self :: Prevote ,
244- proto:: types:: v1 :: SignedMsgType :: Precommit => Self :: Precommit ,
245- proto:: types:: v1 :: SignedMsgType :: Proposal => Self :: Proposal ,
242+ proto:: types:: v1beta1 :: SignedMsgType :: Unknown => Self :: Unknown ,
243+ proto:: types:: v1beta1 :: SignedMsgType :: Prevote => Self :: Prevote ,
244+ proto:: types:: v1beta1 :: SignedMsgType :: Precommit => Self :: Precommit ,
245+ proto:: types:: v1beta1 :: SignedMsgType :: Proposal => Self :: Proposal ,
246246 }
247247 }
248248}
@@ -260,7 +260,7 @@ impl TryFrom<SignedMsgCode> for ConsensusMsgType {
260260 type Error = Error ;
261261
262262 fn try_from ( code : SignedMsgCode ) -> Result < Self , Self :: Error > {
263- proto:: types:: v1 :: SignedMsgType :: try_from ( code)
263+ proto:: types:: v1beta1 :: SignedMsgType :: try_from ( code)
264264 . map ( Into :: into)
265265 . map_err ( |e| Error :: parse ( e. to_string ( ) ) )
266266 }
@@ -285,7 +285,7 @@ mod tests {
285285 }
286286
287287 fn example_proposal ( ) -> Proposal {
288- proto:: types:: v1 :: Proposal {
288+ proto:: types:: v1beta1 :: Proposal {
289289 r#type : ConsensusMsgType :: Proposal . into ( ) ,
290290 height : 12345 ,
291291 round : 1 ,
@@ -299,14 +299,14 @@ mod tests {
299299 }
300300
301301 fn example_vote ( ) -> Vote {
302- proto:: types:: v1 :: Vote {
302+ proto:: types:: v1beta1 :: Vote {
303303 r#type : 0x01 ,
304304 height : 500001 ,
305305 round : 2 ,
306306 timestamp : Some ( example_timestamp ( ) ) ,
307- block_id : Some ( proto:: types:: v1 :: BlockId {
307+ block_id : Some ( proto:: types:: v1beta1 :: BlockId {
308308 hash : b"some hash00000000000000000000000" . to_vec ( ) ,
309- part_set_header : Some ( proto:: types:: v1 :: PartSetHeader {
309+ part_set_header : Some ( proto:: types:: v1beta1 :: PartSetHeader {
310310 total : 1000000 ,
311311 hash : b"parts_hash0000000000000000000000" . to_vec ( ) ,
312312 } ) ,
@@ -317,8 +317,8 @@ mod tests {
317317 ] ,
318318 validator_index : 56789 ,
319319 signature : vec ! [ ] ,
320- extension : vec ! [ ] ,
321- extension_signature : vec ! [ ] ,
320+ // extension: vec![],
321+ // extension_signature: vec![],
322322 }
323323 . try_into ( )
324324 . unwrap ( )
0 commit comments