Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(errors): test failures #10879

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion errors/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (s *abciTestSuite) TestABCIInfoStacktrace() {
},
}

const thisTestSrc = "github.com/cosmos/cosmos-sdk/types/errors.(*abciTestSuite).TestABCIInfoStacktrace"
const thisTestSrc = "github.com/cosmos/cosmos-sdk/errors.(*abciTestSuite).TestABCIInfoStacktrace"

for testName, tc := range cases {
_, _, log := ABCIInfo(tc.err, tc.debug)
Expand Down
6 changes: 3 additions & 3 deletions errors/stacktrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func trimInternal(st errors.StackTrace) errors.StackTrace {
// manual error creation, or runtime for caught panics
for matchesFunc(st[0],
// where we create errors
"github.com/cosmos/cosmos-sdk/types/errors.Wrap",
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf",
"github.com/cosmos/cosmos-sdk/types/errors.WithType",
"github.com/cosmos/cosmos-sdk/errors.Wrap",
"github.com/cosmos/cosmos-sdk/errors.Wrapf",
"github.com/cosmos/cosmos-sdk/errors.WithType",
// runtime are added on panics
"runtime.",
// _test is defined in coverage tests, causing failure
Expand Down
6 changes: 3 additions & 3 deletions errors/stacktrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func (s *errorsTestSuite) TestStackTrace() {

// Wrapping code is unwanted in the errors stack trace.
unwantedSrc := []string{
"github.com/cosmos/cosmos-sdk/types/errors.Wrap\n",
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf\n",
"github.com/cosmos/cosmos-sdk/errors.Wrap\n",
"github.com/cosmos/cosmos-sdk/errors.Wrapf\n",
"runtime.goexit\n",
}
const thisTestSrc = "types/errors/stacktrace_test.go"
const thisTestSrc = "errors/stacktrace_test.go"

for _, tc := range cases {
s.Require().True(reflect.DeepEqual(tc.err.Error(), tc.wantError))
Expand Down