integration: fix p2a_test build under -tags=rpctest

p2a_test.go calls btcutil.NewAddressPayToAnchor, but the
NewAddressPayToAnchor constructor lives in the address/v2 module's
address package. Import that package and call it through there so the
integration package builds when -tags=rpctest is set.
This commit is contained in:
Calvin Kim 2026-05-30 13:51:00 +09:00
parent 61c215ec1a
commit 221178501c

View file

@ -6,6 +6,7 @@ package integration
import (
"testing"
"github.com/btcsuite/btcd/address/v2"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/btcsuite/btcd/chaincfg/v2"
"github.com/btcsuite/btcd/integration/rpctest"
@ -46,7 +47,7 @@ func TestPayToAnchorSimple(t *testing.T) {
// Create a P2A output using the helper to get a P2A address. This
// ensures we're using the same P2A script generation logic.
p2aAddr, err := btcutil.NewAddressPayToAnchor(&chaincfg.SimNetParams)
p2aAddr, err := address.NewAddressPayToAnchor(&chaincfg.SimNetParams)
if err != nil {
t.Fatalf("unable to create P2A address: %v", err)
}