-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update tss address on connectors and custody contracts (#2661)
* rebase develop * rebase develop * add connectors * debug fees * debug fees * auto remove tracker * rebase develop * debug crosschainswap * debud btc swap * enable deposit btc * enable deposit btc * ad changelog * update cctx timeout * update cctx timeout * move to unreleased * move to unreleased * move to unreleased * generate * refactor migration to tss-migration * add issue to track increase in DefaultCctxTimeout * move migration test to a separate file * generate files * generate files * increase DefaultCctxTimeout * rename to admin evm * add unit test for failed to set outbound info * reduce cctx time to try getting CI to run successfully * increase cctx timeout * increase timeout for tss migration tests
- Loading branch information
Showing
18 changed files
with
190 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package local | ||
|
||
import ( | ||
"os" | ||
"time" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/zeta-chain/zetacore/e2e/config" | ||
"github.com/zeta-chain/zetacore/e2e/e2etests" | ||
"github.com/zeta-chain/zetacore/e2e/runner" | ||
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" | ||
) | ||
|
||
func TSSMigration(deployerRunner *runner.E2ERunner, logger *runner.Logger, verbose bool, conf config.Config) { | ||
migrationStartTime := time.Now() | ||
logger.Print("🏁 starting tss migration") | ||
|
||
response, err := deployerRunner.CctxClient.LastZetaHeight( | ||
deployerRunner.Ctx, | ||
&crosschaintypes.QueryLastZetaHeightRequest{}, | ||
) | ||
require.NoError(deployerRunner, err) | ||
err = deployerRunner.ZetaTxServer.UpdateKeygen(response.Height) | ||
require.NoError(deployerRunner, err) | ||
|
||
// Generate new TSS | ||
waitKeygenHeight(deployerRunner.Ctx, deployerRunner.CctxClient, deployerRunner.ObserverClient, logger, 0) | ||
|
||
// Run migration | ||
// migrationRoutine runs migration e2e test , which migrates funds from the older TSS to the new one | ||
// The zetaclient restarts required for this process are managed by the background workers in zetaclient (TSSListener) | ||
fn := migrationRoutine(conf, deployerRunner, verbose, e2etests.TestMigrateTSSName) | ||
|
||
if err := fn(); err != nil { | ||
logger.Print("❌ %v", err) | ||
logger.Print("❌ tss migration failed") | ||
os.Exit(1) | ||
} | ||
deployerRunner.UpdateTssAddressForConnector() | ||
deployerRunner.UpdateTssAddressForErc20custody() | ||
logger.Print("✅ migration completed in %s ", time.Since(migrationStartTime).String()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package runner | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/ethereum/go-ethereum/accounts/abi/bind" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/zeta-chain/zetacore/e2e/utils" | ||
) | ||
|
||
func (r *E2ERunner) UpdateTssAddressForConnector() { | ||
require.NoError(r, r.SetTSSAddresses()) | ||
|
||
tx, err := r.ConnectorEth.UpdateTssAddress(r.EVMAuth, r.TSSAddress) | ||
require.NoError(r, err) | ||
r.Logger.Info(fmt.Sprintf("TSS Address Update Tx: %s", tx.Hash().String())) | ||
receipt := utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) | ||
utils.RequireTxSuccessful(r, receipt) | ||
|
||
tssAddressOnConnector, err := r.ConnectorEth.TssAddress(&bind.CallOpts{Context: r.Ctx}) | ||
require.NoError(r, err) | ||
require.Equal(r, r.TSSAddress, tssAddressOnConnector) | ||
} | ||
|
||
func (r *E2ERunner) UpdateTssAddressForErc20custody() { | ||
require.NoError(r, r.SetTSSAddresses()) | ||
|
||
tx, err := r.ERC20Custody.UpdateTSSAddress(r.EVMAuth, r.TSSAddress) | ||
require.NoError(r, err) | ||
r.Logger.Info(fmt.Sprintf("TSS ERC20 Address Update Tx: %s", tx.Hash().String())) | ||
receipt := utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) | ||
utils.RequireTxSuccessful(r, receipt) | ||
|
||
tssAddressOnCustody, err := r.ERC20Custody.TSSAddress(&bind.CallOpts{Context: r.Ctx}) | ||
require.NoError(r, err) | ||
require.Equal(r, r.TSSAddress, tssAddressOnCustody) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.