Skip to content

Commit a0d46f4

Browse files
authored
Merge pull request #5743 from filecoin-project/fix/store-receipt
fix: fix store receipts
2 parents f793676 + 089881e commit a0d46f4

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pkg/chain/message_store.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -329,25 +329,14 @@ func (ms *MessageStore) LoadReceipts(ctx context.Context, c cid.Cid) ([]types.Me
329329
// StoreReceipts puts the input signed messages to a collection and then writes
330330
// this collection to ipld storage. The cid of the collection is returned.
331331
func (ms *MessageStore) StoreReceipts(ctx context.Context, receipts []types.MessageReceipt) (cid.Cid, error) {
332-
tmp := blockstoreutil.NewTemporary()
333-
rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(tmp)))
332+
rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(ms.bs)))
334333

335334
for i, receipt := range receipts {
336335
if err := rectarr.Set(uint64(i), &receipt); err != nil {
337336
return cid.Undef, errors.Wrap(err, "failed to build receipts amt")
338337
}
339338
}
340339

341-
root, err := rectarr.Root()
342-
if err != nil {
343-
return cid.Undef, err
344-
}
345-
346-
err = blockstoreutil.CopyParticial(ctx, tmp, ms.bs, root)
347-
if err != nil {
348-
return cid.Undef, err
349-
}
350-
351340
return rectarr.Root()
352341
}
353342

0 commit comments

Comments
 (0)