Revert "set LiquidPledging based on environment"

This reverts commit f94b9c4245.
This commit is contained in:
Barry Gitarts 2018-12-21 13:32:12 -05:00
parent f94b9c4245
commit e33f8ea637
2 changed files with 4 additions and 16 deletions

View File

@ -1,7 +1,8 @@
import React from 'react' import React from 'react'
import { HashRouter as Router, Route, Link, Switch } from 'react-router-dom' import { HashRouter as Router, Route, Link, Switch } from 'react-router-dom'
import EmbarkJS from 'Embark/EmbarkJS' import EmbarkJS from 'Embark/EmbarkJS';
import LPVault from 'Embark/contracts/LPVault' import LPVault from 'Embark/contracts/LPVault';
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock';
import web3 from 'Embark/web3' import web3 from 'Embark/web3'
import { initVaultAndLP, vaultPledgingNeedsInit, standardTokenApproval, getLpAllowance } from './utils/initialize' import { initVaultAndLP, vaultPledgingNeedsInit, standardTokenApproval, getLpAllowance } from './utils/initialize'
import { getAllLPEvents, getAllVaultEvents, getProfileEvents, formatFundProfileEvent, getAuthorizedPayments } from './utils/events' import { getAllLPEvents, getAllVaultEvents, getProfileEvents, formatFundProfileEvent, getAuthorizedPayments } from './utils/events'
@ -10,10 +11,8 @@ import { FundingContext } from './context'
import { cancelProfile } from './utils/fundProfiles' import { cancelProfile } from './utils/fundProfiles'
import MainCointainer from './components/MainCointainer' import MainCointainer from './components/MainCointainer'
import { getTransfersMemo } from './selectors/pledging' import { getTransfersMemo } from './selectors/pledging'
import { getLiquidPledgingContract } from './utils/contracts'
const { getNetworkType } = web3.eth.net const { getNetworkType } = web3.eth.net
let LiquidPledging
class App extends React.Component { class App extends React.Component {
state = { state = {
@ -30,11 +29,9 @@ class App extends React.Component {
EmbarkJS.onReady(async (err) => { EmbarkJS.onReady(async (err) => {
getNetworkType().then(async network => { getNetworkType().then(async network => {
const { environment } = EmbarkJS const { environment } = EmbarkJS
LiquidPledging = getLiquidPledgingContract()
console.log({network, environment})
const isInitialized = await vaultPledgingNeedsInit() const isInitialized = await vaultPledgingNeedsInit()
if (!!isInitialized) { if (!!isInitialized) {
console.log('mock_time:', await LiquidPledging.mock_time.call()) console.log('mock_time:', await LiquidPledgingMock.mock_time.call())
const lpAllowance = await getLpAllowance() const lpAllowance = await getLpAllowance()
const fundProfiles = await getProfileEvents() const fundProfiles = await getProfileEvents()
const allPledges = await getAllPledges() const allPledges = await getAllPledges()

View File

@ -1,9 +0,0 @@
import EmbarkJS from 'Embark/EmbarkJS'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
export const getLiquidPledgingContract = () => {
const { environment } = EmbarkJS
if (environment === 'development') return LiquidPledgingMock
return LiquidPledging
}