forked from ethereum/remix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
31 lines (29 loc) · 847 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var init = {
overrideWeb3: function (web3, web3Override) {
web3.eth.getCode = web3Override.getCode
web3.debug.traceTransaction = web3Override.traceTransaction
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