MCPcopy Create free account
hub / github.com/6boris/web3-template / validate

Method validate

api/service/data/base.pb.validate.go:161–273  ·  view source on GitHub ↗
(all bool)

Source from the content-addressed store, hash-verified

159}
160
161func (m *BlockItem) validate(all bool) error {
162 if m == nil {
163 return nil
164 }
165
166 var errors []error
167
168 // no validation rules for Number
169
170 // no validation rules for Hash
171
172 // no validation rules for ParentHash
173
174 // no validation rules for Timestamp
175
176 // no validation rules for Difficulty
177
178 // no validation rules for ExtraData
179
180 // no validation rules for GasLimit
181
182 // no validation rules for GasUsed
183
184 // no validation rules for BaseFeePerGas
185
186 // no validation rules for Miner
187
188 // no validation rules for MixHash
189
190 // no validation rules for Nonce
191
192 // no validation rules for ReceiptsRoot
193
194 // no validation rules for Sha3Uncles
195
196 // no validation rules for Size
197
198 // no validation rules for StateRoot
199
200 // no validation rules for TransactionsRoot
201
202 // no validation rules for TransactionsCount
203
204 // no validation rules for UnclesCount
205
206 // no validation rules for ChainId
207
208 // no validation rules for ChainUniqueId
209
210 if all {
211 switch v := interface{}(m.GetCreatedAt()).(type) {
212 case interface{ ValidateAll() error }:
213 if err := v.ValidateAll(); err != nil {
214 errors = append(errors, BlockItemValidationError{
215 field: "CreatedAt",
216 reason: "embedded message failed validation",
217 cause: err,
218 })

Callers 2

ValidateMethod · 0.95
ValidateAllMethod · 0.95

Calls 5

GetCreatedAtMethod · 0.95
GetUpdatedAtMethod · 0.95
BlockItemMultiErrorTypeAlias · 0.85
ValidateAllMethod · 0.45
ValidateMethod · 0.45

Tested by

no test coverage detected