WalletSign should resolve ID addresses

This commit is contained in:
Aayush Rajasekaran 2020-06-15 21:00:22 -04:00
parent 87e5c38e32
commit 69948cd09c

View File

@ -40,7 +40,11 @@ func (a *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (ty
}
func (a *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byte) (*crypto.Signature, error) {
return a.Wallet.Sign(ctx, k, msg)
keyAddr, err := a.StateManager.ResolveToKeyAddress(ctx, k, nil)
if err != nil {
return nil, xerrors.Errorf("failed to resolve ID address: %w", keyAddr)
}
return a.Wallet.Sign(ctx, keyAddr, msg)
}
func (a *WalletAPI) WalletSignMessage(ctx context.Context, k address.Address, msg *types.Message) (*types.SignedMessage, error) {