forked from TrueCloudLab/frostfs-http-gw
[#186] Improve wallet params
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
9d4049cfe3
commit
d8b04223d4
2 changed files with 10 additions and 8 deletions
10
app.go
10
app.go
|
@ -181,10 +181,7 @@ func remove(list []string, element string) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNeoFSKey(a *app) (*ecdsa.PrivateKey, error) {
|
func getNeoFSKey(a *app) (*ecdsa.PrivateKey, error) {
|
||||||
walletPath := a.cfg.GetString(cmdWallet)
|
walletPath := a.cfg.GetString(cfgWalletPath)
|
||||||
if len(walletPath) == 0 {
|
|
||||||
walletPath = a.cfg.GetString(cfgWalletPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(walletPath) == 0 {
|
if len(walletPath) == 0 {
|
||||||
a.log.Info("no wallet path specified, creating ephemeral key automatically for this run")
|
a.log.Info("no wallet path specified, creating ephemeral key automatically for this run")
|
||||||
|
@ -205,10 +202,7 @@ func getNeoFSKey(a *app) (*ecdsa.PrivateKey, error) {
|
||||||
password = &pwd
|
password = &pwd
|
||||||
}
|
}
|
||||||
|
|
||||||
address := a.cfg.GetString(cmdAddress)
|
address := a.cfg.GetString(cfgWalletAddress)
|
||||||
if len(address) == 0 {
|
|
||||||
address = a.cfg.GetString(cfgWalletAddress)
|
|
||||||
}
|
|
||||||
|
|
||||||
return getKeyFromWallet(w, address, password)
|
return getKeyFromWallet(w, address, password)
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,14 @@ func settings() *viper.Viper {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := v.BindPFlag(cfgWalletPath, flags.Lookup(cmdWallet)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := v.BindPFlag(cfgWalletAddress, flags.Lookup(cmdAddress)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := v.BindPFlags(flags); err != nil {
|
if err := v.BindPFlags(flags); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue