diff --git a/app/components/AddFunder.jsx b/app/components/AddFunder.jsx index 685dab3..87d3fc5 100644 --- a/app/components/AddFunder.jsx +++ b/app/components/AddFunder.jsx @@ -43,7 +43,7 @@ const addDelegateSucessMsg = response => { return `Delegate created with ID of ${idDelegate}` } const addProjectSucessMsg = response => { - const { events: { DelegateAdded: { returnValues: { idProject } } } } = response + const { events: { ProjectAdded: { returnValues: { idProject } } } } = response return `Project created with ID of ${idProject}` } const successMsg = { diff --git a/app/components/FunderProfilesTable.jsx b/app/components/FunderProfilesTable.jsx index a46dc52..55b1c15 100644 --- a/app/components/FunderProfilesTable.jsx +++ b/app/components/FunderProfilesTable.jsx @@ -15,6 +15,7 @@ const FunderProfilesTable = ({ data }) => ( { title: 'Profile Id', field: 'idProfile', type: 'numeric' }, { title: 'Name', field: 'name' }, { title: 'Url', field: 'url' }, + { title: 'Admin Address', field: 'addr'}, { title: 'Commit Time', field: 'commitTime', type: 'numeric' }, { title: 'Type', field: 'type' }, { title: 'Canceled', field: 'canceled' } diff --git a/app/utils/events.js b/app/utils/events.js index b4303bb..6ddc47a 100644 --- a/app/utils/events.js +++ b/app/utils/events.js @@ -3,6 +3,7 @@ import web3 from 'Embark/web3' const GIVER_ADDED = 'GiverAdded' const DELEGATE_ADDED = 'DelegateAdded' +const PROJECT_ADDED = 'ProjectAdded' const lookups = { [GIVER_ADDED]: { id: 'idGiver', @@ -11,6 +12,10 @@ const lookups = { [DELEGATE_ADDED]: { id: 'idDelegate', type: 'Delegate' + }, + [PROJECT_ADDED]: { + id: 'idProject', + type: 'Project' } } @@ -19,12 +24,13 @@ export const formatFundProfileEvent = async event => { const lookup = lookups[event.event] const { returnValues: { url } } = event const idProfile = event.returnValues[lookup.id] - const { commitTime, name, canceled } = await getPledgeAdmin(idProfile).call() + const { addr, commitTime, name, canceled } = await getPledgeAdmin(idProfile).call() return { idProfile, url, commitTime, name, + addr, canceled, type: lookups[event.event].type } @@ -41,10 +47,11 @@ const getPastEvents = async event => { ) return formattedEvents } -export const getFunderProfiles = async () => await getPastEvents('GiverAdded') -export const getDelegateProfiles = async () => await getPastEvents('DelegateAdded') +export const getFunderProfiles = async () => await getPastEvents(GIVER_ADDED) +export const getDelegateProfiles = async () => await getPastEvents(DELEGATE_ADDED) +export const getProjectProfiles = async () => await getPastEvents(PROJECT_ADDED) export const getProfileEvents = async () => { - const funderProfiles = await getFunderProfiles() - const delegateProfiles = await getDelegateProfiles() - return [ ...funderProfiles, ...delegateProfiles] + const [ funderProfiles, delegateProfiles, projectProfiles] + = await Promise.all([getFunderProfiles(), getDelegateProfiles(), getProjectProfiles()]) + return [ ...funderProfiles, ...delegateProfiles, ...projectProfiles] }