@@ -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
@@ -721,6 +722,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
721
722
// Next, we'll generate a new "fake" commitment transaction along with
722
723
// sample internal and output keys.
723
724
commitTx := randTx (h .t , 1 )
725
+
724
726
// Add inputs to the transaction that spend the pre-commitment outputs.
725
727
for _ , outpoint := range preCommitOutpoints {
726
728
commitTx .TxIn = append (commitTx .TxIn , & wire.TxIn {
@@ -736,7 +738,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
736
738
// and commit that.
737
739
commitDetails := supplycommit.SupplyCommitTxn {
738
740
Txn : commitTx ,
739
- InternalKey : internalKey . PubKey ,
741
+ InternalKey : internalKey ,
740
742
OutputKey : outputKey ,
741
743
OutputIndex : 1 ,
742
744
}
@@ -811,7 +813,7 @@ func (h *supplyCommitTestHarness) performSingleTransition(
811
813
812
814
return stateTransitionOutput {
813
815
appliedUpdates : updates ,
814
- internalKey : internalKey . PubKey ,
816
+ internalKey : internalKey ,
815
817
outputKey : outputKey ,
816
818
commitTx : commitTx ,
817
819
chainProof : chainProof ,
@@ -1018,7 +1020,7 @@ func (h *supplyCommitTestHarness) assertTransitionApplied(
1018
1020
// The keys should also be inserted, and the db commitment should match
1019
1021
// what we inserted.
1020
1022
require .Equal (
1021
- h .t , internalKey .SerializeCompressed (),
1023
+ h .t , internalKey .PubKey . SerializeCompressed (),
1022
1024
h .fetchInternalKeyByID (dbCommitment .InternalKeyID ).RawKey ,
1023
1025
"internalKey mismatch" ,
1024
1026
)
@@ -1162,7 +1164,7 @@ func (h *supplyCommitTestHarness) assertTransitionApplied(
1162
1164
"SupplyCommit returned wrong Txn hash" ,
1163
1165
)
1164
1166
require .Equal (
1165
- h .t , output .internalKey .SerializeCompressed (),
1167
+ h .t , output .internalKey .PubKey . SerializeCompressed (),
1166
1168
fetchedCommit .InternalKey .PubKey .SerializeCompressed (),
1167
1169
"SupplyCommit returned wrong InternalKey" ,
1168
1170
)
@@ -1404,7 +1406,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1404
1406
commitTxid2 := commitTx2 .TxHash ()
1405
1407
1406
1408
// Insert the signed commitment with the updated transaction.
1407
- internalKey := test .RandPubKey (t )
1409
+ internalKey , _ := test .RandKeyDesc (t )
1408
1410
outputKey := test .RandPubKey (t )
1409
1411
commitDetails := supplycommit.SupplyCommitTxn {
1410
1412
Txn : commitTx2 ,
@@ -1443,7 +1445,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1443
1445
require .NoError (t , err )
1444
1446
require .Equal (t , chainTx2Record .TxnID , newDbCommitment .ChainTxnID )
1445
1447
require .Equal (t ,
1446
- internalKey .SerializeCompressed (),
1448
+ internalKey .PubKey . SerializeCompressed (),
1447
1449
h .fetchInternalKeyByID (newDbCommitment .InternalKeyID ).RawKey ,
1448
1450
)
1449
1451
require .Equal (
@@ -1466,7 +1468,7 @@ func TestSupplyCommitInsertSignedCommitTx(t *testing.T) {
1466
1468
t , commitTxid2 , fetchedTransition .NewCommitment .Txn .TxHash (),
1467
1469
)
1468
1470
require .Equal (
1469
- t , internalKey .SerializeCompressed (),
1471
+ t , internalKey .PubKey . SerializeCompressed (),
1470
1472
fetchedTransition .NewCommitment .InternalKey .PubKey .SerializeCompressed (), //nolint:lll
1471
1473
)
1472
1474
require .Equal (
@@ -1580,7 +1582,7 @@ func TestSupplyCommitFetchState(t *testing.T) {
1580
1582
1581
1583
// Next, we'll insert a signed commitment transaction.
1582
1584
commitTx := randTx (t , 1 )
1583
- internalKey := test .RandPubKey (t )
1585
+ internalKey , _ := test .RandKeyDesc (t )
1584
1586
outputKey := test .RandPubKey (t )
1585
1587
1586
1588
commitDetails := supplycommit.SupplyCommitTxn {
0 commit comments