Skip to content

Commit

Permalink
Fix panic when feeder returns mismatched number of txns and receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Sep 28, 2023
1 parent 01adf51 commit 8a6218e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions adapters/feeder2core/feeder2core.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ func AdaptBlock(response *feeder.Block, sig *feeder.Signature) (*core.Block, err
}

txns := make([]core.Transaction, len(response.Transactions))
receipts := make([]*core.TransactionReceipt, len(response.Receipts))
eventCount := uint64(0)
for i, txn := range response.Transactions {
var err error
txns[i], err = AdaptTransaction(txn)
if err != nil {
return nil, err
}
receipts[i] = AdaptTransactionReceipt(response.Receipts[i])
eventCount += uint64(len(response.Receipts[i].Events))
}

receipts := make([]*core.TransactionReceipt, len(response.Receipts))
eventCount := uint64(0)
for i, receipt := range response.Receipts {
receipts[i] = AdaptTransactionReceipt(receipt)
eventCount += uint64(len(receipt.Events))
}

sigs := [][]*felt.Felt{}
Expand Down

0 comments on commit 8a6218e

Please sign in to comment.