@@ -32,6 +32,7 @@ import (
32
32
const (
33
33
flagCoinType = "coin-type"
34
34
flagAlgo = "signing-algorithm"
35
+ flagPassword = "password"
35
36
defaultCoinType uint32 = sdk .CoinType
36
37
)
37
38
@@ -97,6 +98,11 @@ $ %s k a cosmoshub testkey`, appName, appName, appName)),
97
98
return err
98
99
}
99
100
101
+ password , err := cmdFlags .GetString (flagPassword )
102
+ if err != nil {
103
+ return err
104
+ }
105
+
100
106
if algo == "" {
101
107
if ccp , ok := chain .ChainProvider .(* cosmos.CosmosProvider ); ok {
102
108
algo = ccp .PCfg .SigningAlgorithm
@@ -105,7 +111,7 @@ $ %s k a cosmoshub testkey`, appName, appName, appName)),
105
111
}
106
112
}
107
113
108
- ko , err := chain .ChainProvider .AddKey (keyName , uint32 (coinType ), algo )
114
+ ko , err := chain .ChainProvider .AddKey (keyName , uint32 (coinType ), algo , password )
109
115
if err != nil {
110
116
return fmt .Errorf ("failed to add key: %w" , err )
111
117
}
@@ -121,6 +127,7 @@ $ %s k a cosmoshub testkey`, appName, appName, appName)),
121
127
}
122
128
cmd .Flags ().Int32 (flagCoinType , - 1 , "coin type number for HD derivation" )
123
129
cmd .Flags ().String (flagAlgo , "" , "signing algorithm for key (secp256k1, sr25519)" )
130
+ cmd .Flags ().String (flagPassword , "x" , "icon keystore password" )
124
131
125
132
return cmd
126
133
}
0 commit comments