Compare commits

..

147 Commits

Author SHA1 Message Date
Richard Moore
203a759efc Add exports for AbstractProviderOptions and for MulticoinProviderPlugin. 2023-06-13 21:41:33 -04:00
Richard Moore
de0f5189f6 Add option to adjust perform cache timeout in AbstractProvider. 2023-06-13 21:40:26 -04:00
Richard Moore
84375be92d Add full support for MultiCoin plugins and automatic detection for EVM-compatible coin types (#3888, #4081). 2023-06-13 16:26:40 -04:00
Richard Moore
2318005dfd Allow Interface instances where InterfaceAbi are allowed (#4142). 2023-06-13 16:22:40 -04:00
Richard Moore
9055ef6c69 Allow Numeric type for decimals in FixedNumber (#4141). 2023-06-12 22:11:08 -04:00
Richard Moore
026c5bb137 admin: updated dist files 2023-06-07 20:20:11 -04:00
Richard Moore
c448458633 docs: typo in jsdocs for eip number (#3992) 2023-06-07 20:14:12 -04:00
Richard Moore
8dd21f0333 Fix lost promise fulfillment when a batch has an error response (#4126). 2023-06-07 20:09:29 -04:00
Richard Moore
11956aee34 admin: updated dist files 2023-06-06 22:42:28 -04:00
Richard Moore
374fbaebcd docs: fixed jsdocs typo (#4023) 2023-06-06 22:37:18 -04:00
Richard Moore
9a14709def docs: fixed jsdocs typo (#4026) 2023-06-06 22:36:09 -04:00
Richard Moore
38ee3195b0 Fix CJS browser bundling (#4033). 2023-06-06 22:33:51 -04:00
Richard Moore
51a9610fe0 docs: updated readme (#4121) 2023-06-06 22:30:17 -04:00
Richard Moore
20c3d1b109 Fixed type guard for non-Typed instances (#4087). 2023-06-06 21:24:02 -04:00
Richard Moore
bb8685b112 Add confirmations to TransactionResponse (#4094). 2023-06-06 20:56:44 -04:00
Richard Moore
3c1bad2fb7 Fix stray promises when a node returns invalid results (#4118). 2023-06-06 19:24:19 -04:00
Richard Moore
f37a52da28 Added support to detect and stop providers spinning on intitial network detection (#4015). 2023-06-06 17:58:06 -04:00
Richard Moore
7dcecfa47d docs: added jsdocs 2023-06-06 17:56:00 -04:00
Richard Moore
3235910f3b tests: remove pocket provider from tests 2023-06-05 22:41:31 -04:00
Richard Moore
8eb8cae8cd admin: updated dist files 2023-06-05 22:12:31 -04:00
Richard Moore
c1357847dc Bump ens-normalize version (#4071, #4077, #4080, #4102). 2023-06-05 22:11:25 -04:00
Richard Moore
9b0e9920c0 Fix for networks with polling with non-consistent block and filter events (#4119). 2023-06-05 22:08:43 -04:00
Richard Moore
56ed4e7380 admin: updated dist files 2023-06-01 17:52:58 -04:00
Richard Moore
15ed2f5b32 Fixed AbstractProvider lookupAddress bug (#4086). 2023-06-01 17:51:21 -04:00
Richard Moore
d8e9586044 Fix FixedNumber comparison bug (#4112). 2023-06-01 17:48:56 -04:00
Richard Moore
bbcfb5f6b8 docs: added jsdocs and general documentation 2023-06-01 17:42:48 -04:00
Richard Moore
c785c1e515 docs: explicitly specify ESM for docs config 2023-05-19 09:44:08 -04:00
Richard Moore
a6000e3c6d admin: updated dist files 2023-05-18 17:28:39 -04:00
Richard Moore
83d7f43b9c Coerce value into BigInt when checking for value. 2023-05-18 17:26:59 -04:00
Richard Moore
50ffd5950c admin: updated rollup config for explicit ESM order 2023-05-18 17:11:34 -04:00
Richard Moore
c8453577e9 admin: tweaked gitignore for misc files 2023-05-18 17:10:56 -04:00
Richard Moore
bcca632ef8 docs: fixed typo in example ABI 2023-05-18 17:07:07 -04:00
Richard Moore
219b16dc28 Better errors when junk passed as Contract target (#3947, #4053). 2023-05-18 17:05:33 -04:00
Richard Moore
f58990b80c More robust message checking in socket providers (#4051). 2023-05-18 16:56:50 -04:00
Richard Moore
984f6fa155 More robust defaultProvider start-up when a backend fails on bootstrap (#3979). 2023-05-18 16:52:47 -04:00
Richard Moore
2e5935b91c Fix Result.map when Array contains zero elements (#4036, #4048). 2023-05-15 17:18:46 -04:00
Richard Moore
6db7458cf0 Fixed error handling for contracts with receive and non-payable fallback. 2023-05-15 16:49:02 -04:00
Richard Moore
f87f6ef9a0 Remove superfluous logging in defaultProvider. 2023-05-07 15:28:07 +09:00
Richard Moore
a09f58452e tests: fixed assert ordering 2023-05-07 02:13:03 +09:00
Richard Moore
13593809bd admin: updated dist files 2023-05-06 15:16:41 +09:00
Richard Moore
1bc8b55d50 Removed superfluous logging. 2023-05-06 15:15:07 +09:00
Richard Moore
96d5e7b206 tests: added test-browser static files 2023-05-06 15:14:36 +09:00
Richard Moore
25ab579634 tests: simplified imports for browser testing 2023-05-06 15:03:58 +09:00
Richard Moore
c7b9be977c tests: added initial browser testing 2023-05-06 15:02:36 +09:00
Richard Moore
2b0fe61133 Fix receipt gas price when effectiveGasPrice is 0 on testnets (#4014). 2023-04-28 21:50:04 +09:00
Richard Moore
f2fb8b5ede tests: angular tests require recursive copy 2023-04-28 21:38:23 +09:00
Richard Moore
e14afe3994 tests: added angular to env tests 2023-04-28 21:36:23 +09:00
Richard Moore
8a71e615c2 tests: refining env tests 2023-04-28 21:10:09 +09:00
Richard Moore
d74a802907 tests: env tests should output TypeScript instead of JavaScript 2023-04-28 20:17:04 +09:00
Richard Moore
6d3639d91c tests: fix bug in prepare script 2023-04-28 20:14:46 +09:00
Richard Moore
35d0e0d976 tests: fix typo in workflow 2023-04-28 20:13:32 +09:00
Richard Moore
795d064058 tests: use matrix for env tests 2023-04-28 20:11:35 +09:00
Richard Moore
fd96d149ab admin: include lib folders in CI tests 2023-04-28 00:56:38 +09:00
Richard Moore
7f49e14c06 admin: updat dist files 2023-04-28 00:55:41 +09:00
Richard Moore
9f9d234a2d docs: added jsdocs to verifyMessage 2023-04-28 00:45:50 +09:00
Richard Moore
a47cad16a8 admin: trying more robust build output structure 2023-04-27 21:19:55 +09:00
Richard Moore
76d8fff581 admin: update dist files 2023-04-25 20:04:48 +09:00
Richard Moore
6c9b7e2a15 tests: added environment test (#3983) 2023-04-25 20:03:40 +09:00
Richard Moore
7e272a314f admin: adding better support for building on a wider variety of environments 2023-04-25 20:02:46 +09:00
Richard Moore
1d70807964 tests: added tests for ECC shared secrets 2023-04-25 20:00:12 +09:00
Richard Moore
af0291c016 Added error event to provider (#3970, #3982). 2023-04-24 20:09:45 +09:00
Richard Moore
e848978758 Removed superfluous parameters for internal transaction functions. 2023-04-24 19:37:05 +09:00
Richard Moore
076edad81e More aggresive tree-shaking. 2023-04-24 19:36:07 +09:00
Richard Moore
7c0465c5fb More flexible static network checking (#3834). 2023-04-24 19:20:39 +09:00
Richard Moore
6cfe22b7e2 docs: updated transaction.value to specify in wei 2023-04-24 18:33:25 +09:00
Richard Moore
8fcbd9cac4 tests: update cjs tests to use require 2023-04-22 18:59:18 +09:00
Richard Moore
f701f390cc admin: update dist files 2023-04-22 18:54:45 +09:00
Richard Moore
df685b1bd9 Support transitive dependants that use non-node16 moduleResolution (#3920). 2023-04-22 18:53:35 +09:00
Richard Moore
47f9d16eb7 admin: adjust the target path for faux_modules 2023-04-22 18:42:26 +09:00
Richard Moore
cdb34b0184 admin: move clone path up a folder 2023-04-21 19:10:13 +09:00
Richard Moore
44ba4a0073 admin: dump faux-npm logs 2023-04-21 19:06:41 +09:00
Richard Moore
c3bc38b567 admin: show installed packages during test-env 2023-04-21 18:56:11 +09:00
Richard Moore
d8efa7b77c admin: add clean target to environment tests 2023-04-21 18:44:50 +09:00
Richard Moore
a1d52c3579 admin: add node types as dependency to fix type resolution 2023-04-21 18:44:23 +09:00
Richard Moore
b70c66ee24 admin: update to newer faux_modules path 2023-04-21 17:58:21 +09:00
Richard Moore
e315e1a74c admin: fix typo in workflow 2023-04-21 17:56:16 +09:00
Richard Moore
0f9f385a19 admin: add missing tag to env-tests 2023-04-21 17:51:00 +09:00
Richard Moore
35c0c01a27 admin: restrict paths for docs generation 2023-04-21 17:50:11 +09:00
Richard Moore
db550971c0 admin: adding initial environment tests 2023-04-21 17:48:26 +09:00
Richard Moore
10e03e095b admin: update dist files 2023-04-19 17:30:37 +09:00
Richard Moore
6b9305886f docs: grammar fixes (#3980) 2023-04-19 16:29:41 +09:00
Richard Moore
91a84102d6 docs: fixed v5 typo in contracts (#3969) 2023-04-19 16:26:03 +09:00
Richard Moore
bacd48cd5c docs: fixed typo (#3964) 2023-04-19 16:24:12 +09:00
Richard Moore
a9b3edd2be docs: fixed typo (#3960) 2023-04-19 16:23:28 +09:00
Richard Moore
4e478e625d Populate any missing log.removed with false (#3959). 2023-04-19 15:45:54 +09:00
Richard Moore
0802b70a72 admin: updated dist files 2023-04-06 04:37:10 -04:00
Richard Moore
c764e9a10b admin: prevent duplicate definition error; research why this happened 2023-04-06 04:33:55 -04:00
Richard Moore
8c5973e3a9 Added support for legacy ABI JSON fragments (#3932). 2023-04-06 04:25:54 -04:00
Richard Moore
e4e951124f admin: added default fallback to exports for legacy tooling 2023-04-06 03:42:22 -04:00
Richard Moore
c58ab3a976 Add _in_ operator support for contract and contract.filters (#3901). 2023-04-06 02:46:47 -04:00
Richard Moore
9060dede49 tests: added testcases for twos compliments 2023-04-05 04:22:59 -04:00
Richard Moore
9cb2a9d89b docs: added Typed info 2023-04-05 04:20:48 -04:00
Richard Moore
a851b24d0a Fixed TypedData unsigned value range (#3873). 2023-04-05 04:20:21 -04:00
Richard Moore
356ff2becb Added missing export for getIndexedAccountPath (#3875). 2023-04-04 23:38:38 -04:00
Richard Moore
50b74b8806 Fixed TypedData payloads for JSON-restricted chainId field (#3868). 2023-04-04 23:18:48 -04:00
Richard Moore
130204dd3b admin: updated dist files 2023-03-27 21:22:35 -04:00
Richard Moore
ffaafc0ce1 Fixed events when emitted in WebSocketProvider (#3767, #3922). 2023-03-27 21:21:03 -04:00
Richard Moore
9373864742 admin: update dist files 2023-03-24 00:49:22 -04:00
Richard Moore
88e8124c37 Fixed FetchRequest when using credentials (#3897). 2023-03-23 23:31:31 -04:00
Richard Moore
c05a84aa65 admin: updated dist files 2023-03-23 17:33:55 -04:00
Richard Moore
603d47496e Stall block polling bootstrap when the network is down (#3924). 2023-03-23 17:08:46 -04:00
Richard Moore
d661f70f3f admin: updated dist files 2023-03-20 15:53:36 -04:00
Richard Moore
62c798ce33 tests: fixed keccak256 implementation in testcase generation 2023-03-20 15:52:19 -04:00
Richard Moore
0cfeed2633 tests: small tweaks to improve failing third-party testcases 2023-03-20 14:43:20 -04:00
Richard Moore
30ffa78d14 Added extra details in the error info field for RPC errors. 2023-03-20 14:42:19 -04:00
Richard Moore
6e01e5448f Remove Ankr as a deafult for now as the provided API key is failing. 2023-03-20 14:40:43 -04:00
Richard Moore
d2e683e8eb admin: updated dist files 2023-03-20 13:33:56 -04:00
Richard Moore
2e3802a83b Fixed deferred filters after unsafe-eval changes (#3749, #3763). 2023-03-20 13:32:50 -04:00
Richard Moore
0816d54dd5 admin: fixed typo in CI workflow 2023-03-20 12:59:57 -04:00
Richard Moore
d4af1046c8 docs: added info on replacing fetchJson with FetchRequest 2023-03-20 12:58:10 -04:00
Richard Moore
0a9e4cd67d tests: updated ENS normalization tests to latest standard 2023-03-20 12:54:08 -04:00
Richard Moore
e03390130c admin: updated dist files 2023-03-20 12:53:37 -04:00
Richard Moore
7d3af512c7 Remove use of Function sub-class to address unsafe-eval issues (#3749, #3763). 2023-03-20 12:49:58 -04:00
Richard Moore
5318b939fd tests: added contract integration tests and llocal Geth 2023-03-20 12:46:21 -04:00
Richard Moore
f06a445247 Added verifyTypedData utility (reported on Farcaster). 2023-03-20 11:31:35 -04:00
Richard Moore
e11d4c1c20 Removed stray logging in IpcProvider (#3908, #3909). 2023-03-18 13:27:47 -04:00
Richard Moore
fcf6c8fcee Fixed legacy serialization for implicit chainId transactions (#3898, #3899). 2023-03-16 12:11:46 -04:00
Richard Moore
3ad4273b8b Fix Webpack issue (reported on discord). 2023-03-16 10:19:33 -04:00
Richard Moore
6315e78ea3 Fix some bundlers which cannot handle recursive pkg.exports (#3848). 2023-03-13 06:41:18 -04:00
Richard Moore
7eaf3c4e8b docs: added provider updates to migration (#3844) 2023-03-13 01:16:41 -04:00
Richard Moore
8a02029c00 docs: fixed typo (#3864) 2023-03-13 01:10:42 -04:00
Richard Moore
4a581b9944 admin: added script to create github releases (#3784) 2023-03-12 05:41:15 -04:00
Richard Moore
47ef3ebde3 Fixed typo in signature.s error (#3891). 2023-03-12 04:50:42 -04:00
Richard Moore
f61ad27a8e docs: fixed typo (#3877) 2023-03-12 04:47:08 -04:00
Richard Moore
c220fe2ea7 Fixed stray unreachable code (#3890). 2023-03-12 04:45:12 -04:00
Richard Moore
8136a6476b docs: added more jsdocs to TransactionResponse 2023-03-11 01:02:24 -05:00
Richard Moore
02a0aad612 Move all wrapping to proper _wrap functions (#3818). 2023-03-10 07:02:51 -05:00
Richard Moore
278f841744 admin: updated dist files 2023-03-07 02:11:03 -05:00
Richard Moore
5f2678fb05 Fixed ethers imported in web workers (#3856). 2023-03-07 02:07:03 -05:00
Richard Moore
abeaa74da0 Added Sepolia support (#3863). 2023-03-07 01:36:57 -05:00
Richard Moore
26a830eef5 docs: updated project links 2023-03-03 18:25:27 -07:00
Richard Moore
dced2b7dac admin: updated dist files 2023-03-03 18:25:07 -07:00
Richard Moore
06aa30363f Added missing exports (#3734). 2023-03-03 18:05:55 -07:00
Richard Moore
a32af3adc1 Allow null values for TypedData domain (#3623). 2023-03-03 17:59:58 -07:00
Richard Moore
287d94fc45 Added listAccounts to JsonRpcProvider (#3778). 2023-03-03 17:59:05 -07:00
Richard Moore
fe1f04c6e5 Allow BigInt for blockTag (#3780). 2023-03-03 17:44:08 -07:00
Richard Moore
f1a810dcb5 Fixed typo in error messages (#3822, #3824). 2023-02-28 21:18:27 -05:00
Richard Moore
76fab923da Re-adding definition files to require exports (#3703). 2023-02-28 21:15:18 -05:00
Richard Moore
4f2d1e1c7b docs: fixed typos in docs 2023-02-26 18:25:02 -05:00
Richard Moore
ba967875f7 docs: update flatworm cli 2023-02-24 00:49:05 -05:00
Richard Moore
0d417ff2a9 admin: updated dist files 2023-02-23 06:31:09 -05:00
Richard Moore
20bbd12819 Fix matic-mumbai network and include aliases to legacy names (#3811). 2023-02-23 06:29:09 -05:00
Richard Moore
388edf6abc Fixed getSigner bug (#3821). 2023-02-23 06:20:39 -05:00
Richard Moore
3a0d8685ca admin: updated dist files 2023-02-23 01:41:13 -05:00
Richard Moore
b993f7c3b6 Fixed getContentHash (#3819). 2023-02-23 01:39:57 -05:00
Richard Moore
51e72b98a2 admin: update dist files 2023-02-22 21:53:56 -05:00
Richard Moore
8298e8599f admin: added changelog generation scripts 2023-02-22 21:52:33 -05:00
1233 changed files with 76736 additions and 5735 deletions

View File

@@ -4,6 +4,9 @@ on:
push:
branches:
- main
paths:
- "src.ts/**"
- "docs.wrm/**"
jobs:
docs:
@@ -32,7 +35,7 @@ jobs:
run: npm install --no-save 'https://github.com/ricmoo/flatworm.git#tsdocs'
- name: Build Documentation
run: node node_modules/flatworm/lib/test-api-index ./docs.wrm/config.js
run: node node_modules/flatworm/lib/cli-test ./docs.wrm/config.mjs
- name: Upload documentation to to docs.ethers.org
uses: ethers-io/sync-s3-action@main

41
.github/workflows/test-browser.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Browser Tests
on:
push:
branches:
- main
jobs:
test-browser:
name: Run Browser Tests
runs-on: ubuntu-latest
environment: ethers-tests
strategy:
fail-fast: false
steps:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Insall Chrome
run: wget -q 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' && sudo dpkg --install google-chrome-stable_current_amd64.deb
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build browser bundles (from TypeScript)
run: npm run build-dist
- name: Run tests
run: npm run test-browser

View File

@@ -6,6 +6,8 @@ on:
- main
paths:
- "src.ts/**"
- "lib.esm/**"
- "lib.commonjs/**"
jobs:
@@ -32,6 +34,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2
@@ -63,6 +68,9 @@ jobs:
with:
node-version: 18.x
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2

86
.github/workflows/test-env.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: Environment Tests
on:
push:
branches:
- main
jobs:
test-tsc-env:
name: Test TypeScript Environments
runs-on: ubuntu-latest
env:
npm_config_registry: http://localhost:8043
strategy:
fail-fast: false
matrix:
tsModuleResolution: [ "node", "node16", "nodenext" ]
tsModule: [ "commonjs", "es2020" ]
steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Checkout repository
uses: actions/checkout@v3
with:
path: "faux_modules/ethers"
- name: Copy tests to working directory
run: cp -r faux_modules/ethers/testcases/test-env/test-tsc/* .
- name: Prepare setup moduleResolution=${{ matrix.tsModuleResolution }} module=${{ matrix.tsModule }}
run: node prepare.cjs ${{ matrix.tsModuleResolution }} ${{ matrix.tsModule }}
- name: Dump Config
run: cat package.json tsconfig.json
- name: Install and run Faux Registry
uses: ethers-io/hijack-npm-action@main
- name: Install packages
run: npm install
- name: Dump Faux Logs
run: cat .fauxNpm.log
- name: Run tests
run: npm test
test-angular:
name: Test Angular Environment
runs-on: ubuntu-latest
env:
npm_config_registry: http://localhost:8043
steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Checkout repository
uses: actions/checkout@v3
with:
path: "faux_modules/ethers"
- name: Copy tests to working directory
run: cp -r faux_modules/ethers/testcases/test-env/angular/* .
- name: Install and run Faux Registry
uses: ethers-io/hijack-npm-action@main
- name: Install packages
run: npm install
- name: Build project
run: npm run build

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
node_modules/**
output/**
misc/**
**/*.swp
**/*.tgz
dist/*.gz

View File

@@ -27,3 +27,5 @@ testcases/**
.DS_Store
node_modules/**
misc/**
**/*.tgz
dist/*.gz

View File

@@ -1,7 +1,122 @@
Change Log
==========
This change log is maintained by `src.ts/_admin/update-changelog.ts but may also be manually updated.`
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
ethers/v6.5.1 (2023-06-07 20:19)
--------------------------------
- Fix lost promise fulfillment when a batch has an error response ([#4126](https://github.com/ethers-io/ethers.js/issues/4126); [8dd21f0](https://github.com/ethers-io/ethers.js/commit/8dd21f03334ffd3cdb7ac532376d51fd4130c7ab)).
ethers/v6.5.0 (2023-06-06 22:41)
--------------------------------
- Fix CJS browser bundling ([#4033](https://github.com/ethers-io/ethers.js/issues/4033); [38ee319](https://github.com/ethers-io/ethers.js/commit/38ee3195b0192d8180899fd61308e03fa3a0eb32)).
- Fixed type guard for non-Typed instances ([#4087](https://github.com/ethers-io/ethers.js/issues/4087); [20c3d1b](https://github.com/ethers-io/ethers.js/commit/20c3d1b109743e33ab60a75d69bf7ede73b15ce2)).
- Add confirmations to TransactionResponse ([#4094](https://github.com/ethers-io/ethers.js/issues/4094); [bb8685b](https://github.com/ethers-io/ethers.js/commit/bb8685b112ce1c689c740d4dbcb358c16fb9b22d)).
- Fix stray promises when a node returns invalid results ([#4118](https://github.com/ethers-io/ethers.js/issues/4118); [3c1bad2](https://github.com/ethers-io/ethers.js/commit/3c1bad2fb7ad4a6ff90ff11f3e382fd18e41c800)).
- Added support to detect and stop providers spinning on intitial network detection ([#4015](https://github.com/ethers-io/ethers.js/issues/4015); [f37a52d](https://github.com/ethers-io/ethers.js/commit/f37a52da28ac130b7f4de52901618320994ea87a)).
ethers/v6.4.2 (2023-06-05 22:41)
--------------------------------
- Bump ens-normalize version ([#4071](https://github.com/ethers-io/ethers.js/issues/4071), [#4077](https://github.com/ethers-io/ethers.js/issues/4077), [#4080](https://github.com/ethers-io/ethers.js/issues/4080), [#4102](https://github.com/ethers-io/ethers.js/issues/4102); [c135784](https://github.com/ethers-io/ethers.js/commit/c1357847dcdec93d72f28d890f9271d0289ccefd)).
- Fix for networks with polling with non-consistent block and filter events ([#4119](https://github.com/ethers-io/ethers.js/issues/4119); [9b0e992](https://github.com/ethers-io/ethers.js/commit/9b0e9920c09577296ec0e2abb3acc3f3299d96c7)).
ethers/v6.4.1 (2023-06-01 17:52)
--------------------------------
- Fixed AbstractProvider lookupAddress bug ([#4086](https://github.com/ethers-io/ethers.js/issues/4086); [15ed2f5](https://github.com/ethers-io/ethers.js/commit/15ed2f5b32084527961332481c9442a313036a01)).
- Fix FixedNumber comparison bug ([#4112](https://github.com/ethers-io/ethers.js/issues/4112); [d8e9586](https://github.com/ethers-io/ethers.js/commit/d8e9586044e888e424b5ead0f6e01f88140dba8a)).
ethers/v6.4.0 (2023-05-18 17:28)
--------------------------------
- Coerce value into BigInt when checking for value ([83d7f43](https://github.com/ethers-io/ethers.js/commit/83d7f43b9ca4b9868a3952510e56b41ea8610baa)).
- Better errors when junk passed as Contract target ([#3947](https://github.com/ethers-io/ethers.js/issues/3947), [#4053](https://github.com/ethers-io/ethers.js/issues/4053); [219b16d](https://github.com/ethers-io/ethers.js/commit/219b16dc284b0c6a532c8c49e824d8234f94222b)).
- More robust message checking in socket providers ([#4051](https://github.com/ethers-io/ethers.js/issues/4051); [f58990b](https://github.com/ethers-io/ethers.js/commit/f58990b80cfd83579014339315e58663c0aa6ae3)).
- More robust defaultProvider start-up when a backend fails on bootstrap ([#3979](https://github.com/ethers-io/ethers.js/issues/3979); [984f6fa](https://github.com/ethers-io/ethers.js/commit/984f6fa155fca08ebec2353c75ee0a0b974e8568)).
- Fix Result.map when Array contains zero elements ([#4036](https://github.com/ethers-io/ethers.js/issues/4036), [#4048](https://github.com/ethers-io/ethers.js/issues/4048); [2e5935b](https://github.com/ethers-io/ethers.js/commit/2e5935b91cff462165a054b33c8b8413f51e3f39)).
- Fixed error handling for contracts with receive and non-payable fallback ([6db7458](https://github.com/ethers-io/ethers.js/commit/6db7458cf0a09e8e8a2abb712239972ab81dc9df)).
- Remove superfluous logging in defaultProvider ([f87f6ef](https://github.com/ethers-io/ethers.js/commit/f87f6ef9a01ca399664f9fe106b0a677dba0c8e8)).
- Removed superfluous logging ([1bc8b55](https://github.com/ethers-io/ethers.js/commit/1bc8b55d502a95c4ae58352bdcfce9e5f9ea72d3)).
- Fix receipt gas price when effectiveGasPrice is 0 on testnets ([#4014](https://github.com/ethers-io/ethers.js/issues/4014); [2b0fe61](https://github.com/ethers-io/ethers.js/commit/2b0fe611335432aee334d777a64d8c7827881618)).
- Added error event to provider ([#3970](https://github.com/ethers-io/ethers.js/issues/3970), [#3982](https://github.com/ethers-io/ethers.js/issues/3982); [af0291c](https://github.com/ethers-io/ethers.js/commit/af0291c01639674658f5049343da88a84da763a1)).
- Removed superfluous parameters for internal transaction functions ([e848978](https://github.com/ethers-io/ethers.js/commit/e8489787585c2e69a23f6cdec6901f22b096aebe)).
- More aggresive tree-shaking ([076edad](https://github.com/ethers-io/ethers.js/commit/076edad81ef62474f48f2b4c8af0edc6e4fd64f2)).
- More flexible static network checking ([#3834](https://github.com/ethers-io/ethers.js/issues/3834); [7c0465c](https://github.com/ethers-io/ethers.js/commit/7c0465c5fb834eba18d4e5535072685bdc1029f0)).
- Support transitive dependants that use non-node16 moduleResolution ([#3920](https://github.com/ethers-io/ethers.js/issues/3920); [df685b1](https://github.com/ethers-io/ethers.js/commit/df685b1bd9ad346ee7863beb6c3ca3f4e94932a2)).
- Populate any missing log.removed with false ([#3959](https://github.com/ethers-io/ethers.js/issues/3959); [4e478e6](https://github.com/ethers-io/ethers.js/commit/4e478e625d5648f2172631eef5fda5776ee776b0)).
ethers/v6.3.0 (2023-04-06 04:35)
--------------------------------
- Added support for legacy ABI JSON fragments ([#3932](https://github.com/ethers-io/ethers.js/issues/3932); [8c5973e](https://github.com/ethers-io/ethers.js/commit/8c5973e3a9b8d4d4ed80bdf209d8a0b6cc6b8d6d)).
- Add _in_ operator support for contract and contract.filters ([#3901](https://github.com/ethers-io/ethers.js/issues/3901); [c58ab3a](https://github.com/ethers-io/ethers.js/commit/c58ab3a97687e15a3ffe30b038089c5f4b570bb9)).
- Fixed TypedData unsigned value range ([#3873](https://github.com/ethers-io/ethers.js/issues/3873); [a851b24](https://github.com/ethers-io/ethers.js/commit/a851b24d0af009ecf277766d2a5f81f9b3e7f9f8)).
- Added missing export for getIndexedAccountPath ([#3875](https://github.com/ethers-io/ethers.js/issues/3875); [356ff2b](https://github.com/ethers-io/ethers.js/commit/356ff2becb4f4d3622b281d3825770af5caf71ca)).
- Fixed TypedData payloads for JSON-restricted chainId field ([#3836](https://github.com/ethers-io/ethers.js/issues/3836); [50b74b8](https://github.com/ethers-io/ethers.js/commit/50b74b8806ef2064f2764b09f89c7ac75fda3a3c)).
ethers/v6.2.3 (2023-03-27 21:22)
--------------------------------
- Fixed events when emitted in WebSocketProvider ([#3767](https://github.com/ethers-io/ethers.js/issues/3767), [#3922](https://github.com/ethers-io/ethers.js/issues/3922); [ffaafc0](https://github.com/ethers-io/ethers.js/commit/ffaafc0ce1cf40d1d76d8d814c9c445057bf6989)).
ethers/v6.2.2 (2023-03-24 00:49)
--------------------------------
- Fixed FetchRequest when using credentials ([#3897](https://github.com/ethers-io/ethers.js/issues/3897); [88e8124](https://github.com/ethers-io/ethers.js/commit/88e8124c37d377628f9b8abdf140fc07ad06259f)).
ethers/v6.2.1 (2023-03-23 17:33)
--------------------------------
- Stall block polling bootstrap when the network is down ([#3924](https://github.com/ethers-io/ethers.js/issues/3924); [603d474](https://github.com/ethers-io/ethers.js/commit/603d47496e2b667c15b72f315261d6e299381848)).
ethers/v6.2.0 (2023-03-20 15:53)
--------------------------------
- Added extra details in the error info field for RPC errors ([30ffa78](https://github.com/ethers-io/ethers.js/commit/30ffa78d1441fa033677fa09237fc135a314f373)).
- Remove Ankr as a deafult for now as the provided API key is failing ([6e01e54](https://github.com/ethers-io/ethers.js/commit/6e01e5448f4a3e2d30288d4c8447db295c3a2e7a)).
- Fixed deferred filters after unsafe-eval changes ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [2e3802a](https://github.com/ethers-io/ethers.js/commit/2e3802a83b8ad2f5a6269d79fbd1c83c9f2d1047)).
- Remove use of Function sub-class to address unsafe-eval issues ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [7d3af51](https://github.com/ethers-io/ethers.js/commit/7d3af512c75b4c24027ec2daef1e9f4c1064194a)).
- Added verifyTypedData utility (reported on Farcaster) ([f06a445](https://github.com/ethers-io/ethers.js/commit/f06a445247f3b294f9fc805cc8fe0752accb8edc)).
- Removed stray logging in IpcProvider ([#3908](https://github.com/ethers-io/ethers.js/issues/3908), [#3909](https://github.com/ethers-io/ethers.js/issues/3909); [e11d4c1](https://github.com/ethers-io/ethers.js/commit/e11d4c1c20cc5b6fd5803cf9636c4f5bc082dab7)).
- Fixed legacy serialization for implicit chainId transactions ([#3898](https://github.com/ethers-io/ethers.js/issues/3898), [#3899](https://github.com/ethers-io/ethers.js/issues/3899); [fcf6c8f](https://github.com/ethers-io/ethers.js/commit/fcf6c8fcee95ec412aaafba8ec84d5049b077a4e)).
- Fix Webpack issue (reported on discord) ([3ad4273](https://github.com/ethers-io/ethers.js/commit/3ad4273b8b714bff344ccbfb1eb71ed8a8b7cfa4)).
- Fix some bundlers which cannot handle recursive pkg.exports ([#3848](https://github.com/ethers-io/ethers.js/issues/3848); [6315e78](https://github.com/ethers-io/ethers.js/commit/6315e78ea32147653b72ca06f6800f3e2df6ffbf)).
- Fixed typo in signature.s error ([#3891](https://github.com/ethers-io/ethers.js/issues/3891); [47ef3eb](https://github.com/ethers-io/ethers.js/commit/47ef3ebde37bfa0c015c258c3d8a6800d751e147)).
- Fixed stray unreachable code ([#3890](https://github.com/ethers-io/ethers.js/issues/3890); [c220fe2](https://github.com/ethers-io/ethers.js/commit/c220fe2ea747ccc80cd3c4020e0278e3daf3c4fc)).
- Move all wrapping to proper _wrap functions ([#3818](https://github.com/ethers-io/ethers.js/issues/3818); [02a0aad](https://github.com/ethers-io/ethers.js/commit/02a0aad61212c35e8d2723a8ae589989b97dae3e)).
ethers/v6.1.0 (2023-03-07 02:10)
--------------------------------
- Fixed ethers imported in web workers ([#3856](https://github.com/ethers-io/ethers.js/issues/3856); [5f2678f](https://github.com/ethers-io/ethers.js/commit/5f2678fb059d643638b9cc1dc59cbfc61ce7a7b8)).
- Added Sepolia support ([#3863](https://github.com/ethers-io/ethers.js/issues/3863); [abeaa74](https://github.com/ethers-io/ethers.js/commit/abeaa74da04fbe25e837a2ffa7d1e9c1257a5da5)).
- Added missing exports ([#3734](https://github.com/ethers-io/ethers.js/issues/3734); [06aa303](https://github.com/ethers-io/ethers.js/commit/06aa30363f88144db672376d39012d7fe3f86c33)).
- Allow null values for TypedData domain ([#3623](https://github.com/ethers-io/ethers.js/issues/3623); [a32af3a](https://github.com/ethers-io/ethers.js/commit/a32af3adc104c4b07a45097a4a3725a4ce9e0be6)).
- Added listAccounts to JsonRpcProvider ([#3778](https://github.com/ethers-io/ethers.js/issues/3778); [287d94f](https://github.com/ethers-io/ethers.js/commit/287d94fc454d03f1b3086ea98745131cdf40129a)).
- Allow BigInt for blockTag ([#3780](https://github.com/ethers-io/ethers.js/issues/3780); [fe1f04c](https://github.com/ethers-io/ethers.js/commit/fe1f04c6e5fb4254a100f492d7dcbdc3cf19a446)).
- Fixed typo in error messages ([#3822](https://github.com/ethers-io/ethers.js/issues/3822), [#3824](https://github.com/ethers-io/ethers.js/issues/3824); [f1a810d](https://github.com/ethers-io/ethers.js/commit/f1a810dcb56df54b1e1567f2a59c73500619472f)).
- Re-adding definition files to require exports ([#3703](https://github.com/ethers-io/ethers.js/issues/3703); [76fab92](https://github.com/ethers-io/ethers.js/commit/76fab923da33e71e6bb751bb0b5e3ba3faa27ab2)).
ethers/v6.0.8 (2023-02-23 06:30)
--------------------------------
- Fix matic-mumbai network and include aliases to legacy names ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [20bbd12](https://github.com/ethers-io/ethers.js/commit/20bbd1281911d31b360f6f5032251c9257943541)).
- Fixed getSigner bug ([#3821](https://github.com/ethers-io/ethers.js/issues/3821); [388edf6](https://github.com/ethers-io/ethers.js/commit/388edf6abc168f89f1ca609e9e5b025dc9205add)).
ethers/v6.0.7 (2023-02-23 01:41)
--------------------------------
- Fixed getContentHash ([#3819](https://github.com/ethers-io/ethers.js/issues/3819); [b993f7c](https://github.com/ethers-io/ethers.js/commit/b993f7c3b6c0e135c460c8b8dc5943215628231a)).
ethers/v6.0.6 (2023-02-22 21:53)
--------------------------------
- Added chain parameters for Arbitrum and Optimism ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [77a7323](https://github.com/ethers-io/ethers.js/commit/77a7323119923e596f4def4f1bc90beae5447320)).
- Fix NonceManager race condition ([#3812](https://github.com/ethers-io/ethers.js/issues/3812), [#3813](https://github.com/ethers-io/ethers.js/issues/3813); [5a3c10a](https://github.com/ethers-io/ethers.js/commit/5a3c10a29c047609a50828adb620d88aa8cf0014)).
- Add UMD output to dist builds ([#3814](https://github.com/ethers-io/ethers.js/issues/3814); [f9eed4c](https://github.com/ethers-io/ethers.js/commit/f9eed4cdb190b06dd4ddaa2382c1de42e8e98de6)).
ethers/v6.0.5 (2023-02-18 22:36)
--------------------------------

View File

@@ -21,25 +21,30 @@ in [TypeScript](https://www.typescriptlang.org).
- Meta-classes create JavaScript objects from any contract ABI, including **ABIv2** and **Human-Readable ABI**
- Connect to Ethereum nodes over [JSON-RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC), [INFURA](https://infura.io), [Etherscan](https://etherscan.io), [Alchemy](https://alchemyapi.io), [Ankr](https://ankr.com) or [MetaMask](https://metamask.io)
- **ENS names** are first-class citizens; they can be used anywhere an Ethereum addresses can be used
- **Tiny** (~120kb compressed; 400kb uncompressed)
- **Small** (~144kb compressed; 460kb uncompressed)
- **Tree-shaking** focused; include only what you need during bundling
- **Complete** functionality for all your Ethereum desires
- Extensive [documentation](https://docs.ethers.org/v6/)
- Large collection of **test cases** which are maintained and added to
- Fully written in **TypeScript**, with strict types for security
- Fully written in **TypeScript**, with strict types for security and safety
- **MIT License** (including ALL dependencies); completely open source to do with as you please
Keep Updated
------------
For the latest news and advisories, please follow the
[@ethersproject](https://twitter.com/ethersproject) on Twitter (low-traffic,
non-marketing, important information only) as well as watch this GitHub project.
For advisories and important notices, follow [@ethersproject](https://twitter.com/ethersproject)
on Twitter (low-traffic, non-marketing, important information only) as well as watch this GitHub project.
For more general news, discussions, and feedback, follow or DM me,
[@ricmoo](https://twitter.com/ricmoo) on Twitter or on the
[Ethers Discord](https://discord.gg/qYtSscGYYc).
For the latest changes, see the
[CHANGELOG](https://github.com/ethers-io/ethers.js/blob/main/CHANGELOG.md).
**Summaries**
- [September 2022](https://blog.ricmoo.com/highlights-ethers-js-september-2022-d7bda0fc37ed)
@@ -121,7 +126,8 @@ The `ethers` package only includes the most common and most core
functionality to interact with Ethereum. There are many other
packages designed to further enhance the functionality and experience.
- Hardware Wallets (@TODO)
- Hardware Wallets (coming soon)
- Account Abstraction (coming soon)
License

4242
dist/ethers.js vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

23671
dist/ethers.umd.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/ethers.umd.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/ethers.umd.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -41,6 +41,8 @@ const assert$1 = {
};
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
// The import here is via the package name. This is to ensure
// that exports mapping/resolution does fall into place.
const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;
// There is almost no big endian hardware, but js typed arrays uses platform specific endianness.
@@ -149,7 +151,7 @@ const u64 = {
/**
* The current version of Ethers.
*/
const version = "6.0.5";
const version = "6.5.1";
/**
* Property helper functions.
@@ -194,7 +196,11 @@ function defineProperties(target, values, types) {
}
/**
* About Errors.
* All errors in ethers include properties to ensure they are both
* human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).
*
* The [[isError]] function can be used to check the error ``code`` and
* provide a type guard for the properties present on that error interface.
*
* @_section: api/utils/errors:Errors [about-errors]
*/
@@ -440,7 +446,7 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
* and accepts non-canonical (overlong) codepoints
*
* **``"replace"``** - replace any illegal UTF-8 sequence with the
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
* UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts
* non-canonical (overlong) codepoints
*
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
@@ -846,7 +852,7 @@ Object.freeze(keccak256);
/**
* A simple hashing function which operates on UTF-8 strings to
* compute an 32-byte irentifier.
* compute an 32-byte identifier.
*
* This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes
* the [[keccak256]].
@@ -955,6 +961,7 @@ class Wordlist {
}
// Use the encode-latin.js script to create the necessary
// data files to be consumed by this class
/**
* An OWL format Wordlist is an encoding method that exploits
* the general locality of alphabetically sorted words to
@@ -965,7 +972,7 @@ class Wordlist {
* based on ASCII-7 small.
*
* If necessary, there are tools within the ``generation/`` folder
* to create these necessary data.
* to create the necessary data.
*/
class WordlistOwl extends Wordlist {
#data;
@@ -980,7 +987,13 @@ class WordlistOwl extends Wordlist {
this.#checksum = checksum;
this.#words = null;
}
/**
* The OWL-encoded data.
*/
get _data() { return this.#data; }
/**
* Decode all the words for the wordlist.
*/
_decodeWords() {
return decodeOwl(this.#data);
}
@@ -1106,15 +1119,25 @@ function decodeOwlA(data, accents) {
* based on latin-1 small.
*
* If necessary, there are tools within the ``generation/`` folder
* to create these necessary data.
* to create the necessary data.
*/
class WordlistOwlA extends WordlistOwl {
#accent;
/**
* Creates a new Wordlist for %%locale%% using the OWLA %%data%%
* and %%accent%% data and validated against the %%checksum%%.
*/
constructor(locale, data, accent, checksum) {
super(locale, data, checksum);
this.#accent = accent;
}
/**
* The OWLA-encoded accent data.
*/
get _accent() { return this.#accent; }
/**
* Decode all the words for the wordlist.
*/
_decodeWords() {
return decodeOwlA(this._data, this._accent);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,26 +1,97 @@
_section: ABI
_section: Application Binary Interfaces @<docs-abi>
Explain about ABI here, what it does and does not do
When interacting with any application, whether it is on Ethereum,
over the internet or within a compiled application on a computer
all information is stored and sent as binary data which is just a
sequence of bytes.
- encodes arbitrary (but defined) data structures to raw bytes
So every application must agree on how to encode and decode their
information as a sequence of bytes.
_subsection: Call
An **Application Binary Interface** (ABI) provides a way to describe
the encoding and decoding process, in a generic way so that a variety
of types and structures of types can be defined.
About encoding
For example, a string is often encoded as a UTF-8 sequence of bytes,
which uses specific bits within sub-sequences to indicate emoji and
other special characters. Every implementation of UTF-8 must understand
and operate under the same rules so that strings work universally. In
this way, UTF-8 standard is itself an ABI.
_heading: selector or signature hash (sighash)
When interacting with Ethereum, a contract received a sequence of bytes
as input (provided by sending a transaction or through a call) and
returns a result as a sequence of bytes. So, each Contract has its own
ABI that helps specify how to encode the input and how to decode the output.
_heading: Results
It is up to the contract developer to make this ABI available. Many
Contracts implement a standard (such as ERC-20), in which case the
ABI for that standard can be used. Many developers choose to verify their
source code on Etherscan, in which case Etherscan computes the ABI and
provides it through their website (which can be fetched using the ``getContract``
method). Otherwise, beyond reverse engineering the Contract there is
not a meaningful way to extract the contract ABI.
_subsection: Events
_subsection: Call Data Representation
When calling a Contract on Ethereum, the input data must be encoded
according to the ABI.
The first 4 bytes of the data are the **method selector**, which is
the keccak256 hash of the normalized method signature.
Then the method parameters are encoded and concatenated to the selector.
All encoded data is made up of components padded to 32 bytes, so the length
of input data will always be congruent to ``4 mod 32``.
The result of a successful call will be encoded values, whose components
are padded to 32 bytes each as well, so the length of a result will always
be congruent to ``0 mod 32``, on success.
The result of a reverted call will contain the **error selector** as the
first 4 bytes, which is the keccak256 of the normalized error signature,
followed by the encoded values, whose components are padded to 32 bytes
each, so the length of a revert will be congruent to ``4 mod 32``.
The one exception to all this is that ``revert(false)`` will return a
result or ``0x``.
_subsection: Event Data Representation
When an Event is emitted from a contract, there are two places data is
logged in a Log: the **topics** and the **data**.
An additonal fee is paid for each **topic**, but this affords a topic
to be indexed in a bloom filter within the block, which allows efficient
filtering.
The **topic hash** is always the first topic in a Log, which is the
keccak256 of the normalized event signature. This allows a specific
event to be efficiently filtered, finding the matching events in a block.
Each additional **indexed** parameter (i.e. parameters marked with
``indexed`` in the signautre) are placed in the topics as well, but may be
filtered to find matching values.
All non-indexed parameters are encoded and placed in the **data**. This
is cheaper and more compact, but does not allow filtering on these values.
For example, the event ``Transfer(address indexed from, address indexed to, uint value)``
would require 3 topics, which are the topic hash, the ``from`` address
and the ``to`` address and the data would contain 32 bytes, which is
the padded big-endian representation of ``value``. This allows for
efficient filtering by the event (i.e. ``Transfer``) as well as the ``from``
address and ``to`` address.
_subsection: Deployment
About initcode
When deploying a transaction, the data provided is treated as **initcode**,
which executes the data as normal EVM bytecode, which returns a sequence
of bytes, but instead of that sequence of bytes being treated as data that
result is instead the bytecode to install as the bytecode of the contract.
Another paragraph [[link-bip-39]].
_heading: Foo?
Bar?
The bytecode produced by Solidity is designed to have all constructor
parameters encoded normally and concatenated to the bytecode and provided
as the ``data`` to a transaction with no ``to`` address.

View File

@@ -1,7 +1,8 @@
_section: Ethereum Basics @priority<99>
_section: Ethereum Basics @<docs-basics> @priority<99>
Prelude here...
This section aims to cover some of the basics for those interested
in a deeper understanding of the inner-workings of Ethereum.
_subsection: About stuff?
_subsection: Topics
Some info
- [Application Binary Interface](docs-abi)

View File

@@ -21,7 +21,7 @@ more fine-grained importing.
Generally this documentation will presume all exports from ethers
have been imported in the code examples, but you may import the
necessary objects any way you wish.
necessary objects in any way you wish.
_code: importing in Node.js @lang<script>
// Import everything
@@ -70,7 +70,7 @@ permission from the user and receiving authorization.
_heading: Transaction
To make any state changes to the blockchain, a transaction is required,
which requires a fee be paid, where the fee covers the associated costs
which requires a fee to be paid, where the fee covers the associated costs
with executing the transaction (such as reading the disk and performing
maths) and storing the updated information.
@@ -180,7 +180,7 @@ machine-readable purposes and maths are often very large and not
terribly human-readable.
For example, imagine dealing with dollars and cents; you would show
values like ``"$2.56"``. In the blockchain world we would keep all
values like ``"$2.56"``. In the blockchain world, we would keep all
values as cents, so that would be ``256`` cents, internally.
So, when accepting data that a user types, it must be converted from
@@ -295,9 +295,9 @@ human-readable ABI, which is just the Solidity signature.
_code: simplified ERC-20 ABI @lang<script>
abi = [
"function decimals() returns (string)",
"function symbol() returns (string)",
"function balanceOf(address addr) returns (uint)"
"function decimals() view returns (string)",
"function symbol() view returns (string)",
"function balanceOf(address addr) view returns (uint)"
]
// Create a contract
@@ -410,7 +410,7 @@ _code: listen for ERC-20 events @lang<script>
// The `event.log` has the entire EventLog
// Optionally, convenience method to stop listening
// Optionally, stop listening
event.removeListener();
});

View File

@@ -1,6 +1,7 @@
link-js-array [link-js-array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
link-js-bigint [link-js-bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
link-js-date [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)
link-js-fetch [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
link-js-normalize [String.normalize](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)
link-js-maxsafe [link-js-maxsafe](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#Description)
link-js-proxy [link-js-proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)

View File

@@ -12,6 +12,7 @@ link-infura [INFURA](https://infura.io)
link-javascriptcore [JavaScriptCore](https://developer.apple.com/documentation/javascriptcore?language=objc)
link-ledger [Ledger](https://www.ledger.com)
link-metamask [MetaMask](https://metamask.io/)
link-node [Node.js](https://nodejs.org/)
link-otto [Otto](https://github.com/robertkrimen/otto)
link-parity [Parity](https://www.parity.io)
link-pocket [Pocket Network](https://pokt.network)
@@ -24,7 +25,7 @@ link-tally [Tally](https://tallyho.org)
# Project-specific
link-alchemy-signup [Alchemy Signup](https://dashboard.alchemyapi.io/signup?referral=55a35117-028e-4b7c-9e47-e275ad0acc6d)
link-ankr-public [link-ankr-public](https://www.ankr.com/protocol/public/)
link-ankr-premium [link-ankr-premium](https://www.ankr.com/protocol/plan/)
link-ankr-signup [link-ankr-premium](https://www.ankr.com/protocol/plan/)
link-etherscan-signup [Etherscan Signup](https://etherscan.io/apis)
link-etherscan-ratelimit [link-etherscan-ratelimit](https://info.etherscan.com/api-return-errors/)
link-infura-signup [INFURA Signup](https://infura.io/register)

View File

@@ -26,6 +26,7 @@ link-eip-1014 [EIP-1014](https://eips.ethereum.org/EIPS/eip-1014)
link-eip-1193 [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193)
link-eip-1559 [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)
link-eip-1577 [EIP-1577](https://eips.ethereum.org/EIPS/eip-1577)
link-eip-2070 [EIP-2930](https://eips.ethereum.org/EIPS/eip-2070)
link-eip-2098 [EIP-2098](https://eips.ethereum.org/EIPS/eip-2098)
link-eip-2304 [EIP-2304](https://eips.ethereum.org/EIPS/eip-2304)
link-eip-2718 [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718)
@@ -41,6 +42,8 @@ link-mit [MIT License](https://en.m.wikipedia.org/wiki/MIT_License)
link-namehash [namehash](https://docs.ens.domains/contract-api-reference/name-processing#hashing-names)
link-rlp [Recursive-Length Prefix](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/)
link-pbkdf2 [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2)
link-solc-abi [ABI Specification](https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#formal-specification-of-the-encoding)
link-solc-jsonabi [ABI JSON Specification](https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#json)
link-solc-errors [Solidity Custom Errors](https://docs.soliditylang.org/en/v0.8.4/abi-spec.html#errors)
link-solc-events [Solidity Events](https://docs.soliditylang.org/en/v0.8.4/abi-spec.html#events)
link-solc-output [solc standard output](https://solidity.readthedocs.io/en/v0.6.0/using-the-compiler.html#output-description)

View File

@@ -136,7 +136,7 @@ _code: other operations in v5 @lang<script>
contract.functions.foo(addr)
// Forces using call
contract.staticCall.foo(addr)
contract.callStatic.foo(addr)
// Estimate the gas
contract.estimateGas.foo(addr)
@@ -214,6 +214,16 @@ _code: wrapping EIP-1193 providers @lang<script>
// v6:
provider = new ethers.BrowserProvider(window.ethereum)
Also, the method for broadcasting transactions to the network has
changed:
_code: broadcasting transactions @lang<script>
// v5
provider.sendTransaction(signedTx)
// v6
provider.broadcastTransaction(signedTx)
_subsection: Signatures @<migrate-signatures>
@@ -236,7 +246,7 @@ The transaction helpers present in v5 were all wrapped into a
[[Transaction]] class, which can handle any supported transaction
format to be further processed
_code: parasing transactions @lang<script>
_code: parsing transactions @lang<script>
// v5
tx = parseTransaction(txBytes)
@@ -295,6 +305,37 @@ _code: defaultAbiCoder @lang<script>
// instance is returned.
coder = AbiCoder.defaultAbiCoder()
_code: fetching content @lang<script>
// v5, with a body and no weird things
data = await ethers.utils.fetchJson(url, json, processFunc)
// v5 with Connection overrides
req = {
url, user: "username", password: "password"
// etc. properties have FetchRequest equivalents
};
data = await ethers.utils.detchJson(req, json, processFunc)
// v6
req = new ethers.FetchRequest(url)
// set a body; optional
req.body = json
// set credentials; optional
req.setCredentials("username", "password")
// set a processFunc; optional
req.processFunc = processFunc
// send the request!
resp = await req.send()
// Get the response body; depending on desired format
data = resp.body // Uint8Array
data = resp.bodyText // Utf8String; throws if invalid
data = resp.bodyJson // Object; throws if invalid
_code: hex conversion @lang<script>
// v5
hex = ethers.utils.hexValue(value)

View File

@@ -0,0 +1,85 @@
export type TestBlockchainNetwork = "mainnet" | "goerli";
export interface TestBlockchainAddress {
test: string;
address: string;
code?: string;
nonce?: number;
name?: string;
balance?: bigint;
storage?: Record<string, string>;
}
export interface TestBlockchainBlock {
test: string;
hash: string;
parentHash: string;
number: number;
timestamp: number;
nonce: string;
difficulty: bigint;
gasLimit: bigint;
gasUsed: bigint;
miner: string;
extraData: string;
transactions: Array<string>;
baseFeePerGas?: bigint;
}
export interface TestBlockchainTransaction {
test: string;
hash: string;
blockHash: string;
blockNumber: number;
type: number;
from: string;
gasPrice: bigint;
gasLimit: bigint;
to: string;
value: bigint;
nonce: number;
data: string;
signature: {
r: string;
s: string;
yParity: 0 | 1;
v: number;
networkV: null | bigint;
};
creates: null | string;
chainId: bigint;
accessList?: Array<Record<string, Array<string>>>;
maxPriorityFeePerGas?: bigint;
maxFeePerGas?: bigint;
}
export interface TestBlockchainReceipt {
test: string;
blockHash: string;
blockNumber: number;
type: number;
contractAddress: null | string;
cumulativeGasUsed: bigint;
from: string;
gasUsed: bigint;
gasPrice: bigint;
logs: Array<{
address: string;
blockHash: string;
blockNumber: number;
data: string;
index: number;
topics: Array<string>;
transactionHash: string;
transactionIndex: number;
}>;
logsBloom: string;
root: null | string;
status: null | number;
to: string;
hash: string;
index: number;
}
export declare const testAddress: Record<TestBlockchainNetwork, Array<TestBlockchainAddress>>;
export declare const testBlock: Record<TestBlockchainNetwork, Array<TestBlockchainBlock>>;
export declare const testTransaction: Record<TestBlockchainNetwork, Array<TestBlockchainTransaction>>;
export declare const testReceipt: Record<TestBlockchainNetwork, Array<TestBlockchainReceipt>>;
export declare const networkNames: Array<TestBlockchainNetwork>;
export declare function networkFeatureAtBlock(feature: string, block: number): boolean;
//# sourceMappingURL=blockchain-data.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,SAAS,GAAG,QAAQ,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE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AmB,CAAC,CA8D/E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAwD3F,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAsFnF,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAErD,CAAC;AACF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ7E"}

View File

@@ -0,0 +1,8 @@
import type { AbstractProvider } from "../index.js";
export declare function setupProviders(): void;
export declare const providerNames: readonly string[];
export declare function getProviderNetworks(provider: string): Array<string>;
export declare function getProvider(provider: string, network: string): null | AbstractProvider;
export declare function checkProvider(provider: string, network: string): boolean;
export declare function connect(network: string): AbstractProvider;
//# sourceMappingURL=create-provider.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2FpD,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED,eAAO,MAAM,aAAa,mBAAuD,CAAC;AAQlF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAInE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,CAgBtF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAIzD"}

View File

@@ -13,13 +13,15 @@ const ProviderCreators = [
return new index_js_1.AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM");
}
},
/*
{
name: "AnkrProvider",
networks: ethNetworks.concat(["matic", "arbitrum"]),
create: function (network) {
return new index_js_1.AnkrProvider(network);
networks: ethNetworks.concat([ "matic", "arbitrum" ]),
create: function(network: string) {
return new AnkrProvider(network);
}
},
*/
/*
{
name: "CloudflareProvider",
@@ -50,13 +52,15 @@ const ProviderCreators = [
return index_js_1.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
}
},
{
name: "PocketProvider",
networks: ethNetworks,
create: function (network) {
return new index_js_1.PocketProvider(network);
}
},
/*
{
name: "PocketProvider",
networks: ethNetworks,
create: function(network: string) {
return new PocketProvider(network);
}
},
*/
{
name: "QuickNodeProvider",
networks: ethNetworks,

View File

@@ -1 +1 @@
{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":";;;AAAA,0CAWqB;AAQpB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAE,CAAC;AACvD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAC7C;QACI,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAS,OAAe;YAC5B,OAAO,IAAI,0BAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QAC5E,CAAC;KACJ;IACD;QACI,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAE,OAAO,EAAE,UAAU,CAAE,CAAC;QACrD,MAAM,EAAE,UAAS,OAAe;YAC5B,OAAO,IAAI,uBAAY,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KACJ;IACD;;;;;;;;MAQE;IACF;QACI,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAS,OAAe;YAC5B,OAA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QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzC,IAAI,QAAQ,EAAE;gBACV,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC/C;YACD,OAAO,QAAQ,CAAC;SACnB;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,IAAI,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;YAAE,MAAM,KAAK,CAAC;SAAE;KAC5D;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAhBD,kCAgBC;AAED,SAAgB,aAAa,CAAC,QAAgB,EAAE,OAAe;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AAC7B,CAAC;AAHD,sCAGC;AAED,SAAgB,OAAO,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAyB,OAAQ,EAAE,CAAC,CAAC;KAAE;IAC/E,OAAO,QAAQ,CAAC;AACpB,CAAC;AAJD,0BAIC"}

21
lib.commonjs/_tests/index.d.ts vendored Normal file
View File

@@ -0,0 +1,21 @@
import "./test-abi.js";
import "./test-address.js";
import "./test-contract.js";
import "./test-crypto.js";
import "./test-hash.js";
import "./test-hash-typeddata.js";
import "./test-providers-avatar.js";
import "./test-providers-ccip.js";
import "./test-providers-wildcard.js";
import "./test-rlp.js";
import "./test-transaction.js";
import "./test-utils-maths.js";
import "./test-utils-misc.js";
import "./test-utils-units.js";
import "./test-utils-utf8.js";
import "./test-wallet.js";
import "./test-wallet-hd.js";
import "./test-wallet-json.js";
import "./test-wallet-mnemonic.js";
import "./test-wordlists.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,8BAA8B,CAAC;AACtC,OAAO,eAAe,CAAA;AACtB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC"}

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("./test-abi.js");
require("./test-address.js");
require("./test-contract.js");
require("./test-crypto.js");
require("./test-hash.js");
require("./test-hash-typeddata.js");
require("./test-providers-avatar.js");
require("./test-providers-ccip.js");
require("./test-providers-wildcard.js");
require("./test-rlp.js");
require("./test-transaction.js");
require("./test-utils-maths.js");
require("./test-utils-misc.js");
require("./test-utils-units.js");
require("./test-utils-utf8.js");
require("./test-wallet.js");
require("./test-wallet-hd.js");
require("./test-wallet-json.js");
require("./test-wallet-mnemonic.js");
require("./test-wordlists.js");
////import "./test-contract-integ.js";
////import "./test-providers-data.js";
//import "./test-providers-errors.js";
////import "./test-providers-extra.js";
////import "./test-providers-send.js";
/*
test-crypto-algoswap.ts
*/
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/_tests/index.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,6BAA0B;AAC1B,8BAA4B;AAC5B,4BAA0B;AAC1B,0BAAwB;AACxB,oCAAkC;AAClC,sCAAoC;AACpC,oCAAkC;AAClC,wCAAsC;AACtC,yBAAsB;AACtB,iCAA+B;AAC/B,iCAA+B;AAC/B,gCAA8B;AAC9B,iCAA+B;AAC/B,gCAA8B;AAC9B,4BAA0B;AAC1B,+BAA6B;AAC7B,iCAA+B;AAC/B,qCAAmC;AACnC,+BAA6B;AAE7B,sCAAsC;AAEtC,sCAAsC;AACtC,sCAAsC;AACtC,uCAAuC;AACvC,sCAAsC;AAEtC;;EAEE"}

2
lib.commonjs/_tests/test-abi.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-abi.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-abi.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-abi.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const utils_js_1 = require("./utils.js");
const index_js_1 = require("../index.js");
function equal(actual, expected) {
@@ -120,4 +118,138 @@ describe("Test Interface", function () {
assert_1.default.equal(log.args[2], BigInt(234));
});
});
describe("Tests Legacy ABI formats", function () {
// See: #3932
const iface = new index_js_1.Interface([
{
name: "implicitView",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"constant": true,
"payable": false,
"type": "function"
},
{
name: "implicitSendNonpay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"constant": false,
"payable": false,
"type": "function"
},
{
name: "implicitSendPay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"constant": false,
"payable": true,
"type": "function"
},
{
name: "implicitSendImplicitPay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"constant": false,
"type": "function"
},
{
name: "implicitSendExplicitPay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
payable: true,
type: "function"
},
{
name: "implicitSendExplicitNonpay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
payable: false,
type: "function"
},
{
name: "implicitAll",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"type": "function"
},
{
name: "explicitView",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"stateMutability": "view",
"constant": true,
"payable": false,
"type": "function"
},
{
name: "explicitPure",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"stateMutability": "pure",
"constant": true,
"payable": false,
"type": "function"
},
{
name: "explicitPay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"stateMutability": "payable",
"constant": true,
"payable": true,
"type": "function"
},
{
name: "explicitNonpay",
outputs: [],
inputs: [
{ type: "int128", name: "arg0" }
],
"stateMutability": "nonpayable",
"constant": true,
"payable": false,
"type": "function"
},
]);
function test(name, isConst, payable, stateMutability) {
it(`tests ABI configuration: ${name}`, function () {
const f = iface.getFunction(name);
assert_1.default.ok(!!f, `missing ${name}`);
assert_1.default.equal(f.constant, isConst, `${name}.constant`);
assert_1.default.equal(f.stateMutability, stateMutability, `${name}.stateMutability`);
assert_1.default.equal(f.payable, payable, `${name}.payable`);
});
}
test("explicitView", true, false, "view");
test("explicitPure", true, false, "pure");
test("explicitPay", false, true, "payable");
test("explicitNonpay", false, false, "nonpayable");
test("implicitView", true, false, "view");
test("implicitSendNonpay", false, false, "nonpayable");
test("implicitSendPay", false, true, "payable");
test("implicitSendImplicitPay", false, true, "payable");
test("implicitSendExplicitPay", false, true, "payable");
test("implicitSendExplicitNonpay", false, false, "nonpayable");
test("implicitAll", false, true, "payable");
});
//# sourceMappingURL=test-abi.js.map

File diff suppressed because one or more lines are too long

2
lib.commonjs/_tests/test-address.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-address.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-address.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-address.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const utils_js_1 = require("./utils.js");
const index_js_1 = require("../index.js");
describe("computes checksum address", function () {

View File

@@ -1 +1 @@
{"version":3,"file":"test-address.js","sourceRoot":"","sources":["../../src.ts/_tests/test-address.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAQvC,0CAGqB;AAGrB,QAAQ,CAAC,2BAA2B,EAAE;IAClC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAkB,UAAU,CAAC,CAAC;IACrD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,EAAE,CAAC,kCAAmC,IAAI,CAAC,IAAK,EAAE,EAAE;YAChD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACrD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAClD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAClE,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,C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MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;YACzE,CAAC,CAAC,CAAC;SACN;KACJ;IAED,MAAM,MAAM,GAAG,4CAA4C,CAAC;IAC5D,MAAM,IAAI,GAAG,oEAAoE,CAAC;IAClF,MAAM,YAAY,GAAG,oEAAoE,CAAC;IAE1F,EAAE,CAAC,iCAAiC,EAAE;QAClC,MAAM,OAAO,GAAG,kEAAkE,CAAC;QACnF,gBAAM,CAAC,MAAM,CAAC;YACV,IAAA,4BAAiB,EAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QACrD,CAAC,EAAE,UAAS,KAAU;YAClB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB;gBACrC,KAAK,CAAC,QAAQ,KAAK,MAAM;gBACzB,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC1C,MAAM,eAAe,GAAG,kEAAkE,CAAC;QAC3F,gBAAM,CAAC,MAAM,CAAC;YACV,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;QACrD,CAAC,EAAE,UAAS,KAAU;YAClB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB;gBACrC,KAAK,CAAC,QAAQ,KAAK,cAAc;gBACjC,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-contract-integ.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-contract-integ.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,78 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
describe("Tests contract integration", function () {
const provider = new index_js_1.ethers.JsonRpcProvider("http:/\/127.0.0.1:8545");
const abi = [
"constructor(address owner, uint maxSupply)",
"function mint(address target) returns (bool minted)",
"function totalSupply() view returns (uint supply)",
"function balanceOf(address target) view returns (uint balance)",
"event Minted(address target)"
];
let address = null;
it("deploys a contract", async function () {
this.timeout(10000);
const bytecode = "0x60c060405234801561001057600080fd5b506040516105863803806105868339818101604052810190610032919061010e565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a08181525050505061014e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a58261007a565b9050919050565b6100b58161009a565b81146100c057600080fd5b50565b6000815190506100d2816100ac565b92915050565b6000819050919050565b6100eb816100d8565b81146100f657600080fd5b50565b600081519050610108816100e2565b92915050565b6000806040838503121561012557610124610075565b5b6000610133858286016100c3565b9250506020610144858286016100f9565b9150509250929050565b60805160a051610414610172600039600060fa0152600061021f01526104146000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806318160ddd146100515780636a6278421461006f57806370a082311461009f5780638da5cb5b146100cf575b600080fd5b6100596100ed565b604051610066919061025c565b60405180910390f35b610089600480360381019061008491906102da565b6100f6565b6040516100969190610322565b60405180910390f35b6100b960048036038101906100b491906102da565b6101d2565b6040516100c6919061025c565b60405180910390f35b6100d761021b565b6040516100e4919061034c565b60405180910390f35b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000000000006000541061012657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061017690610396565b919050555060008081548092919061018d90610396565b91905055507f90ddedd5a25821bba11fbb98de02ec1f75c1be90ae147d6450ce873e7b78b5d8826040516101c1919061034c565b60405180910390a160019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b6000819050919050565b61025681610243565b82525050565b6000602082019050610271600083018461024d565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102a78261027c565b9050919050565b6102b78161029c565b81146102c257600080fd5b50565b6000813590506102d4816102ae565b92915050565b6000602082840312156102f0576102ef610277565b5b60006102fe848285016102c5565b91505092915050565b60008115159050919050565b61031c81610307565b82525050565b60006020820190506103376000830184610313565b92915050565b6103468161029c565b82525050565b6000602082019050610361600083018461033d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103a182610243565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103d3576103d2610367565b5b60018201905091905056fea26469706673582212200a979ea2bfdf429b5546fa25906c9d20a3d67ef5fbe531f31d2cc83533e3239564736f6c63430008120033";
const signer = await provider.getSigner(0);
const factory = new index_js_1.ethers.ContractFactory(abi, bytecode, signer);
const contract = await factory.deploy(signer, 100);
address = await contract.getAddress();
await contract.waitForDeployment();
const deployed = await provider.getCode(address);
assert_1.default.ok(deployed != "0x", "has bytescode");
});
it("runs contract operations", async function () {
this.timeout(10000);
assert_1.default.ok(address != null);
const signer = await provider.getSigner(0);
const CustomContract = index_js_1.ethers.BaseContract.buildClass(abi);
const contract = new CustomContract(address, signer); //ethers.Contract.from<ContractAbi>(address, abi, signer);
// Test implicit staticCall (i.e. view/pure)
{
const supply0 = await contract.totalSupply();
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; default");
}
// Test explicit staticCall
{
const supply0 = await contract.totalSupply.staticCall();
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; staticCall");
}
// Test staticCallResult (positional and named)
{
const supply0 = await contract.totalSupply.staticCallResult();
assert_1.default.equal(supply0[0], BigInt(0), "initial supply 0; staticCallResult");
assert_1.default.equal(supply0.supply, BigInt(0), "initial supply 0; staticCallResult");
}
// Test populateTransaction
const txInfo = await contract.mint.populateTransaction(signer);
assert_1.default.equal(txInfo.to, address, "populateTransaction.to");
const txInfoData = index_js_1.ethers.hexlify(index_js_1.ethers.concat([
"0x6a627842",
index_js_1.ethers.zeroPadValue(await signer.getAddress(), 32)
]));
assert_1.default.equal(txInfo.data, txInfoData, "populateTransaction.data");
// Test minting (default)
const tx = await contract.mint(signer);
const receipt = await tx.wait();
assert_1.default.ok(receipt, "receipt");
// Check the receipt has parsed the events
assert_1.default.equal(receipt.logs.length, 1, "logs.length");
assert_1.default.ok(receipt instanceof index_js_1.ethers.ContractTransactionReceipt, "receipt typeof");
assert_1.default.ok(receipt.logs[0] instanceof index_js_1.ethers.EventLog, "receipt.log typeof");
assert_1.default.equal(receipt.logs[0].fragment && receipt.logs[0].fragment.name, "Minted", "logs[0].fragment.name");
assert_1.default.equal(receipt.logs[0].args[0], await signer.getAddress(), "logs[0].args[0]");
assert_1.default.equal(receipt.logs[0].args.target, await signer.getAddress(), "logs[0].args.target");
// Check the state has been adjusted
assert_1.default.equal(await contract.totalSupply(), BigInt(1), "initial supply 1; default");
assert_1.default.equal(await contract.balanceOf(signer), BigInt(1), "balanceOf(signer)");
// Test minting (explicit)
const tx2 = await contract.mint.send(signer);
await tx2.wait();
// Check the state has been adjusted
assert_1.default.equal(await contract.totalSupply(), BigInt(2), "initial supply 2; default");
});
});
//# sourceMappingURL=test-contract-integ.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-contract-integ.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAG5B,0CAAqC;AAQrC,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,QAAQ,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG;QACR,4CAA4C;QAC5C,qDAAqD;QACrD,mDAAmD;QACnD,gEAAgE;QAChE,8BAA8B;KACjC,CAAC;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AAC,IAAI,EAAE,CAAC;QAEjB,oCAAoC;QACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-contract.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-contract.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const create_provider_js_1 = require("./create-provider.js");
const index_js_1 = require("../index.js");
(0, create_provider_js_1.setupProviders)();
@@ -147,6 +145,34 @@ describe("Test Contract", function () {
await specificEvent;
await allEvents;
});
it("tests the _in_ operator for functions", function () {
const contract = new index_js_1.Contract(addr, abi);
assert_1.default.equal("testCallAdd" in contract, true, "has(testCallAdd)");
assert_1.default.equal("nonExist" in contract, false, "has(nonExist)");
{
const sig = "function testCallAdd(uint256 a, uint256 b) pure returns (uint256 result)";
assert_1.default.equal(sig in contract, true, `has(${sig})`);
assert_1.default.equal("function nonExist()" in contract, false, "has(function nonExist())");
}
assert_1.default.equal("0xf24684e5" in contract, true, "has(0xf24684e5)");
assert_1.default.equal("0xbad01234" in contract, false, "has(0xbad01234)");
});
it("tests the _in_ operator for events", function () {
const contract = new index_js_1.Contract(addr, abi);
assert_1.default.equal("EventUint256" in contract.filters, true, "has(EventUint256)");
assert_1.default.equal("NonExist" in contract.filters, false, "has(NonExist)");
{
const sig = "event EventUint256(uint256 indexed value)";
assert_1.default.equal(sig in contract.filters, true, `has(${sig})`);
assert_1.default.equal("event NonExist()" in contract.filters, false, "has(event NonExist())");
}
{
const hash = "0x85c55bbb820e6d71c71f4894e57751de334b38c421f9c170b0e66d32eafea337";
const badHash = "0xbad01234567890ffbad01234567890ffbad01234567890ffbad01234567890ff";
assert_1.default.equal(hash in contract.filters, true, `has(${hash})`);
assert_1.default.equal(badHash in contract.filters, false, `has(${badHash})`);
}
});
});
describe("Test Typed Contract Interaction", function () {
const tests = [
@@ -270,13 +296,13 @@ describe("Test Contract Fallback", function () {
name: "receive and non-payable fallback",
address: "0x5b59d934f0d22b15e73b5d6b9ae83486b70df67e",
abi: [
"fallback() payable",
"fallback()",
"receive()"
],
sendNone: { data: "0x" },
sendData: { data: "0x" },
sendValue: { data: "0x" },
sendDataAndValue: { error: "overrides.value" },
sendDataAndValue: { error: "overrides" },
},
];
const provider = (0, create_provider_js_1.getProvider)("InfuraProvider", "goerli");
@@ -319,7 +345,7 @@ describe("Test Contract Fallback", function () {
assert_1.default.ok(true);
}
else {
assert_1.default.rejects(func, function (error) {
await assert_1.default.rejects(func, function (error) {
if (error.message === send.error) {
return true;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-crypto-algoswap.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-crypto-algoswap.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto-algoswap.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
describe("test registration", function () {
let hijack = "";

View File

@@ -1 +1 @@
{"version":3,"file":"test-crypto-algoswap.js","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto-algoswap.ts"],"names":[],"mappings":";;;;;AAAA,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ests/test-crypto.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-crypto.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""}

View File

@@ -1,31 +1,30 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const utils_js_1 = require("./utils.js");
const index_js_1 = require("../index.js");
const index_js_2 = require("../index.js");
describe("test hashing", function () {
const tests = (0, utils_js_1.loadTests)("hashes");
tests.forEach((test) => {
it(`computes sha2-256: ${test.name}`, function () {
assert_1.default.equal((0, index_js_1.sha256)(test.data), test.sha256);
assert_1.default.equal((0, index_js_2.sha256)(test.data), test.sha256);
});
});
tests.forEach((test) => {
it(`computes sha2-512: ${test.name}`, function () {
assert_1.default.equal((0, index_js_1.sha512)(test.data), test.sha512);
assert_1.default.equal((0, index_js_2.sha512)(test.data), test.sha512);
});
});
tests.forEach((test) => {
it(`computes ripemd160: ${test.name}`, function () {
assert_1.default.equal((0, index_js_1.ripemd160)(test.data), test.ripemd160);
assert_1.default.equal((0, index_js_2.ripemd160)(test.data), test.ripemd160);
});
});
tests.forEach((test) => {
it(`computes keccak256: ${test.name}`, function () {
assert_1.default.equal((0, index_js_1.keccak256)(test.data), test.keccak256);
assert_1.default.equal((0, index_js_2.keccak256)(test.data), test.keccak256);
});
});
});
@@ -33,31 +32,31 @@ describe("test password-based key derivation", function () {
const tests = (0, utils_js_1.loadTests)("pbkdf");
tests.forEach((test) => {
it(`computes pbkdf2: ${test.name}`, function () {
const password = Buffer.from(test.password.substring(2), "hex");
const salt = Buffer.from(test.salt.substring(2), "hex");
const password = (0, index_js_1.getBytes)(test.password);
const salt = (0, index_js_1.getBytes)(test.salt);
const { iterations, algorithm, key } = test.pbkdf2;
const result = (0, index_js_1.pbkdf2)(password, salt, iterations, test.dkLen, algorithm);
const result = (0, index_js_2.pbkdf2)(password, salt, iterations, test.dkLen, algorithm);
assert_1.default.equal(result, key);
});
});
tests.forEach((test) => {
it(`computes scrypt (sync): ${test.name}`, function () {
this.timeout(1000);
const password = Buffer.from(test.password.substring(2), "hex");
const salt = Buffer.from(test.salt.substring(2), "hex");
const password = (0, index_js_1.getBytes)(test.password);
const salt = (0, index_js_1.getBytes)(test.salt);
const { N, r, p, key } = test.scrypt;
const result = (0, index_js_1.scryptSync)(password, salt, N, r, p, test.dkLen);
const result = (0, index_js_2.scryptSync)(password, salt, N, r, p, test.dkLen);
assert_1.default.equal(result, key);
});
});
tests.forEach((test) => {
it(`computes scrypt (async): ${test.name}`, async function () {
this.timeout(1000);
const password = Buffer.from(test.password.substring(2), "hex");
const salt = Buffer.from(test.salt.substring(2), "hex");
const password = (0, index_js_1.getBytes)(test.password);
const salt = (0, index_js_1.getBytes)(test.salt);
const { N, r, p, key } = test.scrypt;
let progressCount = 0, progressOk = true, lastProgress = -1;
const result = await (0, index_js_1.scrypt)(password, salt, N, r, p, test.dkLen, (progress) => {
const result = await (0, index_js_2.scrypt)(password, salt, N, r, p, test.dkLen, (progress) => {
if (progress < lastProgress) {
progressOk = false;
}
@@ -75,8 +74,405 @@ describe("test hmac", function () {
tests.forEach((test) => {
it(`computes hmac: ${test.name}`, async function () {
const { algorithm, key, data } = test;
assert_1.default.equal((0, index_js_1.computeHmac)(algorithm, key, data), test.hmac);
assert_1.default.equal((0, index_js_2.computeHmac)(algorithm, key, data), test.hmac);
});
});
});
describe("tests ECDH shared secret", function () {
const tests = [
{
"name": "test-0",
"keyA": "0xb484f7e25b06a887c3a01c97db40b5d96a1bd1ce69f342442a8395bfc995c34c",
"keyB": "0x407f75dc7d9f420c54bcc51189a16841b75aab53827d3ed54d5548448136f577",
"shared": "0x04131c0361e18fbdfb1575b06763225e8e7d4b6d33a6b6f369f20ff05bb6bb79cf6f510154615774f14a68ec405244fc8cba9fecdf012d22988575bf7f72f55cea"
},
{
"name": "test-1",
"keyA": "0x953287b3e32f93c3ae8974d380b88f9a6d89ce2969c4b589cf4d068ec719c885",
"keyB": "0xf92ec8bea281236772a90219e9c661d475c6dd457dbf71f3076e9f136a7dee2b",
"shared": "0x04b0d910de1a56e19a300e4cf7d8946fab088da26bad0be01b3139af7f61633387c110d00a9f4059a75808c7471665242996b0999677bfef0f8c9b2eb9cb7ff3f0"
},
{
"name": "test-2",
"keyA": "0xe47de7c043683a3facabbd72097c5c1c9148fc2d66854dfc32df924bfdb45a13",
"keyB": "0x5bfe0ef6a3c40797a4b013d01bbc02dfb150c46cb04c85a52be5d5d370d1f60a",
"shared": "0x04abcb75054302b210ac0ab42d412e47cc08bfc0d29298edc3a1c0f11d88c49240a8f922ca57dfbc003e6655337c75d5598b704ea91546206d9495aa61213aa96a"
},
{
"name": "test-3",
"keyA": "0x3f0b65deb1a95ec280649e81b933ef382441fdc875f6280d782e45628f0dccd7",
"keyB": "0x3aeb016c64f23b276f816aa5494a2cec07361d2a4a0d4992a5b99764127e8f9e",
"shared": "0x04de883e02e1842f87796a83790b646615902e2a0612477bc63002f23a94d700c15632660cf6018f10a81785a9f294dd100309e397e88e7d1b7d70f601a4cf3b1b"
},
{
"name": "test-4",
"keyA": "0xb9f059a915d6421848ae4344c64f1803342a7991c1fd567d61238aaaab583a5a",
"keyB": "0x0beb07549d6496d635c45152673455268f4beb89c07ff049c6e269dfa867ac2c",
"shared": "0x0411f59f62bd3033dba981f23fac5cc0718737dabeea9f060d0fd572383007402b539dd60b23b936c7842fcf16f4fb0524cc07ab02a06c3be8b33113a20f3d47d0"
},
{
"name": "test-5",
"keyA": "0xb48da3af696d7893c818b5e38ff682ab77818dccb80599f36b5108ad25214cf0",
"keyB": "0xac732d7e814ef45ef8a7acf31c4f04eef30247c992b558c8523f4894e599e772",
"shared": "0x0499778f55f0e87e28d72991c380a2ea5147f0336f5bc7d7ef6a1b2ef25e8949d05e3a5e60a1d605abe69427daf321a118f648c4b4da2529843b5409df921fb927"
},
{
"name": "test-6",
"keyA": "0x90b5123740bf282e9622ff8a2511692e0abc897bd61a64f49c2497967cb45dd5",
"keyB": "0x471e8f4b20e3328d4a25c20dad734e0bdc160c6c3dd3709858ca6ba6ce74d24b",
"shared": "0x04428de953d7409c419a6f11622c4a4d087082b54bc8207c514534ecf7901723c1f58359631ba94e95c05d934a2eedcecd705bbb61dd8f57cbb08572dc69e6a782"
},
{
"name": "test-7",
"keyA": "0x9f7f6431c1318481003fd21871b4b8a86ca779caaef10fec2209479b5072ea15",
"keyB": "0xb6be68f448ac1092a704613f3a75324b5c58157f3595c48a3825a0089d7f9d3c",
"shared": "0x0468218704c8c364d4d1838c7f66ccab205797eab0b02b93b75cf4e4437dbe13e7d9d0830971758b3a65e75eab577954b42f6721c104e4b876b77b8db63d23d43d"
},
{
"name": "test-8",
"keyA": "0xb9113e35ac2f7ba2a315e9f4301275cf561b91860f612d14a351273e38c04966",
"keyB": "0x00c3101f5d3d6272299180fd426dc1554854cb06dc911bc85fa97327d4fa3f21",
"shared": "0x04532cc9a89b735f0a11a0dbbbd40b05460dcf8e41e9da8359c727336a245d5d9babcca050434b81c01a6c70bd27692123f99377f22c0651bc0b01ae9871624894"
},
{
"name": "test-9",
"keyA": "0xf569179eccaaf12c837a7362b7fbe41976dbf760270fa759e3dff18ae2bbe5fd",
"keyB": "0xc8654bad899f2e827d581f45db8b7f295a0dcfe5253577d8604c08d589180527",
"shared": "0x04d3568b0d1203d09cf9d1707c3ed1a44eb0230d2169c19c89433df8330010160885e6e626ce4505ac6ce7dda68bd57d2ddaa07a5ef5a4685c6a4e3784b8ad9184"
},
{
"name": "test-10",
"keyA": "0x0ffd74c78276a1bcffe332b0545400e5992c87f2a2f91caa71ad76215ed2b229",
"keyB": "0x47dcfdf847d5b572784d546e0c5048aa4e613e74936fcc5438b75370d5f5525a",
"shared": "0x040fc7a5c5a7f9bfb98b596d698dbb0a87e1dcd50457544644acfb09ee3802835bbadc7717d06f4cc19af3bd308755eedfb162055b08134d63a49231ef9a38e503"
},
{
"name": "test-11",
"keyA": "0x9777dd28dd62dbf7b17244b8e7b49b3cb673b81ef9dabbb196c23ccd3d0b22e6",
"keyB": "0xbc1f73ca7cdc51e1264429d6f6b581c75b3a5986cb993f09ab779156764ae1b1",
"shared": "0x04493d9be34f59077b11f56f8f883bb1f9ff247500f482f3ff6c1adcee9860442529b957a92ddc3a40391859e3b853b95c8e2159cf2dcfcf70ad4d6b7b55386f37"
},
{
"name": "test-12",
"keyA": "0xd0ae54b6b72ddc5b8ed416251671bb488f9bd18e63fc60ed10dbcd12920d2f65",
"keyB": "0x2bcfd3837358a43cb181613ebdb152d72efc9fe7dada0c6bc44eb84d61070e2a",
"shared": "0x049f2d2eb2a6ba4937ab44c8ab1769c4b64b74b4d187f965c5ec1272cbe53d79858c8bcadfc17a37d95633da3881fb0e2900a1dfd1ac7160d67fa3dbd81b3de268"
},
{
"name": "test-13",
"keyA": "0x14dbcd45b32a3ece2adb1691352096d395354928f7ceb5197c85cfe95b4e23eb",
"keyB": "0x111ed2f1a9fafbe021cb07033f0a1d45084fbb6b2facd008fe1d89e7ad029ae8",
"shared": "0x0441389bf60228a087c317d6a07b41ce9da09a4749c6b595ba5d8deef7eb7d8c21d266450b3df6a2a2d29ed149e909b3381604c74b5154da7cdcb9bb26336a6aa5"
},
{
"name": "test-14",
"keyA": "0x3e7d474097eb34d76c38d4bc586f9cefc3bed6d8c172e4e5fea4016e0f820e1c",
"keyB": "0x3d8c224427a5cc554fd064020017c20f655c347f344afa68d133b1e3b8bfb0d6",
"shared": "0x04acd1f4ff562dd474f6ecda6f94b9d6eac65c497f0b103f1b6bcf03fd306f82505d5c5aa9de302f9c0577e479392795eaa13d68e2c6fe665ed7dc249d5a9ca7bd"
},
{
"name": "test-15",
"keyA": "0xa79deef7a811761554cc019967eeb15ad61b6a69b266e3a091c1e00d3bcd2057",
"keyB": "0x43fcca9678c66d1ef35617ade47cf015f75da19d1b7189144a0be0c1631a4a00",
"shared": "0x0470131669ac84dc65ada0c23469b39cc42a54df3482577427a7aab58bddaf13dc05469397717be0882fa7c37b8b7bbfbf49b500d1f17a3b6fe8c7f233eb2ac2b1"
},
{
"name": "test-16",
"keyA": "0x1945930000f6a3bdf339d5b632c3864f9ce8a0370243dd2bdcf805aa8f9e80e8",
"keyB": "0xa97c423f9cc5827730b33ba804d15c8c97406f154a71561e3ed263299781e591",
"shared": "0x0414fca0eb5db9d0b52f64b5e7b794659e87f2ee6816e83076d1e16446f5e9646fb1dd042027eee659363958d472f4a38f9bc400556dd85c7802eb1b87d4250581"
},
{
"name": "test-17",
"keyA": "0x5f6e300343975539ba132a6bf26c2b3fa827ee558bb6698c86bbc84ea8a71577",
"keyB": "0xc015b1dddc249815a81d9c7f54f4676b10a3ec321d9d0ddd35b800557fed6431",
"shared": "0x0476371203edee28e291a2b0fabccdf1018c395b090a8ffff2feec116d3cd103e6d3fa1ea02ddecdbd392dc076ea959c318abf2d69c06e35a92e4f09249d4d73b6"
},
{
"name": "test-18",
"keyA": "0x3f4f0a728833e864f96e202060239743ceb1150cc75094195e6bd4f53e7bf62a",
"keyB": "0x5a7b89392da6f39464967d315ecfbe8822b75062d68f3a43cc2a928a6abf2993",
"shared": "0x04959db3cb80d503579bc587399d09b043778c66115d1354ce449e060d3599bf2faa4adcf7da0419aa0af732ab5b82fe3ed68e5e5860dd2f6610f3f4f2ca7351eb"
},
{
"name": "test-19",
"keyA": "0xc3106be0925e0d69703e4ea6d3dbee7903a8b8bb293ae59b2f90b0efdb0b3a1a",
"keyB": "0x44cf9575f03af5afc03c36f62433ebd52579d894c759cab76d29a4b9d0bae083",
"shared": "0x04a980b037da455ec856a7e3a9f63e8b9daf73f8e1e929f3f10e2c4b603b5bca48264c057ce04a25f5f48d87d27a43f7192aaac3340d7d5972e2ad3efc5de20c13"
},
{
"name": "test-20",
"keyA": "0xb6c7bd2ba0d2b30d3e56d038398c2c937fb5cae348accdc060fb882903312008",
"keyB": "0x9ed8d5fb02fa0e825e7e095cfd32f9e817e8cd030c4363470f55d17e37cf73ef",
"shared": "0x042aa9b64ce873f5a3005a8eaee54e823f17633eec0a808ce0e24286f3c169485c2b7145f10deee39073056ce69c7d8bbbd2ff693b33b8749ae2b2f47e2e342397"
},
{
"name": "test-21",
"keyA": "0x9f44756603bca7e87e2dd718ef2323f12854056aae86dc9e31715f97c0b3dc12",
"keyB": "0xd1ae23664d6320f9989b031cd7357fe346e207ffe73ed51de7c485754b8f1578",
"shared": "0x04037ab94245dad8282b4fabfec79ae5ca26367db2f45a183eb4c0f0c9ab7bf0d2b33503981159468f660711fb956eb730675b1e34f1e7d0aca07b936b64c47d56"
},
{
"name": "test-22",
"keyA": "0x4c6307b149f1052290dc0140d6d597c25ddd23bc0ca826a9f44215009d13dad5",
"keyB": "0x9845254fdb40c7c74d0f9f3c6f73ce97a27f4306368685448b1f72dfbb3dd5d9",
"shared": "0x04f0ea5528a2efa16d424dbc07d49d3d2943e842289c6472f1cdeded965438326af76bb47449b417ef3b82130096f3c019d0ae3ffc3c9631f065a3285ba8539bfd"
},
{
"name": "test-23",
"keyA": "0xab6ac9d67466cae30d31584104970e1093ebda6690dc9bf7bea1f66f07ddfcb7",
"keyB": "0xc0f58e549e7984e780cbc307b2a6b4c4863302474d271637586fa7cc0e389df8",
"shared": "0x045d5fd0d76d168b746462231a5bfb07fc175f43b206622781614e3df3491ba4c3738c4d3ae2d7f18ab0570c86aeb139778219fcc57cac3d42726de0f38d31b52a"
},
{
"name": "test-24",
"keyA": "0x5b0e950974450f38dba31e01379814f0ed1b0f983cfda62dfecff5cd3e8db391",
"keyB": "0x4739f9e168dee9af2c8a9107b18738c9e3335115af8a431810ecce5269fba577",
"shared": "0x04da8ab5cf841804f0b5845f36e46e3463dfa3d6d9e7a306962062b729c680b2e8fdbf2b3eb2bdcc90d2884b9217dbdb3ad3620cd844982f19920e5d4f59353504"
},
{
"name": "test-25",
"keyA": "0x9f3583cffcbe992d4a537defb5d8479c2bfa96a39a3f33fcf40123854bc96ea4",
"keyB": "0x42fe9367ef668babd70d4f5e836627cc78990b8a1738a56adf23baebf9410b48",
"shared": "0x0414edfdae5d2db370a51b5cf45ee6049621f52dd15eb5136c795ed364221c0a5c0f32e9ebbc9211b121ccc06516756e9280b210abe5b1a8f6c658dc69c39341f5"
},
{
"name": "test-26",
"keyA": "0x289406a24a7794b04469a4acf9846e905ed4cae37349101db835f90e25d09605",
"keyB": "0xb2d58cdc470106c12f538b4516559d8ecaad0bcae063848a44f8639168453b93",
"shared": "0x04a9a80e466ea54aa0651eccde081e47637d2c142e1aaaf42572ee0753a49f7667c94b99f5bc2bf632b1330e3ffef95d009560e61084cbc07aab020282af5721f9"
},
{
"name": "test-27",
"keyA": "0xd9bcf36ef585f59e1570904784f0a3df6435c798bec7e1c406e922d51f98b510",
"keyB": "0x40244928c9d371a427a0ce96530120deee3d31af086db679ee6bd8c1a7773030",
"shared": "0x04ac55594d87dfdd8af303c5f92745d49fba6ff15afb628212bc5d432d97bbd909938873c298fb93c851d901bf178e14ef1d590ff0dca7f7ead5613e97e3a824db"
},
{
"name": "test-28",
"keyA": "0x301b79d85431a2c8bc21236cc58e1221eeb0862d3e3cfb29534423e6992e7591",
"keyB": "0xe6a62f0c49971b7b11477fc964d777de92267ab09f1465520ca31edcd7abaffe",
"shared": "0x049b7326b33eacc5ee3c102cae791d1835219253b70596f6a36892f2bb35fda1aebd661c781ac38b2461ac67b80ea1c18cd0230d024712a4e1826a6c5463874b0f"
},
{
"name": "test-29",
"keyA": "0x49542517ff2bd70e851405cf285cf2280f84af838e2b0a68ed779f96d0ce62eb",
"keyB": "0x48ffc78034851d2f4e610bc11b97c21d42f5d7bbada2415ee8f03f6b643c92b7",
"shared": "0x04dc12a233b08ff25ee7806cfede3565dedd663e0cd25108ad233b6c5c8f8c25fe82d4b2820fa44e0ef86d51d0eada0033854a1199644204f9233887e457775bb0"
},
{
"name": "test-30",
"keyA": "0x6597a9b39b58bd47561fd4058894ee327368fdd8b8b267efa0596793c3852ed8",
"keyB": "0xbcab19f22f0cca9fc791f998a5717bc4c81853ff4f1c974a7dde7ecef41b4802",
"shared": "0x043d622a7f3255437c9f6459e68d5e3333d377b76ac053a50affbdf88c555508c42000b092dbb07b72ecf5887766ebb2e47afdb3d8324b7938d9255171d971b1a8"
},
{
"name": "test-31",
"keyA": "0x4127797885e7b8b7c882fec5cf38be273f42de47261e8ea4aab49769d606dd01",
"keyB": "0xc82a9b18f2f060adaf4f7cf56f29a2f4859d12a452b8b9f079f8850423fba666",
"shared": "0x045e7b62ced9cebd94d2115b11f2e9ca6f9a66119a17296613a60439d2960747f927c305822fe15582bb62f48c574aa7c89e7b2c8e5d4affc86f097e794bdf029d"
},
{
"name": "test-32",
"keyA": "0xf5ffbd9bf88dd867ace131df25fc9bd9ab87b7834d91786f110f40eb2e7b73b2",
"keyB": "0x203fe0bd83081d65fe45f194c373dd84c61fcdcfd4783d18e0e060f56efde038",
"shared": "0x04cddff70996f116a874442da0a33ac3df0e99f063bd1066644e6ca88442bda15d5b46fe8c6de7467a13c65febf4a6d258ffae99784c21fa61fa8a3b384b666154"
},
{
"name": "test-33",
"keyA": "0x5073d19c09be03d0c41cef0b950e13b85ee87c4c1642061addbdfd34c3258618",
"keyB": "0x37cf3617c1728e613c738c9b61fc84b76490128b3a584a861862416b1bb5ca60",
"shared": "0x046234004e627b076d7bb6b6aedae341ab755f5f3dbca295fb2a70ae3206f26543c8f031605764e7dfb377a12c0be3a61df6983707ba62955487cc36ba8e8c0812"
},
{
"name": "test-34",
"keyA": "0x0378dd63bb9f1fd4b0b7c266239ca574c7f6f7ca62645b3e9edcf763918eb110",
"keyB": "0xfd144b5e82bb6dbbcc9e9b714d64e283b748e85ba93b0113727fc1670251c6dc",
"shared": "0x0481f04971c2282e9850ee373aba6ec92390e3ff12b95d86d339dfce7dfa592f012ef71875aba27adec232a90f209f420c6e7c73fd40f165ba9b6196a10ca5e82b"
},
{
"name": "test-35",
"keyA": "0xfa99235e06ec83c103ab50653ff5af505b085892781a6e743c7398219562ffe4",
"keyB": "0x6a8850083fdf6ecb9f9bdb613f1c6706fe233e2e74fad460f7c650751bf999e9",
"shared": "0x0407117676960073ab08890efd07eb6222584b2c8ad9a1eb64f9e610138c10a4d59f4ca496910ac35a1fad24e56fc08020ffac2dfabb2d79bbcc041e70dffb203c"
},
{
"name": "test-36",
"keyA": "0x3abcf36699a174e462196891e49e72759f707d7f82ae5e64a49f1273927802ae",
"keyB": "0x44212cd650066f2371908cc6ba520061745db823c64b8b99dae535e364fe7034",
"shared": "0x04c354916600479cbbf9d91f5b851ee075f0aac99befa434f3f3b30fa887a0a7af71129ea47b388ac41538a71f9e52f68473ccc2611ace7cdd999ee036bc43b459"
},
{
"name": "test-37",
"keyA": "0x858512678a61f3d286fd1a90cb8fb8960d8cffaa31686706d0a879d66acabc7f",
"keyB": "0x490e29655cb5da0dcd2f60e4583cb41b7ad9a801fbc00a2927968f06b0c14852",
"shared": "0x040dde94c952ec15bcba15d773ba0dfa9cb5ed7731cda1b7f8110fa91f843173f83d577f601b61f2df21b9f7cbf2b1d54792a6f9403c2446a480af7b69e23b8d21"
},
{
"name": "test-38",
"keyA": "0xaeb4d6c2a817e5882f991f0c3c81d0f6f2d3d8854d472511a211cae67adae695",
"keyB": "0x72c297384a02544ba9719c0ce1f0ad3cb4e89b57536880f65c0462d1f058a55f",
"shared": "0x041a61bd828eacb1aaacbbb3b0291d691f5fc1462f16fc55f828b1f28e73342957de6b718501e66c3a1885ce16e124adb600457095ba770f58be012d0b69ca949a"
},
{
"name": "test-39",
"keyA": "0xb0fc529ff1bb4a7985663d54b279cbf4a597ec922a810ca16b87697ef3ef0dd3",
"keyB": "0xaf6019921bc7db54c334102a766d32d3ff06fd68ed08efe8ca2a35ce5074dcd0",
"shared": "0x04b49b24610350fde84bf067affc1d9f7ac549b3c4c05fa963aade41e65d6645cf867466f6c87e11298cb433f45f65eec4c5d88e76acdd5515a92802ded42c6e0a"
},
{
"name": "test-40",
"keyA": "0x160fdb84df11195fb0d33335e593499c3505cadce25ffdf6cdd8af0cb78d400c",
"keyB": "0xb37568a52ead1debcb2d402fa3d58f212a37321aae2cea1b90b263a3276bfdce",
"shared": "0x04091c2e14e517d9990425bb5d0a9e48f3bfe27a1cb673182fe1f7dc27bd6a56043a7745c9d27052e60ce72a1d82357f6675fadf9994add784c45821f52f2b094e"
},
{
"name": "test-41",
"keyA": "0x253ca7443d94998bab1f508e3424c662831c6be6ec5d387e97c79f078087ff15",
"keyB": "0x38102245618fddf8a1bd7de152c6fa630523223b89a1649d5f2fa5f9e47ffe4a",
"shared": "0x04046754be94d9ad925f67b1bc80fe32cd6920f9f80327cdc83f68e95d999b1d8ab7b41844db1c1ea66662b42737169daefc675c9364583565e3982b674d8a30dd"
},
{
"name": "test-42",
"keyA": "0xef558874b5b1d5915c83e3c1e4554d73de1e9943af445eba3f6516b731cc0126",
"keyB": "0x956e32c2e87263215b8c31c7f2e7311d6acad863f3c428b0625c9376cbc405cd",
"shared": "0x047e9265334e20ad8747098147b0eabb6d01c8ab12722cf0bbede05c1beaa67e8e770e04e19cf6035f48289fbe85cd4b9496a9ca5a90d088f8e75a0c1c6c7f1cc8"
},
{
"name": "test-43",
"keyA": "0x32c00e0d3a2ba3db6685058e1327dcee6425068190890439391fdb95857f27b0",
"keyB": "0x8b39021f7ad57a101534977d323c0349cecc8405d93286c6e71a441f4cc16c86",
"shared": "0x04c8095c862e64f6866fd3c177ed898fa3ca5da2d585c60ea4646d8f2cb9f332dbd54ca9d3b2a9e852a15189a0eb97a8edfaa114a01277418aa2ecfdfb3770caa0"
},
{
"name": "test-44",
"keyA": "0x40627c6987e20c07014833e23a0b9304bbaf66525a59b892e224944b56d3117a",
"keyB": "0xe23607bff98d5699816836f65e5405f2e60d4fe2449979acd43ee2b3e9bfc218",
"shared": "0x04be3ec3c188e7c74944d42beddf19003aeb0ccf8cccf8532b220dc666520f277e8b98b87ee694e8c76256e51ebf69433479c69a4ccef3032e9cb550632db539f8"
},
{
"name": "test-45",
"keyA": "0x46c25bcd7d2f8ce6d27148a11f18e0314046260433f8cc6421be4dcd72a6e088",
"keyB": "0xf29022ca90a60d455d0b1470034d1c7fbba27a9997b1940a9373a97d092f965e",
"shared": "0x041f5fd1dd02afa8ce5d2877a05ce92a4db5aef022a8203551590343352c1bd6e71cad811974a74f49d140949aa091dc4262cf7da0b48bdfa26939cf4b9c461f52"
},
{
"name": "test-46",
"keyA": "0x6d6b69d4f9fafd986e5b1a9c36f3021aae9ce64c027f1bf9bd9e9e12d86a276b",
"keyB": "0xeed0cabb4ae5a696e762c98e6d697bd88a89d9a0b38458c6e696f0748e404fe6",
"shared": "0x04f2f9c8fa945577d7188292f5c4a4fad80bdcc3db44d6d5c15bda5a23971ac7046cb8af44bb5864a9e0e82c921805663c539a22f8c5ef22187062564f1359f4d2"
},
{
"name": "test-47",
"keyA": "0xf6b6d733b8c473a562f7a23c7cbb23f40273d809d13aeb308149ad709c674300",
"keyB": "0xd873a7d24c1f498a43c181f566f265cda248f9e2df8a825e69a73aeb1437dad9",
"shared": "0x0495f669c1c7271be4c8e628017ef570a0cb903887c3ea4897f09cc9ecd2a4f6b043e1fa41d1ddbf8f01e60368bc95e81ae2a8bf4922374294b0836ff7e43ad2ab"
},
{
"name": "test-48",
"keyA": "0x28410a640558a5da5b7746a46a9cdefc704ba2944f23699d3767f6505a97eb78",
"keyB": "0xfd1a548275be4d922cc294276d7b059cea0fbbcb629be29bb8072de597a96597",
"shared": "0x04fca25ec051c8532f664fe2c2e213d1bd3e298422232dd34e821245256e0bff4ff80fb1f03524fd57d1d4a6effc076899cc21dde0be10d60016c20c33b7524d00"
},
{
"name": "test-49",
"keyA": "0x89e51abd416ad4579d523bed183da74b991c589decb982649a0abedfe6061c0f",
"keyB": "0x22b4cad2ade397b86756c2457516cd23d0858700b0597fdb2433e891efa435e3",
"shared": "0x049316e68898db5d7c987fbfa371b1fbd6a56d585bde1017a825d1dfaad406b428a505e773e63ddd0244b0e25ddc1b08dda6dd9968673f7b10c40d8fe8a1e1d55f"
},
{
"name": "test-50",
"keyA": "0x2c645e1abac8e5848617067e6c3d739a6f126484d27f73bc8fdfdc9f0ac3ff04",
"keyB": "0x71252585fb806d9273c0103dcf642b419e7632ef3aeba3efc6c71863b50ae177",
"shared": "0x04886ec11347e30fc5e68a353201d702c4425358791ea6a6213c444c7489e38103c953fe13f4238dbe769f0d6208f693e356f81e7037977cf8a5b04661e37d2569"
},
{
"name": "test-51",
"keyA": "0x572a1ce3adfc10ca3afc39262d36c329ba44d7cfa6ca5c62d2e882ac25480d47",
"keyB": "0x2b9081d499417315277663c86e25dd7898ea67e969b632dd11e80d29e92b557f",
"shared": "0x0424c5ae82f447c156d97ed31c83f36cf3416cb4a72666bb4e8a61687a4ba4ae22b42f7d18579ff204f7974af9f8dcc51d8f9eabc45c720f607478ba78c2b2921c"
},
{
"name": "test-52",
"keyA": "0x60ba350fb7e0729ad992f53a314eacce65da6897856e362d2ef0959e890b9e99",
"keyB": "0x6a9629c655cf4f8b8816e95df1c14f769cb946431c6da17a04423ceef8979ee1",
"shared": "0x04831e236ece1bde7db14b819c06e0a17964b88b5fc4e8253a8dc316d613fad8ffdb5117eb920f34ce838d6861caa0e885e3c20d37cfd20e19d1092d52976e0f91"
},
{
"name": "test-53",
"keyA": "0x32eb6769ade64560a016e080f5e16ea97b2d0cb96b730e9c5c809bfd19a002c4",
"keyB": "0x7dff2eb8455b0e9c0fd38838db3d3de96067a6efc05d21d1bb303ca0bd52d87d",
"shared": "0x04b0cf54b0590546e434a5e3d2071c3c022d4b3b571660b359cee7d199e525965e9f38d12436affda7741d5b752e0b430149a1ec6d7835a6999e64b3ea324e91c6"
},
{
"name": "test-54",
"keyA": "0x70446e5ede6e26b96d3cecfe8afc35055a0a90f83c7db4d1b8a819d5cddb6642",
"keyB": "0x2df217bf6e92875e35af50bfa301059b2ddf593c0694b70116a8c87ee27ef4c9",
"shared": "0x0458e1554b06a40b9508d86d5cedeb3dccb82053881393306b1894d198412500dc0efa4dad2265d7532e59d06f71cf33f3d48728b4707434a5c722eea8d9a9acbc"
},
{
"name": "test-55",
"keyA": "0x64e16f672ec5aba6be5a4965d44bd7224aae65d444ceee6dd58690e527b36186",
"keyB": "0xefb054ff4222e8e493cb667f56129dc1b6a3437581280a3f984ff0ea09ec3029",
"shared": "0x04c806576fb79b4d7d38d00a3ee2c2896dfb1b29ef3a42ac72a82c7bf7626f2073a79aec8ee2c3c101845ce5171b27a9f23075ed74ccdae088956e3dcdbae74e7d"
},
{
"name": "test-56",
"keyA": "0x284a5592ab3fa9b8df2bf927761a667118697cd7413c255ef3cce9e9de76c321",
"keyB": "0x52d0033d83fbdeb0b7c8d21b475ec637fabfcc7c2593494d7e846ecd974083af",
"shared": "0x04e092613c7552c3180bdb041c32b9763804e6703c2c116009f1012526002472b5b627a85cb50c90942fe177bd36e2d4fbd8e9d835c72a607ee07ffead29cf12eb"
},
{
"name": "test-57",
"keyA": "0x488e6c2d97fe0ff3f5357254658ae487ade54bdf7bf871ffdfe27079cbeff103",
"keyB": "0x00f8632a6982d58c25236ce1952c19052f6b08edad61edd166570a8679a98f5c",
"shared": "0x048f02436bb55798561a6a78aacbeec67f0acd8ba88e99af6ec1b7b5152d9a5d7691a905c11fe26c2ba3d72be918f6ee7c3e66115a31a7f199f33073f6f5087181"
},
{
"name": "test-58",
"keyA": "0x0067fd2eec16c7ddf9a364f591d47394bfc12fd2b3ccff1bf1013e92e969f6f0",
"keyB": "0x76f1e3f4abfb237ec3ac6e72a56f25bfa06e7561bc5fdc4823282f9db40c49d4",
"shared": "0x04975e88ffcd670b06e7752d3d375613d0cd614f2b3a812e684342dcc16be6de336af2bb30ab25da0362ecf43752b477b412081d723f5c6840ea78deacd5f76b4a"
},
{
"name": "test-59",
"keyA": "0x4ff02743564c317a3578c08f7961a204d48e511e31688ba069037f6090235b37",
"keyB": "0xcf22489e1b9058b4a645e38504eaa32e031dea44e1465eb1122e14e4847c9744",
"shared": "0x04e584b571a9f99087bc6cb7818741cfc3b630ec412f64da1ada72de17279afa60258c5844cc2c7c1416548497b083f2aeb035c8945c0aa03a25b97bad7870c136"
},
{
"name": "test-60",
"keyA": "0xd140deee768594cea37e2eb5c89c60228083f93866ebd62c7c07a1a9f8a9bf58",
"keyB": "0xc9f2edf7ccd6db9f21ef5a3966ee11694dec652d60ef21a540802db8b990c370",
"shared": "0x0451b4a54b1fcdcbe4f5b97b3003bce3cc91f362cf2baa696ad0abca3cd21b12d4e4f3d1b0dc1c18599917f5fc9be7825d23999769d3811edf61a7ecc34525b403"
},
{
"name": "test-61",
"keyA": "0x63dcf1d3db0d89a37df3734e88f601412a184030f15474a0d9687e3105361161",
"keyB": "0x5370bec049bcd28507f4078783d9378cd84b8e05230089e8987d3a485c945b08",
"shared": "0x04e27e5ec5eb72fa6bda376f832b4730d6f7b9104594fa191ac87198f0d4aeed47c79568cf8f59fae0e43e8bf0931c491eda0cce1f19efc4153aacde94e673ba7f"
},
{
"name": "test-62",
"keyA": "0x465d0d758d8c7664d9e1bfa46fb5fb8e27265cb4bc28c0f7752d596910545028",
"keyB": "0xeff55416a21e627ec4c55a08c9a3f7378ae2953fd5bf0926bde15965cf6b4d5d",
"shared": "0x0487b20dbad3b5443594fc66470559206c37440a01ef91c24c38a51bc7bcf7676409789c6bc214087947ab8d0359927080422b2ecbd23e765bf6a79e4bbb456796"
},
{
"name": "test-63",
"keyA": "0x28469aab3ebc9efdec35b19e7c42a26311c649267ac92ae2ef2f5c8880eb517c",
"keyB": "0x786e828e92abb73818380b37395c67dcb6a72f3e0a440bdf1f5f132a0621fc78",
"shared": "0x046bfff91c9b31abb6df020018b66734c7f9fc4f7294c809c706b76c308982e5d75c10200fbdf67d75ba4b154223f591bfe3504006ba69634d4025c57b9af4ab73"
}
];
for (const { name, keyA, keyB, shared } of tests) {
it(`tests shared secrets match: ${name}`, function () {
const signA = new index_js_2.SigningKey(keyA);
const signB = new index_js_2.SigningKey(keyB);
assert_1.default.equal(signA.computeSharedSecret(signB.publicKey), shared, "privA + pubB");
assert_1.default.equal(signB.computeSharedSecret(signA.publicKey), shared, "pubA + privB");
assert_1.default.equal(signA.computeSharedSecret(signB.privateKey), shared, "privA + privB");
});
}
});
//# sourceMappingURL=test-crypto.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-hash-typeddata.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-hash-typeddata.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-hash-typeddata.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const utils_js_1 = require("./utils.js");
const index_js_1 = require("../index.js");
describe("Tests Typed Data (EIP-712)", function () {

View File

@@ -1 +1 @@
{"version":3,"file":"test-hash-typeddata.js","sourceRoot":"","sources":["../../src.ts/_tests/test-hash-typeddata.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,yCAAuC;AAGvC,0CAA+C;AAG/C,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAoB,YAAY,CAAC,CAAC;IACzD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,EAAE,CAAC,8BAA+B,IAAI,CAAC,IAAK,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,2BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClD,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YACnE,gBAAM,CAAC,KAAK,CA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;YAC3F,gBAAM,CAAC,KAAK,CAAC,2BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}

2
lib.commonjs/_tests/test-hash.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-hash.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-hash.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-hash.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
const utils_js_1 = require("./utils.js");
//import { dnsEncode, isValidName, namehash } from "../index.js";

View File

@@ -1 +1 @@
{"version":3,"file":"test-hash.js","sourceRoot":"","sources":["../../src.ts/_tests/test-hash.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAKqB;AAErB,yCAAsC;AAKtC,iEAAiE;AAEjE,QAAQ,CAAC,gBAAgB,EAAE;IACvB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAmB,UAAU,CAAC,CAAC;IAEtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACb,EAAE,CAAC,oBAAqB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,EAAE;gBAClD,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEtC,gBAAM,CAAC,KAAK,CAAC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E,CAAC,CAAC,CAAC;KACN;IAED,MAAM,QAAQ,GAAG;QACb,EAAE,KAAK,EAAE,CAAE,OAAO,CAAE,EAAE,MAAM,EAAE,CAAE,CAAC,CAAE,EAAE;QACrC,EAAE,KAAK,EAAE,CAAE,QAAQ,CAAE,EAAE,MAAM,EAAE,CAAE,IAAI,CAAE,EAAE;QACzC,EAAE,KAAK,EAAE,CAAE,OAAO,CAAE,EAAE,MAAM,EAAE,CAAE,KAAK,CAAE,EAAE;KAC5C,CAAC;IAEF,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE;QACtC,EAAE,CAAC,iCAAiC,EAAE;YAClC,gBAAM,CAAC,MAAM,CAAC;gBACV,MAAM,MAAM,GAAG,IAAA,yBAAc,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,EAAE,UAAU,KAAK;gBACd,OAAO,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-avatar.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-avatar.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const create_provider_js_1 = require("./create-provider.js");
(0, create_provider_js_1.setupProviders)();
describe("Resolve ENS avatar", function () {

View File

@@ -1 +1 @@
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,oBAAoB,EAAE;IAC3B;QACI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,owCAAowC,EAAE;QACp0C,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,8EAA8E,EAAE;QAC9I,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,qCAAqC,EAAE;KACtG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACP;;;;;;;;;;;;;MAaE;AACF,CAAC,CAAC,CAAC"}
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,oBAAoB,EAAE;IAC3B;QACI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,owCAAowC,EAAE;QACp0C,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,8EAA8E,EAAE;QAC9I,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,qCAAqC,EAAE;KACtG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACP;;;;;;;;;;;;;MAaE;AACF,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-ccip.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-ccip.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-ccip.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
const create_provider_js_1 = require("./create-provider.js");
(0, create_provider_js_1.setupProviders)();

View File

@@ -1 +1 @@
{"version":3,"file":"test-providers-ccip.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-ccip.ts"],"names":[],"mappings":";;;;;AAA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CAAC,CAAC;QAEpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;QAEnC,sCAAsC;QACtC,MAAM,EAAE,GAAG;YACP,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI;YACjC,IAAI,EAAE,4MAA4M;SACrN,CAAA;QAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAA"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-data.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-data.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const create_provider_js_1 = require("./create-provider.js");
const utils_js_1 = require("./utils.js");
const blockchain_data_js_1 = require("./blockchain-data.js");

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-errors.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-errors.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-errors.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
const create_provider_js_1 = require("./create-provider.js");
const utils_js_1 = require("./utils.js");
@@ -36,6 +34,7 @@ describe("Tests Provider Call Exception", function () {
(0, index_js_1.dataSlice)((0, index_js_1.id)("testPanic(uint256)"), 0, 4),
(0, index_js_1.zeroPadValue)((0, index_js_1.toBeArray)(code), 32)
]);
await (0, utils_js_1.stall)(1000);
const tx = { to: testAddr, data };
try {
const result = await (method === "call" ? provider.call(tx) : provider.estimateGas(tx));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-extra.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-extra.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-extra.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
const utils_js_1 = require("./utils.js");
describe("Test Etherscan extra APIs", function () {

View File

@@ -1 +1 @@
{"version":3,"file":"test-providers-extra.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-extra.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAAgD;AAEhD,yCAAqC;AAGrC,QAAQ,CAAC,2BAA2B,EAAE;IAClC,IAAA,kBAAO,EAAC,oCAAoC,EAAE,KAAK;QAC/C,MAAM,QAAQ,GAAG,IAAI,4BAAiB,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;QACxF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;QACrE,gBAAM,CAAC,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAChD,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
{"version":3,"file":"test-providers-extra.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-extra.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAE5B,0CAAgD;AAEhD,yCAAqC;AAGrC,QAAQ,CAAC,2BAA2B,EAAE;IAClC,IAAA,kBAAO,EAAC,oCAAoC,EAAE,KAAK;QAC/C,MAAM,QAAQ,GAAG,IAAI,4BAAiB,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;QACxF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;QACrE,gBAAM,CAAC,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAChD,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-send.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-send.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-send.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const index_js_1 = require("../index.js");
const create_provider_js_1 = require("./create-provider.js");
function stall(duration) {

View File

@@ -1 +1 @@
{"version":3,"file":"test-providers-send.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-send.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;A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C,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-providers-wildcard.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-providers-wildcard.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-wildcard.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const create_provider_js_1 = require("./create-provider.js");
(0, create_provider_js_1.setupProviders)();
describe("Test EIP-2544 ENS wildcards", function () {

View File

@@ -1 +1 @@
{"version":3,"file":"test-providers-wildcard.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-wildcard.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,6BAA6B,EAAE;IACpC,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;IAEnC,EAAE,CAAC,sBAAsB,EAAE,KAAK;QAC5B,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAClE,gBAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;QAE9C,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,4CAA4C,EAAE,SAAS,CAAC,CAAC;QACxF,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC;QAE5E,2BAA2B;QAC3B,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,EAAE,EAAE,6DAA6D,EAAE,aAAa,CAAC,CAAC;QAEvH,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,EAAE,4CAA4C,EAAE,cAAc,CAAC,CAAC;IAC5G,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
{"version":3,"file":"test-providers-wildcard.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-wildcard.ts"],"names":[],"mappings":";;;AAAA,4DAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,6BAA6B,EAAE;IACpC,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;IAEnC,EAAE,CAAC,sBAAsB,EAAE,KAAK;QAC5B,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAClE,gBAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;QAE9C,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,4CAA4C,EAAE,SAAS,CAAC,CAAC;QACxF,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC;QAE5E,2BAA2B;QAC3B,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,EAAE,EAAE,6DAA6D,EAAE,aAAa,CAAC,CAAC;QAEvH,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,EAAE,4CAA4C,EAAE,cAAc,CAAC,CAAC;IAC5G,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

2
lib.commonjs/_tests/test-rlp.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-rlp.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-rlp.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-rlp.ts"],"names":[],"mappings":""}

View File

@@ -1,9 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const utils_js_1 = require("./utils.js");
const index_js_1 = require("../index.js");
describe("Test RLP Coder", function () {
@@ -15,7 +13,7 @@ describe("Test RLP Coder", function () {
});
tests.forEach(({ name, encoded, decoded }) => {
it(`decodes RLP: ${name}`, function () {
assert_1.default.deepStrictEqual((0, index_js_1.decodeRlp)(encoded), decoded);
assert_1.default.deepEqual((0, index_js_1.decodeRlp)(encoded), decoded);
});
});
});
@@ -46,7 +44,7 @@ describe("Test bad RLP Data", function () {
}, (error) => {
return (error.code === "BUFFER_OVERRUN" &&
error.message.match(/^data too short/) &&
Buffer.from(error.buffer).toString("hex") === "" &&
(0, index_js_1.hexlify)(error.buffer) === "0x" &&
error.offset === 1 &&
error.length === 0);
});
@@ -57,7 +55,7 @@ describe("Test bad RLP Data", function () {
}, (error) => {
return (error.code === "BUFFER_OVERRUN" &&
error.message.match(/^child data too short/) &&
Buffer.from(error.buffer).toString("hex") === "c8880102030405060708" &&
(0, index_js_1.hexlify)(error.buffer) === "0xc8880102030405060708" &&
error.offset === 0 &&
error.length === 8);
});
@@ -70,7 +68,7 @@ describe("Test bad RLP Data", function () {
}, (error) => {
return (error.code === "BUFFER_OVERRUN" &&
error.message.match(/^data short segment too short/) &&
Buffer.from(error.buffer).toString("hex") === "c8c382c3823145" &&
(0, index_js_1.hexlify)(error.buffer) === "0xc8c382c3823145" &&
error.offset === 9 &&
error.length === 7);
});

View File

@@ -1 +1 @@
{"version":3,"file":"test-rlp.js","sourceRoot":"","sources":["../../src.ts/_tests/test-rlp.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAEvC,0CAAmD;AAInD,QAAQ,CAAC,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File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=test-transaction.d.ts.map

Some files were not shown because too many files have changed in this diff Show More