store eventId on profile

This commit is contained in:
Barry Gitarts 2019-01-18 20:51:48 -05:00
parent 4ec9180006
commit ade8b1bdfc
3 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@ export default class Profile extends LiquidModel {
static table = 'profiles'
@field('addr') addr
@field('event_id') eventId
@field('canceled') canceled
@field('commit_time') commitTime
@field('type') type

View File

@ -6,15 +6,16 @@ export default appSchema({
tableSchema({
name: 'lp_events',
columns: [
{ name: 'event_id', type: 'string' },
{ name: 'address', type: 'string' },
{ name: 'event', type: 'string' },
{ name: 'event_id', type: 'string' },
{ name: 'block_number', type: 'number', isIndexed: true },
]
}),
tableSchema({
name: 'profiles',
columns: [
{ name: 'event_id', type: 'string' },
{ name: 'addr', type: 'string' },
{ name: 'canceled', type: 'boolean' },
{ name: 'commit_time', type: 'number' },

View File

@ -47,10 +47,11 @@ const getPastVaultEvents = async (event, raw = false) => {
const { getPledgeAdmin } = LiquidPledging.methods
export const formatFundProfileEvent = async event => {
const lookup = lookups[event.event]
const { returnValues: { url, idProject } } = event
const { id, returnValues: { url, idProject } } = event
const idProfile = event.returnValues[lookup.id]
const { addr, commitTime, name, canceled } = await getPledgeAdmin(idProfile).call()
return {
id,
idProfile,
idProject,
url,