Fix SetOption set account
This commit is contained in:
parent
b6bb3987ba
commit
f498e53095
12
app/app.go
12
app/app.go
|
@ -68,16 +68,12 @@ func (app *Basecoin) SetOption(key string, value string) (log string) {
|
||||||
return "Success"
|
return "Success"
|
||||||
case "account":
|
case "account":
|
||||||
var err error
|
var err error
|
||||||
var setAccount types.Account
|
var acc *types.Account
|
||||||
wire.ReadJSONPtr(&setAccount, []byte(value), &err)
|
wire.ReadJSONPtr(&acc, []byte(value), &err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "Error decoding setAccount message: " + err.Error()
|
return "Error decoding acc message: " + err.Error()
|
||||||
}
|
|
||||||
accBytes := wire.BinaryBytes(setAccount)
|
|
||||||
res := app.eyesCli.SetSync(setAccount.PubKey.Address(), accBytes)
|
|
||||||
if res.IsErr() {
|
|
||||||
return "Error saving account: " + res.Error()
|
|
||||||
}
|
}
|
||||||
|
app.state.SetAccount(acc.PubKey.Address(), acc)
|
||||||
return "Success"
|
return "Success"
|
||||||
}
|
}
|
||||||
return "Unrecognized option key " + key
|
return "Unrecognized option key " + key
|
||||||
|
|
Loading…
Reference in New Issue