update pledges commitTime on sync
This commit is contained in:
parent
31b2dd0697
commit
1362da59d3
|
@ -56,11 +56,12 @@ export const updateStalePledges = async () => {
|
||||||
const batch = stalePledges.map(p => {
|
const batch = stalePledges.map(p => {
|
||||||
const updated = updatedPledges[p.idPledge - 1]
|
const updated = updatedPledges[p.idPledge - 1]
|
||||||
return p.prepareUpdate(p => {
|
return p.prepareUpdate(p => {
|
||||||
const { amount, nDelegates, pledgeState, blockNumber } = updated
|
const { amount, nDelegates, pledgeState, blockNumber, commitTime } = updated
|
||||||
p.amount = amount
|
p.amount = amount
|
||||||
p.nDelegates = Number(nDelegates)
|
p.nDelegates = Number(nDelegates)
|
||||||
p.pledgeState = Number(pledgeState)
|
p.pledgeState = Number(pledgeState)
|
||||||
p.blockNumber = blockNumber
|
p.blockNumber = blockNumber
|
||||||
|
p.commitTime = Number(commitTime)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
database.action(() => database.batch(...batch))
|
database.action(() => database.batch(...batch))
|
||||||
|
|
Loading…
Reference in New Issue