From 089881ef093e0e07074ff7393c39d1717f8d7595 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Wed, 22 Feb 2023 09:32:34 +0800 Subject: [PATCH] fix: fix store receipts --- pkg/chain/message_store.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkg/chain/message_store.go b/pkg/chain/message_store.go index 6eae86b4e5..a27d7bfd7f 100644 --- a/pkg/chain/message_store.go +++ b/pkg/chain/message_store.go @@ -329,8 +329,7 @@ func (ms *MessageStore) LoadReceipts(ctx context.Context, c cid.Cid) ([]types.Me // StoreReceipts puts the input signed messages to a collection and then writes // this collection to ipld storage. The cid of the collection is returned. func (ms *MessageStore) StoreReceipts(ctx context.Context, receipts []types.MessageReceipt) (cid.Cid, error) { - tmp := blockstoreutil.NewTemporary() - rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(tmp))) + rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(ms.bs))) for i, receipt := range receipts { if err := rectarr.Set(uint64(i), &receipt); err != nil { @@ -338,16 +337,6 @@ func (ms *MessageStore) StoreReceipts(ctx context.Context, receipts []types.Mess } } - root, err := rectarr.Root() - if err != nil { - return cid.Undef, err - } - - err = blockstoreutil.CopyParticial(ctx, tmp, ms.bs, root) - if err != nil { - return cid.Undef, err - } - return rectarr.Root() }