Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Aug 28, 2024
1 parent 2372ef5 commit ede2ec8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
10 changes: 0 additions & 10 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package local
import (
"context"
"errors"
"math/big"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -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()
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/zetae2e/local/tss_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func tssMigrationTestRoutine(
account := conf.AdditionalAccounts.UserMigration
// initialize runner for migration test
tssMigrationTestRunner, err := initTestRunner(
"TSSmigration",
"tssMigration",
conf,
deployerRunner,
account,
Expand Down
2 changes: 1 addition & 1 deletion e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
9 changes: 9 additions & 0 deletions e2e/runner/v2_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions zetaclient/chains/bitcoin/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ede2ec8

Please sign in to comment.