Skip to content

Commit

Permalink
feat: initial empty command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathansumner committed Apr 16, 2024
1 parent 9dd34ea commit 459bf08
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

const (
AccountAddressPrefix = "fetch"
AccountAddressPrefix = "asi"
)

var (
Expand Down
64 changes: 64 additions & 0 deletions cmd/fetchd/cmd/genasiupgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package cmd

import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
)

const (
flagNewDescription = "new-description"
Bech32Chars = "023456789acdefghjklmnpqrstuvwxyz"
AddrDataLength = 32
WasmDataLength = 52
AddrChecksumLength = 6
AccAddressPrefix = ""
ValAddressPrefix = "valoper"
ConsAddressPrefix = "valcons"

NewBaseDenom = "asi"
NewDenom = "aasi"
NewAddrPrefix = "asi"
NewChainId = "asi-1"
NewDescription = "ASI Token"

OldBaseDenom = "fet"
OldDenom = "afet"
OldAddrPrefix = "fetch"
)

// ASIGenesisUpgradeCmd returns replace-genesis-values cobra Command.
func ASIGenesisUpgradeCmd(defaultNodeHome string) *cobra.Command {
cmd := &cobra.Command{
Use: "asi-genesis-upgrade",
Short: "This command carries out a full upgrade of the genesis file to the new ASI chain parameters.",
Long: `The following command will upgrade the current genesis file to the new ASI chain parameters. The following changes will be made:
- Chain ID will be updated to "asi-1"
- The native coin denom will be updated to "asi"
- The address prefix will be updated to "asi"
- The old fetch addresses will be updated to the new asi addresses`,

Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
return nil
},
}

cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)")
cmd.Flags().String(flagNewDescription, "", "The new description for the native coin in the genesis file")
flags.AddQueryFlagsToCmd(cmd)

return cmd
}

func ASIGenesisUpgradeReplaceDenomMetadata() {}

func ASIGenesisUpgradeReplaceChainID() {}

func ASIGenesisUpgradeReplaceDenom() {}

func ASIGenesisUpgradeReplaceAddresses() {}

func ASIGenesisUpgradeWithdrawIBCChannelsBalances() {}

func ASIGenesisUpgradeWithdrawReconciliationBalances() {}
1 change: 1 addition & 0 deletions cmd/fetchd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
// AddStakeReconciliationMigrateCmd(),
genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
ASIGenesisUpgradeCmd(app.DefaultNodeHome),
AddGenesisAccountCmd(app.DefaultNodeHome),
AddGenesisDelegationCmd(app.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
Expand Down

0 comments on commit 459bf08

Please sign in to comment.