Merge pull request #121 from guggero/msat-conversion

lndclient: fix Value/ValueMsat conversion problem
pull/122/head
Oliver Gugger 4 years ago committed by GitHub
commit 0e2f3c9571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -134,7 +134,7 @@ func (s *invoicesClient) AddHoldInvoice(ctx context.Context,
rpcIn := &invoicesrpc.AddHoldInvoiceRequest{
Memo: in.Memo,
Hash: in.Hash[:],
Value: int64(in.Value),
ValueMsat: int64(in.Value),
Expiry: in.Expiry,
CltvExpiry: in.CltvExpiry,
Private: true,

@ -323,7 +323,7 @@ func (s *lightningClient) AddInvoice(ctx context.Context,
rpcIn := &lnrpc.Invoice{
Memo: in.Memo,
Value: int64(in.Value),
ValueMsat: int64(in.Value),
Expiry: in.Expiry,
CltvExpiry: in.CltvExpiry,
Private: true,

@ -10,7 +10,6 @@ import (
"github.com/lightninglabs/loop/lndclient"
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/zpay32"
)
@ -77,7 +76,7 @@ func (s *mockInvoices) AddHoldInvoice(ctx context.Context,
s.lnd.ChainParams, *hash, creationDate,
zpay32.Description(in.Memo),
zpay32.CLTVExpiry(in.CltvExpiry),
zpay32.Amount(lnwire.MilliSatoshi(in.Value)),
zpay32.Amount(in.Value),
)
if err != nil {
return "", err

@ -11,7 +11,6 @@ import (
"github.com/lightninglabs/loop/lndclient"
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/zpay32"
"golang.org/x/net/context"
)
@ -88,7 +87,7 @@ func (h *mockLightningClient) AddInvoice(ctx context.Context,
h.lnd.ChainParams, hash, creationDate,
zpay32.Description(in.Memo),
zpay32.CLTVExpiry(in.CltvExpiry),
zpay32.Amount(lnwire.MilliSatoshi(in.Value)),
zpay32.Amount(in.Value),
)
if err != nil {
return lntypes.Hash{}, "", err

Loading…
Cancel
Save