ToProto converts Header to protobuf
()
| 514 | |
| 515 | // ToProto converts Header to protobuf |
| 516 | func (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. |