Revision 6d7613d9dce4cfba281879dcd15edf3647b4e48b authored by William Banfield on 15 December 2021, 16:49:05 UTC, committed by William Banfield on 15 December 2021, 16:49:05 UTC
1 parent 9cd4cfe
msgs.go
package privval
import (
"fmt"
"github.com/gogo/protobuf/proto"
privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval"
)
// TODO: Add ChainIDRequest
func mustWrapMsg(pb proto.Message) privvalproto.Message {
msg := privvalproto.Message{}
switch pb := pb.(type) {
case *privvalproto.Message:
msg = *pb
case *privvalproto.PubKeyRequest:
msg.Sum = &privvalproto.Message_PubKeyRequest{PubKeyRequest: pb}
case *privvalproto.PubKeyResponse:
msg.Sum = &privvalproto.Message_PubKeyResponse{PubKeyResponse: pb}
case *privvalproto.SignVoteRequest:
msg.Sum = &privvalproto.Message_SignVoteRequest{SignVoteRequest: pb}
case *privvalproto.SignedVoteResponse:
msg.Sum = &privvalproto.Message_SignedVoteResponse{SignedVoteResponse: pb}
case *privvalproto.SignedProposalResponse:
msg.Sum = &privvalproto.Message_SignedProposalResponse{SignedProposalResponse: pb}
case *privvalproto.SignProposalRequest:
msg.Sum = &privvalproto.Message_SignProposalRequest{SignProposalRequest: pb}
case *privvalproto.PingRequest:
msg.Sum = &privvalproto.Message_PingRequest{PingRequest: pb}
case *privvalproto.PingResponse:
msg.Sum = &privvalproto.Message_PingResponse{PingResponse: pb}
default:
panic(fmt.Errorf("unknown message type %T", pb))
}
return msg
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...