@@ -20,6 +20,7 @@ import (
20
20
"github.com/lightninglabs/taproot-assets/tapdb/sqlc"
21
21
"github.com/lightninglabs/taproot-assets/universe/supplycommit"
22
22
lfn "github.com/lightningnetwork/lnd/fn/v2"
23
+ "github.com/lightningnetwork/lnd/keychain"
23
24
"github.com/lightningnetwork/lnd/lnutils"
24
25
"github.com/stretchr/testify/require"
25
26
)
@@ -126,8 +127,8 @@ func (h *supplyCommitTestHarness) addTestMintingBatch() ([]byte, int64,
126
127
Txid : mintTxID [:],
127
128
RawTx : mintTxBytes ,
128
129
})
129
- require .NoError (h .t , err )
130
130
131
+ require .NoError (h .t , err )
131
132
genesisPointBytes , err := encodeOutpoint (genesisPoint )
132
133
require .NoError (h .t , err )
133
134
err = db .AnchorGenesisPoint (ctx , sqlc.AnchorGenesisPointParams {
@@ -158,7 +159,7 @@ func (h *supplyCommitTestHarness) addTestMintingBatch() ([]byte, int64,
158
159
// transition performed by performSingleTransition.
159
160
type stateTransitionOutput struct {
160
161
appliedUpdates []supplycommit.SupplyUpdateEvent
161
- internalKey * btcec. PublicKey
162
+ internalKey keychain. KeyDescriptor
162
163
outputKey * btcec.PublicKey
163
164
commitTx * wire.MsgTx
164
165
chainProof supplycommit.ChainProof
@@ -720,6 +721,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
720
721
// Next, we'll generate a new "fake" commitment transaction along with
721
722
// sample internal and output keys.
722
723
commitTx := randTx (h .t , 1 )
724
+
723
725
// Add inputs to the transaction that spend the pre-commitment outputs.
724
726
for _ , outpoint := range preCommitOutpoints {
725
727
commitTx .TxIn = append (commitTx .TxIn , & wire.TxIn {
@@ -735,7 +737,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
735
737
// and commit that.
736
738
commitDetails := supplycommit.SupplyCommitTxn {
737
739
Txn : commitTx ,
738
- InternalKey : internalKey . PubKey ,
740
+ InternalKey : internalKey ,
739
741
OutputKey : outputKey ,
740
742
OutputIndex : 1 ,
741
743
}
@@ -810,7 +812,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
810
812
811
813
return stateTransitionOutput {
812
814
appliedUpdates : updates ,
813
- internalKey : internalKey . PubKey ,
815
+ internalKey : internalKey ,
814
816
outputKey : outputKey ,
815
817
commitTx : commitTx ,
816
818
chainProof : chainProof ,
@@ -1017,7 +1019,7 @@ func (h *supplyCommitTestHarness) assertTransitionApplied(
1017
1019
// The keys should also be inserted, and the db commitment should match
1018
1020
// what we inserted.
1019
1021
require .Equal (
1020
- h .t , internalKey .SerializeCompressed (),
1022
+ h .t , internalKey .PubKey . SerializeCompressed (),
1021
1023
h .fetchInternalKeyByID (dbCommitment .InternalKeyID ).RawKey ,
1022
1024
"internalKey mismatch" ,
1023
1025
)
@@ -1161,7 +1163,7 @@ func (h *supplyCommitTestHarness) assertTransitionApplied(
1161
1163
"SupplyCommit returned wrong Txn hash" ,
1162
1164
)
1163
1165
require .Equal (
1164
- h .t , output .internalKey .SerializeCompressed (),
1166
+ h .t , output .internalKey .PubKey . SerializeCompressed (),
1165
1167
fetchedCommit .InternalKey .PubKey .SerializeCompressed (),
1166
1168
"SupplyCommit returned wrong InternalKey" ,
1167
1169
)
@@ -1401,7 +1403,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1401
1403
commitTxid2 := commitTx2 .TxHash ()
1402
1404
1403
1405
// Insert the signed commitment with the updated transaction.
1404
- internalKey := test .RandPubKey (t )
1406
+ internalKey , _ := test .RandKeyDesc (t )
1405
1407
outputKey := test .RandPubKey (t )
1406
1408
commitDetails := supplycommit.SupplyCommitTxn {
1407
1409
Txn : commitTx2 ,
@@ -1440,7 +1442,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1440
1442
require .NoError (t , err )
1441
1443
require .Equal (t , chainTx2Record .TxnID , newDbCommitment .ChainTxnID )
1442
1444
require .Equal (t ,
1443
- internalKey .SerializeCompressed (),
1445
+ internalKey .PubKey . SerializeCompressed (),
1444
1446
h .fetchInternalKeyByID (newDbCommitment .InternalKeyID ).RawKey ,
1445
1447
)
1446
1448
require .Equal (
@@ -1463,7 +1465,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1463
1465
t , commitTxid2 , fetchedTransition .NewCommitment .Txn .TxHash (),
1464
1466
)
1465
1467
require .Equal (
1466
- t , internalKey .SerializeCompressed (),
1468
+ t , internalKey .PubKey . SerializeCompressed (),
1467
1469
fetchedTransition .NewCommitment .InternalKey .PubKey .SerializeCompressed (), //nolint:lll
1468
1470
)
1469
1471
require .Equal (
@@ -1577,7 +1579,7 @@ func TestSupplyCommitFetchState(t *testing.T) {
1577
1579
1578
1580
// Next, we'll insert a signed commitment transaction.
1579
1581
commitTx := randTx (t , 1 )
1580
- internalKey := test .RandPubKey (t )
1582
+ internalKey , _ := test .RandKeyDesc (t )
1581
1583
outputKey := test .RandPubKey (t )
1582
1584
1583
1585
commitDetails := supplycommit.SupplyCommitTxn {
0 commit comments