Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

feat: revamped dag api #76

Merged
merged 11 commits into from
Feb 8, 2017
Merged

feat: revamped dag api #76

merged 11 commits into from
Feb 8, 2017

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Feb 7, 2017

ref: https://github.com/ipfs/interface-ipfs-core/issues/81#issuecomment-277271941

  • merge get and resolve
  • localResolve option
  • put with cid or with hashAlg and format
  • refactor dag-pb tests
  • new basic tests
  • refactor dag-cbor tests
  • refactor eth-block tests
  • refactor all-together-now tests

@daviddias daviddias added the status/in-progress In progress label Feb 7, 2017
@daviddias
Copy link
Member Author

done, ready for review :)

Copy link
Member

@nicola nicola left a comment

Choose a reason for hiding this comment

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

All good!


// pass an optional blockService, if no blockService is passed,
// one is created in memory.
const ipldResolver = new IPLDResolver(blockService)
const Resolver = new Resolver(blockService)
Copy link
Member

Choose a reason for hiding this comment

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

let's tell them that the blockService can be optional

Copy link
Member Author

Choose a reason for hiding this comment

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

It's on the comment :)
image

Copy link
Member

Choose a reason for hiding this comment

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

it was late night..

Copy link
Member Author

Choose a reason for hiding this comment

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

@nicola <3

```

## API

### IPLD Resolver
### `.put(node, <<cid> || <format>, <hashAlg>>, callback)`
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't it meant to be {node: *, cid: *} (this is what I saw from the tests)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I saw it later on in the code while I was seeing this.
This makes much more sense and it is much cleaner, awesome!

(it just breaks my ipld selector tests! :D)

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, sorry about that, as you say it gets things clearer :)

}

resolve (cid, path, callback) {
get (cid, path, options, callback) {
Copy link
Member

Choose a reason for hiding this comment

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

<3 merging get and resolve :)

@kumavis
Copy link
Contributor

kumavis commented Feb 8, 2017

nice!

@daviddias daviddias merged commit 0e878b0 into master Feb 8, 2017
@daviddias daviddias deleted the feat/revamped-dag-api branch February 8, 2017 07:41
@daviddias daviddias removed the status/in-progress In progress label Feb 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants