Commit Graph

10 Commits

Author SHA1 Message Date
Alessio Treglia b832e103b1
client/keys: make add command's output parseable (#6603)
client/input/input.go: GetConfirmation() should communicate
with the user via the io.Writer instance passed in as
argument.

client/keys/add.go: replace cmd.PrintErrln() calls with
fmt.Fprintln(cmd.ErrOrStderr(), ...) because of cobra's
PrintErr* functions broken behaviour. For more information
please see https://github.com/spf13/cobra/pull/894

Closes: #6601
Thanks: @noandrea for pointing this out.
2020-07-05 13:22:49 +02:00
Marko 218ec99508
various linter fixes (#6106)
x/staking: Fix all linter warnings.

Fixed warnings across base packages.

New linters:
- unparam
- nolintlint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-02 21:26:59 +02:00
Alessio Treglia a1feca39c2
Enter the new keyring interface (#5904)
crypto/keyring:

`Keybase` interface gives way to its successor: `Keyring`. `LegacyKeybase`
interface is added in order to guarantee limited backward compatibility with
the old `Keybase` interface for the sole purpose of migrating keys across
the new keyring backends.

The package no longer depends on the `github.com/types.Config`
singleton.

`SupportedAlgos` and `SupportedLedgerAlgos` methods have been removed.
The keyring just fails when trying to perform an action with an unsupported
algorithm.

crypto/ subdirs reorganization:

`crypto/keys/hd` was moved to `crypto/hd`, which now groups together
all HD wallets related types and utilities.

client/input:

* Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions.
* `GetConfirmation`'s signature changed to take in a io.Writer for better integration
  with `cobra.Command` types.

client/context:

* In-memory keyring is allocated in the context when `--gen-only` flag is passed
  in. `GetFromFields` does no longer silently allocate a keyring, it takes one as
  argument.

Co-authored with @jgimeno

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2020-04-08 11:38:28 +02:00
Alessio Treglia 3db39cda3c
Fix various linter warnings (#5824) 2020-03-18 12:59:08 +00:00
Henrik Aasted Sørensen 91b53f2698 Merge PR #4919: Fix GetConfirmation User Input Bug 2019-08-19 09:22:07 -04:00
Marko b2f8c58ec4 Merge PR #4608: More linters - Gosec, staticcheck 2019-06-26 13:30:36 -07:00
Alessio Treglia 7b5e6cee07
Remove client/input.{Buffer,Override}Stdin() functions (#4602)
Cobra's new release made them redundant.

Thanks: Juan Leni <juan.leni@zondax.ch> for the original patch.
2019-06-22 11:24:59 +02:00
Alessio Treglia 1fcac93d57
switch GetConfirmation()'s default to no (#4575)
client/input.GetConfirmation() returns true if and only if the
user's input is confirmative.

The function is used in places where fat-fingering may cause
financial loss, e.g. gaiacli tx send command. Thus it seems
wiser to provide a conservative default in order to protect
users from accidental mistyping.

Closes: #4564
2019-06-18 11:46:51 +02:00
Alessio Treglia 18415eedaf
Take empty input as yes answer (#4565)
Closes: #4564
2019-06-16 12:06:39 +02:00
frog power 4000 73e5ef7c13 reduce module interdependancy, /client refactor (#4415)
* abstract staking BuildCreateValidatorMsg, genutil defines its own flags

* client/ refactor

* staking move keys from keeper to types
2019-05-28 09:44:04 +01:00