mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-18 07:48:46 +00:00
3c61cc7d8a
* allow checkpoint or genesis origin; refactoring some quick readability improvements and simplifying the logic enforcing the startup ordering of the attestation processing routine * address PR feedback * gofmt * Update beacon-chain/blockchain/receive_attestation.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Apply suggestions from code review use log.WithError for aggregation friendliness Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> Co-authored-by: kasey <kasey@users.noreply.github.com> Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
25 lines
704 B
Go
25 lines
704 B
Go
package kv
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestWrappedSentinelError(t *testing.T) {
|
|
e := ErrNotFoundOriginBlockRoot
|
|
if !errors.Is(e, ErrNotFoundOriginBlockRoot) {
|
|
t.Error("expected that a copy of ErrNotFoundOriginBlockRoot would have an is-a relationship")
|
|
}
|
|
|
|
outer := errors.New("wrapped error")
|
|
e2 := DBError{Wraps: ErrNotFoundOriginBlockRoot, Outer: outer}
|
|
if !errors.Is(e2, ErrNotFoundOriginBlockRoot) {
|
|
t.Error("expected that errors.Is would know DBError wraps ErrNotFoundOriginBlockRoot")
|
|
}
|
|
|
|
// test that the innermost not found error is detected
|
|
if !errors.Is(e2, ErrNotFound) {
|
|
t.Error("expected that errors.Is would know ErrNotFoundOriginBlockRoot wraps ErrNotFound")
|
|
}
|
|
}
|