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/libs/remix-debug/test/init.ts

32 lines
847 B

var init = {
overrideWeb3: function (web3, web3Override) {
web3.eth.getCode = web3Override.getCode
web3.debug.traceTransaction = web3Override.traceTransaction
8 years ago
web3.debug.storageRangeAt = web3Override.storageRangeAt
web3.eth.getTransaction = web3Override.getTransaction
web3.eth.getTransactionFromBlock = web3Override.getTransactionFromBlock
web3.eth.getBlockNumber = web3Override.getBlockNumber
},
readFile: function (filename, callback) {
var fs = require('fs')
try {
console.log('reading ' + filename)
if (callback) {
fs.readFile(filename, 'utf8', callback)
} else {
return fs.readFileSync(filename, 'utf8')
}
} catch (e) {
console.log(e)
if (callback) {
callback(e)
} else {
return e
}
}
}
}
module.exports = init