Skip to content

Commit 360144c

Browse files
committed
Add fuzzing tests
1 parent 5fb674c commit 360144c

2 files changed

Lines changed: 55 additions & 8 deletions

File tree

pkg/txm/clientwrappers/dualbroadcast/meta_client.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ func (a *MetaClient) SendTransaction(ctx context.Context, tx *types.Transaction,
168168
}
169169
return nil
170170
}
171-
return errors.New("meta transaction was empty")
171+
a.lggr.Info("No bids for transactionID(%d): ", tx.ID)
172+
return nil
172173
}
173174
return a.c.SendTransaction(ctx, attempt.SignedTransaction)
174175
}
@@ -244,7 +245,7 @@ func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transactio
244245
ChainID: &cid,
245246
ToAddress: tx.ToAddress,
246247
Payload: tx.Data,
247-
ER: true,
248+
ER: false,
248249
FromAddress: tx.FromAddress,
249250
MaxFeePerGas: &fee,
250251
}
@@ -301,7 +302,7 @@ func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transactio
301302
}
302303

303304
if response.Result == nil {
304-
return nil, errors.New("empty response")
305+
return nil, nil
305306
}
306307

307308
return VerifyResponse(response.Result.MetacalldataResponse, dualBroadcastParams, tx.Data, tx.FromAddress, fwdrDestAddress)
@@ -400,16 +401,11 @@ func VerifyMetadata(txData []byte, fromAddress common.Address, result Metacallda
400401
}
401402

402403
// SOP
403-
atLeastOne := false
404404
for _, sop := range result.SOPs {
405405
if sop.To != to || sop.Control != dApp {
406406
// Exit early
407407
return nil, fmt.Errorf("incorrect SOP: sop.To: %v, sop.Control: %v, to: %v, dApp: %v", sop.To, sop.Control, to, dApp)
408408
}
409-
atLeastOne = true
410-
}
411-
if !atLeastOne {
412-
return nil, errors.New("no valid sop")
413409
}
414410

415411
// UOP

0 commit comments

Comments
 (0)