MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / ToProto

Method ToProto

types/block.go:939–956  ·  view source on GitHub ↗

ToProto converts Commit to protobuf

()

Source from the content-addressed store, hash-verified

937
938// ToProto converts Commit to protobuf
939func (commit *Commit) ToProto() *tmproto.Commit {
940 if commit == nil {
941 return nil
942 }
943
944 c := new(tmproto.Commit)
945 sigs := make([]tmproto.CommitSig, len(commit.Signatures))
946 for i := range commit.Signatures {
947 sigs[i] = *commit.Signatures[i].ToProto()
948 }
949 c.Signatures = sigs
950
951 c.Height = commit.Height
952 c.Round = commit.Round
953 c.BlockID = commit.BlockID.ToProto()
954
955 return c
956}
957
958// FromProto sets a protobuf Commit to the given pointer.
959// It returns an error if the commit is invalid.

Callers 1

TestMaxCommitBytesFunction · 0.95

Calls 1

ToProtoMethod · 0.45

Tested by 1

TestMaxCommitBytesFunction · 0.76