Hash returns the hash of the commit
()
| 892 | |
| 893 | // Hash returns the hash of the commit |
| 894 | func (commit *Commit) Hash() tmbytes.HexBytes { |
| 895 | if commit == nil { |
| 896 | return nil |
| 897 | } |
| 898 | if commit.hash == nil { |
| 899 | bs := make([][]byte, len(commit.Signatures)) |
| 900 | for i, commitSig := range commit.Signatures { |
| 901 | pbcs := commitSig.ToProto() |
| 902 | bz, err := pbcs.Marshal() |
| 903 | if err != nil { |
| 904 | panic(err) |
| 905 | } |
| 906 | |
| 907 | bs[i] = bz |
| 908 | } |
| 909 | commit.hash = merkle.HashFromByteSlices(bs) |
| 910 | } |
| 911 | return commit.hash |
| 912 | } |
| 913 | |
| 914 | // StringIndented returns a string representation of the commit. |
| 915 | func (commit *Commit) StringIndented(indent string) string { |
nothing calls this directly
no test coverage detected