diff --git a/apps/remix-ide/src/remixEngine.js b/apps/remix-ide/src/remixEngine.js index 6b96d44783..2eac1e085d 100644 --- a/apps/remix-ide/src/remixEngine.js +++ b/apps/remix-ide/src/remixEngine.js @@ -27,7 +27,7 @@ export class RemixEngine extends Engine { if (name === 'filePanel') return { queueTimeout: 60000 * 20 } if (name === 'fileManager') return { queueTimeout: 60000 * 20 } if (name === 'openaigpt') return { queueTimeout: 60000 * 2 } - if (name === 'cookbookdev') return { queueTimeout: 60000 * 2 } + if (name === 'cookbookdev') return { queueTimeout: 60000 * 3 } return { queueTimeout: 10000 } } diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index 7cb42f1470..668d7c60c6 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -2,6 +2,8 @@ import { hash } from '@remix-project/remix-lib' import { bytesToHex, setLengthLeft, toBytes, addHexPrefix } from '@ethereumjs/util' import stringSimilarity from 'string-similarity' +import { BN } from 'bn.js' +import { isBigInt } from 'web3-validator' /* contains misc util: @TODO should be split @@ -152,6 +154,12 @@ export function buildCallPath (index, rootCall) { */ // eslint-disable-next-line camelcase export function sha3_256 (value) { + if ((value.constructor && value.constructor.name === 'BigNumber') || BN.isBN(value) || isBigInt(value)) { + value = value.toString(16) + } + if (typeof value === 'number') { + value = value.toString(16) + } value = toBytes(addHexPrefix(value)) const retInBuffer: Uint8Array = hash.keccak(Buffer.from(setLengthLeft(value, 32))) return bytesToHex(retInBuffer)