Skip to content

Commit

Permalink
chore: update to check err in QueryBtcLightClientMainchainAll
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Dec 9, 2024
1 parent 6704f78 commit 8dc8c44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/e2e/configurer/chain/queries_btclightclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package chain

import (
"encoding/base64"
"errors"
"net/url"
"strconv"

"github.com/cosmos/cosmos-sdk/types/query"
sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query"
"github.com/stretchr/testify/require"

"github.com/babylonlabs-io/babylon/test/e2e/util"
btclighttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
Expand Down Expand Up @@ -43,8 +45,11 @@ func (n *NodeConfig) QueryBtcLightClientMainchainAll() []*btclighttypes.BTCHeade
for {
resp, err := n.QueryBtcLightClientMainchain(pagination)
if err != nil {
// err could come as {"code":3,"message":"header specified by key does not exist","details":[]}
return headers
if errors.As(err, "header specified by key does not exist") {

Check failure on line 48 in test/e2e/configurer/chain/queries_btclightclient.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

errorsas: second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type (govet)

Check failure on line 48 in test/e2e/configurer/chain/queries_btclightclient.go

View workflow job for this annotation

GitHub Actions / lint_test / unit-tests

second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type
// err could come as {"code":3,"message":"header specified by key does not exist","details":[]}
return headers
}
require.NoError(n.t, err)
}

headers = append(headers, resp.Headers...)
Expand Down

0 comments on commit 8dc8c44

Please sign in to comment.