Skip to content

Commit

Permalink
[chore] Fix fail UpdateWhitelistedRelayers (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanhNhann authored Nov 8, 2024
1 parent 2dd125b commit 6db210d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ replace (

require (
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869
github.com/decentrio/rollup-e2e-testing v0.0.0-20241107030935-0ab2fee3053f
github.com/decentrio/rollup-e2e-testing v0.0.0-20241108100500-52975477c492
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20241016085626-2b8c8898058b
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241015102238-a827c3784461
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U=
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc=
github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241107030935-0ab2fee3053f h1:5/3Zqa7aBRMMdVL9XuNf8eyumxxK6P67aiDezjYcvlM=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241107030935-0ab2fee3053f/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241108100500-52975477c492 h1:QYiWwriqJEO5s6zku5bEykVhzwZhmqc8Y5gBrhCP0k8=
github.com/decentrio/rollup-e2e-testing v0.0.0-20241108100500-52975477c492/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c=
github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4=
github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI=
Expand Down
15 changes: 9 additions & 6 deletions tests/zero_fee_relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ func TestZeroFee_RelaySuccess_EVM(t *testing.T) {
rollappUserAddr := rollappUser.FormattedAddress()

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
// sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, sequencerAddr, []string{wallet.FormattedAddress()})
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)

channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID)
Expand Down Expand Up @@ -332,11 +333,12 @@ func TestZeroFee_RelaySuccess_Wasm(t *testing.T) {
rollappUserAddr := rollappUser.FormattedAddress()

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
// sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, sequencerAddr, []string{wallet.FormattedAddress()})
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)

channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID)
Expand Down Expand Up @@ -645,8 +647,9 @@ func TestZeroFee_RotatedSequencer_EVM(t *testing.T) {
rollappUserAddr := rollappUser.FormattedAddress()

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
// sequencerAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", keyDir)
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

cmd := append([]string{rollapp1.FullNodes[0].Chain.Config().Bin}, "dymint", "show-sequencer", "--home", rollapp1.FullNodes[0].HomeDir())
pub1, _, err := rollapp1.GetNode().Exec(ctx, cmd, nil)
Expand Down Expand Up @@ -682,7 +685,7 @@ func TestZeroFee_RotatedSequencer_EVM(t *testing.T) {
fmt.Printf("Sequencer check: %v\n", resp.Sequencers)

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, sequencerAddr, []string{wallet.FormattedAddress()})
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)

channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID)
Expand Down

0 comments on commit 6db210d

Please sign in to comment.