Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add separate accounts for each policy in e2e tests #2459

Merged
merged 5 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
* [2349](https://github.com/zeta-chain/node/pull/2349) - add TestBitcoinDepositRefund and WithdrawBitcoinMultipleTimes E2E tests
* [2368](https://github.com/zeta-chain/node/pull/2368) - eliminate panic usage across testing suite
* [2369](https://github.com/zeta-chain/node/pull/2369) - fix random cross-chain swap failure caused by using tiny UTXO
* [2549](https://github.com/zeta-chain/node/pull/2459) - add separate accounts for each policy in e2e tests
* [2415](https://github.com/zeta-chain/node/pull/2415) - add e2e test for upgrade and test admin functionalities


### Fixes

* [1484](https://github.com/zeta-chain/node/issues/1484) - replaced hard-coded `MaxLookaheadNonce` with a default lookback factor
Expand Down
17 changes: 13 additions & 4 deletions cmd/zetae2e/config/localnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@ additional_accounts:
bech32_address: "zeta17w0adeg64ky0daxwd2ugyuneellmjgnx4e483s"
evm_address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
private_key: "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
user_fungible_admin:
bech32_address: "zeta1svzuz982w09vf2y08xsh8qplj36phyz466krj3"
evm_address: "0x8305C114Ea73cAc4A88f39A173803F94741b9055"
private_key: "d88d09a7d6849c15a36eb6931f9dd616091a63e9849a2cc86f309ba11fb8fec5"
policy_accounts:
emergency_policy_account:
bech32_address: "zeta16m2cnrdwtgweq4njc6t470vl325gw4kp6s7tap"
evm_address: "0xd6d5898dAE5A1D905672c6975F3d9f8aA88756C1"
private_key: "88BE93D11624B794F4BCC77BEA7385AF7EAD0B183B913485C74F0A803ABBC3F0"
operational_policy_account:
bech32_address: "zeta1pgx85vzx4fzh5zzyjqgs6a6cmaujd0xs8efrkc"
evm_address: "0x0A0c7a3046AA457A084490110d7758Df7926bcd0"
private_key: "59D1B982BD446545A1740ABD01F1ED9C162B72ACC1522B9B71B6DB5A9C37FA7D"
admin_policy_account:
bech32_address: "zeta142ds9x7raljv2qz9euys93e64gjmgdfnc47dwq"
evm_address: "0xAa9b029BC3EFe4c50045Cf0902c73aAa25b43533"
private_key: "0595CB0CD9BF5264A85A603EC8E43C30ADBB5FD2D9E2EF84C374EA4A65BB616C"
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
rpcs:
zevm: "http://zetacore0:8545"
evm: "http://eth:8545"
Expand Down
8 changes: 6 additions & 2 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ func localE2ETest(cmd *cobra.Command, _ []string) {

zetaTxServer, err := txserver.NewZetaTxServer(
conf.RPCs.ZetaCoreRPC,
[]string{utils.FungibleAdminName},
[]string{conf.AdditionalAccounts.UserFungibleAdmin.RawPrivateKey.String()},
[]string{utils.EmergencyPolicyName, utils.OperationalPolicyName, utils.AdminPolicyName},
[]string{
conf.PolicyAccounts.EmergencyPolicyAccount.RawPrivateKey.String(),
conf.PolicyAccounts.OperationalPolicyAccount.RawPrivateKey.String(),
conf.PolicyAccounts.AdminPolicyAccount.RawPrivateKey.String(),
},
conf.ZetaChainID,
)
noError(err)
Expand Down
27 changes: 22 additions & 5 deletions contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,20 @@ then

# set admin account
zetacored add-genesis-account zeta1n0rn6sne54hv7w2uu93fl48ncyqz97d3kty6sh 100000000000000000000000000azeta # Funds the localnet_gov_admin account

address=$(yq -r '.additional_accounts.user_fungible_admin.bech32_address' /root/config.yml)

emergency_policy=$(yq -r '.policy_accounts.emergency_policy_account.bech32_address' /root/config.yml)
admin_policy=$(yq -r '.policy_accounts.admin_policy_account.bech32_address' /root/config.yml)
operational_policy=$(yq -r '.policy_accounts.operational_policy_account.bech32_address' /root/config.yml)

kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

zetacored add-genesis-account "$address" 100000000000000000000000000azeta
cat $HOME/.zetacored/config/genesis.json | jq --arg address "$address" '.app_state["authority"]["policies"]["items"][0]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq --arg address "$address" '.app_state["authority"]["policies"]["items"][1]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq --arg address "$address" '.app_state["authority"]["policies"]["items"][2]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
zetacored add-genesis-account "$emergency_policy" 100000000000000000000000000azeta
zetacored add-genesis-account "$admin_policy" 100000000000000000000000000azeta
zetacored add-genesis-account "$operational_policy" 100000000000000000000000000azeta

cat $HOME/.zetacored/config/genesis.json | jq --arg address "$emergency_policy" '.app_state["authority"]["policies"]["items"][0]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq --arg address "$operational_policy" '.app_state["authority"]["policies"]["items"][1]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq --arg address "$admin_policy" '.app_state["authority"]["policies"]["items"][2]["address"] = $address' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

# give balance to runner accounts to deploy contracts directly on zEVM
# default account
Expand All @@ -242,6 +250,15 @@ then
# ethers tester
address=$(yq -r '.additional_accounts.user_ether.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
# emergency policy account
address=$(yq -r '.policy_accounts.emergency_policy_account.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
# admin policy account
address=$(yq -r '.policy_accounts.admin_policy_account.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
# operational policy account
address=$(yq -r '.policy_accounts.operational_policy_account.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

# 3. Copy the genesis.json to all the nodes .And use it to create a gentx for every node
zetacored gentx operator 1000000000000000000000azeta --chain-id=$CHAINID --keyring-backend=$KEYRING --gas-prices 20000000000azeta
Expand Down
55 changes: 44 additions & 11 deletions e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
// Default account to use when running tests and running setup
DefaultAccount Account `yaml:"default_account"`
AdditionalAccounts AdditionalAccounts `yaml:"additional_accounts"`
PolicyAccounts PolicyAccounts `yaml:"policy_accounts"`
RPCs RPCs `yaml:"rpcs"`
Contracts Contracts `yaml:"contracts"`
ZetaChainID string `yaml:"zeta_chain_id"`
Expand All @@ -57,14 +58,19 @@

// AdditionalAccounts are extra accounts required to run specific tests
type AdditionalAccounts struct {
UserERC20 Account `yaml:"user_erc20"`
UserZetaTest Account `yaml:"user_zeta_test"`
UserZEVMMPTest Account `yaml:"user_zevm_mp_test"`
UserBitcoin Account `yaml:"user_bitcoin"`
UserEther Account `yaml:"user_ether"`
UserMisc Account `yaml:"user_misc"`
UserAdmin Account `yaml:"user_admin"`
UserFungibleAdmin Account `yaml:"user_fungible_admin"`
UserERC20 Account `yaml:"user_erc20"`
UserZetaTest Account `yaml:"user_zeta_test"`
UserZEVMMPTest Account `yaml:"user_zevm_mp_test"`
UserBitcoin Account `yaml:"user_bitcoin"`
UserEther Account `yaml:"user_ether"`
UserMisc Account `yaml:"user_misc"`
UserAdmin Account `yaml:"user_admin"`
}

type PolicyAccounts struct {
EmergencyPolicyAccount Account `yaml:"emergency_policy_account"`
OperationalPolicyAccount Account `yaml:"operational_policy_account"`
AdminPolicyAccount Account `yaml:"admin_policy_account"`
}

// RPCs contains the configuration for the RPC endpoints
Expand Down Expand Up @@ -192,7 +198,14 @@
a.UserEther,
a.UserMisc,
a.UserAdmin,
a.UserFungibleAdmin,
}
}

func (a PolicyAccounts) AsSlice() []Account {
return []Account{
a.EmergencyPolicyAccount,
a.OperationalPolicyAccount,
a.AdminPolicyAccount,

Check warning on line 208 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L204-L208

Added lines #L204 - L208 were not covered by tests
lumtis marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -216,9 +229,21 @@
}
err := account.Validate()
if err != nil {
return fmt.Errorf("validating account %d: %w", i, err)
return fmt.Errorf("validating additional account %d: %w", i, err)

Check warning on line 232 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L232

Added line #L232 was not covered by tests
}
}

policyAccounts := c.PolicyAccounts.AsSlice()
for i, account := range policyAccounts {
if account.RawEVMAddress == "" {
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
continue

Check warning on line 239 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L236-L239

Added lines #L236 - L239 were not covered by tests
}
err := account.Validate()
if err != nil {
return fmt.Errorf("validating policy account %d: %w", i, err)

Check warning on line 243 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L241-L243

Added lines #L241 - L243 were not covered by tests
}
}
lumtis marked this conversation as resolved.
Show resolved Hide resolved

return nil
}

Expand Down Expand Up @@ -257,7 +282,15 @@
if err != nil {
return err
}
c.AdditionalAccounts.UserFungibleAdmin, err = generateAccount()
c.PolicyAccounts.EmergencyPolicyAccount, err = generateAccount()
if err != nil {
return err

Check warning on line 287 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L287

Added line #L287 was not covered by tests
}
c.PolicyAccounts.OperationalPolicyAccount, err = generateAccount()
if err != nil {
return err

Check warning on line 291 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L291

Added line #L291 was not covered by tests
}
c.PolicyAccounts.AdminPolicyAccount, err = generateAccount()
lumtis marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
Expand Down
8 changes: 6 additions & 2 deletions e2e/e2etests/test_erc20_deposit_refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ func TestERC20DepositAndCallRefund(r *runner.E2ERunner, _ []string) {
r.Logger.CCTX(*cctx, "deposit")
r.Logger.Info("Refunding the cctx via admin")

msg := types.NewMsgRefundAbortedCCTX(r.ZetaTxServer.GetAccountAddress(0), cctx.Index, r.EVMAddress().String())
msg := types.NewMsgRefundAbortedCCTX(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
cctx.Index,
r.EVMAddress().String(),
)

_, err = r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg)
_, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, msg)
require.NoError(r, err)

// Check that the erc20 in the aborted cctx was refunded on ZetaChain
Expand Down
8 changes: 4 additions & 4 deletions e2e/e2etests/test_eth_deposit_liquidity_cap.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ func TestDepositEtherLiquidityCap(r *runner.E2ERunner, args []string) {
amountLessThanCap := liquidityCapArg.BigInt().Div(liquidityCapArg.BigInt(), big.NewInt(10)) // 1/10 of the cap
amountMoreThanCap := liquidityCapArg.BigInt().Mul(liquidityCapArg.BigInt(), big.NewInt(10)) // 10 times the cap
msg := fungibletypes.NewMsgUpdateZRC20LiquidityCap(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
r.ETHZRC20Addr.Hex(),
liquidityCap,
)
res, err := r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg)
res, err := r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, msg)
require.NoError(r, err)

r.Logger.Info("set liquidity cap tx hash: %s", res.TxHash)
Expand Down Expand Up @@ -69,12 +69,12 @@ func TestDepositEtherLiquidityCap(r *runner.E2ERunner, args []string) {

r.Logger.Info("Removing the liquidity cap")
msg = fungibletypes.NewMsgUpdateZRC20LiquidityCap(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
r.ETHZRC20Addr.Hex(),
math.ZeroUint(),
)

res, err = r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg)
res, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, msg)
require.NoError(r, err)

r.Logger.Info("remove liquidity cap tx hash: %s", res.TxHash)
Expand Down
41 changes: 21 additions & 20 deletions e2e/e2etests/test_migrate_chain_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,28 @@ func TestMigrateChainSupport(r *runner.E2ERunner, _ []string) {

// update the chain params to set up the chain
chainParams := getNewEVMChainParams(newRunner)
adminAddr, err := newRunner.ZetaTxServer.GetAccountAddressFromName(utils.FungibleAdminName)
require.NoError(r, err)

_, err = newRunner.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, observertypes.NewMsgUpdateChainParams(
adminAddr,
_, err = newRunner.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, observertypes.NewMsgUpdateChainParams(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
chainParams,
))
require.NoError(r, err)

// setup the gas token
require.NoError(r, err)
_, err = newRunner.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, fungibletypes.NewMsgDeployFungibleCoinZRC20(
adminAddr,
"",
chainParams.ChainId,
18,
"Sepolia ETH",
"sETH",
coin.CoinType_Gas,
100000,
))
_, err = newRunner.ZetaTxServer.BroadcastTx(
utils.OperationalPolicyName,
fungibletypes.NewMsgDeployFungibleCoinZRC20(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
"",
chainParams.ChainId,
18,
"Sepolia ETH",
"sETH",
coin.CoinType_Gas,
100000,
),
)
require.NoError(r, err)

// set the gas token in the runner
Expand All @@ -95,8 +96,8 @@ func TestMigrateChainSupport(r *runner.E2ERunner, _ []string) {
newRunner.ETHZRC20 = ethZRC20

// set the chain nonces for the new chain
_, err = r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, observertypes.NewMsgResetChainNonces(
adminAddr,
_, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, observertypes.NewMsgResetChainNonces(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
chainParams.ChainId,
0,
0,
Expand All @@ -106,8 +107,8 @@ func TestMigrateChainSupport(r *runner.E2ERunner, _ []string) {
// deactivate the previous chain
chainParams = observertypes.GetDefaultGoerliLocalnetChainParams()
chainParams.IsSupported = false
_, err = newRunner.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, observertypes.NewMsgUpdateChainParams(
adminAddr,
_, err = newRunner.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, observertypes.NewMsgUpdateChainParams(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
chainParams,
))
require.NoError(r, err)
Expand Down Expand Up @@ -155,8 +156,8 @@ func TestMigrateChainSupport(r *runner.E2ERunner, _ []string) {

// whitelist erc20 zrc20
newRunner.Logger.Info("whitelisting ERC20 on new network")
res, err := newRunner.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, crosschaintypes.NewMsgWhitelistERC20(
adminAddr,
res, err := newRunner.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, crosschaintypes.NewMsgWhitelistERC20(
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
newRunner.ERC20Addr.Hex(),
chains.Sepolia.ChainId,
"USDT",
Expand Down
8 changes: 4 additions & 4 deletions e2e/e2etests/test_pause_zrc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func TestPauseZRC20(r *runner.E2ERunner, _ []string) {
// Pause ETH ZRC20
r.Logger.Info("Pausing ETH")
msgPause := fungibletypes.NewMsgPauseZRC20(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.EmergencyPolicyName),
[]string{r.ETHZRC20Addr.Hex()},
)
res, err := r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msgPause)
res, err := r.ZetaTxServer.BroadcastTx(utils.EmergencyPolicyName, msgPause)
require.NoError(r, err)
r.Logger.Info("pause zrc20 tx hash: %s", res.TxHash)

Expand Down Expand Up @@ -106,10 +106,10 @@ func TestPauseZRC20(r *runner.E2ERunner, _ []string) {
// Unpause ETH ZRC20
r.Logger.Info("Unpausing ETH")
msgUnpause := fungibletypes.NewMsgUnpauseZRC20(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.OperationalPolicyName),
[]string{r.ETHZRC20Addr.Hex()},
)
res, err = r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msgUnpause)
res, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, msgUnpause)
require.NoError(r, err)

r.Logger.Info("unpause zrc20 tx hash: %s", res.TxHash)
Expand Down
4 changes: 2 additions & 2 deletions e2e/e2etests/test_rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ func waitForWithdrawMined(

// setupRateLimiterFlags sets up the rate limiter flags with flags defined in the test
func setupRateLimiterFlags(r *runner.E2ERunner, flags crosschaintypes.RateLimiterFlags) error {
adminAddr, err := r.ZetaTxServer.GetAccountAddressFromName(utils.FungibleAdminName)
adminAddr, err := r.ZetaTxServer.GetAccountAddressFromName(utils.OperationalPolicyName)
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
_, err = r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, crosschaintypes.NewMsgUpdateRateLimiterFlags(
_, err = r.ZetaTxServer.BroadcastTx(utils.OperationalPolicyName, crosschaintypes.NewMsgUpdateRateLimiterFlags(
adminAddr,
flags,
))
Expand Down
4 changes: 2 additions & 2 deletions e2e/e2etests/test_update_bytecode_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func TestUpdateBytecodeConnector(r *runner.E2ERunner, _ []string) {

r.Logger.Info("Updating the bytecode of the Connector")
msg := fungibletypes.NewMsgUpdateContractBytecode(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.AdminPolicyName),
r.ConnectorZEVMAddr.Hex(),
codeHashRes.CodeHash,
)
res, err := r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg)
res, err := r.ZetaTxServer.BroadcastTx(utils.AdminPolicyName, msg)
require.NoError(r, err)
r.Logger.Info("Update connector bytecode tx hash: %s", res.TxHash)

Expand Down
4 changes: 2 additions & 2 deletions e2e/e2etests/test_update_bytecode_zrc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func TestUpdateBytecodeZRC20(r *runner.E2ERunner, _ []string) {

r.Logger.Info("Updating the bytecode of the ZRC20")
msg := fungibletypes.NewMsgUpdateContractBytecode(
r.ZetaTxServer.GetAccountAddress(0),
r.ZetaTxServer.MustGetAccountAddressFromName(utils.AdminPolicyName),
r.ETHZRC20Addr.Hex(),
codeHashRes.CodeHash,
)
res, err := r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg)
res, err := r.ZetaTxServer.BroadcastTx(utils.AdminPolicyName, msg)
require.NoError(r, err)

r.Logger.Info("Update zrc20 bytecode tx hash: %s", res.TxHash)
Expand Down
6 changes: 3 additions & 3 deletions e2e/runner/setup_zeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r *E2ERunner) SetZEVMContracts() {

// deploy system contracts and ZRC20 contracts on ZetaChain
uniswapV2FactoryAddr, uniswapV2RouterAddr, zevmConnectorAddr, wzetaAddr, erc20zrc20Addr, err := r.ZetaTxServer.DeploySystemContractsAndZRC20(
e2eutils.FungibleAdminName,
e2eutils.OperationalPolicyName,
r.ERC20Addr.Hex(),
)
require.NoError(r, err)
Expand Down Expand Up @@ -209,12 +209,12 @@ func (r *E2ERunner) SetupBTCZRC20() {
func (r *E2ERunner) EnableHeaderVerification(chainIDList []int64) error {
r.Logger.Print("⚙️ enabling verification flags for block headers")

return r.ZetaTxServer.EnableHeaderVerification(e2eutils.FungibleAdminName, chainIDList)
return r.ZetaTxServer.EnableHeaderVerification(e2eutils.OperationalPolicyName, chainIDList)
}

// FundEmissionsPool funds the emissions pool on ZetaChain with the same value as used originally on mainnet (20M ZETA)
func (r *E2ERunner) FundEmissionsPool() error {
r.Logger.Print("⚙️ funding the emissions pool on ZetaChain with 20M ZETA (%s)", txserver.EmissionsPoolAddress)

return r.ZetaTxServer.FundEmissionsPool(e2eutils.FungibleAdminName, EmissionsPoolFunding)
return r.ZetaTxServer.FundEmissionsPool(e2eutils.OperationalPolicyName, EmissionsPoolFunding)
}
Loading
Loading