Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions darepod/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Comment on lines +324 to +333

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)
}


// RPCAddr returns the bound daemon gRPC listener address once startup has
// progressed far enough to create the listener.
func (s *Server) RPCAddr() net.Addr {
Expand Down
Loading