From 088c18b39aff617383780fb2648d75d91c16f6d5 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:27:19 -0500 Subject: [PATCH] Node/P2P: Add WithComponents (#4089) --- node/pkg/p2p/run_params.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node/pkg/p2p/run_params.go b/node/pkg/p2p/run_params.go index 3d468f65f2..1ac48a8e05 100644 --- a/node/pkg/p2p/run_params.go +++ b/node/pkg/p2p/run_params.go @@ -100,6 +100,14 @@ func NewRunParams( return p, nil } +// WithComponents is used to set the components if you need something other than the defaults. +func WithComponents(components *Components) RunOpt { + return func(p *RunParams) error { + p.components = components + return nil + } +} + // WithSignedObservationListener is used to set the channel to receive `SignedObservation` messages. func WithSignedObservationListener(obsvRecvC chan<- *common.MsgWithTimeStamp[gossipv1.SignedObservation]) RunOpt { return func(p *RunParams) error {