The Wayback Machine - https://web.archive.org/web/20220309093336/https://github.com/ipfs/js-ipfs/issues/3913
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs.block API is out of sync with the implementation #3913

Open
matheus23 opened this issue Oct 7, 2021 · 4 comments
Open

ipfs.block API is out of sync with the implementation #3913

matheus23 opened this issue Oct 7, 2021 · 4 comments

Comments

@matheus23
Copy link
Contributor

@matheus23 matheus23 commented Oct 7, 2021

Here is what I've noticed:

  • ipfs.block.get
    • docs say it returns a Block, but it returns a Uint8Array
    • docs are missing the preload option
  • ipfs.block.put
    • docs say it can also take a Block as a parameter, but it can only be a Uint8Array
    • docs say it can take a cid as an option, but the implementation ignores such a parameter
    • docs say it returns a Block, but it's just a Uint8Array
@lidel
Copy link
Member

@lidel lidel commented Oct 8, 2021

@matheus23 mind opening PR with updated docs (make docs match the latest implementation)? 🙏

docs are missing the preload option

which docs? (it is js-ipfs only feature)

@matheus23
Copy link
Contributor Author

@matheus23 matheus23 commented Oct 8, 2021

which docs? (it is js-ipfs only feature)

The options parameter for ipfs.block.get is missing an optional preload: boolean parameter.

@lidel
Copy link
Member

@lidel lidel commented Oct 11, 2021

Ack. It also should be added to the docs you linked.

@vogdb
Copy link

@vogdb vogdb commented Jan 12, 2022

The return of ipfs.block.get has been fixed in #3990. @lidel I can help to fix the rest, if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment