@@ -3,7 +3,6 @@ package cmd
3
3
import (
4
4
"bufio"
5
5
"encoding/json"
6
- "errors"
7
6
"fmt"
8
7
9
8
"github.com/ethereum/go-ethereum/common"
@@ -15,7 +14,6 @@ import (
15
14
"github.com/cosmos/cosmos-sdk/server"
16
15
sdk "github.com/cosmos/cosmos-sdk/types"
17
16
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
18
- authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
19
17
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
20
18
"github.com/cosmos/cosmos-sdk/x/genutil"
21
19
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
@@ -25,12 +23,6 @@ import (
25
23
evmtypes "github.com/xpladev/ethermint/x/evm/types"
26
24
)
27
25
28
- const (
29
- flagVestingStart = "vesting-start-time"
30
- flagVestingEnd = "vesting-end-time"
31
- flagVestingAmt = "vesting-amount"
32
- )
33
-
34
26
// AddGenesisAccountCmd returns add-genesis-account cobra Command.
35
27
func AddGenesisAccountCmd (defaultNodeHome string ) * cobra.Command {
36
28
cmd := & cobra.Command {
@@ -39,7 +31,7 @@ func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command {
39
31
Long : `Add a genesis account to genesis.json. The provided account must specify
40
32
the account address or key name and a list of initial coins. If a key name is given,
41
33
the address will be looked up in the local Keybase. The list of initial tokens must
42
- contain valid denominations. Accounts may optionally be supplied with vesting parameters.
34
+ contain valid denominations.
43
35
` ,
44
36
Args : cobra .ExactArgs (2 ),
45
37
RunE : func (cmd * cobra.Command , args []string ) error {
@@ -91,53 +83,15 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
91
83
return fmt .Errorf ("failed to parse coins: %w" , err )
92
84
}
93
85
94
- vestingStart , err := cmd .Flags ().GetInt64 (flagVestingStart )
95
- if err != nil {
96
- return err
97
- }
98
- vestingEnd , err := cmd .Flags ().GetInt64 (flagVestingEnd )
99
- if err != nil {
100
- return err
101
- }
102
- vestingAmtStr , err := cmd .Flags ().GetString (flagVestingAmt )
103
- if err != nil {
104
- return err
105
- }
106
-
107
- vestingAmt , err := sdk .ParseCoinsNormalized (vestingAmtStr )
108
- if err != nil {
109
- return fmt .Errorf ("failed to parse vesting amount: %w" , err )
110
- }
111
-
112
86
// create concrete account type based on input parameters
113
87
var genAccount authtypes.GenesisAccount
114
88
115
89
balances := banktypes.Balance {Address : addr .String (), Coins : coins .Sort ()}
116
90
baseAccount := authtypes .NewBaseAccount (addr , nil , 0 , 0 )
117
91
118
- if ! vestingAmt .IsZero () {
119
- baseVestingAccount := authvesting .NewBaseVestingAccount (baseAccount , vestingAmt .Sort (), vestingEnd )
120
-
121
- if (balances .Coins .IsZero () && ! baseVestingAccount .OriginalVesting .IsZero ()) ||
122
- baseVestingAccount .OriginalVesting .IsAnyGT (balances .Coins ) {
123
- return errors .New ("vesting amount cannot be greater than total amount" )
124
- }
125
-
126
- switch {
127
- case vestingStart != 0 && vestingEnd != 0 :
128
- genAccount = authvesting .NewContinuousVestingAccountRaw (baseVestingAccount , vestingStart )
129
-
130
- case vestingEnd != 0 :
131
- genAccount = authvesting .NewDelayedVestingAccountRaw (baseVestingAccount )
132
-
133
- default :
134
- return errors .New ("invalid vesting parameters; must supply start and end time or end time" )
135
- }
136
- } else {
137
- genAccount = & ethermint.EthAccount {
138
- BaseAccount : baseAccount ,
139
- CodeHash : common .BytesToHash (evmtypes .EmptyCodeHash ).Hex (),
140
- }
92
+ genAccount = & ethermint.EthAccount {
93
+ BaseAccount : baseAccount ,
94
+ CodeHash : common .BytesToHash (evmtypes .EmptyCodeHash ).Hex (),
141
95
}
142
96
143
97
if err := genAccount .Validate (); err != nil {
@@ -203,9 +157,6 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
203
157
204
158
cmd .Flags ().String (flags .FlagHome , defaultNodeHome , "The application home directory" )
205
159
cmd .Flags ().String (flags .FlagKeyringBackend , flags .DefaultKeyringBackend , "Select keyring's backend (os|file|kwallet|pass|test)" )
206
- cmd .Flags ().String (flagVestingAmt , "" , "amount of coins for vesting accounts" )
207
- cmd .Flags ().Int64 (flagVestingStart , 0 , "schedule start time (unix epoch) for vesting accounts" )
208
- cmd .Flags ().Int64 (flagVestingEnd , 0 , "schedule end time (unix epoch) for vesting accounts" )
209
160
flags .AddQueryFlagsToCmd (cmd )
210
161
211
162
return cmd
0 commit comments