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

Consider Generics for Tree #138

Closed
liamsi opened this issue Dec 16, 2022 · 1 comment
Closed

Consider Generics for Tree #138

liamsi opened this issue Dec 16, 2022 · 1 comment
Labels
enhancement New feature or request T:proposal

Comments

@liamsi
Copy link
Member

liamsi commented Dec 16, 2022

The tree interface here expects bytes on Push:

rsmt2d/tree.go

Lines 18 to 22 in 80d231f

// Tree wraps Merkle tree implementations to work with rsmt2d
type Tree interface {
Push(data []byte)
Root() []byte
}

This makes sense but at the same time we'd rather want to use some explicit type in NMT instead of just aliasing byte slices (see: celestiaorg/nmt#71).

Push could leverage generics potentially instead.

This is a low-priority consideration.

@liamsi liamsi added enhancement New feature or request T:proposal labels Dec 16, 2022
@liamsi
Copy link
Member Author

liamsi commented Feb 6, 2023

Looking back at this issue there is no clear benefit over simply using an interface for data instead (just needs a way to serialize from whatever is pushed to the tree).
Closing this issue for now. It is too focused around a specific implementation detail (generics).

@liamsi liamsi closed this as completed Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request T:proposal
Projects
None yet
Development

No branches or pull requests

1 participant