Skip to content

Commit

Permalink
fix: address codec & example field
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Aug 26, 2024
1 parent 25d9719 commit 3cc0ec3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions x/genutil/client/cli/genaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,31 @@ func AddBulkGenesisAccountCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "bulk-add-genesis-account [/file/path.json]",
Short: "Bulk add genesis accounts to genesis.json",
Example: `bulk-add-genesis-account accounts.json
where accounts.json is:
[
{
"address": "cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5",
"coins": [
{ "denom": "umuon", "amount": "100000000" },
{ "denom": "stake", "amount": "200000000" }
]
},
{
"address": "cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg",
"coins": [
{ "denom": "umuon", "amount": "500000000" }
],
"vesting_amt": [
{ "denom": "umuon", "amount": "400000000" }
],
"vesting_start": 1724711478,
"vesting_end": 1914013878
}
]
`,
Long: `Add genesis accounts in bulk to genesis.json. The provided account must specify
the account address and a list of initial coins. The list of initial tokens must
contain valid denominations. Accounts may optionally be supplied with vesting parameters.
Expand Down
2 changes: 1 addition & 1 deletion x/genutil/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func AddGenesisAccounts(
addr := acc.Address
coins := acc.Coins

accAddr, err := sdk.AccAddressFromBech32(addr)
accAddr, err := addressCodec.StringToBytes(addr)
if err != nil {
return fmt.Errorf("failed to parse account address %s: %w", addr, err)
}
Expand Down

0 comments on commit 3cc0ec3

Please sign in to comment.