Skip to content

lnwallet: fix lnwallet test compilation on v0.20.x - #11093

Merged
ziggie1984 merged 1 commit into
lightningnetwork:v0.20.x-branchfrom
ziggie1984:fix-lnwallet-chanstate-v0.20.x
Aug 18, 2026
Merged

lnwallet: fix lnwallet test compilation on v0.20.x#11093
ziggie1984 merged 1 commit into
lightningnetwork:v0.20.x-branchfrom
ziggie1984:fix-lnwallet-chanstate-v0.20.x

Conversation

@ziggie1984

Copy link
Copy Markdown
Collaborator

The lnwallet test package does not compile on this branch, which fails CI for every PR targeting it, regardless of that PR's own contents.

lnwallet/wallet_test.go:6:2: no required module provides package
  github.com/lightningnetwork/lnd/chanstate

Cause

The regression test added by the backport of #11035 was taken verbatim from master, where the OpenChannel type lives in the chanstate package. That package does not exist on this branch. The cherry-pick applied without a conflict because the commit only adds an import line and a new function — there was nothing textual for git to reconcile — so the breakage landed silently.

The same problem exists on v0.21.x-branch, fixed identically in #11092.

Impact

Because the missing package is unresolvable in the module graph, this breaks considerably more than go test ./lnwallet:

Check Failure
Run unit tests (all variants) FAIL github.com/lightningnetwork/lnd/lnwallet [setup failed]
Check commits no required module provides package .../chanstate
Lint code could not load export data for ".../chanstate"Makefile:378: lint-source Error 3
Cross compilation no required module provides packageMakefile:199: release Error 1

make release and golangci-lint both resolve test imports, which is why even the build-only jobs fail.

Fix

Use channeldb.OpenChannel — the type completeChan actually carries on this branch (lnwallet/wallet.go:337, :366). Two lines; no production code touched.

Testing

  • go vet ./... — clean (previously reported the error above)
  • go build ./... — clean
  • go test ./lnwallet/ -run TestHandleFundingCounterPartySigsMissingReservation — passes, having been uncompilable before

The regression test added by the backport of lightningnetwork#11035 was taken verbatim
from master, where the `OpenChannel` type lives in the `chanstate`
package. That package does not exist on this branch, so the `lnwallet`
test package failed to compile.

Because the missing package is unresolvable in the module graph, this
broke far more than `go test ./lnwallet`: the unit test jobs, the
linter, `make release` (and therefore cross compilation) and the
`Check commits` job all failed for every PR targeting this branch.

Use `channeldb.OpenChannel`, which is the type `completeChan` actually
carries here.
@ziggie1984
ziggie1984 force-pushed the fix-lnwallet-chanstate-v0.20.x branch from 642be04 to a0c8ef3 Compare August 17, 2026 23:35
@github-actions github-actions Bot added the severity-low Best-effort review label Aug 17, 2026
@github-actions

Copy link
Copy Markdown

🟢 PR Severity: LOW

gh pr view | 1 files | 4 lines changed

🟢 Low (1 files)
  • lnwallet/wallet_test.go - test-only change, no production code touched

Analysis

Although lnwallet/* is normally a CRITICAL package (wallet operations, channel funding, signing), this PR only modifies wallet_test.go, a test file, with a very small diff (2 additions / 2 deletions). Per the classification rules, test-only changes are treated as LOW severity regardless of the package they live in, and no bump is warranted given the tiny, single-file diff.


To override, add a severity-override-{critical,high,medium,low} label.

@ziggie1984
ziggie1984 merged commit c70e7d1 into lightningnetwork:v0.20.x-branch Aug 18, 2026
36 checks passed
@ziggie1984
ziggie1984 deleted the fix-lnwallet-chanstate-v0.20.x branch August 18, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants