ValidateBasic performs basic validation that doesn't involve state data. Does not actually check the cryptographic signatures.
()
| 875 | // ValidateBasic performs basic validation that doesn't involve state data. |
| 876 | // Does not actually check the cryptographic signatures. |
| 877 | func (commit *Commit) ValidateBasic() error { |
| 878 | if commit.Height < 0 { |
| 879 | return errors.New("negative Height") |
| 880 | } |
| 881 | if commit.Round < 0 { |
| 882 | return errors.New("negative Round") |
| 883 | } |
| 884 | |
| 885 | if commit.Height >= 1 { |
| 886 | if commit.BlockID.IsZero() { |
| 887 | return errors.New("commit cannot be for nil block") |
| 888 | } |
| 889 | |
| 890 | if len(commit.Signatures) == 0 { |
| 891 | return errors.New("no signatures in commit") |
| 892 | } |
| 893 | for i, commitSig := range commit.Signatures { |
| 894 | if err := commitSig.ValidateBasic(); err != nil { |
| 895 | return fmt.Errorf("wrong CommitSig #%d: %v", i, err) |
| 896 | } |
| 897 | } |
| 898 | } |
| 899 | return nil |
| 900 | } |
| 901 | |
| 902 | // Hash returns the hash of the commit |
| 903 | func (commit *Commit) Hash() tmbytes.HexBytes { |
nothing calls this directly
no test coverage detected