test pnpn cache (#16743)

This commit is contained in:
g1nt0ki
2025-10-18 23:09:52 +02:00
committed by GitHub
parent 9d43a9e5e2
commit 6ed331ffcb
15 changed files with 23 additions and 58 deletions

View File

@@ -1,21 +0,0 @@
module.exports = {
"env": {
"node": true,
"commonjs": true,
"es2021": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
ignorePatterns: ['projects/test/*'],
"rules": {
"no-case-declarations": "off",
"no-unused-vars": "off",
"no-useless-escape": "warn",
"no-prototype-builtins": "off",
"no-unreachable": "off",
}
}

View File

@@ -72,5 +72,4 @@ jobs:
- name: Run ESLint
run: |
npm ci
npm run lint

16
eslint.config.js Normal file
View File

@@ -0,0 +1,16 @@
module.exports = [
{
files: ["**/*.js"],
ignores: ["projects/test/*"],
languageOptions: {
ecmaVersion: "latest",
},
rules: {
"no-case-declarations": "off",
"no-unused-vars": "off",
"no-useless-escape": "warn",
"no-prototype-builtins": "off",
"no-unreachable": "off",
}
}
];

View File

@@ -8,8 +8,8 @@
"weeklyChanges": "git pull && git diff $(git log -1 --before=@{7.days.ago} --format=%H) --stat | grep -E \"projects/\" | cut -d / -f 2 | cut -d \" \" -f 1 | uniq | wc -l",
"dev": "babel-watch curve.js",
"build": "node scripts/buildImports.js",
"lint": "eslint -c .eslintrc.js .",
"eslint:github-action": "eslint -c .eslintrc.js .",
"lint": "eslint -c eslint.config.js .",
"eslint:github-action": "eslint -c eslint.config.js .",
"test-interactive": "node utils/testInteractive",
"tvl": "cd utils;npm i; cd ..; node utils/testInteractive",
"treasury": "cd utils;npm i; cd ..; node utils/testInteractive treasury",

View File

@@ -4,13 +4,13 @@ const { getEnv } = require('../helper/env')
const { sumUnknownTokens } = require('../helper/unknownTokens')
async function fetcher() {
const { data: { yield }} = await get('https://api.blacksail.finance/stats', {
const { data} = await get('https://api.blacksail.finance/stats', {
headers: {
'x-api-key': getEnv('BLACKSAIL_API_KEY'),
'Content-Type': 'application/json'
}
});
return Object.values(yield).map((i) => i.strat_address).filter(i => i)
return Object.values(data.yield).map((i) => i.strat_address).filter(i => i)
}
async function tvl(api) {

View File

@@ -1,5 +1,3 @@
/* eslint-disable no-async-promise-executor */
const sdk = require('@defillama/sdk');
const ADDRESSES = require('../helper/coreAssets.json')
const static_contract = "0xA25F892cF2731ba89b88750423Fc618De0959C43";
const fil_fig_stake_contract = "0xD44bfE4523f1B2703DDE9C7dBc010Ad39EF668f7";
@@ -35,4 +33,3 @@ module.exports = {
staking:(api) => getFigStake(api, bsc_fig_stake_contract, BSC_FIG_TOKEN)
}
};
/* eslint-enable no-async-promise-executor */

View File

@@ -119,7 +119,6 @@ function v3Tvl(
if (!tokenBalances.length) throw new Error("null value of tokens");
const blSet = new Set([...blacklistedTokens, ...pools].map((s) => s.toLowerCase()));
// eslint-disable-next-line no-const-assign
tokenBalances = tokenBalances.filter(([t]) => !blSet.has(String(t).toLowerCase()));
await api.addTokens(tokenBalances);

View File

@@ -79,7 +79,6 @@ async function sumTokens(options) {
const evmAddressExceptions = new Set(['tron', 'xdc'])
const nonEvmOwnerFound = !evmAddressExceptions.has(chain) && owners.some(o => !o.startsWith('0x'))
const isAltEvm = altEVMHelper[chain] && nonEvmOwnerFound
console.log('chain:', chain, 'isAltEvm:', isAltEvm, 'nonEvmOwnerFound:', nonEvmOwnerFound)
if (!ibcChains.includes(chain) && !helpers[chain] && !specialChains.includes(chain) && !isAltEvm) {
if (nonEvmOwnerFound) throw new Error('chain handler missing: ' + chain)

View File

@@ -101,7 +101,7 @@ const b64url = (function () {
// initialize result and counters
var bc = 0, bs, buffer, idx = 0, output = '';
// get next character
buffer = str.charAt(idx++); // eslint-disable-line no-cond-assign
buffer = str.charAt(idx++);
// character found in table? initialize bit storage and add its ascii value;
~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
// and if not first of each 4 characters,

View File

@@ -47,7 +47,6 @@ async function getGearboxV31Collateral(api, marketConfigurator, pageSize = 1e3)
// page through credit accounts for each CM
for (const cm of creditManagers) {
let offset = 0
// eslint-disable-next-line no-constant-condition
while (true) {
const accounts = await api.call({
abi: GearboxCompressorABI.getCreditAccounts,

View File

@@ -31,7 +31,6 @@ async function tvl(api) {
async function getMarketIds(chain, factory) {
const market_ids = [];
// eslint-disable-next-line no-constant-condition
while(true) {
const resp = await queryContract({
contract: factory,

View File

@@ -15,4 +15,4 @@ module.exports = {
return api.sumTokens({ tokens: ["0xd46ba6d942050d489dbd938a2c909a5d5039a161"], owners: [...bonds, "0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd"] })
}
}
}
}

View File

@@ -201,7 +201,6 @@ async function fetchAllTokens(subgraph, query, block, type) {
const isKashi = type === 'kashi';
const key = isKashi ? 'kashiPairs' : 'tokens';
// eslint-disable-next-line no-constant-condition
while (true) {
const result = await request(subgraph, query, { id: lastId, block });
const tokens = result[key] || [];

View File

@@ -1,21 +0,0 @@
{
// This is an alias to @tsconfig/node16: https://github.com/tsconfig/bases
"extends": "ts-node/node16/tsconfig.json",
// Most ts-node options can be specified here using their programmatic names.
"ts-node": {
// It is faster to skip typechecking.
// Remove if you want ts-node to do typechecking.
"transpileOnly": true,
"files": true,
"compilerOptions": {
// compilerOptions specified here will override those declared below,
// but *only* in ts-node. Useful if you want ts-node and tsc to use
// different options with a single tsconfig.json.
}
},
"compilerOptions": {
"noImplicitAny": false,
"strictNullChecks": false,
"typeRoots": ["./typings/", "./node_modules/@types/"]
}
}

View File

@@ -38,7 +38,7 @@ async function run() {
])
adapterPath = response.adapterPath
while (true) { // eslint-disable-line
while (true) {
adapterPrompt.default = adapterPath
await runAdapter(adapterPath, true)
const answer = await inquirer.prompt([adapterPrompt])