Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Sep 6, 2024
1 parent a9748dd commit 07acd73
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions blockchain/filedao/sized.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package filedao

import (
"bytes"
"context"
"os"
"slices"
"sync"

"github.com/holiman/billy"
Expand Down Expand Up @@ -331,3 +333,24 @@ func newSlotter() func() (uint32, bool) {
return sizeList[i], true
}
}

func fillTransactionLog(receipts []*action.Receipt, txLogs []*iotextypes.TransactionLog) error {
for _, l := range txLogs {
idx := slices.IndexFunc(receipts, func(r *action.Receipt) bool {
return bytes.Equal(r.ActionHash[:], l.ActionHash)
})
if idx < 0 {
return errors.Errorf("missing receipt for log %x", l.ActionHash)
}
txLogs := make([]*action.TransactionLog, len(l.GetTransactions()))
for j, tx := range l.GetTransactions() {
txlog, err := convertToTxLog(tx)

Check failure on line 347 in blockchain/filedao/sized.go

View workflow job for this annotation

GitHub Actions / ci flow

undefined: convertToTxLog
if err != nil {
return err
}
txLogs[j] = txlog
}
receipts[idx].AddTransactionLogs(txLogs...)
}
return nil
}

0 comments on commit 07acd73

Please sign in to comment.