Skip to content

Commit

Permalink
Use api instead of node for block and path
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavila committed Feb 22, 2019
1 parent c0aaeac commit 3b9664a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions core/coreapi/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ func (api *BlockAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Bloc
return nil, err
}

//<<<<<<< HEAD
if settings.Pin {
api.pinning.PinWithMode(b.Cid(), pin.Recursive)
}
//=======
// api.node.Provider.Provide(b.Cid())
//>>>>>>> Add provider to ipfs and provide when adding/fetching

api.provider.Provide(b.Cid())

return &BlockStat{path: coreiface.IpldPath(b.Cid()), size: len(data)}, nil
}
Expand All @@ -75,7 +73,7 @@ func (api *BlockAPI) Get(ctx context.Context, p coreiface.Path) (io.Reader, erro
return nil, err
}

//api.node.Provider.Provide(rp.Cid())
api.provider.Provide(rp.Cid())

return bytes.NewReader(b.RawData()), nil
}
Expand Down Expand Up @@ -129,7 +127,7 @@ func (api *BlockAPI) Stat(ctx context.Context, p coreiface.Path) (coreiface.Bloc
return nil, err
}

//api.node.Provider.Provide(b.Cid())
api.provider.Provide(b.Cid())

return &BlockStat{
path: coreiface.IpldPath(b.Cid()),
Expand Down
2 changes: 1 addition & 1 deletion core/coreapi/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (api *CoreAPI) ResolveNode(ctx context.Context, p coreiface.Path) (ipld.Nod
return nil, err
}

//api.node.Provider.Provide(node.Cid())
api.provider.Provide(node.Cid())

return node, nil
}
Expand Down

2 comments on commit 3b9664a

@GitCop
Copy link

@GitCop GitCop commented on 3b9664a Feb 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link

@GitCop GitCop commented on 3b9664a Feb 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

Please sign in to comment.