pull/5370/head
yann300 8 months ago
parent 2cf0cbaeb0
commit 4e871030e3
  1. 2
      apps/remix-ide/src/remixEngine.js
  2. 8
      libs/remix-lib/src/util.ts

@ -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 }
}

@ -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)

Loading…
Cancel
Save