Skip to content

Commit

Permalink
Revert "fix: node 20 support (#141)"
Browse files Browse the repository at this point in the history
This reverts commit d615c01.
  • Loading branch information
nugaon authored Jun 13, 2024
1 parent d615c01 commit ab92a76
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 166 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ docs
.vscode

generator/build
yarn.lock
174 changes: 19 additions & 155 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dockerode": "^4.0.2",
"ethers": "^5.7.2",
"furious-commander": "^1.7.1",
"node-fetch": "3.3.2",
"node-fetch": "3.0.0-beta.9",
"ora": "^5.3.0"
},
"devDependencies": {
Expand Down
8 changes: 1 addition & 7 deletions src/shim/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,5 @@ const getRandomValuesNode = <T extends ArrayBufferView | null>(array: T): T => {
}

if (isNode && globalThis) {
if (!globalThis.crypto) {
globalThis.crypto = {} as Crypto;
}

if (!globalThis.crypto.getRandomValues) {
globalThis.crypto.getRandomValues = getRandomValuesNode;
}
globalThis.crypto = { ...globalThis.crypto, getRandomValues: getRandomValuesNode }
}
4 changes: 2 additions & 2 deletions src/utils/wait.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { default as __fetch, FetchError } from 'node-fetch'
import fetch, { FetchError } from 'node-fetch'
import { sleep } from './index'
import { TimeoutError } from './error'
import { BeeDebug } from '@ethersphere/bee-js'
Expand Down Expand Up @@ -40,7 +40,7 @@ function isAllowedError(e: FetchError): boolean {
export async function waitForBlockchain(waitingIterations = 30): Promise<void> {
for (let i = 0; i < waitingIterations; i++) {
try {
const request = await __fetch('http://127.0.0.1:9545', {
const request = await fetch('http://127.0.0.1:9545', {
method: 'POST',
body: BLOCKCHAIN_BODY_REQUEST,
headers: { 'Content-Type': 'application/json' },
Expand Down

0 comments on commit ab92a76

Please sign in to comment.