ethereumjs / merkle-patricia-tree

Project is in active development and has been moved to the EthereumJS VM monorepo.

Home Page:https://github.com/ethereumjs/ethereumjs-monorepo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor: Use ES6 classes and extends keyword instead of util.inherits

holgerd77 opened this issue · comments

The current way the different Trie class objects are constructed is not very readable, furthermore the use of util.inherits in Node is discouraged.

This should be reworked to use ES6 classes, constructors together with the extends keyword to inherit properties and methods.

I can take a look at this

Hi Alex, just discovered that people are working on a pretty interesting and advanced fork of this library. Have started a discussion on that here: #54.

Maybe wait with this, would like to see where we are going there. If you want, you can also have a look at the fork from RainBlock, I think it should be possible to take many of the changes done there back into the library here.

Ah ok. Thanks for the heads up @holgerd77

Thanks to @alextsg, most of the library has been ported to ES6 classes in #57 and #61. What remains now is trieNode. I was also wondering as to the purpose of secureInterface and checkpointInterface, why are they not implemented in SecureTrie and CheckpointTrie respectively?

The whole code base has been now ported to ES6 classes, see #57, #61, #71 and #73.