lodestar
lodestar copied to clipboard
chore: remove got dependency
Motivation
For the solution of #6488
Description
Changed all codes which use got
to fetch
module.
Closes # #6488
Steps to test or reproduce
yarn build
yarn test:unit
The correct way to remove a dependency is to use the yarn remove command.
@jeluard is there a difference between that and just removing it from package.json + running yarn install afterwards?
The correct way to remove a dependency is to use the yarn remove command.
@jeluard is there a difference between that and just removing it from package.json + running yarn install afterwards?
Probably not, somehow it feels safer to use yarn remove
:)
The correct way to remove a dependency is to use the yarn remove command.
@jeluard is there a difference between that and just removing it from package.json + running yarn install afterwards?
Probably not, somehow it feels safer to use
yarn remove
:)
Sorry, should delete by yarn remove
Remaining task
- [x] Importing @lodestar/api for wrapedFetch function
- [x] Delete following codes
if (err instanceof FetchError && err.code !== "ECONNREFUSED") {
return {ok: true};
}
- [x] Unility function for fetch of POST requests (using wrapedFetch)
- [x] Error handing of fetchBootnode
- [x] Simulate the error dev node for it by passing --network flag. Reference PR https://github.com/ChainSafe/lodestar/pull/6279
4XX-5XX Error
Error: Error fetching bootnodes file: Status Code 404 (Not Found)
at fetchBootnodes (file:///home/hnaito/lodestar/packages/cli/src/networks/index.ts:116:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at getNetworkBootnodes (file:///home/hnaito/lodestar/packages/cli/src/networks/index.ts:128:24)
at beaconHandlerInit (file:///home/hnaito/lodestar/packages/cli/src/cmds/beacon/handler.ts:179:35)
Other error
Error fetching latest bootnodes: FetchError: Request to https://example-example-example.com/notfound failed, reason: getaddrinfo ENOTFOUND example-example-example.com
at wrappedFetch (file:///home/hnaito/lodestar/packages/api/src/utils/client/fetch.ts:12:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at fetchBootnodes (file:///home/hnaito/lodestar/packages/cli/src/networks/index.ts:114:15)
at getNetworkBootnodes (file:///home/hnaito/lodestar/packages/cli/src/networks/index.ts:128:24)
at beaconHandlerInit (file:///home/hnaito/lodestar/packages/cli/src/cmds/beacon/handler.ts:179:35)
at Object.beaconHandler [as handler] (file:///home/hnaito/lodestar/packages/cli/src/cmds/beacon/handler.ts:36:84)
@nflaig So far, pointed codes are corrected. However, you mentioned the nested Error still Nesting by FetchError. https://github.com/ChainSafe/lodestar/pull/6497/files#diff-e138e8a415f1771c2089d8cf11a0ec52cb3c345e163e9b7573fc0284c342b4a1R130
Codecov Report
Attention: Patch coverage is 22.22222%
with 14 lines
in your changes missing coverage. Please review.
Project coverage is 61.71%. Comparing base (
6675739
) to head (e90a890
). Report is 381 commits behind head on unstable.
Additional details and impacted files
@@ Coverage Diff @@
## unstable #6497 +/- ##
============================================
- Coverage 61.72% 61.71% -0.01%
============================================
Files 555 555
Lines 58204 58217 +13
Branches 1843 1844 +1
============================================
+ Hits 35926 35931 +5
- Misses 22239 22247 +8
Partials 39 39
closing as stale