remove dapp refernces to LiquidPledgingMock
This commit is contained in:
parent
e33f8ea637
commit
81c001a78f
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import { Formik } from 'formik'
|
||||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import Button from '@material-ui/core/Button'
|
||||
import MenuItem from '@material-ui/core/MenuItem'
|
||||
import TextField from '@material-ui/core/TextField'
|
||||
|
@ -8,7 +8,7 @@ import Snackbar from '@material-ui/core/Snackbar'
|
|||
import web3 from 'Embark/web3'
|
||||
import { MySnackbarContentWrapper } from './base/SnackBars'
|
||||
|
||||
const { addGiver, addDelegate, addProject } = LiquidPledgingMock.methods
|
||||
const { addGiver, addDelegate, addProject } = LiquidPledging.methods
|
||||
const FUNDER = 'FUNDER'
|
||||
const DELEGATE = 'DELEGATE'
|
||||
const PROJECT = 'PROJECT'
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { Formik } from 'formik';
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
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 TextField from '@material-ui/core/TextField';
|
||||
import Snackbar from '@material-ui/core/Snackbar';
|
||||
|
@ -11,7 +11,7 @@ import web3 from 'Embark/web3';
|
|||
import { MySnackbarContentWrapper } from './base/SnackBars';
|
||||
import { currencies, TOKEN_ICON_API, getTokenLabel } from '../utils/currencies'
|
||||
|
||||
const { donate } = LiquidPledgingMock.methods
|
||||
const { donate } = LiquidPledging.methods
|
||||
const hoursToSeconds = hours => hours * 60 * 60
|
||||
const addFunderSucessMsg = response => {
|
||||
const { events: { GiverAdded: { returnValues: { idGiver } } } } = response
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { Fragment, memo } from 'react'
|
||||
import MaterialTable from 'material-table'
|
||||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import { FundingContext } from '../context'
|
||||
|
||||
const { cancelProject } = LiquidPledgingMock.methods
|
||||
const { cancelProject } = LiquidPledging.methods
|
||||
|
||||
const convertToHours = seconds => seconds / 60 / 60
|
||||
const cancelText = canceled => canceled ? 'Yes' : 'No'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React from 'react'
|
||||
import { Formik } from 'formik'
|
||||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import TextField from '@material-ui/core/TextField'
|
||||
|
||||
const { setMockedTime } = LiquidPledgingMock.methods
|
||||
const { setMockedTime } = LiquidPledging.methods
|
||||
|
||||
const SetMockedTime = () => (
|
||||
<Formik
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import { Formik } from 'formik'
|
||||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import Button from '@material-ui/core/Button'
|
||||
import TextField from '@material-ui/core/TextField'
|
||||
import Dialog from '@material-ui/core/Dialog'
|
||||
|
@ -12,7 +12,7 @@ import { getTokenLabel } from '../utils/currencies'
|
|||
import { toWei } from '../utils/conversions'
|
||||
import { FundingContext } from '../context'
|
||||
|
||||
const { transfer } = LiquidPledgingMock.methods
|
||||
const { transfer } = LiquidPledging.methods
|
||||
|
||||
const TransferDialog = ({ row, handleClose, transferPledgeAmounts }) => (
|
||||
<Formik
|
||||
|
|
|
@ -11,13 +11,13 @@ import TextField from '@material-ui/core/TextField'
|
|||
import indigo from '@material-ui/core/colors/indigo'
|
||||
import blueGrey from '@material-ui/core/colors/blueGrey'
|
||||
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 { getTokenLabel } from '../../utils/currencies'
|
||||
import { toWei } from '../../utils/conversions'
|
||||
import { FundingContext } from '../../context'
|
||||
|
||||
const { withdraw } = LiquidPledgingMock.methods
|
||||
const { withdraw } = LiquidPledging.methods
|
||||
const { confirmPayment } = LPVault.methods
|
||||
|
||||
const styles = {
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import { HashRouter as Router, Route, Link, Switch } from 'react-router-dom'
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import LPVault from 'Embark/contracts/LPVault';
|
||||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock';
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import web3 from 'Embark/web3'
|
||||
import { initVaultAndLP, vaultPledgingNeedsInit, standardTokenApproval, getLpAllowance } from './utils/initialize'
|
||||
import { getAllLPEvents, getAllVaultEvents, getProfileEvents, formatFundProfileEvent, getAuthorizedPayments } from './utils/events'
|
||||
|
@ -31,7 +31,7 @@ class App extends React.Component {
|
|||
const { environment } = EmbarkJS
|
||||
const isInitialized = await vaultPledgingNeedsInit()
|
||||
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 fundProfiles = await getProfileEvents()
|
||||
const allPledges = await getAllPledges()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||
import LiquidPledging from 'Embark/contracts/LiquidPledging'
|
||||
import LPVault from 'Embark/contracts/LPVault'
|
||||
import web3 from 'Embark/web3'
|
||||
|
||||
|
@ -43,7 +43,7 @@ const getPastVaultEvents = async (event, raw = false) => {
|
|||
return formattedEvents
|
||||
}
|
||||
|
||||
const { getPledgeAdmin } = LiquidPledgingMock.methods
|
||||
const { getPledgeAdmin } = LiquidPledging.methods
|
||||
export const formatFundProfileEvent = async event => {
|
||||
const lookup = lookups[event.event]
|
||||
const { returnValues: { url, idProject } } = event
|
||||
|
@ -62,7 +62,7 @@ export const formatFundProfileEvent = async event => {
|
|||
}
|
||||
|
||||
const getPastEvents = async (event, raw = false) => {
|
||||
const events = await LiquidPledgingMock.getPastEvents(event, {
|
||||
const events = await LiquidPledging.getPastEvents(event, {
|
||||
addr: await web3.eth.getCoinbase(),
|
||||
fromBlock: 0,
|
||||
toBlock: 'latest'
|
||||
|
@ -76,7 +76,7 @@ const getPastEvents = async (event, raw = false) => {
|
|||
|
||||
export const lpEventsSubscription = async () => {
|
||||
//todo add on event handlers
|
||||
const events = await LiquidPledgingMock.events.allEvents({
|
||||
const events = await LiquidPledging.events.allEvents({
|
||||
fromBlock: 0,
|
||||
toBlock: 'latest'
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 web3 from 'Embark/web3'
|
||||
|
||||
|
@ -8,26 +8,26 @@ export const initVaultAndLP = async () => {
|
|||
let toSend;
|
||||
|
||||
|
||||
toSend = LiquidPledgingMock.methods.initialize(LPVault._address);
|
||||
toSend = LiquidPledging.methods.initialize(LPVault._address);
|
||||
estimateGas = await toSend.estimateGas();
|
||||
const lpInit = await toSend.send({gas: estimateGas + 1000})
|
||||
console.log(lpInit)
|
||||
|
||||
toSend = LPVault.methods.initialize(LiquidPledgingMock._address);
|
||||
toSend = LPVault.methods.initialize(LiquidPledging._address);
|
||||
estimateGas = await toSend.estimateGas();
|
||||
const vaultInit = await toSend.send({gas: estimateGas + 1000})
|
||||
console.log(vaultInit)
|
||||
}
|
||||
|
||||
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())
|
||||
return needsInit
|
||||
}
|
||||
|
||||
export const standardTokenApproval = async () => {
|
||||
const { approve } = StandardToken.methods
|
||||
const spender = LiquidPledgingMock._address
|
||||
const spender = LiquidPledging._address
|
||||
return await approve(
|
||||
spender,
|
||||
web3.utils.toWei('10000000', 'tether')
|
||||
|
@ -37,7 +37,7 @@ export const standardTokenApproval = async () => {
|
|||
export const getLpAllowance = async () => {
|
||||
const { allowance } = StandardToken.methods
|
||||
const account = await web3.eth.getCoinbase()
|
||||
const spender = LiquidPledgingMock._address
|
||||
const spender = LiquidPledging._address
|
||||
const allowanceAmt = Number(await allowance(account, spender).call())
|
||||
return allowanceAmt
|
||||
}
|
||||
|
|
|
@ -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) => {
|
||||
const pledge = await pledgePromise
|
||||
return {
|
||||
|
@ -10,7 +10,7 @@ export const formatPledge = async (pledgePromise, idx) => {
|
|||
}
|
||||
|
||||
export const getAllPledges = async (start = 1) => {
|
||||
const numPledges = await LiquidPledgingMock.methods.numberOfPledges().call()
|
||||
const numPledges = await LiquidPledging.methods.numberOfPledges().call()
|
||||
const pledges = []
|
||||
for (let i = start; i <= numPledges; i++) {
|
||||
pledges.push(getPledge(i).call())
|
||||
|
|
|
@ -56,16 +56,16 @@ module.exports = {
|
|||
strategy: 'explicit',
|
||||
contracts: {
|
||||
LPVault: {},
|
||||
LiquidPledgingMock: {},
|
||||
LiquidPledging: {
|
||||
instanceOf: 'LiquidPledgingMock'
|
||||
},
|
||||
RecoveryVault: {},
|
||||
LPFactory: {
|
||||
args: ['$LPVault', '$LiquidPledgingMock']
|
||||
// args: {
|
||||
// _vaultBase: '$LPVault',
|
||||
// _lpBase: '$LiquidPledgingMock',
|
||||
// },
|
||||
args: {
|
||||
_vaultBase: '$LPVault',
|
||||
_lpBase: '$LiquidPledging',
|
||||
},
|
||||
},
|
||||
|
||||
// contracts for testing
|
||||
StandardToken: {},
|
||||
Kernel: {
|
||||
|
|
Loading…
Reference in New Issue