remove dapp refernces to LiquidPledgingMock

This commit is contained in:
Barry Gitarts 2018-12-21 14:31:46 -05:00 committed by Barry G
parent e33f8ea637
commit 81c001a78f
11 changed files with 34 additions and 34 deletions

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { Formik } from 'formik' import { Formik } from 'formik'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import Button from '@material-ui/core/Button' import Button from '@material-ui/core/Button'
import MenuItem from '@material-ui/core/MenuItem' import MenuItem from '@material-ui/core/MenuItem'
import TextField from '@material-ui/core/TextField' import TextField from '@material-ui/core/TextField'
@ -8,7 +8,7 @@ import Snackbar from '@material-ui/core/Snackbar'
import web3 from 'Embark/web3' import web3 from 'Embark/web3'
import { MySnackbarContentWrapper } from './base/SnackBars' import { MySnackbarContentWrapper } from './base/SnackBars'
const { addGiver, addDelegate, addProject } = LiquidPledgingMock.methods const { addGiver, addDelegate, addProject } = LiquidPledging.methods
const FUNDER = 'FUNDER' const FUNDER = 'FUNDER'
const DELEGATE = 'DELEGATE' const DELEGATE = 'DELEGATE'
const PROJECT = 'PROJECT' const PROJECT = 'PROJECT'

View File

@ -2,7 +2,7 @@ import React from 'react';
import { Formik } from 'formik'; import { Formik } from 'formik';
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 LiquidPledging from 'Embark/contracts/LiquidPledging';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
import Snackbar from '@material-ui/core/Snackbar'; import Snackbar from '@material-ui/core/Snackbar';
@ -11,7 +11,7 @@ import web3 from 'Embark/web3';
import { MySnackbarContentWrapper } from './base/SnackBars'; import { MySnackbarContentWrapper } from './base/SnackBars';
import { currencies, TOKEN_ICON_API, getTokenLabel } from '../utils/currencies' import { currencies, TOKEN_ICON_API, getTokenLabel } from '../utils/currencies'
const { donate } = LiquidPledgingMock.methods const { donate } = LiquidPledging.methods
const hoursToSeconds = hours => hours * 60 * 60 const hoursToSeconds = hours => hours * 60 * 60
const addFunderSucessMsg = response => { const addFunderSucessMsg = response => {
const { events: { GiverAdded: { returnValues: { idGiver } } } } = response const { events: { GiverAdded: { returnValues: { idGiver } } } } = response

View File

@ -1,9 +1,9 @@
import React, { Fragment, memo } from 'react' import React, { Fragment, memo } from 'react'
import MaterialTable from 'material-table' import MaterialTable from 'material-table'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import { FundingContext } from '../context' import { FundingContext } from '../context'
const { cancelProject } = LiquidPledgingMock.methods const { cancelProject } = LiquidPledging.methods
const convertToHours = seconds => seconds / 60 / 60 const convertToHours = seconds => seconds / 60 / 60
const cancelText = canceled => canceled ? 'Yes' : 'No' const cancelText = canceled => canceled ? 'Yes' : 'No'

View File

@ -1,9 +1,9 @@
import React from 'react' import React from 'react'
import { Formik } from 'formik' import { Formik } from 'formik'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import TextField from '@material-ui/core/TextField' import TextField from '@material-ui/core/TextField'
const { setMockedTime } = LiquidPledgingMock.methods const { setMockedTime } = LiquidPledging.methods
const SetMockedTime = () => ( const SetMockedTime = () => (
<Formik <Formik

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { Formik } from 'formik' import { Formik } from 'formik'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import Button from '@material-ui/core/Button' import Button from '@material-ui/core/Button'
import TextField from '@material-ui/core/TextField' import TextField from '@material-ui/core/TextField'
import Dialog from '@material-ui/core/Dialog' import Dialog from '@material-ui/core/Dialog'
@ -12,7 +12,7 @@ import { getTokenLabel } from '../utils/currencies'
import { toWei } from '../utils/conversions' import { toWei } from '../utils/conversions'
import { FundingContext } from '../context' import { FundingContext } from '../context'
const { transfer } = LiquidPledgingMock.methods const { transfer } = LiquidPledging.methods
const TransferDialog = ({ row, handleClose, transferPledgeAmounts }) => ( const TransferDialog = ({ row, handleClose, transferPledgeAmounts }) => (
<Formik <Formik

View File

@ -11,13 +11,13 @@ import TextField from '@material-ui/core/TextField'
import indigo from '@material-ui/core/colors/indigo' import indigo from '@material-ui/core/colors/indigo'
import blueGrey from '@material-ui/core/colors/blueGrey' import blueGrey from '@material-ui/core/colors/blueGrey'
import Collapse from '@material-ui/core/Collapse' import Collapse from '@material-ui/core/Collapse'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import LPVault from 'Embark/contracts/LPVault' import LPVault from 'Embark/contracts/LPVault'
import { getTokenLabel } from '../../utils/currencies' import { getTokenLabel } from '../../utils/currencies'
import { toWei } from '../../utils/conversions' import { toWei } from '../../utils/conversions'
import { FundingContext } from '../../context' import { FundingContext } from '../../context'
const { withdraw } = LiquidPledgingMock.methods const { withdraw } = LiquidPledging.methods
const { confirmPayment } = LPVault.methods const { confirmPayment } = LPVault.methods
const styles = { const styles = {

View File

@ -2,7 +2,7 @@ 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 LiquidPledging from 'Embark/contracts/LiquidPledging'
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'
@ -31,7 +31,7 @@ class App extends React.Component {
const { environment } = EmbarkJS const { environment } = EmbarkJS
const isInitialized = await vaultPledgingNeedsInit() const isInitialized = await vaultPledgingNeedsInit()
if (!!isInitialized) { if (!!isInitialized) {
console.log('mock_time:', await LiquidPledgingMock.mock_time.call()) console.log('mock_time:', await LiquidPledging.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,4 +1,4 @@
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import LPVault from 'Embark/contracts/LPVault' import LPVault from 'Embark/contracts/LPVault'
import web3 from 'Embark/web3' import web3 from 'Embark/web3'
@ -43,7 +43,7 @@ const getPastVaultEvents = async (event, raw = false) => {
return formattedEvents return formattedEvents
} }
const { getPledgeAdmin } = LiquidPledgingMock.methods const { getPledgeAdmin } = LiquidPledging.methods
export const formatFundProfileEvent = async event => { export const formatFundProfileEvent = async event => {
const lookup = lookups[event.event] const lookup = lookups[event.event]
const { returnValues: { url, idProject } } = event const { returnValues: { url, idProject } } = event
@ -62,7 +62,7 @@ export const formatFundProfileEvent = async event => {
} }
const getPastEvents = async (event, raw = false) => { const getPastEvents = async (event, raw = false) => {
const events = await LiquidPledgingMock.getPastEvents(event, { const events = await LiquidPledging.getPastEvents(event, {
addr: await web3.eth.getCoinbase(), addr: await web3.eth.getCoinbase(),
fromBlock: 0, fromBlock: 0,
toBlock: 'latest' toBlock: 'latest'
@ -76,7 +76,7 @@ const getPastEvents = async (event, raw = false) => {
export const lpEventsSubscription = async () => { export const lpEventsSubscription = async () => {
//todo add on event handlers //todo add on event handlers
const events = await LiquidPledgingMock.events.allEvents({ const events = await LiquidPledging.events.allEvents({
fromBlock: 0, fromBlock: 0,
toBlock: 'latest' toBlock: 'latest'
}) })

View File

@ -1,5 +1,5 @@
import LPVault from 'Embark/contracts/LPVault' import LPVault from 'Embark/contracts/LPVault'
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
import StandardToken from 'Embark/contracts/StandardToken' import StandardToken from 'Embark/contracts/StandardToken'
import web3 from 'Embark/web3' import web3 from 'Embark/web3'
@ -8,26 +8,26 @@ export const initVaultAndLP = async () => {
let toSend; let toSend;
toSend = LiquidPledgingMock.methods.initialize(LPVault._address); toSend = LiquidPledging.methods.initialize(LPVault._address);
estimateGas = await toSend.estimateGas(); estimateGas = await toSend.estimateGas();
const lpInit = await toSend.send({gas: estimateGas + 1000}) const lpInit = await toSend.send({gas: estimateGas + 1000})
console.log(lpInit) console.log(lpInit)
toSend = LPVault.methods.initialize(LiquidPledgingMock._address); toSend = LPVault.methods.initialize(LiquidPledging._address);
estimateGas = await toSend.estimateGas(); estimateGas = await toSend.estimateGas();
const vaultInit = await toSend.send({gas: estimateGas + 1000}) const vaultInit = await toSend.send({gas: estimateGas + 1000})
console.log(vaultInit) console.log(vaultInit)
} }
export const vaultPledgingNeedsInit = async () => { export const vaultPledgingNeedsInit = async () => {
const needsInit = !!Number(await LiquidPledgingMock.methods.getInitializationBlock().call()) const needsInit = !!Number(await LiquidPledging.methods.getInitializationBlock().call())
&& !!Number(await LPVault.methods.getInitializationBlock().call()) && !!Number(await LPVault.methods.getInitializationBlock().call())
return needsInit return needsInit
} }
export const standardTokenApproval = async () => { export const standardTokenApproval = async () => {
const { approve } = StandardToken.methods const { approve } = StandardToken.methods
const spender = LiquidPledgingMock._address const spender = LiquidPledging._address
return await approve( return await approve(
spender, spender,
web3.utils.toWei('10000000', 'tether') web3.utils.toWei('10000000', 'tether')
@ -37,7 +37,7 @@ export const standardTokenApproval = async () => {
export const getLpAllowance = async () => { export const getLpAllowance = async () => {
const { allowance } = StandardToken.methods const { allowance } = StandardToken.methods
const account = await web3.eth.getCoinbase() const account = await web3.eth.getCoinbase()
const spender = LiquidPledgingMock._address const spender = LiquidPledging._address
const allowanceAmt = Number(await allowance(account, spender).call()) const allowanceAmt = Number(await allowance(account, spender).call())
return allowanceAmt return allowanceAmt
} }

View File

@ -1,6 +1,6 @@
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' import LiquidPledging from 'Embark/contracts/LiquidPledging'
const { getPledgeAdmin, numberOfPledges, getPledge } = LiquidPledgingMock.methods const { getPledgeAdmin, numberOfPledges, getPledge } = LiquidPledging.methods
export const formatPledge = async (pledgePromise, idx) => { export const formatPledge = async (pledgePromise, idx) => {
const pledge = await pledgePromise const pledge = await pledgePromise
return { return {
@ -10,7 +10,7 @@ export const formatPledge = async (pledgePromise, idx) => {
} }
export const getAllPledges = async (start = 1) => { export const getAllPledges = async (start = 1) => {
const numPledges = await LiquidPledgingMock.methods.numberOfPledges().call() const numPledges = await LiquidPledging.methods.numberOfPledges().call()
const pledges = [] const pledges = []
for (let i = start; i <= numPledges; i++) { for (let i = start; i <= numPledges; i++) {
pledges.push(getPledge(i).call()) pledges.push(getPledge(i).call())

View File

@ -56,16 +56,16 @@ module.exports = {
strategy: 'explicit', strategy: 'explicit',
contracts: { contracts: {
LPVault: {}, LPVault: {},
LiquidPledgingMock: {}, LiquidPledging: {
instanceOf: 'LiquidPledgingMock'
},
RecoveryVault: {}, RecoveryVault: {},
LPFactory: { LPFactory: {
args: ['$LPVault', '$LiquidPledgingMock'] args: {
// args: { _vaultBase: '$LPVault',
// _vaultBase: '$LPVault', _lpBase: '$LiquidPledging',
// _lpBase: '$LiquidPledgingMock', },
// },
}, },
// contracts for testing // contracts for testing
StandardToken: {}, StandardToken: {},
Kernel: { Kernel: {