lockedValue fix

This commit is contained in:
Matthias Kretschmann 2021-01-29 12:48:59 +01:00
parent b22cd82501
commit 6b304e0386
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 2 additions and 1 deletions

View File

@ -310,10 +310,11 @@ export function createPoolTransaction(
pool.consumePrice = poolTx.consumePrice
pool.spotPrice = poolTx.spotPrice
const oldLockedValue = pool.lockedValue
pool.lockedValue = pool.oceanReserve + pool.datatokenReserve * pool.spotPrice
const factory = PoolFactory.load('1')
factory.totalLockedValue =
factory.totalLockedValue - pool.lockedValue + pool.lockedValue
factory.totalLockedValue - oldLockedValue + pool.lockedValue
pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))