mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-28 10:00:21 +00:00
@@ -167,11 +167,14 @@ func MsgFromProto(msg *tmcons.Message) (Message, error) {
|
||||
case *tmcons.Message_NewValidBlock:
|
||||
pbPartSetHeader, err := types.PartSetHeaderFromProto(&msg.NewValidBlock.BlockPartSetHeader)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parts to proto error: %w", err)
|
||||
return nil, fmt.Errorf("parts header to proto error: %w", err)
|
||||
}
|
||||
|
||||
pbBits := new(bits.BitArray)
|
||||
pbBits.FromProto(msg.NewValidBlock.BlockParts)
|
||||
err = pbBits.FromProto(msg.NewValidBlock.BlockParts)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parts to proto error: %w", err)
|
||||
}
|
||||
|
||||
pb = &NewValidBlockMessage{
|
||||
Height: msg.NewValidBlock.Height,
|
||||
@@ -191,7 +194,11 @@ func MsgFromProto(msg *tmcons.Message) (Message, error) {
|
||||
}
|
||||
case *tmcons.Message_ProposalPol:
|
||||
pbBits := new(bits.BitArray)
|
||||
pbBits.FromProto(&msg.ProposalPol.ProposalPol)
|
||||
err := pbBits.FromProto(&msg.ProposalPol.ProposalPol)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("proposal PoL to proto error: %w", err)
|
||||
}
|
||||
|
||||
pb = &ProposalPOLMessage{
|
||||
Height: msg.ProposalPol.Height,
|
||||
ProposalPOLRound: msg.ProposalPol.ProposalPolRound,
|
||||
@@ -237,10 +244,13 @@ func MsgFromProto(msg *tmcons.Message) (Message, error) {
|
||||
case *tmcons.Message_VoteSetBits:
|
||||
bi, err := types.BlockIDFromProto(&msg.VoteSetBits.BlockID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("voteSetBits msg to proto error: %w", err)
|
||||
return nil, fmt.Errorf("block ID msg to proto error: %w", err)
|
||||
}
|
||||
bits := new(bits.BitArray)
|
||||
bits.FromProto(&msg.VoteSetBits.Votes)
|
||||
err = bits.FromProto(&msg.VoteSetBits.Votes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("votes to proto error: %w", err)
|
||||
}
|
||||
|
||||
pb = &VoteSetBitsMessage{
|
||||
Height: msg.VoteSetBits.Height,
|
||||
|
||||
Reference in New Issue
Block a user