ethjs / ethjs-contract

A simple contract object for the Ethereum RPC layer.
MIT License
20 stars 28 forks source link

Break codebase into separate pieces #4

Closed danfinlay closed 6 years ago

danfinlay commented 7 years ago

In particular, breaks the Contract class into its own file.

This has the benefit of being more modular, allowing subclassing for external modules, as well as saving memory that was previously wasted re-initializing the class on each instance creation.

Fixes #3.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 7a5973fb49035422fc5e46bdd4d24defaee2fcfc on flyswatter:i3-BreakOutContractClass into afa016904cf2ab1f79b831494b80faea8d7b74a0 on ethjs:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 7a5973fb49035422fc5e46bdd4d24defaee2fcfc on flyswatter:i3-BreakOutContractClass into afa016904cf2ab1f79b831494b80faea8d7b74a0 on ethjs:master.

SilentCicero commented 7 years ago

Will review, I like this a lot. Does it change the main method signatures in anyway?

danfinlay commented 7 years ago

Nope, all external API is identical, no tests changed, all tests passing.

I want this entirely so I can inherit from this to make an event-emitting subclass of your contract abstraction.

SilentCicero commented 7 years ago

Keep going on the event subclasses, that sounds great. I want to see a PR for that soon =D

danfinlay commented 7 years ago

Oh, do you think it should just be a different export on this repo? I was making it its own repo that imports the contract file from this one.

SilentCicero commented 7 years ago

@flyswatter oh yeah, it's own is fine