-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration handler for disabling seqno (#394)
## Describe your changes and provide context Add migration handler to add new disable seqno parameter to chain. Note that i verified that we already use default values so we can just set the params to default instead of maintaining authParamsV1 and V2 ## Testing performed to validate your change - unit tests - upgraded local chain, ensure that bank sends work
- Loading branch information
1 parent
66364a5
commit 66854d0
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/x/auth/keeper" | ||
"github.com/cosmos/cosmos-sdk/x/auth/types" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func TestMigrate2to3(t *testing.T) { | ||
app, ctx := createTestApp(true) | ||
|
||
prevParams := types.Params{ | ||
MaxMemoCharacters: types.DefaultMaxMemoCharacters, | ||
TxSigLimit: types.DefaultTxSigLimit, | ||
TxSizeCostPerByte: types.DefaultTxSizeCostPerByte, | ||
SigVerifyCostED25519: types.DefaultSigVerifyCostED25519, | ||
SigVerifyCostSecp256k1: types.DefaultSigVerifyCostSecp256k1, | ||
} | ||
|
||
app.AccountKeeper.SetParams(ctx, prevParams) | ||
// migrate to default params | ||
m := keeper.NewMigrator(app.AccountKeeper, app.GRPCQueryRouter()) | ||
err := m.Migrate2to3(ctx) | ||
require.NoError(t, err) | ||
params := app.AccountKeeper.GetParams(ctx) | ||
require.Equal(t, params.DisableSeqnoCheck, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters