Skip to content

Commit

Permalink
chore: update upgrade e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed Feb 10, 2025
1 parent 549ee06 commit ac1bb56
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions e2e/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/stretchr/testify/require"
)

// TestScheduleUpgrade tests the module's ability to schedule an upgrade on-chain.
func TestScheduleUpgrade(t *testing.T) {
// TestScheduleAndCancelUpgrade tests the module's ability to schedule and cancel an upgrade on-chain.
func TestScheduleAndCancelUpgrade(t *testing.T) {
t.Parallel()

var wrapper Wrapper
Expand All @@ -27,8 +27,7 @@ func TestScheduleUpgrade(t *testing.T) {

EnsureUpgrade(t, wrapper, ctx, "", 0)

cmd := []string{"authority", "software-upgrade", "v2", "--upgrade-height", "50",
"--chain-id", wrapper.chain.Config().ChainID, "--no-validate"}
cmd := []string{"authority", "software-upgrade", "v2", "--upgrade-height", "50", "--no-validate"}

// broadcast from un-authorized account
_, err := validator.ExecTx(
Expand All @@ -47,4 +46,24 @@ func TestScheduleUpgrade(t *testing.T) {
require.NoError(t, err)

EnsureUpgrade(t, wrapper, ctx, "v2", 50)

cmd = []string{"authority", "cancel-software-upgrade"}

// broadcast from un-authorized account
_, err = validator.ExecTx(
ctx,
notAuthorized.KeyName(),
cmd...,
)
require.ErrorContains(t, err, "signer is not authority")

// broadcast from authorized authority account
_, err = validator.ExecTx(
ctx,
wrapper.owner.KeyName(),
cmd...,
)
require.NoError(t, err)

EnsureUpgrade(t, wrapper, ctx, "", 0)
}

0 comments on commit ac1bb56

Please sign in to comment.