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

Move Size() elsewhere #12

Open
Stebalien opened this issue Jun 23, 2017 · 0 comments
Open

Move Size() elsewhere #12

Stebalien opened this issue Jun 23, 2017 · 0 comments

Comments

@Stebalien
Copy link
Member

Stebalien commented Jun 23, 2017

By case:

  1. In CBOR encoded IPLD nodes, it means "size of this encoded node" (property of Block).
  2. In protobuf IPFS nodes, it means "size of this encoded node + size of all encoded children" (property of IPFSNode because only IPFSNode links store enough metadata to efficiently compute this).

Therefore, it doesn't belong on Node.

  1. Define Size on Block that returns the size of the encoded block case 1. Note: This size method should not be able to return an error.
  2. Define some form of FileSize/IPFSDagSize on an IPFSNode type (elsewhere) for case 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant