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:
dependabot[bot] 2021-02-23 16:54:15 +01:00 committed by GitHub
parent 6cdda54e63
commit 42af9acbe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 26 deletions

View File

@ -3,16 +3,12 @@
"parserOptions": {
"project": ["./tsconfig.json"]
},
"extends": [
"oceanprotocol",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"extends": ["oceanprotocol", "plugin:prettier/recommended"],
"plugins": ["@typescript-eslint"],
"rules": {
"no-use-before-define": "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
View File

@ -2430,9 +2430,9 @@
}
},
"eslint-config-prettier": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz",
"integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==",
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz",
"integrity": "sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA==",
"dev": true
},
"eslint-config-standard": {

View File

@ -32,7 +32,7 @@
"auto-changelog": "^2.2.1",
"eslint": "^7.20.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",
"prettier": "^2.2.1",
"release-it": "^14.4.1",

View File

@ -112,7 +112,13 @@ export function updatePoolTokenBalance(
if (balance < ZERO_BD || poolToken.balance < ZERO_BD) {
log.warning(
'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
@ -190,11 +196,19 @@ export function updatePoolTransactionToken(
if (ptxTokenValues.tokenAddress == OCEAN) {
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) {
log.warning(
'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
pool.oceanReserve = ptxTokenValues.tokenReserve
@ -326,16 +340,23 @@ export function createPoolTransaction(
pool.spotPrice = poolTx.spotPrice
const oldValueLocked = pool.valueLocked
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')
if (oldValueLocked < ZERO_BD || pool.valueLocked < ZERO_BD) {
log.warning(
'EEEEEEEEEEEEEEEEE valueLocked < Zero: pool={}, oldVL={}, newVL={}, OCEAN={}, DT={}, spotPrice={}',
[pool.id, oldValueLocked.toString(), pool.valueLocked.toString(),
poolTx.oceanReserve.toString(), poolTx.datatokenReserve.toString(),
pool.spotPrice.toString()])
[
pool.id,
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))

View File

@ -425,8 +425,11 @@ export function handleTransfer(event: Transfer): void {
const pool = Pool.load(poolId)
const poolTx = PoolTransaction.load(event.transaction.hash.toHexString())
const value = tokenToDecimal(event.params.value.toBigDecimal(), 18)
debuglog('poolShare Transfer event: (from, to, value)', event,
[event.params.from.toHex(), event.params.to.toHex(), value.toString()])
debuglog('poolShare Transfer event: (from, to, value)', event, [
event.params.from.toHex(),
event.params.to.toHex(),
value.toString()
])
if (isMint) {
if (poolShareTo == null) {
@ -490,11 +493,18 @@ export function handleTransfer(event: Transfer): void {
poolShareFrom.save()
debuglog(
'pool shares transfer: ' +
'(id, value, totalShares, shareToBalance, shareFromBalance, toAddress, fromAddress)', event,
[poolId, value.toString(), pool.totalShares.toString(),
poolShareTo.balance.toString(), poolShareFrom.balance.toString(),
poolShareTo.userAddress, poolShareFrom.userAddress
])
'(id, value, totalShares, shareToBalance, shareFromBalance, toAddress, fromAddress)',
event,
[
poolId,
value.toString(),
pool.totalShares.toString(),
poolShareTo.balance.toString(),
poolShareFrom.balance.toString(),
poolShareTo.userAddress,
poolShareFrom.userAddress
]
)
}
if (