From 5572478c88d218d8dda43aa7d011aa671f0fe10b Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Tue, 17 Dec 2024 15:36:56 -0600 Subject: [PATCH] yes lets goo --- package.json | 2 +- packages/cli/package.json | 2 - .../commands/governance/execute-l2.test.ts | 2 +- .../governance/executehotfix-l2.test.ts | 2 +- .../commands/governance/hashhotfix-l2.test.ts | 2 +- .../src/commands/governance/show-l2.test.ts | 2 +- .../governance/test-proposal-l2.test.ts | 2 +- packages/cli/src/test-utils/setup.global.ts | 2 +- packages/cli/src/utils/config.test.ts | 2 +- packages/cli/src/utils/config.ts | 2 +- packages/dev-utils/src/ganache-setup.ts | 2 +- .../src/test-utils/setup.global.ts | 2 +- .../sdk/keystores/src/file-keystore.test.ts | 2 +- packages/sdk/keystores/src/file-keystore.ts | 4 +- .../network-utils/scripts/fetch_timezones.ts | 2 +- .../wallets/wallet-base/src/signing-utils.ts | 3 ++ .../wallet-ledger/src/ledger-wallet.test.ts | 2 +- yarn.lock | 54 ++----------------- 18 files changed, 22 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index f8dfeb9bf..f24952853 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "tsconfig-paths": "^4.2.0", "typedoc": "^0.27.5", "typedoc-plugin-markdown": "^4.3.2", - "typescript": "5.7.2" + "typescript": "5.3.3" }, "resolutions": { "ganache": "npm:@celo/ganache@7.8.0-unofficial.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4d44c02e6..d44140748 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -73,9 +73,7 @@ "ethers": "5", "fs-extra": "^8.1.0", "humanize-duration": "^3.32.1", - "path": "^0.12.7", "prompts": "^2.0.1", - "randombytes": "^2.0.1", "web3": "1.10.4", "web3-utils": "^1.10.4" }, diff --git a/packages/cli/src/commands/governance/execute-l2.test.ts b/packages/cli/src/commands/governance/execute-l2.test.ts index 003a4a398..a5004ae2e 100644 --- a/packages/cli/src/commands/governance/execute-l2.test.ts +++ b/packages/cli/src/commands/governance/execute-l2.test.ts @@ -9,7 +9,7 @@ import { } from '@celo/dev-utils/lib/anvil-test' import { timeTravel } from '@celo/dev-utils/lib/ganache-test' import fs from 'fs' -import path from 'path' +import path from 'node:path' import Web3 from 'web3' import { stripAnsiCodesAndTxHashes, testLocallyWithWeb3Node } from '../../test-utils/cliUtils' import Execute from './execute' diff --git a/packages/cli/src/commands/governance/executehotfix-l2.test.ts b/packages/cli/src/commands/governance/executehotfix-l2.test.ts index a4ae36ea0..fc7854d31 100644 --- a/packages/cli/src/commands/governance/executehotfix-l2.test.ts +++ b/packages/cli/src/commands/governance/executehotfix-l2.test.ts @@ -9,7 +9,7 @@ import { withImpersonatedAccount, } from '@celo/dev-utils/lib/anvil-test' import fs from 'fs' -import path from 'path' +import path from 'node:path' import Web3 from 'web3' import { AbiItem, PROXY_ADMIN_ADDRESS } from '../../../../sdk/connect/lib' import { diff --git a/packages/cli/src/commands/governance/hashhotfix-l2.test.ts b/packages/cli/src/commands/governance/hashhotfix-l2.test.ts index 4b97eb179..fb7a50cd4 100644 --- a/packages/cli/src/commands/governance/hashhotfix-l2.test.ts +++ b/packages/cli/src/commands/governance/hashhotfix-l2.test.ts @@ -1,7 +1,7 @@ import { PROXY_ADMIN_ADDRESS } from '@celo/connect' import { setCode, testWithAnvilL2 } from '@celo/dev-utils/lib/anvil-test' import fs from 'fs' -import path from 'path' +import path from 'node:path' import Web3 from 'web3' import { stripAnsiCodesAndTxHashes, testLocallyWithWeb3Node } from '../../test-utils/cliUtils' import HashHotfix from './hashhotfix' diff --git a/packages/cli/src/commands/governance/show-l2.test.ts b/packages/cli/src/commands/governance/show-l2.test.ts index 3a7d7e306..2d49235a5 100644 --- a/packages/cli/src/commands/governance/show-l2.test.ts +++ b/packages/cli/src/commands/governance/show-l2.test.ts @@ -4,7 +4,7 @@ import { Proposal } from '@celo/contractkit/lib/wrappers/Governance' import { testWithAnvilL2 } from '@celo/dev-utils/lib/anvil-test' import { timeTravel } from '@celo/dev-utils/lib/ganache-test' import fs from 'fs' -import path from 'path' +import path from 'node:path' import Web3 from 'web3' import { stripAnsiCodesAndTxHashes, testLocallyWithWeb3Node } from '../../test-utils/cliUtils' import Show from './show' diff --git a/packages/cli/src/commands/governance/test-proposal-l2.test.ts b/packages/cli/src/commands/governance/test-proposal-l2.test.ts index e0847f88a..85abd6bcd 100644 --- a/packages/cli/src/commands/governance/test-proposal-l2.test.ts +++ b/packages/cli/src/commands/governance/test-proposal-l2.test.ts @@ -2,7 +2,7 @@ import { PROXY_ADMIN_ADDRESS } from '@celo/connect' import { setCode, testWithAnvilL2 } from '@celo/dev-utils/lib/anvil-test' import * as celoGovernance from '@celo/governance' import fs from 'fs' -import path from 'path' +import path from 'node:path' import Web3 from 'web3' import { stripAnsiCodesAndTxHashes, testLocallyWithWeb3Node } from '../../test-utils/cliUtils' import TestProposal from './test-proposal' diff --git a/packages/cli/src/test-utils/setup.global.ts b/packages/cli/src/test-utils/setup.global.ts index 207d18694..da668a682 100644 --- a/packages/cli/src/test-utils/setup.global.ts +++ b/packages/cli/src/test-utils/setup.global.ts @@ -2,7 +2,7 @@ import baseSetup from '@celo/dev-utils/lib/ganache-setup' import { shouldRunGanacheTests } from '@celo/dev-utils/lib/ganache-test' // Has to import the matchers somewhere so that typescript knows the matchers have been made available import _unused from '@celo/dev-utils/lib/matchers' -import * as path from 'path' +import * as path from 'node:path' // Warning: There should be an unused import of '@celo/dev-utils/lib/matchers' above. // If there is not, then your editor probably deleted it automatically. diff --git a/packages/cli/src/utils/config.test.ts b/packages/cli/src/utils/config.test.ts index 16a85ecd2..cc362768f 100644 --- a/packages/cli/src/utils/config.test.ts +++ b/packages/cli/src/utils/config.test.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra' +import { join } from 'node:path' import { tmpdir } from 'os' -import { join } from 'path' import { CeloConfig, readConfig, writeConfig } from './config' // NOTE: for some reason if I don't mock the whole module, jest fails diff --git a/packages/cli/src/utils/config.ts b/packages/cli/src/utils/config.ts index 2085cb9df..392b06b22 100644 --- a/packages/cli/src/utils/config.ts +++ b/packages/cli/src/utils/config.ts @@ -1,6 +1,6 @@ import { CELO_DERIVATION_PATH_BASE } from '@celo/base' import * as fs from 'fs-extra' -import * as path from 'path' +import * as path from 'node:path' export interface CeloConfig { node: string diff --git a/packages/dev-utils/src/ganache-setup.ts b/packages/dev-utils/src/ganache-setup.ts index 6046cdc60..972e94956 100644 --- a/packages/dev-utils/src/ganache-setup.ts +++ b/packages/dev-utils/src/ganache-setup.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra' import * as ganache from 'ganache' -import * as path from 'path' +import * as path from 'node:path' import * as targz from 'targz' import { TEST_BALANCE, TEST_GAS_LIMIT, TEST_GAS_PRICE, TEST_MNEMONIC } from './test-utils' diff --git a/packages/sdk/contractkit/src/test-utils/setup.global.ts b/packages/sdk/contractkit/src/test-utils/setup.global.ts index cc0aba7ef..923927418 100644 --- a/packages/sdk/contractkit/src/test-utils/setup.global.ts +++ b/packages/sdk/contractkit/src/test-utils/setup.global.ts @@ -3,7 +3,7 @@ import { shouldRunGanacheTests } from '@celo/dev-utils/lib/ganache-test' // Has to import the matchers somewhere so that typescript knows the matchers have been made available import _very_important from '@celo/dev-utils/lib/matchers' import { waitForPortOpen } from '@celo/dev-utils/lib/network' -import * as path from 'path' +import * as path from 'node:path' // Warning: There should be an unused import of '@celo/dev-utils/lib/matchers' above. // If there is not, then your editor probably deleted it automatically. diff --git a/packages/sdk/keystores/src/file-keystore.test.ts b/packages/sdk/keystores/src/file-keystore.test.ts index 8b4d988b7..989ebafeb 100644 --- a/packages/sdk/keystores/src/file-keystore.test.ts +++ b/packages/sdk/keystores/src/file-keystore.test.ts @@ -1,6 +1,6 @@ import { trimLeading0x } from '@celo/utils/lib/address' import { mkdirSync, readdirSync, readFileSync, writeFileSync } from 'fs' -import path from 'path' +import path from 'node:path' import { rimraf } from 'rimraf' import { FileKeystore } from './file-keystore' import { ADDRESS1, GETH_GEN_KEYSTORE1, KEYSTORE_NAME1, PASSPHRASE1, PK1 } from './test-constants' diff --git a/packages/sdk/keystores/src/file-keystore.ts b/packages/sdk/keystores/src/file-keystore.ts index 08eb4dbac..ccd612d41 100644 --- a/packages/sdk/keystores/src/file-keystore.ts +++ b/packages/sdk/keystores/src/file-keystore.ts @@ -1,5 +1,5 @@ -import { mkdirSync, promises as fsPromises, readFileSync, unlinkSync, writeFileSync } from 'fs' -import path from 'path' +import { promises as fsPromises, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs' +import path from 'node:path' import { KeystoreBase } from './keystore-base' export class FileKeystore extends KeystoreBase { diff --git a/packages/sdk/network-utils/scripts/fetch_timezones.ts b/packages/sdk/network-utils/scripts/fetch_timezones.ts index 59d289d00..075fef1fe 100644 --- a/packages/sdk/network-utils/scripts/fetch_timezones.ts +++ b/packages/sdk/network-utils/scripts/fetch_timezones.ts @@ -1,6 +1,6 @@ import fs from 'fs' import 'isomorphic-fetch' -import path from 'path' +import path from 'node:path' import { Timezone } from '../src/utils/timezone' const TZ_URL = 'https://data.iana.org/time-zones/tzdb/zone.tab' diff --git a/packages/sdk/wallets/wallet-base/src/signing-utils.ts b/packages/sdk/wallets/wallet-base/src/signing-utils.ts index 61c3560b0..750301be0 100644 --- a/packages/sdk/wallets/wallet-base/src/signing-utils.ts +++ b/packages/sdk/wallets/wallet-base/src/signing-utils.ts @@ -411,6 +411,7 @@ export async function encodeTransaction( if (rlpEncoded.type === 'eip1559' || rlpEncoded.type === 'cip64') { tx = { ...tx, + // @ts-expect-error maxFeePerGas: rlpEncoded.transaction.maxFeePerGas!.toString(), maxPriorityFeePerGas: rlpEncoded.transaction.maxPriorityFeePerGas!.toString(), accessList: parseAccessList(rlpEncoded.transaction.accessList || []), @@ -419,12 +420,14 @@ export async function encodeTransaction( if (rlpEncoded.type === 'cip64' || rlpEncoded.type === 'celo-legacy') { tx = { ...tx, + // @ts-expect-error feeCurrency: rlpEncoded.transaction.feeCurrency!.toString(), } } if (rlpEncoded.type === 'ethereum-legacy') { tx = { ...tx, + // @ts-expect-error gasPrice: rlpEncoded.transaction.gasPrice!.toString(), } } diff --git a/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts b/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts index f93aa5623..c1f57dc75 100644 --- a/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts +++ b/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts @@ -23,7 +23,7 @@ import * as ethUtil from '@ethereumjs/util' import TransportNodeHid from '@ledgerhq/hw-transport-node-hid' import { VerifyPublicKeyInput, createVerify } from 'crypto' import { readFileSync } from 'fs' -import { dirname, join } from 'path' +import { dirname, join } from 'node:path' import Web3 from 'web3' import { legacyLedgerPublicKeyHex } from './data' import { meetsVersionRequirements } from './ledger-utils' diff --git a/yarn.lock b/yarn.lock index 40238ba51..b3e2d3f16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1731,9 +1731,7 @@ __metadata: humanize-duration: "npm:^3.32.1" jest: "npm:^29.7.0" oclif: "npm:^4.14.15" - path: "npm:^0.12.7" prompts: "npm:^2.0.1" - randombytes: "npm:^2.0.1" ts-jest: "npm:^29.1.5" ts-node: "npm:^10.9.1" typescript: "npm:5.3.3" @@ -8309,7 +8307,7 @@ __metadata: tsconfig-paths: "npm:^4.2.0" typedoc: "npm:^0.27.5" typedoc-plugin-markdown: "npm:^4.3.2" - typescript: "npm:5.7.2" + typescript: "npm:5.3.3" languageName: unknown linkType: soft @@ -12119,13 +12117,6 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2.0.3": - version: 2.0.3 - resolution: "inherits@npm:2.0.3" - checksum: 8771303d66c51be433b564427c16011a8e3fbc3449f1f11ea50efb30a4369495f1d0e89f0fc12bdec0bd7e49102ced5d137e031d39ea09821cb3c717fcf21e69 - languageName: node - linkType: hard - "ini@npm:^4.1.1": version: 4.1.1 resolution: "ini@npm:4.1.1" @@ -16044,16 +16035,6 @@ __metadata: languageName: node linkType: hard -"path@npm:^0.12.7": - version: 0.12.7 - resolution: "path@npm:0.12.7" - dependencies: - process: "npm:^0.11.1" - util: "npm:^0.10.3" - checksum: d49d101f9596613cf4cd1d4ebc4e64ba9a9df5d9cd75a410cfe87a88ce4bf0e2617ff44b92025376f7ecb02e88a6308b27f7f39d810f2335a5126f762487adfb - languageName: node - linkType: hard - "pathe@npm:^1.1.2": version: 1.1.2 resolution: "pathe@npm:1.1.2" @@ -16279,7 +16260,7 @@ __metadata: languageName: node linkType: hard -"process@npm:^0.11.1, process@npm:^0.11.10": +"process@npm:^0.11.10": version: 0.11.10 resolution: "process@npm:0.11.10" checksum: dbaa7e8d1d5cf375c36963ff43116772a989ef2bb47c9bdee20f38fd8fc061119cf38140631cf90c781aca4d3f0f0d2c834711952b728953f04fd7d238f59f5b @@ -16589,7 +16570,7 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.0.1, randombytes@npm:^2.1.0": +"randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" dependencies: @@ -18927,16 +18908,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.7.2": - version: 5.7.2 - resolution: "typescript@npm:5.7.2" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 4caa3904df69db9d4a8bedc31bafc1e19ffb7b24fbde2997a1633ae1398d0de5bdbf8daf602ccf3b23faddf1aeeb9b795223a2ed9c9a4fdcaf07bfde114a401a - languageName: node - linkType: hard - "typescript@patch:typescript@npm%3A5.3.3#optional!builtin": version: 5.3.3 resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" @@ -18947,16 +18918,6 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.7.2#optional!builtin": - version: 5.7.2 - resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin::version=5.7.2&hash=e012d7" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: ff27fc124bceb8969be722baa38af945b2505767cf794de3e2715e58f61b43780284060287d651fcbbdfb6f917f4653b20f4751991f17e0706db389b9bb3f75d - languageName: node - linkType: hard - "uc.micro@npm:^2.0.0, uc.micro@npm:^2.1.0": version: 2.1.0 resolution: "uc.micro@npm:2.1.0" @@ -19154,15 +19115,6 @@ __metadata: languageName: node linkType: hard -"util@npm:^0.10.3": - version: 0.10.4 - resolution: "util@npm:0.10.4" - dependencies: - inherits: "npm:2.0.3" - checksum: 1200a1ca2b474758342b3a0c5261c56f14ef09ad7eeaec3e6f449f5776ecdfce09a153cad62652b823e74647cdcfd2918552eadd2434783dfb58dabc5061803a - languageName: node - linkType: hard - "util@npm:^0.12.4, util@npm:^0.12.5": version: 0.12.5 resolution: "util@npm:0.12.5"