From 502a314c6a987e618c680f8d20e187f4a124a43e Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Mon, 20 Feb 2023 01:50:25 -0800 Subject: [PATCH] adjust ethers6 --- .gitignore | 1 + package.json | 5 +++-- src.ts/abi/fragments.ts | 8 +++++--- src.ts/providers/index.ts | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index efeb289bf7..d9fa2d14d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea node_modules/** output/** diff --git a/package.json b/package.json index 6d6c25ca34..9bd827aac1 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "license": "MIT", "main": "./lib.commonjs/index.js", "module": "./lib.esm/index.js", - "name": "ethers", + "name": "@sentio/ethers", "publishConfig": { "access": "public", "tag": "latest" @@ -128,7 +128,8 @@ "test-browser": "node lib.esm/_admin/test-browser", "test-commonjs": "mocha --reporter ./reporter.cjs ./lib.commonjs/_tests/test-*.js", "test-coverage": "c8 -o output -r lcov -r text mocha --no-color --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js | tee output/summary.txt", - "test-esm": "mocha --trace-warnings --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js" + "test-esm": "mocha --trace-warnings --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js", + "build-pub": "npm run build-all && npm run build-dist && npm publish --ignore-git-checks" }, "sideEffects": false, "version": "6.12.2" diff --git a/src.ts/abi/fragments.ts b/src.ts/abi/fragments.ts index 202b7a93f7..a81d82516e 100644 --- a/src.ts/abi/fragments.ts +++ b/src.ts/abi/fragments.ts @@ -864,9 +864,11 @@ export class ParamType { "invalid name", "obj.name", name); let indexed = obj.indexed; - if (indexed != null) { + if (indexed == true) { assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; + indexed = true; + } else { + indexed = false } let type = obj.type; @@ -1045,7 +1047,7 @@ export abstract class NamedFragment extends Fragment { } } -function joinParams(format: FormatType, params: ReadonlyArray): string { +function joinParams(format: FormatType, params: ReadonlyArray): string { return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", ": ",") + ")"; } diff --git a/src.ts/providers/index.ts b/src.ts/providers/index.ts index c0a33dc8aa..5d79f15f26 100644 --- a/src.ts/providers/index.ts +++ b/src.ts/providers/index.ts @@ -91,6 +91,8 @@ export type { TransactionResponseParams, } from "./formatting.js"; +export * from "./format.js"; + /* export type { CommunityResourcable