From 8c566c3bda72997236afcb3af09f5a9e2f761f5e Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 14 Dec 2022 12:27:06 -0500 Subject: [PATCH] Print addr when key not found --- chain/wallet/multi.go | 10 +++++----- chain/wallet/wallet.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chain/wallet/multi.go b/chain/wallet/multi.go index a88475c2e..91d271477 100644 --- a/chain/wallet/multi.go +++ b/chain/wallet/multi.go @@ -120,22 +120,22 @@ func (m MultiWallet) WalletSign(ctx context.Context, signer address.Address, toS return nil, err } if w == nil { - return nil, xerrors.Errorf("key not found") + return nil, xerrors.Errorf("key not found for %s", signer) } return w.WalletSign(ctx, signer, toSign, meta) } -func (m MultiWallet) WalletExport(ctx context.Context, address address.Address) (*types.KeyInfo, error) { - w, err := m.find(ctx, address, m.Remote, m.Local) +func (m MultiWallet) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error) { + w, err := m.find(ctx, addr, m.Remote, m.Local) if err != nil { return nil, err } if w == nil { - return nil, xerrors.Errorf("key not found") + return nil, xerrors.Errorf("key not found for %s", addr) } - return w.WalletExport(ctx, address) + return w.WalletExport(ctx, addr) } func (m MultiWallet) WalletImport(ctx context.Context, info *types.KeyInfo) (address.Address, error) { diff --git a/chain/wallet/wallet.go b/chain/wallet/wallet.go index b88d776b5..2f382d5f8 100644 --- a/chain/wallet/wallet.go +++ b/chain/wallet/wallet.go @@ -140,7 +140,7 @@ func (w *LocalWallet) WalletExport(ctx context.Context, addr address.Address) (* return nil, xerrors.Errorf("failed to find key to export: %w", err) } if k == nil { - return nil, xerrors.Errorf("key not found") + return nil, xerrors.Errorf("key not found for %s", addr) } return &k.KeyInfo, nil