From ede2ec8f82ddfe41cddb93a8b9b6f2d579fdb749 Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 28 Aug 2024 10:21:05 +0200 Subject: [PATCH] comments --- cmd/zetae2e/local/local.go | 10 ---------- cmd/zetae2e/local/tss_migration.go | 2 +- e2e/config/config.go | 2 +- e2e/runner/v2_migration.go | 9 +++++++++ zetaclient/chains/bitcoin/observer/observer.go | 4 ++++ 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index 092ff66ed7..9fcb718e26 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -3,7 +3,6 @@ package local import ( "context" "errors" - "math/big" "os" "path/filepath" "time" @@ -243,15 +242,6 @@ func localE2ETest(cmd *cobra.Command, _ []string) { // run the v2 migration if testV2Migration { - // deposit erc20 to ensure that the custody contract has funds to migrate - oneThousand := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(1000)) - erc20Deposit := deployerRunner.DepositERC20WithAmountAndMessage( - deployerRunner.EVMAddress(), - oneThousand, - []byte{}, - ) - deployerRunner.WaitForMinedCCTX(erc20Deposit) - deployerRunner.RunV2Migration() } diff --git a/cmd/zetae2e/local/tss_migration.go b/cmd/zetae2e/local/tss_migration.go index 62313b1b75..afe60d0be7 100644 --- a/cmd/zetae2e/local/tss_migration.go +++ b/cmd/zetae2e/local/tss_migration.go @@ -25,7 +25,7 @@ func tssMigrationTestRoutine( account := conf.AdditionalAccounts.UserMigration // initialize runner for migration test tssMigrationTestRunner, err := initTestRunner( - "TSSmigration", + "tssMigration", conf, deployerRunner, account, diff --git a/e2e/config/config.go b/e2e/config/config.go index 8ea123d964..15a7d57306 100644 --- a/e2e/config/config.go +++ b/e2e/config/config.go @@ -69,7 +69,7 @@ type AdditionalAccounts struct { UserEther Account `yaml:"user_ether"` UserMisc Account `yaml:"user_misc"` UserAdmin Account `yaml:"user_admin"` - UserMigration Account `yaml:"user_migration"` // used for TSS migration + UserMigration Account `yaml:"user_migration"` // used for TSS migration, TODO: rename (https://github.com/zeta-chain/node/issues/2780) UserPrecompile Account `yaml:"user_precompile"` UserV2Ether Account `yaml:"user_v2_ether"` UserV2ERC20 Account `yaml:"user_v2_erc20"` diff --git a/e2e/runner/v2_migration.go b/e2e/runner/v2_migration.go index d54ba1a2e2..abfb114409 100644 --- a/e2e/runner/v2_migration.go +++ b/e2e/runner/v2_migration.go @@ -19,6 +19,15 @@ import ( // RunV2Migration runs the process for the v2 migration func (r *E2ERunner) RunV2Migration() { + // prepare for v2 migration: deposit erc20 to ensure that the custody contract has funds to migrate + oneThousand := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(1000)) + erc20Deposit := r.DepositERC20WithAmountAndMessage( + r.EVMAddress(), + oneThousand, + []byte{}, + ) + r.WaitForMinedCCTX(erc20Deposit) + // Part 1: add new admin authorization r.Logger.Info("Part 1: Adding authorization for new v2 contracts") err := r.ZetaTxServer.AddAuthorization("/zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatus") diff --git a/zetaclient/chains/bitcoin/observer/observer.go b/zetaclient/chains/bitcoin/observer/observer.go index 8673b4c775..1e6af54ea4 100644 --- a/zetaclient/chains/bitcoin/observer/observer.go +++ b/zetaclient/chains/bitcoin/observer/observer.go @@ -456,8 +456,12 @@ func (ob *Observer) WatchUTXOs(ctx context.Context) error { } err := ob.FetchUTXOs(ctx) if err != nil { + // log debug log if the error if no wallet is loaded + // this is to prevent extensive logging in localnet when the wallet is not loaded for non-Bitcoin test if !strings.Contains(err.Error(), "No wallet is loaded") { ob.logger.UTXOs.Error().Err(err).Msg("error fetching btc utxos") + } else { + ob.logger.UTXOs.Debug().Msg("No wallet is loaded; retrying...") } } ticker.UpdateInterval(ob.GetChainParams().WatchUtxoTicker, ob.logger.UTXOs)