@@ -48,10 +48,10 @@ type TransmissionState struct {
4848type TargetStrategy interface {
4949 // QueryTransmissionState defines how the report should be queried
5050 // via ChainReader, and how resulting errors should be classified.
51- QueryTransmissionState (ctx context.Context , rec string , workflowExecutionID string , reportID uint16 ) (* TransmissionState , error )
51+ QueryTransmissionState (ctx context.Context , reportID uint16 , request capabilities. CapabilityRequest ) (* TransmissionState , error )
5252 // TransmitReport constructs the tx to transmit the report, and defines
5353 // any specific handling for sending the report via ChainWriter.
54- TransmitReport (ctx context.Context , receiver string , report []byte , reportContext []byte , signatures [][]byte , workflowExecutionID string ) (string , error )
54+ TransmitReport (ctx context.Context , report []byte , reportContext []byte , signatures [][]byte , request capabilities. CapabilityRequest ) (string , error )
5555}
5656
5757var (
@@ -80,7 +80,7 @@ type writeTarget struct {
8080 cs commontypes.ChainService
8181 cr commontypes.ContractReader
8282 cw commontypes.ContractWriter
83- configValidateFn func (config ReqConfig ) error
83+ configValidateFn func (request capabilities. CapabilityRequest ) error
8484
8585 nodeAddress string
8686 forwarderAddress string
@@ -102,7 +102,7 @@ type WriteTargetOpts struct {
102102 ChainService commontypes.ChainService
103103 ContractReader commontypes.ContractReader
104104 ChainWriter commontypes.ContractWriter
105- ConfigValidateFn func (config ReqConfig ) error
105+ ConfigValidateFn func (request capabilities. CapabilityRequest ) error
106106
107107 NodeAddress string
108108 ForwarderAddress string
@@ -190,24 +190,21 @@ func (c *writeTarget) Execute(ctx context.Context, request capabilities.Capabili
190190 // Helper to build monitoring (Beholder) messages
191191 builder := NewMessageBuilder (c .chainInfo , capInfo )
192192
193- // Parse the request (WT-specific) config
194- var reqConfig ReqConfig
195- err := request .Config .UnwrapTo (& reqConfig )
196- if err != nil {
197- msg := builder .buildWriteError (info , 0 , "failed to parse config" , err .Error ())
198- return capabilities.CapabilityResponse {}, c .asEmittedError (ctx , msg )
199- }
193+ // // Parse the request (WT-specific) config
194+ // var reqConfig ReqConfig
195+ // err := request.Config.UnwrapTo(&reqConfig)
196+ // if err != nil {
197+ // msg := builder.buildWriteError(info, 0, "failed to parse config", err.Error())
198+ // return capabilities.CapabilityResponse{}, c.asEmittedError(ctx, msg)
199+ // }
200200
201201 // Validate the config
202- err = c .configValidateFn (reqConfig )
202+ err : = c .configValidateFn (request )
203203 if err != nil {
204204 msg := builder .buildWriteError (info , 0 , "failed to validate config" , err .Error ())
205205 return capabilities.CapabilityResponse {}, c .asEmittedError (ctx , msg )
206206 }
207207
208- // Source the receiver address from the config
209- info .receiver = reqConfig .Address
210-
211208 // Source the signed report from the request
212209 signedReport , ok := request .Inputs .Underlying [KeySignedReport ]
213210 if ! ok {
@@ -285,7 +282,7 @@ func (c *writeTarget) Execute(ctx context.Context, request capabilities.Capabili
285282 "executionID" , request .Metadata .WorkflowExecutionID ,
286283 )
287284
288- state , err := c .targetStrategy .QueryTransmissionState (ctx , info .receiver , request . Metadata . WorkflowExecutionID , info . reportInfo .reportID )
285+ state , err := c .targetStrategy .QueryTransmissionState (ctx , info .reportInfo .reportID , request )
289286
290287 if err != nil {
291288 msg := builder .buildWriteError (info , 0 , "failed to fetch [TransmissionState]" , err .Error ())
@@ -311,7 +308,7 @@ func (c *writeTarget) Execute(ctx context.Context, request capabilities.Capabili
311308 "executionID" , request .Metadata .WorkflowExecutionID ,
312309 )
313310
314- txID , err := c .targetStrategy .TransmitReport (ctx , info . receiver , inputs .Report , inputs .Context , inputs .Signatures , request . Metadata . WorkflowExecutionID )
311+ txID , err := c .targetStrategy .TransmitReport (ctx , inputs .Report , inputs .Context , inputs .Signatures , request )
315312 c .lggr .Debugw ("Transaction submitted" , "request" , request , "transaction-id" , txID )
316313 if err != nil {
317314 msg := builder .buildWriteError (info , 0 , "failed to transmit the report" , err .Error ())
@@ -438,7 +435,7 @@ func (c *writeTarget) acceptAndConfirmWrite(ctx context.Context, info requestInf
438435 }
439436
440437 // Check confirmation status (transmission state)
441- state , err := c .targetStrategy .QueryTransmissionState (ctx , info .receiver , info . request . Metadata . WorkflowExecutionID , info .reportInfo . reportID )
438+ state , err := c .targetStrategy .QueryTransmissionState (ctx , info .reportInfo . reportID , info .request )
442439 if err != nil {
443440 lggr .Errorw ("failed to check confirmed status" , "txID" , txID , "err" , err )
444441 continue
0 commit comments