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