forked from cerc-io/laconicd-deprecated
@@ -43,19 +43,19 @@ func AddGenesisAccountCmd(
|
||||
Short: "Add a genesis account to genesis.json",
|
||||
Long: `Add a genesis account to genesis.json. The provided account must specify
|
||||
the account address or key name and a list of initial coins. If a key name is given,
|
||||
the address will be looked up in the local Keyring. The list of initial tokens must
|
||||
the address will be looked up in the local Keybase. The list of initial tokens must
|
||||
contain valid denominations. Accounts may optionally be supplied with vesting parameters.
|
||||
`,
|
||||
Args: cobra.ExactArgs(2),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
config := ctx.Config
|
||||
config.SetRoot(viper.GetString(cli.HomeFlag))
|
||||
inBuf := bufio.NewReader(cmd.InOrStdin())
|
||||
|
||||
addr, err := sdk.AccAddressFromBech32(args[0])
|
||||
inBuf := bufio.NewReader(cmd.InOrStdin())
|
||||
if err != nil {
|
||||
// attempt to lookup address from keyring if no address was provided
|
||||
keystore, err := keyring.New(
|
||||
// attempt to lookup address from Keybase if no address was provided
|
||||
kb, err := keyring.NewKeyring(
|
||||
sdk.KeyringServiceName(),
|
||||
viper.GetString(flags.FlagKeyringBackend),
|
||||
viper.GetString(flagClientHome),
|
||||
@@ -65,9 +65,9 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
|
||||
return err
|
||||
}
|
||||
|
||||
info, err := keystore.Key(args[0])
|
||||
info, err := kb.Get(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get address from Keyring: %w", err)
|
||||
return fmt.Errorf("failed to get address from Keybase: %w", err)
|
||||
}
|
||||
|
||||
addr = info.GetAddress()
|
||||
|
||||
Reference in New Issue
Block a user