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