Add more chain get types

This commit is contained in:
Travis Person
2020-03-09 03:16:43 +00:00
parent 85f01e4ded
commit 9216a1eb07
2 changed files with 72 additions and 0 deletions
+12
View File
@@ -12,6 +12,7 @@ import (
commcid "github.com/filecoin-project/go-fil-commcid"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/crypto"
"github.com/filecoin-project/specs-actors/actors/util/adt"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-hamt-ipld"
@@ -271,6 +272,17 @@ func resolveOnce(bs blockstore.Blockstore) func(ctx context.Context, ds ipld.Nod
names[0] = "@H:" + string(addr.Bytes())
}
if strings.HasPrefix(names[0], "@Hi:") {
i, err := strconv.ParseInt(names[0][4:], 10, 64)
if err != nil {
return nil, nil, xerrors.Errorf("parsing int64: %w", err)
}
ik := adt.IntKey(i)
names[0] = "@H:" + ik.Key()
}
if strings.HasPrefix(names[0], "@H:") {
cst := cbor.NewCborStore(bs)