mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Bump eslint-config-prettier from 7.2.0 to 8.0.0 (#37)
* Bump eslint-config-prettier from 7.2.0 to 8.0.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.2.0 to 8.0.0. - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v7.2.0...v8.0.0) Signed-off-by: dependabot[bot] <support@github.com> * update ESLint config * breaking eslint-config-prettier config merge, see https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
This commit is contained in:
parent
6cdda54e63
commit
42af9acbe0
10
.eslintrc
10
.eslintrc
@ -3,16 +3,12 @@
|
|||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": ["./tsconfig.json"]
|
"project": ["./tsconfig.json"]
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": ["oceanprotocol", "plugin:prettier/recommended"],
|
||||||
"oceanprotocol",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier",
|
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-use-before-define": "off",
|
"no-use-before-define": "off",
|
||||||
"eqeqeq": "off",
|
"eqeqeq": "off",
|
||||||
"@typescript-eslint/no-use-before-define": "error"
|
"@typescript-eslint/no-use-before-define": "error",
|
||||||
|
"no-undef": ["warn"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -2430,9 +2430,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-config-prettier": {
|
"eslint-config-prettier": {
|
||||||
"version": "7.2.0",
|
"version": "8.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz",
|
||||||
"integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==",
|
"integrity": "sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"eslint-config-standard": {
|
"eslint-config-standard": {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
"auto-changelog": "^2.2.1",
|
"auto-changelog": "^2.2.1",
|
||||||
"eslint": "^7.20.0",
|
"eslint": "^7.20.0",
|
||||||
"eslint-config-oceanprotocol": "^1.5.0",
|
"eslint-config-oceanprotocol": "^1.5.0",
|
||||||
"eslint-config-prettier": "^7.2.0",
|
"eslint-config-prettier": "^8.0.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"release-it": "^14.4.1",
|
"release-it": "^14.4.1",
|
||||||
|
@ -112,7 +112,13 @@ export function updatePoolTokenBalance(
|
|||||||
if (balance < ZERO_BD || poolToken.balance < ZERO_BD) {
|
if (balance < ZERO_BD || poolToken.balance < ZERO_BD) {
|
||||||
log.warning(
|
log.warning(
|
||||||
'EEEEEEEEEEEEEEEEE poolToken.balance < Zero: pool={}, poolToken={}, oldBalance={}, newBalance={}',
|
'EEEEEEEEEEEEEEEEE poolToken.balance < Zero: pool={}, poolToken={}, oldBalance={}, newBalance={}',
|
||||||
[poolToken.poolId, poolToken.tokenAddress.toString(), poolToken.balance.toString(), balance.toString()])
|
[
|
||||||
|
poolToken.poolId,
|
||||||
|
poolToken.tokenAddress.toString(),
|
||||||
|
poolToken.balance.toString(),
|
||||||
|
balance.toString()
|
||||||
|
]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
poolToken.balance = balance
|
poolToken.balance = balance
|
||||||
@ -190,11 +196,19 @@ export function updatePoolTransactionToken(
|
|||||||
|
|
||||||
if (ptxTokenValues.tokenAddress == OCEAN) {
|
if (ptxTokenValues.tokenAddress == OCEAN) {
|
||||||
const factory = PoolFactory.load('1')
|
const factory = PoolFactory.load('1')
|
||||||
factory.totalOceanLiquidity = factory.totalOceanLiquidity + ptxTokenValues.tokenReserve - pool.oceanReserve
|
factory.totalOceanLiquidity =
|
||||||
|
factory.totalOceanLiquidity +
|
||||||
|
ptxTokenValues.tokenReserve -
|
||||||
|
pool.oceanReserve
|
||||||
if (factory.totalOceanLiquidity < ZERO_BD || pool.oceanReserve < ZERO_BD) {
|
if (factory.totalOceanLiquidity < ZERO_BD || pool.oceanReserve < ZERO_BD) {
|
||||||
log.warning(
|
log.warning(
|
||||||
'EEEEEEEEEEEEEEEEE totalOceanLiquidity or oceanReserve < Zero: pool={}, totOcnLiq={}, ocnRes={}',
|
'EEEEEEEEEEEEEEEEE totalOceanLiquidity or oceanReserve < Zero: pool={}, totOcnLiq={}, ocnRes={}',
|
||||||
[pool.id, factory.totalOceanLiquidity.toString(), pool.oceanReserve.toString()])
|
[
|
||||||
|
pool.id,
|
||||||
|
factory.totalOceanLiquidity.toString(),
|
||||||
|
pool.oceanReserve.toString()
|
||||||
|
]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
ptx.oceanReserve = ptxTokenValues.tokenReserve
|
ptx.oceanReserve = ptxTokenValues.tokenReserve
|
||||||
pool.oceanReserve = ptxTokenValues.tokenReserve
|
pool.oceanReserve = ptxTokenValues.tokenReserve
|
||||||
@ -326,16 +340,23 @@ export function createPoolTransaction(
|
|||||||
pool.spotPrice = poolTx.spotPrice
|
pool.spotPrice = poolTx.spotPrice
|
||||||
const oldValueLocked = pool.valueLocked
|
const oldValueLocked = pool.valueLocked
|
||||||
const spotPrice = pool.spotPrice >= ZERO_BD ? pool.spotPrice : ZERO_BD
|
const spotPrice = pool.spotPrice >= ZERO_BD ? pool.spotPrice : ZERO_BD
|
||||||
pool.valueLocked = poolTx.oceanReserve + (poolTx.datatokenReserve * spotPrice)
|
pool.valueLocked = poolTx.oceanReserve + poolTx.datatokenReserve * spotPrice
|
||||||
const factory = PoolFactory.load('1')
|
const factory = PoolFactory.load('1')
|
||||||
if (oldValueLocked < ZERO_BD || pool.valueLocked < ZERO_BD) {
|
if (oldValueLocked < ZERO_BD || pool.valueLocked < ZERO_BD) {
|
||||||
log.warning(
|
log.warning(
|
||||||
'EEEEEEEEEEEEEEEEE valueLocked < Zero: pool={}, oldVL={}, newVL={}, OCEAN={}, DT={}, spotPrice={}',
|
'EEEEEEEEEEEEEEEEE valueLocked < Zero: pool={}, oldVL={}, newVL={}, OCEAN={}, DT={}, spotPrice={}',
|
||||||
[pool.id, oldValueLocked.toString(), pool.valueLocked.toString(),
|
[
|
||||||
poolTx.oceanReserve.toString(), poolTx.datatokenReserve.toString(),
|
pool.id,
|
||||||
pool.spotPrice.toString()])
|
oldValueLocked.toString(),
|
||||||
|
pool.valueLocked.toString(),
|
||||||
|
poolTx.oceanReserve.toString(),
|
||||||
|
poolTx.datatokenReserve.toString(),
|
||||||
|
pool.spotPrice.toString()
|
||||||
|
]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
factory.totalValueLocked = factory.totalValueLocked - oldValueLocked + pool.valueLocked
|
factory.totalValueLocked =
|
||||||
|
factory.totalValueLocked - oldValueLocked + pool.valueLocked
|
||||||
|
|
||||||
pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))
|
pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))
|
||||||
|
|
||||||
|
@ -425,8 +425,11 @@ export function handleTransfer(event: Transfer): void {
|
|||||||
const pool = Pool.load(poolId)
|
const pool = Pool.load(poolId)
|
||||||
const poolTx = PoolTransaction.load(event.transaction.hash.toHexString())
|
const poolTx = PoolTransaction.load(event.transaction.hash.toHexString())
|
||||||
const value = tokenToDecimal(event.params.value.toBigDecimal(), 18)
|
const value = tokenToDecimal(event.params.value.toBigDecimal(), 18)
|
||||||
debuglog('poolShare Transfer event: (from, to, value)', event,
|
debuglog('poolShare Transfer event: (from, to, value)', event, [
|
||||||
[event.params.from.toHex(), event.params.to.toHex(), value.toString()])
|
event.params.from.toHex(),
|
||||||
|
event.params.to.toHex(),
|
||||||
|
value.toString()
|
||||||
|
])
|
||||||
|
|
||||||
if (isMint) {
|
if (isMint) {
|
||||||
if (poolShareTo == null) {
|
if (poolShareTo == null) {
|
||||||
@ -490,11 +493,18 @@ export function handleTransfer(event: Transfer): void {
|
|||||||
poolShareFrom.save()
|
poolShareFrom.save()
|
||||||
debuglog(
|
debuglog(
|
||||||
'pool shares transfer: ' +
|
'pool shares transfer: ' +
|
||||||
'(id, value, totalShares, shareToBalance, shareFromBalance, toAddress, fromAddress)', event,
|
'(id, value, totalShares, shareToBalance, shareFromBalance, toAddress, fromAddress)',
|
||||||
[poolId, value.toString(), pool.totalShares.toString(),
|
event,
|
||||||
poolShareTo.balance.toString(), poolShareFrom.balance.toString(),
|
[
|
||||||
poolShareTo.userAddress, poolShareFrom.userAddress
|
poolId,
|
||||||
])
|
value.toString(),
|
||||||
|
pool.totalShares.toString(),
|
||||||
|
poolShareTo.balance.toString(),
|
||||||
|
poolShareFrom.balance.toString(),
|
||||||
|
poolShareTo.userAddress,
|
||||||
|
poolShareFrom.userAddress
|
||||||
|
]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user