Skip to content

darepod: re-expose GetStoredVTXO for harness inspection - #274

Merged
Roasbeef merged 1 commit into
mainfrom
pr223-getstoredvtxo-followup
Apr 17, 2026
Merged

darepod: re-expose GetStoredVTXO for harness inspection#274
Roasbeef merged 1 commit into
mainfrom
pr223-getstoredvtxo-followup

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

Summary

Restore the harness-only GetStoredVTXO accessor on darepod.Server
that was introduced in #239 and then accidentally removed during the
policy-migration refactor in 35dc614 (darepod: wire policy through daemon and CLI). The docs in darepod/CLAUDE.md and darepod/AGENTS.md
still reference this method, so the removal left the API surface
doc-inconsistent.

Motivation

The server-side integration harness (harness/arkharness.go in the
darepo repo) needs to inspect a client daemon's persisted
partial-unroll state during itests. Without this accessor:

  • reaching into the unexported vtxoStore field across package+repo
    boundaries requires reflection or a visibility change, both of which
    break the "harness does not poke private daemon state" invariant
    that the client CLAUDE.md explicitly calls out;
  • widening vtxoStore to an exported field exports the entire
    *db.VTXOPersistenceStore surface area when only a single lookup is
    needed.

Change

Re-add the 15-line accessor that delegates straight to
s.vtxoStore.GetVTXO(ctx, outpoint). Same shape as the original in
PR #239. No other code touched.

Test plan

  • Client go build ./darepod/... clean.
  • Server-side itests against this client commit (in the
    pr223-followup branch of darepo) run green.

Restore the harness-only accessor that was introduced in PR #239 and
then inadvertently removed during the policy-migration refactor in
commit 35dc614 (darepod: wire policy through daemon and CLI). The
docs in darepod/CLAUDE.md and darepod/AGENTS.md still reference this
method, so the removal left the API surface doc-inconsistent.

The server-side darepo integration harness (harness/arkharness.go
over in the darepo repo) calls this method to inspect a client
daemon's persisted partial-unroll state without reaching into the
unexported vtxoStore field across package+repo boundaries. Reflection
or widening the field visibility would both violate the "harness does
not poke private state" invariant the client CLAUDE.md calls out, so
a narrow purpose-scoped accessor is the right shape.

No behavior change beyond the accessor itself: it delegates straight
to s.vtxoStore.GetVTXO.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the GetStoredVTXO method to the Server struct in darepod/server.go, which allows test harnesses to inspect locally stored VTXO descriptors. The review feedback suggests improving the implementation by removing unnecessary blank lines and avoiding string concatenation in the error message for better readability.

Comment thread darepod/server.go
Comment on lines +324 to +333
func (s *Server) GetStoredVTXO(ctx context.Context,
outpoint wire.OutPoint) (*vtxo.Descriptor, error) {

if s.vtxoStore == nil {
return nil, fmt.Errorf("client daemon VTXO " +
"store not initialized")
}

return s.vtxoStore.GetVTXO(ctx, outpoint)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The implementation of GetStoredVTXO contains unnecessary blank lines and string concatenation in the error message. For better readability and searchability of error messages, it's preferred to use a single string literal and follow the formatting conventions used in the rest of the file (e.g., no blank line at the start of a function).

func (s *Server) GetStoredVTXO(ctx context.Context,
	outpoint wire.OutPoint) (*vtxo.Descriptor, error) {
	if s.vtxoStore == nil {
		return nil, fmt.Errorf("client daemon VTXO store not initialized")
	}

	return s.vtxoStore.GetVTXO(ctx, outpoint)
}

@Roasbeef
Roasbeef merged commit 45a451a into main Apr 17, 2026
17 checks passed
ellemouton pushed a commit that referenced this pull request May 22, 2026
client+itest: cooperative leave end-to-end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant