ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.
()
| 923 | // ValidateBasic performs basic validation (checking param bounds, etc.) and |
| 924 | // returns an error if any check fails. |
| 925 | func (cfg *MempoolConfig) ValidateBasic() error { |
| 926 | if cfg.Size < 0 { |
| 927 | return errors.New("size can't be negative") |
| 928 | } |
| 929 | if cfg.MaxTxsBytes < 0 { |
| 930 | return errors.New("max-txs-bytes can't be negative") |
| 931 | } |
| 932 | if cfg.CacheSize < 0 { |
| 933 | return errors.New("cache-size can't be negative") |
| 934 | } |
| 935 | if cfg.MaxTxBytes < 0 { |
| 936 | return errors.New("max-tx-bytes can't be negative") |
| 937 | } |
| 938 | if cfg.TTLDuration < 0 { |
| 939 | return errors.New("ttl-duration can't be negative") |
| 940 | } |
| 941 | if cfg.TTLNumBlocks < 0 { |
| 942 | return errors.New("ttl-num-blocks can't be negative") |
| 943 | } |
| 944 | |
| 945 | return nil |
| 946 | } |
| 947 | |
| 948 | //----------------------------------------------------------------------------- |
| 949 | // StateSyncConfig |
nothing calls this directly
no outgoing calls
no test coverage detected