Error when keybase is nil during Sign

This commit is contained in:
Aleksandr Bezobchuk 2020-03-25 15:12:39 -04:00
parent f4e6bd6ad7
commit e950dd34aa
No known key found for this signature in database
GPG Key ID: 7DAC30FBD99879B0
1 changed files with 1 additions and 11 deletions

View File

@ -326,17 +326,7 @@ func PrepareFactory(ctx context.CLIContext, txf Factory) (Factory, error) {
// by the CanonicalSignBytes call.
func Sign(txf Factory, name, passphrase string, tx ClientTx) ([]byte, error) {
if txf.keybase == nil {
keybase, err := keyring.NewKeyring(
sdk.KeyringServiceName(),
viper.GetString(flags.FlagKeyringBackend),
viper.GetString(flags.FlagHome),
os.Stdin,
)
if err != nil {
return nil, err
}
txf = txf.WithKeybase(keybase)
return nil, errors.New("keybase must be set prior to signing a transaction")
}
signBytes, err := tx.CanonicalSignBytes(txf.chainID, txf.accountNumber, txf.sequence)