This commit is contained in:
Matthias Kretschmann 2020-12-10 16:37:49 +01:00
parent 4ed9f5558f
commit 371eae73ed
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 7 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import { BigInt, BigDecimal, log } from '@graphprotocol/graph-ts'
import { BigInt, BigDecimal } from '@graphprotocol/graph-ts'
import { OrderStarted, Transfer } from '../types/templates/DataToken/DataToken'
import { Datatoken, TokenBalance, TokenOrder } from '../types/schema'

View File

@ -7,7 +7,7 @@ import { ZERO_BD } from './helpers'
export function handleNewPool(event: BPoolRegistered): void {
let factory = PoolFactory.load('1')
if (factory == null) {
if (factory === null) {
factory = new PoolFactory('1')
factory.totalLiquidity = ZERO_BD
factory.totalSwapVolume = ZERO_BD

View File

@ -152,7 +152,7 @@ export function _handleRebind(
const pool = Pool.load(poolId)
const decimals = BigInt.fromI32(18).toI32()
if (tokenAddress != OCEAN) {
if (tokenAddress !== OCEAN) {
pool.datatokenAddress = tokenAddress
}
pool.tokenCount += BigInt.fromI32(1)
@ -233,8 +233,7 @@ export function handleJoinPool(event: LOG_JOIN): void {
return
}
let datatoken: Datatoken | null
datatoken =
const datatoken: Datatoken =
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
const decimals =
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
@ -279,8 +278,7 @@ export function handleExitPool(event: LOG_EXIT): void {
return
}
let datatoken: Datatoken | null
datatoken =
const datatoken: Datatoken =
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
const decimals =
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
@ -408,8 +406,8 @@ export function handleTransfer(event: Transfer): void {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const isMint = event.params.from.toHex() == ZERO_ADDRESS
const isBurn = event.params.to.toHex() == ZERO_ADDRESS
const isMint = event.params.from.toHex() === ZERO_ADDRESS
const isBurn = event.params.to.toHex() === ZERO_ADDRESS
const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex())
let poolShareFrom = PoolShare.load(poolShareFromId)