Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Jun 19, 2024
1 parent 287cad8 commit b031671
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion e2e/e2etests/helper_bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ func withdrawBTCZRC20(r *runner.E2ERunner, to btcutil.Address, amount *big.Int)

// get cctx and check status
cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, receipt.TxHash.Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status, "cctx status is not OutboundMined")
require.Equal(
r,
crosschaintypes.CctxStatus_OutboundMined,
cctx.CctxStatus.Status,
"cctx status is not OutboundMined",
)

// get bitcoin tx according to the outTxHash in cctx
outTxHash := cctx.GetCurrentOutboundParam().Hash
Expand Down
1 change: 1 addition & 0 deletions e2e/e2etests/test_bitcoin_deposit_refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
"github.com/zeta-chain/zetacore/x/crosschain/types"
Expand Down
1 change: 1 addition & 0 deletions e2e/e2etests/test_bitcoin_withdraw_multiple.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/btcsuite/btcutil"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/pkg/chains"
)
Expand Down
11 changes: 9 additions & 2 deletions e2e/utils/zetacore.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/stretchr/testify/require"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
)

type CCTXClient = crosschaintypes.QueryClient
Expand Down Expand Up @@ -192,7 +193,13 @@ type waitConfig struct {
}

// WaitCctxByInboundHash waits until cctx appears by inbound hash.
func WaitCctxByInboundHash(ctx context.Context, t require.TestingT, hash string, c CCTXClient, opts ...WaitOpts) []crosschaintypes.CrossChainTx {
func WaitCctxByInboundHash(
ctx context.Context,
t require.TestingT,
hash string,
c CCTXClient,
opts ...WaitOpts,
) []crosschaintypes.CrossChainTx {
const tick = time.Millisecond * 200

if _, hasDeadline := ctx.Deadline(); !hasDeadline {
Expand Down

0 comments on commit b031671

Please sign in to comment.