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

Proposal: export proofLeafNode #73

Closed
liamsi opened this issue Jun 29, 2018 · 3 comments · Fixed by #205
Closed

Proposal: export proofLeafNode #73

liamsi opened this issue Jun 29, 2018 · 3 comments · Fixed by #205

Comments

@liamsi
Copy link
Contributor

liamsi commented Jun 29, 2018

Currently, proofLeafNode is not exported. While it is good practice to export only what is really neccessary (and hide fields and functionality that are not essential for the API), I think this type should be public/exported: If someone is about to write a verifier in another language, he needs to know enough details what a RangeProof consists of (and proofLeafNode is part of that):
https://github.com/tendermint/iavl/blob/f2c70966873724a199ea37d0cbfc8b50baa0f7bf/proof_range.go#L12-L21

Exporting the type would also create a proper godoc item. Similarly, proofInnerNode (as PathToLeaf is just a type alias to []proofInnerNode).

cc @jlandrews @jaekwon

@tessr
Copy link
Contributor

tessr commented Jan 27, 2020

I am in favor of this, I think. I just found myself wishing these fields were exported while trying to write a toy program--not sure if that's actually representative of what people want to do with this package, though.

@erikgrinaker
Copy link
Contributor

Yeah, I’d say it’s generally bad form to expose private types as publicly accessible values - i.e. Leaves []proofLeafNode elements are publicly accessible, but of a private type.

@tessr
Copy link
Contributor

tessr commented Jan 31, 2020

Another great point.

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

Successfully merging a pull request may close this issue.

3 participants