integration: fix p2a_test build under -tags=rpctest
What changed, and why it matters
This commit fixes a build error in an integration test file when a special build tag is used. It changes which internal package provides a helper function for creating a test Bitcoin address. There is no security issue here—just a straightforward code fix to make tests compile.
No security action needed. Treat as a normal build/test maintenance fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates integration/p2a_test.go to import github.com/btcsuite/btcd/address/v2 and call address.NewAddressPayToAnchor instead of btcutil.NewAddressPayToAnchor. The function was moved/refactored into the address/v2 module, so the old call no longer compiled under -tags=rpctest. This is a pure build-fix refactor with no runtime behavior change.
Changed components
integration/p2a_test.goInspect captured patch +2 / −1
diff --git a/integration/p2a_test.go b/integration/p2a_test.go
index 059e56b..e986db2 100644
--- a/integration/p2a_test.go
+++ b/integration/p2a_test.go
@@ -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)
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.