added dumpStorage back

pull/5370/head
Admin 3 years ago committed by Aniket
parent 313bdbcf55
commit 0903873ba0
  1. 5
      apps/remix-ide-e2e/src/tests/ballot.test.ts
  2. 6
      apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
  3. 8
      libs/remix-lib/src/web3Provider/web3VmProvider.ts
  4. 26
      libs/remix-simulator/test/blocks.ts

@ -57,7 +57,7 @@ module.exports = {
.goToVMTraceStep(144) .goToVMTraceStep(144)
.pause(2000) .pause(2000)
// Should be uncommented while fixing https://github.com/ethereum/remix-project/issues/1644 // Should be uncommented while fixing https://github.com/ethereum/remix-project/issues/1644
// .checkVariableDebug('soliditystate', stateCheck) .checkVariableDebug('soliditystate', stateCheck)
.checkVariableDebug('soliditylocals', localsCheck) .checkVariableDebug('soliditylocals', localsCheck)
}, },
@ -117,7 +117,7 @@ const localsCheck = {
type: 'address' type: 'address'
} }
} }
/*
const stateCheck = { const stateCheck = {
chairperson: { chairperson: {
value: '0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C', value: '0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C',
@ -175,7 +175,6 @@ const stateCheck = {
immutable: false immutable: false
} }
} }
*/
const ballotABI = `[ const ballotABI = `[
{ {

@ -253,7 +253,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="functionPanel"]', 'vote(proposal)', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'vote(proposal)', 60000)
.pause(2000) .pause(2000)
// Should be uncommented while fixing https://github.com/ethereum/remix-project/issues/1644 // Should be uncommented while fixing https://github.com/ethereum/remix-project/issues/1644
// .checkVariableDebug('soliditylocals', locals) .checkVariableDebug('soliditylocals', locals)
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.pause(2000) .pause(2000)
.openFile('tests/ballotFailedDebug_test.sol') .openFile('tests/ballotFailedDebug_test.sol')
@ -558,7 +558,7 @@ const sources = [
} }
} }
] ]
/*
const locals = { const locals = {
sender: { sender: {
value: { value: {
@ -586,4 +586,4 @@ const locals = {
type: 'uint256' type: 'uint256'
} }
} }
*/

@ -132,8 +132,8 @@ export class Web3VmProvider {
// dumpStorage throws error as 'Missing Node in DB' // dumpStorage throws error as 'Missing Node in DB'
// This can be uncommented once that error is handled // This can be uncommented once that error is handled
// https://github.com/ethereum/remix-project/issues/1644 // https://github.com/ethereum/remix-project/issues/1644
// const storage = await this.vm.stateManager.dumpStorage(data.to) const storage = await this.vm.stateManager.dumpStorage(data.to)
const storage = {} // const storage = {}
this.storageCache[this.processingHash][tx['to']] = storage this.storageCache[this.processingHash][tx['to']] = storage
this.lastProcessedStorageTxHash[tx['to']] = this.processingHash this.lastProcessedStorageTxHash[tx['to']] = this.processingHash
} catch (e) { } catch (e) {
@ -252,8 +252,8 @@ export class Web3VmProvider {
// dumpStorage throws error as 'Missing Node in DB' // dumpStorage throws error as 'Missing Node in DB'
// This can be uncommented once that error is handled // This can be uncommented once that error is handled
// https://github.com/ethereum/remix-project/issues/1644 // https://github.com/ethereum/remix-project/issues/1644
// const storage = await this.vm.stateManager.dumpStorage(account) const storage = await this.vm.stateManager.dumpStorage(account)
const storage = {} // const storage = {}
this.storageCache[this.processingHash][this.processingAddress] = storage this.storageCache[this.processingHash][this.processingAddress] = storage
this.lastProcessedStorageTxHash[this.processingAddress] = this.processingHash this.lastProcessedStorageTxHash[this.processingAddress] = this.processingHash
} catch (e) { } catch (e) {

@ -116,7 +116,6 @@ describe('blocks', () => {
}) })
}) })
/*
describe('eth_getStorageAt', () => { describe('eth_getStorageAt', () => {
it('should get storage at position at given address', async () => { it('should get storage at position at given address', async () => {
const abi: any = [ const abi: any = [
@ -201,29 +200,28 @@ describe('blocks', () => {
} }
] ]
// const code = '0x608060405234801561001057600080fd5b506040516020806102018339810180604052602081101561003057600080fd5b810190808051906020019092919050505080600081905550506101a9806100586000396000f3fe60806040526004361061005c576000357c0100000000000000000000000000000000000000000000000000000000900480632a1afcd91461006157806360fe47b11461008c5780636d4ce63c146100c7578063ce01e1ec146100f2575b600080fd5b34801561006d57600080fd5b5061007661012d565b6040518082815260200191505060405180910390f35b34801561009857600080fd5b506100c5600480360360208110156100af57600080fd5b8101908080359060200190929190505050610133565b005b3480156100d357600080fd5b506100dc61013d565b6040518082815260200191505060405180910390f35b3480156100fe57600080fd5b5061012b6004803603602081101561011557600080fd5b8101908080359060200190929190505050610146565b005b60005481565b8060008190555050565b60008054905090565b80600081905550807f63a242a632efe33c0e210e04e4173612a17efa4f16aa4890bc7e46caece80de060405160405180910390a25056fea165627a7a7230582063160eb16dc361092a85ced1a773eed0b63738b83bea1e1c51cf066fa90e135d0029' const code = '0x608060405234801561001057600080fd5b506040516020806102018339810180604052602081101561003057600080fd5b810190808051906020019092919050505080600081905550506101a9806100586000396000f3fe60806040526004361061005c576000357c0100000000000000000000000000000000000000000000000000000000900480632a1afcd91461006157806360fe47b11461008c5780636d4ce63c146100c7578063ce01e1ec146100f2575b600080fd5b34801561006d57600080fd5b5061007661012d565b6040518082815260200191505060405180910390f35b34801561009857600080fd5b506100c5600480360360208110156100af57600080fd5b8101908080359060200190929190505050610133565b005b3480156100d357600080fd5b506100dc61013d565b6040518082815260200191505060405180910390f35b3480156100fe57600080fd5b5061012b6004803603602081101561011557600080fd5b8101908080359060200190929190505050610146565b005b60005481565b8060008190555050565b60008054905090565b80600081905550807f63a242a632efe33c0e210e04e4173612a17efa4f16aa4890bc7e46caece80de060405160405180910390a25056fea165627a7a7230582063160eb16dc361092a85ced1a773eed0b63738b83bea1e1c51cf066fa90e135d0029'
// const contract = new web3.eth.Contract(abi) const contract = new web3.eth.Contract(abi)
// const accounts = await web3.eth.getAccounts() const accounts = await web3.eth.getAccounts()
// const contractInstance: any = await contract.deploy({ data: code, arguments: [100] }).send({ from: accounts[0], gas: 400000 }) const contractInstance: any = await contract.deploy({ data: code, arguments: [100] }).send({ from: accounts[0], gas: 400000 })
// contractInstance.currentProvider = web3.eth.currentProvider contractInstance.currentProvider = web3.eth.currentProvider
// contractInstance.givenProvider = web3.eth.currentProvider contractInstance.givenProvider = web3.eth.currentProvider
// await contractInstance.methods.set(100).send({ from: accounts[0].toLowerCase(), gas: 400000 }) await contractInstance.methods.set(100).send({ from: accounts[0].toLowerCase(), gas: 400000 })
// let storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) let storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
// assert.deepEqual(storage, '0x64') assert.deepEqual(storage, '0x64')
// await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 }) await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 })
// storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
// assert.deepEqual(storage, '0x64') assert.deepEqual(storage, '0x64')
await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 }) await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 })
storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
assert.deepEqual(storage, '0xc8') assert.deepEqual(storage, '0xc8')
}) })
}) })
*/
describe('eth_call', () => { describe('eth_call', () => {
it('should get a value', async () => { it('should get a value', async () => {

Loading…
Cancel
Save