Commit 5d818814 authored by aniket-engg's avatar aniket-engg Committed by Aniket

storage imports updated

parent 2984cc21
const util = require('../solidity-decoder/types/util')
import { sub } from '../solidity-decoder/types/util'
/**
* extract the mappings location from the storage
......@@ -17,7 +17,7 @@ export async function decodeMappingsKeys (web3, storage, corrections) {
try {
const key = storage[hashedLoc].key
for (let k in corrections) {
const corrected = util.sub(key, corrections[k].slot).toString(16)
const corrected = sub(key, corrections[k].slot).toString(16)
preimage = await getPreimage(web3, '0x' + corrected)
if (preimage) break
}
......
'use strict'
const traceHelper = require('../trace/traceHelper')
const mappingPreimages = require('./mappingPreimages')
import { isContractCreation } from '../trace/traceHelper'
import { decodeMappingsKeys } from './mappingPreimages'
/**
* Basically one instance is created for one debugging session.
......@@ -50,7 +50,7 @@ export class StorageResolver {
return this.preimagesMappingByAddress[address]
}
const storage = await this.storageRange(tx, stepIndex, address)
const mappings = mappingPreimages.decodeMappingsKeys(this.web3, storage, corrections)
const mappings = decodeMappingsKeys(this.web3, storage, corrections)
this.preimagesMappingByAddress[address] = mappings
return mappings
}
......@@ -130,7 +130,7 @@ export class StorageResolver {
storageRangeWeb3Call (tx, address, start, maxSize): Promise<Array<unknown>> {
return new Promise((resolve, reject) => {
if (traceHelper.isContractCreation(address)) {
if (isContractCreation(address)) {
resolve([{}, null])
} else {
this.web3.debug.storageRangeAt(
......
'use strict'
const remixLib = require('@remix-project/remix-lib')
const util = remixLib.util
const mappingPreimages = require('./mappingPreimages')
import { util } from '@remix-project/remix-lib'
import { decodeMappingsKeys } from './mappingPreimages'
/**
* easier access to the storage resolver
......@@ -102,7 +101,7 @@ export class StorageViewer {
if (this.mappingsLocationChanges) {
return this.mappingsLocationChanges
}
const mappings = mappingPreimages.decodeMappingsKeys(this.web3, storageChanges, corrections)
const mappings = decodeMappingsKeys(this.web3, storageChanges, corrections)
this.mappingsLocationChanges = mappings
return this.mappingsLocationChanges
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment