ToProto converts SignedHeader to protobuf
()
| 177 | |
| 178 | // ToProto converts SignedHeader to protobuf |
| 179 | func (sh *SignedHeader) ToProto() *tmproto.SignedHeader { |
| 180 | if sh == nil { |
| 181 | return nil |
| 182 | } |
| 183 | |
| 184 | psh := new(tmproto.SignedHeader) |
| 185 | if sh.Header != nil { |
| 186 | psh.Header = sh.Header.ToProto() |
| 187 | } |
| 188 | if sh.Commit != nil { |
| 189 | psh.Commit = sh.Commit.ToProto() |
| 190 | } |
| 191 | |
| 192 | return psh |
| 193 | } |
| 194 | |
| 195 | // FromProto sets a protobuf SignedHeader to the given pointer. |
| 196 | // It returns an error if the header or the commit is invalid. |