Skip to content

Commit

Permalink
Revert "resolve with cb"
Browse files Browse the repository at this point in the history
This reverts commit 5d510c3.
  • Loading branch information
mmsqe committed Aug 7, 2023
1 parent 5d510c3 commit 2fa4959
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions x/genutil/client/cli/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $ %s migrate v0.36 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2
`, version.AppName),
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
return MigrateHandler(cmd, args, GetMigrationCallback)
return MigrateHandler(cmd, args, migrationMap)
},
}

Expand All @@ -74,8 +74,7 @@ $ %s migrate v0.36 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2

// MigrateHandler handles the migration command with a migration map as input,
// returning an error upon failure.
// func MigrateHandler(cmd *cobra.Command, args []string, migrations types.MigrationMap) error {
func MigrateHandler(cmd *cobra.Command, args []string, cb func(version string) types.MigrationCallback) error {
func MigrateHandler(cmd *cobra.Command, args []string, migrations types.MigrationMap) error {
clientCtx := client.GetClientContextFromCmd(cmd)

var err error
Expand All @@ -101,7 +100,7 @@ func MigrateHandler(cmd *cobra.Command, args []string, cb func(version string) t
return errors.Wrap(err, "failed to JSON unmarshal initial genesis state")
}

migrationFunc := cb(target)
migrationFunc := migrations[target]
if migrationFunc == nil {
return fmt.Errorf("unknown migration function for version: %s", target)
}
Expand Down

0 comments on commit 2fa4959

Please sign in to comment.