mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
07a0a95ee7
* use real blob verifier in forkchoice spectest * wip * Use real blob sidecar for test * Set file db correctly * correctly handle blob cases where valid=false * work-around spectest's weird Fork in genesis state * gaz * revert T-money's log level change * rm whitespace * unskip minimal test * Preston's feedback --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package verification
|
|
|
|
import "github.com/pkg/errors"
|
|
|
|
// ErrMissingVerification indicates that the given verification function was never performed on the value.
|
|
var ErrMissingVerification = errors.New("verification was not performed for requirement")
|
|
|
|
// VerificationMultiError is a custom error that can be used to access individual verification failures.
|
|
type VerificationMultiError struct {
|
|
r *results
|
|
err error
|
|
}
|
|
|
|
// Unwrap is used by errors.Is to unwrap errors.
|
|
func (ve VerificationMultiError) Unwrap() error {
|
|
if ve.err == nil {
|
|
return nil
|
|
}
|
|
return ve.err
|
|
}
|
|
|
|
// Error satisfies the standard error interface.
|
|
func (ve VerificationMultiError) Error() string {
|
|
if ve.err == nil {
|
|
return ""
|
|
}
|
|
return ve.err.Error()
|
|
}
|
|
|
|
// Failures provides access to map of Requirements->error messages
|
|
// so that calling code can introspect on what went wrong.
|
|
func (ve VerificationMultiError) Failures() map[Requirement]error {
|
|
return ve.r.failures()
|
|
}
|
|
|
|
func newVerificationMultiError(r *results, err error) VerificationMultiError {
|
|
return VerificationMultiError{r: r, err: err}
|
|
}
|