Skip to content

Commit

Permalink
unconditionally update
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 6, 2024
1 parent 14c639d commit 2c42f12
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions e2e/runner/setup_evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,11 @@ func (r *E2ERunner) SetupEVM(contractsDeployed bool, whitelistERC20 bool) {
},
)
require.NoError(r, err, "failed to get chain params for chain %d", chains.GoerliLocalnet.ChainId)
chainParams := currentChainParamsRes.ChainParams
needsUpdate := false

if chainParams.Erc20CustodyContractAddress != r.ERC20CustodyAddr.Hex() {
chainParams.Erc20CustodyContractAddress = r.ERC20CustodyAddr.Hex()
needsUpdate = true
}
if chainParams.ConnectorContractAddress != r.ConnectorEthAddr.Hex() {
chainParams.ConnectorContractAddress = r.ConnectorEthAddr.Hex()
needsUpdate = true
}
if chainParams.ZetaTokenContractAddress != r.ZetaEthAddr.Hex() {
chainParams.ZetaTokenContractAddress = r.ZetaEthAddr.Hex()
needsUpdate = true
}

if !needsUpdate {
r.Logger.Info("Chain params are up to date")
return
}
chainParams := currentChainParamsRes.ChainParams
chainParams.Erc20CustodyContractAddress = r.ERC20CustodyAddr.Hex()
chainParams.ConnectorContractAddress = r.ConnectorEthAddr.Hex()
chainParams.ZetaTokenContractAddress = r.ZetaEthAddr.Hex()

_, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, observertypes.NewMsgUpdateChainParams(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
Expand Down

0 comments on commit 2c42f12

Please sign in to comment.