mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
revert debug changes.
This commit is contained in:
parent
50c5ac247c
commit
7a0f2b6113
@ -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): ',
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user