parent
febab2efc2
commit
0c4348a6ee
@ -1,62 +1,60 @@ |
||||
const version = require('../../package.json').version |
||||
import web3 from 'web3' |
||||
|
||||
export class Misc { |
||||
|
||||
methods () { |
||||
return { |
||||
web3_clientVersion: this.web3_clientVersion.bind(this), |
||||
eth_protocolVersion: this.eth_protocolVersion.bind(this), |
||||
eth_syncing: this.eth_syncing.bind(this), |
||||
eth_mining: this.eth_mining.bind(this), |
||||
eth_hashrate: this.eth_hashrate.bind(this), |
||||
web3_sha3: this.web3_sha3.bind(this), |
||||
eth_getCompilers: this.eth_getCompilers.bind(this), |
||||
eth_compileSolidity: this.eth_compileSolidity.bind(this), |
||||
eth_compileLLL: this.eth_compileLLL.bind(this), |
||||
eth_compileSerpent: this.eth_compileSerpent.bind(this) |
||||
} |
||||
import Web3 from 'web3' |
||||
|
||||
export function methods () { |
||||
return { |
||||
web3_clientVersion: this.web3_clientVersion.bind(this), |
||||
eth_protocolVersion: this.eth_protocolVersion.bind(this), |
||||
eth_syncing: this.eth_syncing.bind(this), |
||||
eth_mining: this.eth_mining.bind(this), |
||||
eth_hashrate: this.eth_hashrate.bind(this), |
||||
web3_sha3: this.web3_sha3.bind(this), |
||||
eth_getCompilers: this.eth_getCompilers.bind(this), |
||||
eth_compileSolidity: this.eth_compileSolidity.bind(this), |
||||
eth_compileLLL: this.eth_compileLLL.bind(this), |
||||
eth_compileSerpent: this.eth_compileSerpent.bind(this) |
||||
} |
||||
} |
||||
|
||||
web3_clientVersion (payload, cb) { |
||||
cb(null, 'Remix Simulator/' + version) |
||||
} |
||||
export function web3_clientVersion (payload, cb) { |
||||
cb(null, 'Remix Simulator/' + version) |
||||
} |
||||
|
||||
eth_protocolVersion (payload, cb) { |
||||
cb(null, '0x3f') |
||||
} |
||||
export function eth_protocolVersion (payload, cb) { |
||||
cb(null, '0x3f') |
||||
} |
||||
|
||||
eth_syncing (payload, cb) { |
||||
cb(null, false) |
||||
} |
||||
export function eth_syncing (payload, cb) { |
||||
cb(null, false) |
||||
} |
||||
|
||||
eth_mining (payload, cb) { |
||||
// TODO: should depend on the state
|
||||
cb(null, false) |
||||
} |
||||
export function eth_mining (payload, cb) { |
||||
// TODO: should depend on the state
|
||||
cb(null, false) |
||||
} |
||||
|
||||
eth_hashrate (payload, cb) { |
||||
cb(null, '0x0') |
||||
} |
||||
export function eth_hashrate (payload, cb) { |
||||
cb(null, '0x0') |
||||
} |
||||
|
||||
web3_sha3 (payload, cb) { |
||||
const str = payload.params[0] |
||||
cb(null, web3.utils.sha3(str)) |
||||
} |
||||
export function web3_sha3 (payload, cb) { |
||||
const str: string = payload.params[0] |
||||
cb(null, Web3.utils.sha3(str)) |
||||
} |
||||
|
||||
eth_getCompilers (payload, cb) { |
||||
cb(null, []) |
||||
} |
||||
export function eth_getCompilers (payload, cb) { |
||||
cb(null, []) |
||||
} |
||||
|
||||
eth_compileSolidity (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
export function eth_compileSolidity (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
|
||||
eth_compileLLL (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
export function eth_compileLLL (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
|
||||
eth_compileSerpent (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
export function eth_compileSerpent (payload, cb) { |
||||
cb(null, 'unsupported') |
||||
} |
||||
|
||||
|
@ -1,24 +1,20 @@ |
||||
|
||||
export class Net { |
||||
|
||||
methods () { |
||||
return { |
||||
net_version: this.net_version, |
||||
net_listening: this.net_listening, |
||||
net_peerCount: this.net_peerCount |
||||
} |
||||
export function methods (): Record<string, unknown> { |
||||
return { |
||||
net_version: this.net_version, |
||||
net_listening: this.net_listening, |
||||
net_peerCount: this.net_peerCount |
||||
} |
||||
} |
||||
|
||||
net_version (payload, cb) { |
||||
// should be configured networkId
|
||||
cb(null, 1337) |
||||
} |
||||
export function net_version (payload, cb): void { |
||||
// should be configured networkId
|
||||
cb(null, 1337) |
||||
} |
||||
|
||||
net_listening (payload, cb) { |
||||
cb(null, true) |
||||
} |
||||
export function net_listening (payload, cb): void { |
||||
cb(null, true) |
||||
} |
||||
|
||||
net_peerCount (payload, cb) { |
||||
cb(null, 0) |
||||
} |
||||
export function net_peerCount (payload, cb): void { |
||||
cb(null, 0) |
||||
} |
||||
|
Loading…
Reference in new issue