gballet / multiproof-rs

A rust implementation of Alexey Akhunov's multiproof algorithm
Apache License 2.0
33 stars 8 forks source link

Tree's new_* methods are MPT-specific #47

Open gballet opened 4 years ago

gballet commented 4 years ago

This is a tracker for @s1na's question on #44

These new_* methods seem to be specific to the MPT tree. Is there maybe a way in Rust to only define them on Node and then cast a Tree to a Node when these methods are needed?

AFAIK, there isn't. This being said, indeed a difference should be made, e.g. by introducing an inherited TreeWithExtension : Tree trait.