fix reference

pull/5370/head
yann300 2 years ago
parent a4c423deff
commit 03e668bf91
  1. 6
      libs/remix-lib/src/hash.ts
  2. 4
      libs/remix-simulator/src/vm-context.ts

@ -1,6 +1,6 @@
import { keccak224, keccak384, keccak256 as k256, keccak512 } from 'ethereum-cryptography/keccak' import { keccak224, keccak384, keccak256 as k256, keccak512 } from 'ethereum-cryptography/keccak'
const createHash = require('create-hash') const createHash = require('create-hash')
import * as rlp from 'rlp' import { encode, Input } from 'rlp'
import { toBuffer, setLengthLeft, isHexString } from '@ethereumjs/util' import { toBuffer, setLengthLeft, isHexString } from '@ethereumjs/util'
/** /**
@ -157,8 +157,8 @@ export const ripemd160FromArray = function(a: number[], padded: boolean): Buffer
* Creates SHA-3 hash of the RLP encoded version of the input. * Creates SHA-3 hash of the RLP encoded version of the input.
* @param a The input data * @param a The input data
*/ */
export const rlphash = function(a: rlp.Input): Buffer { export const rlphash = function(a: Input): Buffer {
return keccak(rlp.encode(a)) return keccak(encode(a))
} }
/** /**

@ -2,7 +2,7 @@
'use strict' 'use strict'
import { hash } from '@remix-project/remix-lib' import { hash } from '@remix-project/remix-lib'
import { bufferToHex } from '@ethereumjs/util' import { bufferToHex } from '@ethereumjs/util'
import rlp from 'rlp' import { decode } from 'rlp'
import { execution } from '@remix-project/remix-lib' import { execution } from '@remix-project/remix-lib'
const { LogsManager } = execution const { LogsManager } = execution
import { VmProxy } from './VmProxy' import { VmProxy } from './VmProxy'
@ -66,7 +66,7 @@ class StateManagerCommonStorageDump extends DefaultStateManager {
const stream = trie.createReadStream() const stream = trie.createReadStream()
stream.on('data', (val) => { stream.on('data', (val) => {
const value = rlp.decode(val.value) const value = decode(val.value)
storage['0x' + val.key.toString('hex')] = { storage['0x' + val.key.toString('hex')] = {
key: this.keyHashes[val.key.toString('hex')], key: this.keyHashes[val.key.toString('hex')],
value: '0x' + value.toString('hex') value: '0x' + value.toString('hex')

Loading…
Cancel
Save