Skip to content

Commit

Permalink
rename err in dummy header
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Oct 2, 2023
1 parent a343118 commit a6716a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions headertest/dummy_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/celestiaorg/go-header"
)

var DummyHeaderError = errors.New("forced failure")
var ErrVerificationFailed = errors.New("forced failure")

type DummyHeader struct {
Chainid string
Expand Down Expand Up @@ -81,7 +81,7 @@ func (d *DummyHeader) IsExpired(period time.Duration) bool {

func (d *DummyHeader) Verify(hdr *DummyHeader) error {
if hdr.VerifyFailure {
return &header.VerifyError{Reason: DummyHeaderError, SoftFailure: hdr.SoftFailure}
return &header.VerifyError{Reason: ErrVerificationFailed, SoftFailure: hdr.SoftFailure}
}

// if adjacent, check PreviousHash -- this check is necessary
Expand Down
4 changes: 2 additions & 2 deletions headertest/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ func TestVerify(t *testing.T) {
untrusted.VerifyFailure = true
return untrusted
},
err: DummyHeaderError,
err: ErrVerificationFailed,
},
{
prepare: func() *DummyHeader {
untrusted := next()
untrusted.VerifyFailure = true
return untrusted
},
err: DummyHeaderError,
err: ErrVerificationFailed,
soft: true, // soft because non-adjacent
},
{
Expand Down

0 comments on commit a6716a0

Please sign in to comment.