revert debug changes.

This commit is contained in:
ssallam 2021-01-18 16:24:36 +01:00
parent 50c5ac247c
commit 7a0f2b6113
2 changed files with 5 additions and 20 deletions

View File

@ -151,9 +151,6 @@ export function updatePoolTransactionToken(
feeValue: BigDecimal
): void {
const ptx = PoolTransaction.load(poolTx)
if (ptx == null) {
log.error('?????????????????????????? PoolTransaction not found for {}, pooltokenid {} ????????????????', [poolTx, poolTokenId])
}
const poolToken = PoolToken.load(poolTokenId)
const pool = PoolEntity.load(poolToken.poolId)
const ptxTokenValuesId = poolTx.concat('-').concat(poolToken.tokenAddress)
@ -238,9 +235,6 @@ export function createPoolTransaction(
event_type: string,
userAddress: string
): void {
debuglog('createPoolTransaction', event, [])
const poolId = event.address.toHex()
const pool = PoolEntity.load(poolId)
const ptx = event.transaction.hash.toHexString()
@ -251,7 +245,6 @@ export function createPoolTransaction(
)
if (ocnToken == null || dtToken == null) {
debuglog('?????????????? no oceanToken or no dtToken: ', event, [poolId, ocnToken.id, poolId.concat('-').concat(pool.datatokenAddress)])
return
}
@ -310,17 +303,15 @@ export function createPoolTransaction(
pool.consumePrice = poolTx.consumePrice
pool.spotPrice = poolTx.spotPrice
const lockedValue = pool.lockedValue
pool.lockedValue = pool.oceanReserve + (pool.datatokenReserve * pool.spotPrice)
let factory = PoolFactory.load('1')
factory.totalLockedValue = factory.totalLockedValue - lockedValue + pool.lockedValue
pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))
// const lockedValue = pool.lockedValue
// pool.lockedValue = pool.oceanReserve + (pool.datatokenReserve * pool.spotPrice)
// let factory = PoolFactory.load('1')
// factory.totalLockedValue = factory.totalLockedValue - lockedValue + pool.lockedValue
pool.save()
// factory.save()
factory.save()
debuglog(
'updated pool reserves (source, dtBalance, ocnBalance, dtReserve, ocnReserve): ',

View File

@ -174,12 +174,6 @@ export function handleSetup(event: LOG_CALL): void {
handleSetSwapFee(event, swapFee)
handleFinalize(event)
createPoolTransaction(event, 'setup', event.transaction.from.toHex())
const ptx = event.transaction.hash.toHexString()
let poolTx = PoolTransaction.load(ptx)
if (poolTx == null) {
debuglog('????????????????????????????/ no PoolTransaction ', event, [ptx])
return
}
// update base token
let amount = hexToDecimal(baseTokenAmount, 18)