add some type info to chain get

This commit is contained in:
whyrusleeping
2020-03-06 18:47:19 -08:00
parent 84a887cc58
commit cdd37bda1c
4 changed files with 57 additions and 9 deletions
+5 -2
View File
@@ -306,7 +306,7 @@ func resolveOnce(bs blockstore.Blockstore) func(ctx context.Context, ds ipld.Nod
}
}
func (a *ChainAPI) ChainGetNode(ctx context.Context, p string) (interface{}, error) {
func (a *ChainAPI) ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) {
ip, err := path.ParsePath(p)
if err != nil {
return nil, xerrors.Errorf("parsing path: %w", err)
@@ -327,7 +327,10 @@ func (a *ChainAPI) ChainGetNode(ctx context.Context, p string) (interface{}, err
return nil, err
}
return node, nil
return &api.IpldObject{
Cid: node.Cid(),
Obj: node,
}, nil
}
func (a *ChainAPI) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) {