mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-01-28 20:25:19 +00:00
fix pledges profile relationship import
fix pledgeState type error
This commit is contained in:
parent
8ae34629cc
commit
c5b734b175
@ -6,6 +6,7 @@ import { getProfilesById } from './profiles'
|
|||||||
|
|
||||||
const createPledge = (pledge, data, profiles) => {
|
const createPledge = (pledge, data, profiles) => {
|
||||||
const { id, owner, amount, blockNumber, token, commitTime, nDelegates, pledgeState, intendedProject } = data
|
const { id, owner, amount, blockNumber, token, commitTime, nDelegates, pledgeState, intendedProject } = data
|
||||||
|
console.log({data})
|
||||||
const profile = profiles.find(p => p.idProfile == owner)
|
const profile = profiles.find(p => p.idProfile == owner)
|
||||||
pledge.pledgeId = Number(id)
|
pledge.pledgeId = Number(id)
|
||||||
pledge.owner = Number(owner)
|
pledge.owner = Number(owner)
|
||||||
@ -13,7 +14,7 @@ const createPledge = (pledge, data, profiles) => {
|
|||||||
pledge.token = token
|
pledge.token = token
|
||||||
pledge.commitTime = Number(commitTime)
|
pledge.commitTime = Number(commitTime)
|
||||||
pledge.nDelegates = Number(nDelegates)
|
pledge.nDelegates = Number(nDelegates)
|
||||||
pledge.pledgeState = pledgeState
|
pledge.pledgeState = Number(pledgeState)
|
||||||
pledge.intendedProject = Number(intendedProject)
|
pledge.intendedProject = Number(intendedProject)
|
||||||
pledge.blockNumber = Number(blockNumber)
|
pledge.blockNumber = Number(blockNumber)
|
||||||
pledge.profile.set(profile)
|
pledge.profile.set(profile)
|
||||||
|
@ -51,8 +51,10 @@ class App extends React.Component {
|
|||||||
// not running in parallel due to possible metamask / infura limitation
|
// not running in parallel due to possible metamask / infura limitation
|
||||||
await getAndAddLpEvents()
|
await getAndAddLpEvents()
|
||||||
await getAndAddVaultEvents()
|
await getAndAddVaultEvents()
|
||||||
await getAndAddPledges()
|
|
||||||
|
// Profiles must be loaded before pledges to set profile on pledge model
|
||||||
await addFormattedProfiles()
|
await addFormattedProfiles()
|
||||||
|
await getAndAddPledges()
|
||||||
await updateStalePledges()
|
await updateStalePledges()
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user