@@ -224,11 +224,7 @@ func (a *SolanaAccessor) registerFilterIfNotExists(
224
224
// one-to-one mapping of event fields from the Solana format to the standard CCIP format.
225
225
func (a * SolanaAccessor ) convertCCIPMessageSent (ctx context.Context , logs []logpollertypes.Log , onrampAddr solana.PublicKey ) ([]* chainaccessor.SendRequestedEvent , error ) {
226
226
itemType := codec .WrapItemType (false , consts .ContractNameOnRamp , consts .EventNameCCIPMessageSent )
227
- eventType , err := a .codec .CreateType (itemType , false )
228
- if err != nil {
229
- return nil , fmt .Errorf ("failed to create type to decode event into: %w" , err )
230
- }
231
- iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & eventType )
227
+ iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & ccip.EventCCIPMessageSent {})
232
228
if err != nil {
233
229
return nil , fmt .Errorf ("failed to decode logs into sequences: %w" , err )
234
230
}
@@ -241,7 +237,7 @@ func (a *SolanaAccessor) convertCCIPMessageSent(ctx context.Context, logs []logp
241
237
for i , seq := range iter {
242
238
event , ok := seq .Data .(* ccip.EventCCIPMessageSent )
243
239
if ! ok {
244
- return nil , fmt .Errorf ("failed to cast %v to EventCCIPMessageSent" , seq .Data )
240
+ return nil , fmt .Errorf ("failed to cast %T to EventCCIPMessageSent" , seq .Data )
245
241
}
246
242
msg := ccipocr3.Message {
247
243
Header : ccipocr3.RampMessageHeader {
@@ -325,11 +321,7 @@ func (a *SolanaAccessor) processCommitReports(
325
321
ctx context.Context , logs []logpollertypes.Log , ts time.Time , limit int ,
326
322
) ([]ccipocr3.CommitPluginReportWithMeta , error ) {
327
323
itemType := codec .WrapItemType (false , consts .ContractNameOffRamp , consts .EventNameCommitReportAccepted )
328
- eventType , err := a .codec .CreateType (itemType , false )
329
- if err != nil {
330
- return nil , fmt .Errorf ("failed to create type to decode event into: %w" , err )
331
- }
332
- iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & eventType )
324
+ iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & ccip.EventCommitReportAccepted {})
333
325
if err != nil {
334
326
return nil , fmt .Errorf ("failed to decode logs into sequences: %w" , err )
335
327
}
@@ -382,7 +374,7 @@ func validateCommitReportAcceptedEvent(
382
374
) (* ccip.EventCommitReportAccepted , error ) {
383
375
ev , is := (seq .Data ).(* ccip.EventCommitReportAccepted )
384
376
if ! is {
385
- return nil , fmt .Errorf ("unexpected type %T while expecting a commit report " , seq )
377
+ return nil , fmt .Errorf ("unexpected type %T while expecting EventCommitReportAccepted " , seq . Data )
386
378
}
387
379
388
380
if ev == nil {
@@ -551,11 +543,7 @@ func createExecutedMessagesKeyFilter(rangesPerChain map[ccipocr3.ChainSelector][
551
543
552
544
func (a * SolanaAccessor ) processExecutionStateChangesEvents (ctx context.Context , logs []logpollertypes.Log , nonEmptyRangesPerChain map [ccipocr3.ChainSelector ][]ccipocr3.SeqNumRange ) (map [ccipocr3.ChainSelector ][]ccipocr3.SeqNum , error ) {
553
545
itemType := codec .WrapItemType (false , consts .ContractNameOffRamp , consts .EventNameExecutionStateChanged )
554
- eventType , err := a .codec .CreateType (itemType , false )
555
- if err != nil {
556
- return nil , fmt .Errorf ("failed to create type to decode event into: %w" , err )
557
- }
558
- iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & eventType )
546
+ iter , err := a .decodeLogsIntoSequences (ctx , itemType , logs , & ccip.EventExecutionStateChanged {})
559
547
if err != nil {
560
548
return nil , fmt .Errorf ("failed to decode logs into sequences: %w" , err )
561
549
}
0 commit comments