From a1d116c7a2a41bb8faa5be0a453997547959fb07 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 30 Nov 2018 11:52:08 -0500 Subject: [PATCH] convert hoursToSeconds cleanup AddFunder --- app/components/AddFunder.jsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/components/AddFunder.jsx b/app/components/AddFunder.jsx index 06faf06..c0597d6 100644 --- a/app/components/AddFunder.jsx +++ b/app/components/AddFunder.jsx @@ -1,7 +1,5 @@ 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 Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; @@ -9,20 +7,20 @@ import Snackbar from '@material-ui/core/Snackbar'; import web3 from "Embark/web3"; import { MySnackbarContentWrapper } from './base/SnackBars'; -const { addGiver, numberOfPledgeAdmins, getPledgeAdmin } = LiquidPledgingMock.methods; -const hoursToSeconds = hours => hours * 60 * 60; +const { addGiver } = LiquidPledgingMock.methods +const hoursToSeconds = hours => hours * 60 * 60 const addFunderSucessMsg = response => { - const { events: { GiverAdded: { returnValues: { idGiver } } } } = response; - return `Funder created with ID of ${idGiver}`; + const { events: { GiverAdded: { returnValues: { idGiver } } } } = response + return `Funder created with ID of ${idGiver}` } const AddFunder = () => ( { - const { funderName, funderDescription, commitTime } = values; - const account = await web3.eth.getCoinbase(); - const args = [funderName, funderDescription, commitTime, 0]; + const { funderName, funderDescription, commitTime } = values + const account = await web3.eth.getCoinbase() + const args = [funderName, funderDescription, hoursToSeconds(commitTime), 0] addGiver(...args) .estimateGas({ from: account }) .then(async gas => { @@ -112,4 +110,4 @@ const AddFunder = () => ( ) -export default AddFunder; +export default AddFunder