Skip to content

Commit

Permalink
mod+itest+virtual_tx_signer: use new signing method without quirk
Browse files Browse the repository at this point in the history
This commit uses the new SignOutputRawKeyLocator method of lndclient
that always populates the key locator when it's non-zero and with that
allows us to correctly sign for assets after restoring the underlying
lnd node from the seed.
  • Loading branch information
guggero committed Nov 22, 2024
1 parent ee3d745 commit 0e4aef4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ require (
github.com/lib/pq v1.10.9
github.com/lightninglabs/aperture v0.3.2-beta.0.20241015115230-d59b5514c19a
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2
github.com/lightninglabs/lndclient v0.18.4-5
github.com/lightninglabs/lndclient v1.0.1-0.20241122123707-38c18e21fc15
github.com/lightninglabs/neutrino/cache v1.1.2
github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241120143113-9246d5c51cd2
github.com/lightningnetwork/lnd v0.18.4-beta.rc1
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
github.com/lightningnetwork/lnd/fn v1.2.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ github.com/lightninglabs/lightning-node-connect v0.2.5-alpha h1:ZRVChwczFXK0CEbx
github.com/lightninglabs/lightning-node-connect v0.2.5-alpha/go.mod h1:A9Pof9fETkH+F67BnOmrBDThPKstqp73wlImWOZvTXQ=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2XZwcfE4xoS5AILqP1mj7kqnhbBSxW9BDxY=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4=
github.com/lightninglabs/lndclient v0.18.4-5 h1:KokX5ZlFuZEmtD7sHWg1cXzee0ZsnBWuSKV9/RcTEv4=
github.com/lightninglabs/lndclient v0.18.4-5/go.mod h1:tafbfrisn1Iwt3em3nYWdE06C8jpoZtpNyiSB485OCg=
github.com/lightninglabs/lndclient v1.0.1-0.20241122123707-38c18e21fc15 h1:70afFCdGZ/6LpXpvrxN8Hu+uSCwlxJBTsuhN/ttfSu4=
github.com/lightninglabs/lndclient v1.0.1-0.20241122123707-38c18e21fc15/go.mod h1:qaIx+eqEV+Bdf1j7GVeJiDqJbtZXsr9XTfHu/8HmgQU=
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd h1:D8aRocHpoCv43hL8egXEMYyPmyOiefFHZ66338KQB2s=
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk=
github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g=
Expand All @@ -496,8 +496,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241120143113-9246d5c51cd2 h1:zGnSH1gTpPA637465d5tp7VkdWw5sVyWZxxmfZ0rKo4=
github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241120143113-9246d5c51cd2/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
github.com/lightningnetwork/lnd v0.18.4-beta.rc1 h1:z6hFKvtbfo8udPrIb81GbSoKlUWd06d4LRxTkD19IMQ=
github.com/lightningnetwork/lnd v0.18.4-beta.rc1/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
Expand Down
11 changes: 8 additions & 3 deletions itest/send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2029,10 +2029,15 @@ func testRestoreLndFromSeed(t *harnessTest) {

AssertAddrCreated(t.t, alice, rpcAsset, aliceAddr)

sendAsset(
t, bob, withReceiverAddresses(aliceAddr),
withError("invalid transfer asset witness"),
sendResp, sendEvents = sendAssetsToAddr(t, bob, aliceAddr)

ConfirmAndAssertOutboundTransfer(
t.t, t.lndHarness.Miner().Client, bob, sendResp,
genInfo.AssetId,
[]uint64{rpcAsset.Amount - sendAmount*2, sendAmount}, 1, 2,
)
AssertNonInteractiveRecvComplete(t.t, alice, 2)
AssertSendEventsComplete(t.t, aliceAddr.ScriptKey, sendEvents)
}

// addProofTestVectorFromFile adds a proof test vector by extracting it from the
Expand Down
2 changes: 1 addition & 1 deletion virtual_tx_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewLndRpcVirtualTxSigner(lnd *lndclient.LndServices) *LndRpcVirtualTxSigner
func (l *LndRpcVirtualTxSigner) SignVirtualTx(signDesc *lndclient.SignDescriptor,
tx *wire.MsgTx, prevOut *wire.TxOut) (*schnorr.Signature, error) {

sigs, err := l.lnd.Signer.SignOutputRaw(
sigs, err := l.lnd.Signer.SignOutputRawKeyLocator(
context.Background(), tx, []*lndclient.SignDescriptor{signDesc},
[]*wire.TxOut{prevOut},
)
Expand Down

0 comments on commit 0e4aef4

Please sign in to comment.