computablelabs / ffa-frontend

Client for the Computable FFA Market
1 stars 1 forks source link

Create a `Web3Module` vuex module. #48

Closed thirtyaughtsix closed 5 years ago

thirtyaughtsix commented 5 years ago

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 of VuexModule it appeaers to be a decorated version of state. That means that most of your expectations about this.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.

thirtyaughtsix commented 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.

thirtyaughtsix commented 5 years ago

I'll just leave this here: https://yarnpkg.com/lang/en/docs/cli/add/

thirtyaughtsix commented 5 years ago

Gonna piggyback getter testing and preliminary metamask integration stuff in this same PR