|
|
@ -1,10 +1,9 @@ |
|
|
|
const version = require('../../package.json').version |
|
|
|
const version = require('../../package.json').version |
|
|
|
const web3 = require('web3') |
|
|
|
import web3 from 'web3' |
|
|
|
|
|
|
|
|
|
|
|
const Misc = function () { |
|
|
|
export class Misc { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.methods = function () { |
|
|
|
methods () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
web3_clientVersion: this.web3_clientVersion.bind(this), |
|
|
|
web3_clientVersion: this.web3_clientVersion.bind(this), |
|
|
|
eth_protocolVersion: this.eth_protocolVersion.bind(this), |
|
|
|
eth_protocolVersion: this.eth_protocolVersion.bind(this), |
|
|
@ -17,48 +16,47 @@ Misc.prototype.methods = function () { |
|
|
|
eth_compileLLL: this.eth_compileLLL.bind(this), |
|
|
|
eth_compileLLL: this.eth_compileLLL.bind(this), |
|
|
|
eth_compileSerpent: this.eth_compileSerpent.bind(this) |
|
|
|
eth_compileSerpent: this.eth_compileSerpent.bind(this) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.web3_clientVersion = function (payload, cb) { |
|
|
|
web3_clientVersion (payload, cb) { |
|
|
|
cb(null, 'Remix Simulator/' + version) |
|
|
|
cb(null, 'Remix Simulator/' + version) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_protocolVersion = function (payload, cb) { |
|
|
|
eth_protocolVersion (payload, cb) { |
|
|
|
cb(null, '0x3f') |
|
|
|
cb(null, '0x3f') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_syncing = function (payload, cb) { |
|
|
|
eth_syncing (payload, cb) { |
|
|
|
cb(null, false) |
|
|
|
cb(null, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_mining = function (payload, cb) { |
|
|
|
eth_mining (payload, cb) { |
|
|
|
// TODO: should depend on the state
|
|
|
|
// TODO: should depend on the state
|
|
|
|
cb(null, false) |
|
|
|
cb(null, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_hashrate = function (payload, cb) { |
|
|
|
eth_hashrate (payload, cb) { |
|
|
|
cb(null, '0x0') |
|
|
|
cb(null, '0x0') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.web3_sha3 = function (payload, cb) { |
|
|
|
web3_sha3 (payload, cb) { |
|
|
|
const str = payload.params[0] |
|
|
|
const str = payload.params[0] |
|
|
|
cb(null, web3.utils.sha3(str)) |
|
|
|
cb(null, web3.utils.sha3(str)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_getCompilers = function (payload, cb) { |
|
|
|
eth_getCompilers (payload, cb) { |
|
|
|
cb(null, []) |
|
|
|
cb(null, []) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_compileSolidity = function (payload, cb) { |
|
|
|
eth_compileSolidity (payload, cb) { |
|
|
|
cb(null, 'unsupported') |
|
|
|
cb(null, 'unsupported') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_compileLLL = function (payload, cb) { |
|
|
|
eth_compileLLL (payload, cb) { |
|
|
|
cb(null, 'unsupported') |
|
|
|
cb(null, 'unsupported') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Misc.prototype.eth_compileSerpent = function (payload, cb) { |
|
|
|
eth_compileSerpent (payload, cb) { |
|
|
|
cb(null, 'unsupported') |
|
|
|
cb(null, 'unsupported') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.exports = Misc |
|
|
|
|
|
|
|