@@ -4,9 +4,11 @@ import (
44 "context"
55 "strings"
66
7+ "github.com/btcsuite/btcd/chaincfg"
78 restProxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
89 "github.com/lightninglabs/lndclient"
910 tap "github.com/lightninglabs/taproot-assets"
11+ "github.com/lightninglabs/taproot-assets/address"
1012 "github.com/lightninglabs/taproot-assets/perms"
1113 "github.com/lightninglabs/taproot-assets/tapcfg"
1214 "github.com/lightninglabs/taproot-assets/taprpc"
@@ -39,15 +41,23 @@ var _ SubServer = (*taprootAssetsSubServer)(nil)
3941
4042// NewTaprootAssetsSubServer returns a new tap implementation of the SubServer
4143// interface.
42- func NewTaprootAssetsSubServer (cfg * tapcfg.Config ,
44+ func NewTaprootAssetsSubServer (network string , cfg * tapcfg.Config ,
4345 remoteCfg * RemoteDaemonConfig , remote , lndRemote bool ) SubServer {
4446
4547 // Overwrite the tap daemon's user agent name, so it sends "litd"
4648 // instead of "tapd".
4749 tap .SetAgentName ("litd" )
4850
51+ // A quirk of the address package is that it requires the exact testnet
52+ // name, not the generic one...
53+ if network == "testnet" {
54+ network = chaincfg .TestNet3Params .Name
55+ }
56+
57+ chainCfg := address .ParamsForChain (network )
58+
4959 return & taprootAssetsSubServer {
50- Server : tap .NewServer (nil ),
60+ Server : tap .NewServer (& chainCfg , nil ),
5161 cfg : cfg ,
5262 remoteCfg : remoteCfg ,
5363 remote : remote ,
0 commit comments