Skip to content

Commit 5dc74e7

Browse files
committed
tapgarden+tapcfg: populate chain params in ChainPlanter
This allows deriving a pre-commitment output script key when the universe commitment feature is enabled.
1 parent 32cd867 commit 5dc74e7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tapcfg/server.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,8 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
534534
RuntimeID: runtimeID,
535535
EnableChannelFeatures: enableChannelFeatures,
536536
Lnd: lndServices,
537-
ChainParams: address.ParamsForChain(
538-
cfg.ActiveNetParams.Name,
539-
),
540-
ReOrgWatcher: reOrgWatcher,
537+
ChainParams: tapChainParams,
538+
ReOrgWatcher: reOrgWatcher,
541539
AssetMinter: tapgarden.NewChainPlanter(tapgarden.PlanterConfig{
542540
GardenKit: tapgarden.GardenKit{
543541
Wallet: walletAnchor,
@@ -553,6 +551,7 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
553551
ProofWatcher: reOrgWatcher,
554552
UniversePushBatchSize: defaultUniverseSyncBatchSize,
555553
},
554+
ChainParams: tapChainParams,
556555
ProofUpdates: proofArchive,
557556
ErrChan: mainErrChan,
558557
}),

tapgarden/planter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/btcsuite/btcd/chaincfg/chainhash"
1717
"github.com/btcsuite/btcd/wire"
1818
"github.com/davecgh/go-spew/spew"
19+
"github.com/lightninglabs/taproot-assets/address"
1920
"github.com/lightninglabs/taproot-assets/asset"
2021
"github.com/lightninglabs/taproot-assets/fn"
2122
"github.com/lightninglabs/taproot-assets/proof"
@@ -83,6 +84,11 @@ type GardenKit struct {
8384
type PlanterConfig struct {
8485
GardenKit
8586

87+
// ChainParams defines the chain parameters for the target blockchain
88+
// network. It specifies whether the network is Bitcoin mainnet or
89+
// testnet.
90+
ChainParams address.ChainParams
91+
8692
// ProofUpdates is the storage backend for updated proofs.
8793
ProofUpdates proof.Archiver
8894

tapgarden/planter_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ func (t *mintingTestHarness) refreshChainPlanter() {
156156
ProofFiles: t.proofFiles,
157157
ProofWatcher: t.proofWatcher,
158158
},
159+
ChainParams: *chainParams,
159160
ProofUpdates: t.proofFiles,
160161
ErrChan: t.errChan,
161162
})

0 commit comments

Comments
 (0)