ensure holderCount is always not null
This commit is contained in:
parent
cc7d6ef42a
commit
71849f783f
|
@ -248,3 +248,5 @@ type PauseEvent implements TokenEvent @entity {
|
|||
" Transaction hash "
|
||||
transaction: Bytes!
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ function getOrCreateAccountBalance(account: Account, token: Token): AccountBalan
|
|||
newBalance.account = account.id
|
||||
newBalance.token = token.id
|
||||
newBalance.amount = ZERO.toBigDecimal()
|
||||
// increment token count
|
||||
token.holderCount = token.holderCount.plus(ONE)
|
||||
token.save()
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ export function handleTransfer(event: Transfer): void {
|
|||
token.flags = decodeFlags(0)
|
||||
|
||||
token.eventCount = ZERO
|
||||
token.holderCount = ZERO
|
||||
token.burnEventCount = ZERO
|
||||
token.mintEventCount = ZERO
|
||||
token.transferEventCount = ZERO
|
||||
|
|
Loading…
Reference in New Issue