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