Merge pull request #9873 from filecoin-project/gstuart/print-addr-key-not-found
feat: wallet: Print addr when key not found
This commit is contained in:
commit
a264893543
@ -120,22 +120,22 @@ func (m MultiWallet) WalletSign(ctx context.Context, signer address.Address, toS
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if w == nil {
|
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)
|
return w.WalletSign(ctx, signer, toSign, meta)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MultiWallet) WalletExport(ctx context.Context, address address.Address) (*types.KeyInfo, error) {
|
func (m MultiWallet) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error) {
|
||||||
w, err := m.find(ctx, address, m.Remote, m.Local)
|
w, err := m.find(ctx, addr, m.Remote, m.Local)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if w == nil {
|
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) {
|
func (m MultiWallet) WalletImport(ctx context.Context, info *types.KeyInfo) (address.Address, error) {
|
||||||
|
@ -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)
|
return nil, xerrors.Errorf("failed to find key to export: %w", err)
|
||||||
}
|
}
|
||||||
if k == nil {
|
if k == nil {
|
||||||
return nil, xerrors.Errorf("key not found")
|
return nil, xerrors.Errorf("key not found for %s", addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &k.KeyInfo, nil
|
return &k.KeyInfo, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user