@@ -66,6 +66,8 @@ type mintingTestHarness struct {
6666
6767 store tapgarden.MintingStore
6868
69+ treeStore * tapgarden.FallibleTapscriptTreeMgr
70+
6971 keyRing * tapgarden.MockKeyRing
7072
7173 genSigner * tapgarden.MockGenSigner
@@ -96,10 +98,12 @@ func newMintingTestHarness(t *testing.T, store tapgarden.MintingStore,
9698
9799 keyRing := tapgarden .NewMockKeyRing ()
98100 genSigner := tapgarden .NewMockGenSigner (keyRing )
101+ treeMgr := tapgarden .NewFallibleTapscriptTreeMgr (store )
99102
100103 return & mintingTestHarness {
101104 T : t ,
102105 store : store ,
106+ treeStore : & treeMgr ,
103107 ticker : ticker .NewForce (interval ),
104108 wallet : tapgarden .NewMockWalletAnchor (),
105109 chain : tapgarden .NewMockChainBridge (),
@@ -126,6 +130,7 @@ func (t *mintingTestHarness) refreshChainPlanter() {
126130 Wallet : t .wallet ,
127131 ChainBridge : t .chain ,
128132 Log : t .store ,
133+ TreeStore : t .treeStore ,
129134 KeyRing : t .keyRing ,
130135 GenSigner : t .genSigner ,
131136 GenTxBuilder : t .genTxBuilder ,
@@ -277,7 +282,7 @@ func (t *mintingTestHarness) assertFinalizeBatch(wg *sync.WaitGroup,
277282// progressCaretaker uses the mock interfaces to progress a caretaker from start
278283// to TX confirmation.
279284func (t * mintingTestHarness ) progressCaretaker (
280- seedlings []* tapgarden.Seedling ) func () {
285+ seedlings []* tapgarden.Seedling , batchSibling * chainhash. Hash ) func () {
281286
282287 // Assert that the caretaker has requested a genesis TX to be funded.
283288 _ = t .assertGenesisTxFunded ()
@@ -295,7 +300,7 @@ func (t *mintingTestHarness) progressCaretaker(
295300
296301 // We should now transition to the next state where we'll attempt to
297302 // sign this PSBT packet generated above.
298- t .assertGenesisPsbtFinalized ()
303+ t .assertGenesisPsbtFinalized (batchSibling )
299304
300305 // With the PSBT packet finalized for the caretaker, we should now
301306 // receive a request to publish a transaction followed by a
@@ -626,7 +631,9 @@ func (t *mintingTestHarness) assertSeedlingsMatchSprouts(
626631
627632// assertGenesisPsbtFinalized asserts that a request to finalize the genesis
628633// transaction has been requested by a caretaker.
629- func (t * mintingTestHarness ) assertGenesisPsbtFinalized () {
634+ func (t * mintingTestHarness ) assertGenesisPsbtFinalized (
635+ sibling * chainhash.Hash ) {
636+
630637 t .Helper ()
631638
632639 // Ensure that a request to finalize the PSBt has come across.
@@ -650,7 +657,7 @@ func (t *mintingTestHarness) assertGenesisPsbtFinalized() {
650657
651658 // The minting key of the batch should match the public key
652659 // that was inserted into the wallet.
653- batchKey , _ , err := pendingBatch .MintingOutputKey ()
660+ batchKey , _ , err := pendingBatch .MintingOutputKey (sibling )
654661 require .NoError (t , err )
655662
656663 importedKey , err := fn .RecvOrTimeout (
@@ -791,7 +798,7 @@ func testBasicAssetCreation(t *mintingTestHarness) {
791798
792799 // We should now transition to the next state where we'll attempt to
793800 // sign this PSBT packet generated above.
794- t .assertGenesisPsbtFinalized ()
801+ t .assertGenesisPsbtFinalized (nil )
795802
796803 // With the PSBT packet finalized for the caretaker, we should now
797804 // receive a request to publish a transaction followed by a
@@ -893,7 +900,7 @@ func testMintingTicker(t *mintingTestHarness) {
893900
894901 // We should now transition to the next state where we'll attempt to
895902 // sign this PSBT packet generated above.
896- t .assertGenesisPsbtFinalized ()
903+ t .assertGenesisPsbtFinalized (nil )
897904
898905 // With the PSBT packet finalized for the caretaker, we should now
899906 // receive a request to publish a transaction followed by a
@@ -1029,7 +1036,7 @@ func testMintingCancelFinalize(t *mintingTestHarness) {
10291036
10301037 // We should now transition to the next state where we'll attempt to
10311038 // sign this PSBT packet generated above.
1032- t .assertGenesisPsbtFinalized ()
1039+ t .assertGenesisPsbtFinalized (nil )
10331040
10341041 // With the PSBT packet finalized for the caretaker, we should now
10351042 // receive a request to publish a transaction followed by a
@@ -1137,7 +1144,7 @@ func testFinalizeBatch(t *mintingTestHarness) {
11371144 t .finalizeBatch (& wg , respChan )
11381145 batchCount ++
11391146
1140- _ = t .progressCaretaker (seedlings )
1147+ _ = t .progressCaretaker (seedlings , nil )
11411148 caretakerCount ++
11421149
11431150 t .assertFinalizeBatch (& wg , respChan , "" )
@@ -1161,7 +1168,7 @@ func testFinalizeBatch(t *mintingTestHarness) {
11611168 t .finalizeBatch (& wg , respChan )
11621169 batchCount ++
11631170
1164- sendConfNtfn := t .progressCaretaker (seedlings )
1171+ sendConfNtfn := t .progressCaretaker (seedlings , nil )
11651172 caretakerCount ++
11661173
11671174 // Trigger the confirmation event, which should cause the caretaker to
@@ -1191,7 +1198,7 @@ func testFinalizeBatch(t *mintingTestHarness) {
11911198 t .finalizeBatch (& wg , respChan )
11921199 batchCount ++
11931200
1194- sendConfNtfn = t .progressCaretaker (seedlings )
1201+ sendConfNtfn = t .progressCaretaker (seedlings , nil )
11951202 sendConfNtfn ()
11961203
11971204 t .assertFinalizeBatch (& wg , respChan , "" )
0 commit comments