Closed thirtyaughtsix closed 5 years ago
We need to come up with a way to configure this vuex module at "boot," like storing the contract addresses in a yaml or something. Someone needs to do a quick couple hour spike on figuring that out.
I mean we could hardcode that stuff but that's awfully ghetto.
I'll just leave this here: https://yarnpkg.com/lang/en/docs/cli/add/
Gonna piggyback getter testing and preliminary metamask integration stuff in this same PR
Create a new
Web3Module
vuex module. We'll quarantine Web3 here and also encapsulate the protocol stuff here as well.First things first, we need to include a Web3 into the project. It needs to be exactly version
beta-37
.One thing to keep in mind (and it has relevance to the class/no-class discussion - and no I ain't talking about the Kardashians): something weird happens in certain contexts whereby the type of the
VuexModule
isn't what you expect it to be. Rather than being an instance of your fancy custom subclass ofVuexModule
it appeaers to be a decorated version ofstate
. That means that most of your expectations aboutthis.whatever
are wrong.The tl;dr is that we need to use external classes to encapsulate logic we want to externalize from methods in any
VuexModule
. This probably drives OO purists nuts. Good.