remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/test/TestTraceRetriever.js

38 lines
1.1 KiB

'use strict'
var traceHelper = require('../src/helpers/traceHelper')
var traceInvokation = require('./resources/contractInvokationTrace')
function TestTraceRetriever () {
this.storages = {} // contains all intial storage (by addresses)
}
TestTraceRetriever.prototype.getTrace = function (txHash, callback) {
console.log(traceInvokation)
callback(null, traceInvokation)
}
/* not used */
TestTraceRetriever.prototype.getStorage = function (tx, address, callback) {
if (traceHelper.isContractCreation(address)) {
callback(null, {})
} else if (this.storages[address]) {
callback(null, this.storages[address])
} else {
/*
return storage
*/
/*
var self = this
this.web3.debug.storageAt(tx.blockNumber.toString(), tx.transactionIndex, address, function (error, result) {
self.storages[address] = result
callback(error, result)
})
*/
}
}
TestTraceRetriever.prototype.debugStorageAtAvailable = function () {
return false // test scenario does not require web3.
}
module.exports = TestTraceRetriever