squash forks and use correct amt library everywhere

This commit is contained in:
whyrusleeping
2020-02-04 18:26:42 -08:00
parent c013ef3b30
commit faf05cafcf
29 changed files with 214 additions and 1250 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import (
"strconv"
"strings"
"github.com/filecoin-project/go-amt-ipld"
"github.com/filecoin-project/go-amt-ipld/v2"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-hamt-ipld"
@@ -241,7 +241,7 @@ func resolveOnce(bs blockstore.Blockstore) func(ctx context.Context, ds ipld.Nod
}
if strings.HasPrefix(names[0], "@A:") {
a, err := amt.LoadAMT(amt.WrapBlockstore(bs), nd.Cid())
a, err := amt.LoadAMT(ctx, cbor.NewCborStore(bs), nd.Cid())
if err != nil {
return nil, nil, xerrors.Errorf("load amt: %w", err)
}
@@ -252,7 +252,7 @@ func resolveOnce(bs blockstore.Blockstore) func(ctx context.Context, ds ipld.Nod
}
var m interface{}
if err := a.Get(idx, &m); err != nil {
if err := a.Get(ctx, idx, &m); err != nil {
return nil, nil, xerrors.Errorf("amt get: %w", err)
}
fmt.Printf("AG %T %v\n", m, m)
+4 -4
View File
@@ -6,7 +6,7 @@ import (
"fmt"
"strconv"
"github.com/filecoin-project/go-amt-ipld"
"github.com/filecoin-project/go-amt-ipld/v2"
cid "github.com/ipfs/go-cid"
"github.com/ipfs/go-hamt-ipld"
@@ -280,13 +280,13 @@ func (a *StateAPI) StateMarketDeals(ctx context.Context, ts *types.TipSet) (map[
return nil, err
}
blks := amt.WrapBlockstore(a.StateManager.ChainStore().Blockstore())
da, err := amt.LoadAMT(blks, state.Deals)
blks := cbor.NewCborStore(a.StateManager.ChainStore().Blockstore())
da, err := amt.LoadAMT(ctx, blks, state.Deals)
if err != nil {
return nil, err
}
if err := da.ForEach(func(i uint64, v *cbg.Deferred) error {
if err := da.ForEach(ctx, func(i uint64, v *cbg.Deferred) error {
var d actors.OnChainDeal
if err := d.UnmarshalCBOR(bytes.NewReader(v.Raw)); err != nil {
return err