From b48a5be883ae6680a48ea546b601414d73aa1495 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 16 Apr 2026 23:48:25 -0500 Subject: [PATCH] darepod: re-expose GetStoredVTXO for harness inspection 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. --- darepod/server.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/darepod/server.go b/darepod/server.go index 60f16548a..8b48e0a4f 100644 --- a/darepod/server.go +++ b/darepod/server.go @@ -317,6 +317,21 @@ func (s *Server) DaemonReady() <-chan struct{} { return s.daemonReady } +// GetStoredVTXO returns the persisted VTXO descriptor for the given +// outpoint. This method exists for test harnesses only; it lets +// server-side integration tests inspect locally stored partial-unroll +// state without reaching into internal daemon fields. +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) +} + // RPCAddr returns the bound daemon gRPC listener address once startup has // progressed far enough to create the listener. func (s *Server) RPCAddr() net.Addr {