Skip to content

Commit

Permalink
rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Jul 17, 2024
1 parent 113cdf0 commit 8d6265f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
e2etests.TestUpdateBytecodeZRC20Name,
e2etests.TestUpdateBytecodeConnectorName,
e2etests.TestDepositEtherLiquidityCapName,
e2etests.TestAdminTransactionsName,
e2etests.TestCriticalAdminTransactionsName,

// TestMigrateChainSupportName tests EVM chain migration. Currently this test doesn't work with Anvil because pre-EIP1559 txs are not supported
// See issue below for details
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/zetacored/zetacored_query_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ zetacored query crosschain [flags]
* [zetacored query crosschain show-cctx](zetacored_query_crosschain_show-cctx.md) - shows a CCTX
* [zetacored query crosschain show-gas-price](zetacored_query_crosschain_show-gas-price.md) - shows a gasPrice
* [zetacored query crosschain show-inbound-hash-to-cctx](zetacored_query_crosschain_show-inbound-hash-to-cctx.md) - shows a inboundHashToCctx
* [zetacored query crosschain show-inbound-tracker](zetacored_query_crosschain_show-inbound-tracker.md) - shows an inbound tracker by chainId and txHash
* [zetacored query crosschain show-inbound-tracker](zetacored_query_crosschain_show-inbound-tracker.md) - shows an inbound tracker by chainID and txHash
* [zetacored query crosschain show-outbound-tracker](zetacored_query_crosschain_show-outbound-tracker.md) - shows an outbound tracker
* [zetacored query crosschain show-rate-limiter-flags](zetacored_query_crosschain_show-rate-limiter-flags.md) - shows the rate limiter flags

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# query crosschain show-inbound-tracker

shows an inbound tracker by chainId and txHash
shows an inbound tracker by chainID and txHash

```
zetacored query crosschain show-inbound-tracker [chainId] [txHash] [flags]
zetacored query crosschain show-inbound-tracker [chainID] [txHash] [flags]
```

### Options
Expand Down
16 changes: 8 additions & 8 deletions e2e/e2etests/e2etests.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ const (
Admin tests
Test admin functionalities
*/
TestDepositEtherLiquidityCapName = "deposit_eth_liquidity_cap"
TestMigrateChainSupportName = "migrate_chain_support"
TestPauseZRC20Name = "pause_zrc20"
TestUpdateBytecodeZRC20Name = "update_bytecode_zrc20"
TestUpdateBytecodeConnectorName = "update_bytecode_connector"
TestRateLimiterName = "rate_limiter"
TestAdminTransactionsName = "admin_transactions"
TestDepositEtherLiquidityCapName = "deposit_eth_liquidity_cap"
TestMigrateChainSupportName = "migrate_chain_support"
TestPauseZRC20Name = "pause_zrc20"
TestUpdateBytecodeZRC20Name = "update_bytecode_zrc20"
TestUpdateBytecodeConnectorName = "update_bytecode_connector"
TestRateLimiterName = "rate_limiter"
TestCriticalAdminTransactionsName = "critical_admin_transactions"

TestMigrateTSSName = "migrate_TSS"

Expand Down Expand Up @@ -535,7 +535,7 @@ var AllE2ETests = []runner.E2ETest{
TestRateLimiter,
),
runner.NewE2ETest(
TestAdminTransactionsName,
TestCriticalAdminTransactionsName,
"test critical admin transactions",
[]runner.ArgDefinition{},
TestAdminTransactions,
Expand Down
7 changes: 3 additions & 4 deletions e2e/e2etests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ import (
"fmt"
"math/big"
"strconv"
"time"

"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcutil"
"github.com/cenkalti/backoff/v4"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
"github.com/zeta-chain/zetacore/pkg/chains"
"github.com/zeta-chain/zetacore/pkg/retry"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
)

func WaitNBlocks(r *runner.E2ERunner, n int64) {
func WaitForBlocks(r *runner.E2ERunner, n int64) {
height, err := r.CctxClient.LastZetaHeight(r.Ctx, &crosschaintypes.QueryLastZetaHeightRequest{})
if err != nil {
return

Check warning on line 24 in e2e/e2etests/helpers.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/helpers.go#L21-L24

Added lines #L21 - L24 were not covered by tests
Expand All @@ -28,7 +27,7 @@ func WaitNBlocks(r *runner.E2ERunner, n int64) {
return retry.Retry(waitForBlock(r, height.Height+n))

Check warning on line 27 in e2e/e2etests/helpers.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/helpers.go#L26-L27

Added lines #L26 - L27 were not covered by tests
}

bo := backoff.WithMaxRetries(backoff.NewConstantBackOff(5*time.Second), 10)
bo := retry.DefaultBackoff()
err = retry.DoWithBackoff(call, bo)
require.NoError(r, err, "failed to wait for %d blocks", n)

Check warning on line 32 in e2e/e2etests/helpers.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/helpers.go#L30-L32

Added lines #L30 - L32 were not covered by tests
}
Expand Down
5 changes: 3 additions & 2 deletions e2e/e2etests/test_admin_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2etests

import (
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
"github.com/zeta-chain/zetacore/pkg/chains"
Expand Down Expand Up @@ -36,7 +37,7 @@ func TestUpdateGasPriceIncreaseFlags(r *runner.E2ERunner) {
_, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, msgGasPriceFlags)
require.NoError(r, err)

Check warning on line 38 in e2e/e2etests/test_admin_transactions.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/test_admin_transactions.go#L37-L38

Added lines #L37 - L38 were not covered by tests

WaitNBlocks(r, 1)
WaitForBlocks(r, 1)

Check warning on line 40 in e2e/e2etests/test_admin_transactions.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/test_admin_transactions.go#L40

Added line #L40 was not covered by tests

flags, err := r.ObserverClient.CrosschainFlags(r.Ctx, &observertypes.QueryGetCrosschainFlagsRequest{})
require.NoError(r, err)

Check warning on line 43 in e2e/e2etests/test_admin_transactions.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/test_admin_transactions.go#L42-L43

Added lines #L42 - L43 were not covered by tests
Expand Down Expand Up @@ -66,7 +67,7 @@ func TestAddToInboundTracker(r *runner.E2ERunner) {
_, err = r.ZetaTxServer.BroadcastTx(utils.EmergencyPolicyName, msgBtc)
require.NoError(r, err)

Check warning on line 68 in e2e/e2etests/test_admin_transactions.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/test_admin_transactions.go#L67-L68

Added lines #L67 - L68 were not covered by tests

WaitNBlocks(r, 1)
WaitForBlocks(r, 1)

Check warning on line 70 in e2e/e2etests/test_admin_transactions.go

View check run for this annotation

Codecov / codecov/patch

e2e/e2etests/test_admin_transactions.go#L70

Added line #L70 was not covered by tests

tracker, err := r.CctxClient.InboundTracker(r.Ctx, &crosschaintypes.QueryInboundTrackerRequest{
ChainId: msgEth.ChainId,
Expand Down
4 changes: 2 additions & 2 deletions x/crosschain/client/cli/query_inbound_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func CmdShowInboundTracker() *cobra.Command {
cmd := &cobra.Command{
Use: "show-inbound-tracker [chainId] [txHash]",
Short: "shows an inbound tracker by chainId and txHash",
Use: "show-inbound-tracker [chainID] [txHash]",
Short: "shows an inbound tracker by chainID and txHash",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx := client.GetClientContextFromCmd(cmd)
Expand Down

0 comments on commit 8d6265f

Please sign in to comment.