Skip to content

Commit

Permalink
chore(e2e): upgrade e2e Hermes to v1.2.0 (#4337) (#4356)
Browse files Browse the repository at this point in the history
* Update hermes version for e2e

* Update hermes command

* Update hermes command

* Update hermes command

* config file specifies deprecated setting

* hermes create channel update

* hermes create channel update

* update some argument

* Update success string to determine success

(cherry picked from commit e0bede0)

Co-authored-by: ducnt131 <62016666+anhductn2001@users.noreply.github.com>
  • Loading branch information
mergify[bot] and anhductn2001 authored Feb 17, 2023
1 parent 0c81bd5 commit 3a2f360
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/configurer/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func (bc *baseConfigurer) runIBCRelayer(chainConfigA *chain.Config, chainConfigB

func (bc *baseConfigurer) connectIBCChains(chainA *chain.Config, chainB *chain.Config) error {
bc.t.Logf("connecting %s and %s chains via IBC", chainA.ChainMeta.Id, chainB.ChainMeta.Id)
cmd := []string{"hermes", "create", "channel", chainA.ChainMeta.Id, chainB.ChainMeta.Id, "--port-a=transfer", "--port-b=transfer"}
_, _, err := bc.containerManager.ExecHermesCmd(bc.t, cmd, "successfully opened init channel")
cmd := []string{"hermes", "create", "channel", "--a-chain", chainA.ChainMeta.Id, "--b-chain", chainB.ChainMeta.Id, "--a-port", "transfer", "--b-port", "transfer", "--new-client-connection", "--yes"}
_, _, err := bc.containerManager.ExecHermesCmd(bc.t, cmd, "SUCCESS")
if err != nil {
return err
}
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/configurer/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ func (c *Config) SendIBC(dstChain *Config, recipient string, token sdk.Coin) {

balancesDstPreWithTxFeeBalance, err := dstNode.QueryBalances(recipient)
require.NoError(c.t, err)

balancesDstPre := removeFeeTokenFromBalance(balancesDstPreWithTxFeeBalance)

cmd := []string{"hermes", "tx", "raw", "ft-transfer", dstChain.Id, c.Id, "transfer", "channel-0", token.Amount.String(), fmt.Sprintf("--denom=%s", token.Denom), fmt.Sprintf("--receiver=%s", recipient), "--timeout-height-offset=1000"}
_, _, err = c.containerManager.ExecHermesCmd(c.t, cmd, "Success")
cmd := []string{"hermes", "tx", "ft-transfer", "--dst-chain", dstChain.Id, "--src-chain", c.Id, "--src-port", "transfer", "--src-channel", "channel-0", "--amount", token.Amount.String(), fmt.Sprintf("--denom=%s", token.Denom), fmt.Sprintf("--receiver=%s", recipient), "--timeout-height-offset=1000"}
_, _, err = c.containerManager.ExecHermesCmd(c.t, cmd, "SUCCESS")
require.NoError(c.t, err)

require.Eventually(
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/containers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const (
previousVersionInitRepository = "osmolabs/osmosis-e2e-init-chain"
previousVersionInitTag = "v14.x-937d601e-1676550460-manual"
// Hermes repo/version for relayer
relayerRepository = "osmolabs/hermes"
relayerTag = "0.13.0"
relayerRepository = "informalsystems/hermes"
relayerTag = "1.2.0"
)

// Returns ImageConfig needed for running e2e test.
Expand Down
13 changes: 7 additions & 6 deletions tests/e2e/scripts/hermes_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -ex
# initialize Hermes relayer configuration
mkdir -p /root/.hermes/
touch /root/.hermes/config.toml

echo $OSMO_A_E2E_VAL_MNEMONIC > /root/.hermes/OSMO_A_MNEMONIC.txt
echo $OSMO_B_E2E_VAL_MNEMONIC > /root/.hermes/OSMO_B_MNEMONIC.txt
# setup Hermes relayer configuration
tee /root/.hermes/config.toml <<EOF
[global]
Expand All @@ -18,7 +19,7 @@ misbehaviour = true
[mode.connections]
enabled = false
[mode.channels]
enabled = false
enabled = true
[mode.packets]
enabled = true
clear_interval = 100
Expand All @@ -42,9 +43,9 @@ account_prefix = 'osmo'
key_name = 'val01-osmosis-a'
store_prefix = 'ibc'
max_gas = 6000000
gas_multiplier = 1.1
default_gas = 400000
gas_price = { price = 0.0025, denom = 'e2e-default-feetoken' }
gas_adjustment = 1.0
clock_drift = '1m' # to accomdate docker containers
trusting_period = '239seconds'
trust_threshold = { numerator = '1', denominator = '3' }
Expand All @@ -58,17 +59,17 @@ account_prefix = 'osmo'
key_name = 'val01-osmosis-b'
store_prefix = 'ibc'
max_gas = 6000000
gas_multiplier = 1.1
default_gas = 400000
gas_price = { price = 0.0025, denom = 'e2e-default-feetoken' }
gas_adjustment = 1.0
clock_drift = '1m' # to accomdate docker containers
trusting_period = '239seconds'
trust_threshold = { numerator = '1', denominator = '3' }
EOF

# import keys
hermes keys restore ${OSMO_B_E2E_CHAIN_ID} -n "val01-osmosis-b" -m "${OSMO_B_E2E_VAL_MNEMONIC}"
hermes keys restore ${OSMO_A_E2E_CHAIN_ID} -n "val01-osmosis-a" -m "${OSMO_A_E2E_VAL_MNEMONIC}"
hermes keys add --chain ${OSMO_B_E2E_CHAIN_ID} --key-name "val01-osmosis-b" --mnemonic-file /root/.hermes/OSMO_B_MNEMONIC.txt
hermes keys add --chain ${OSMO_A_E2E_CHAIN_ID} --key-name "val01-osmosis-a" --mnemonic-file /root/.hermes/OSMO_A_MNEMONIC.txt

# start Hermes relayer
hermes start

0 comments on commit 3a2f360

Please sign in to comment.