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

Method ToProto

types/block.go:516–537  ·  view source on GitHub ↗

ToProto converts Header to protobuf

()

Source from the content-addressed store, hash-verified

514
515// ToProto converts Header to protobuf
516func (h *Header) ToProto() *tmproto.Header {
517 if h == nil {
518 return nil
519 }
520
521 return &tmproto.Header{
522 Version: h.Version,
523 ChainID: h.ChainID,
524 Height: h.Height,
525 Time: h.Time,
526 LastBlockId: h.LastBlockID.ToProto(),
527 ValidatorsHash: h.ValidatorsHash,
528 NextValidatorsHash: h.NextValidatorsHash,
529 ConsensusHash: h.ConsensusHash,
530 AppHash: h.AppHash,
531 DataHash: h.DataHash,
532 EvidenceHash: h.EvidenceHash,
533 LastResultsHash: h.LastResultsHash,
534 LastCommitHash: h.LastCommitHash,
535 ProposerAddress: h.ProposerAddress,
536 }
537}
538
539// FromProto sets a protobuf Header to the given pointer.
540// It returns an error if the header is invalid.

Callers 1

TestMaxHeaderBytesFunction · 0.95

Calls 1

ToProtoMethod · 0.45

Tested by 1

TestMaxHeaderBytesFunction · 0.76