implement eth_coinbase

pull/5370/head
Iuri Matias 6 years ago
parent 165736146a
commit da15b1786f
  1. 2
      remix-simulator/README.md
  2. 5
      remix-simulator/bin/ethsim
  3. 5
      remix-simulator/src/methods/blocks.js
  4. 2
      remix-simulator/src/provider.js
  5. 4
      remix-simulator/src/server.js

@ -9,7 +9,7 @@ Implemented:
* [X] net_peerCount
* [X] eth_protocolVersion
* [X] eth_syncing
* [_] eth_coinbase
* [X] eth_coinbase
* [X] eth_mining
* [X] eth_hashrate
* [~] eth_gasPrice

@ -22,9 +22,12 @@ program
program
.option('-p, --port [port]', 'specify port')
.option('-b, --ip [host]', 'specify host')
.option('-c, --coinbase [coinbase]', 'specify host')
.parse(process.argv)
const Server = require('../src/server')
const server = new Server()
const server = new Server({
coinbase: program.coinbase || "0x0000000000000000000000000000000000000000"
})
server.start(program.host || '127.0.0.1', program.port || 8545)

@ -1,5 +1,6 @@
var Blocks = function () {
var Blocks = function (options) {
this.coinbase = options.coinbase || "0x0000000000000000000000000000000000000000"
}
Blocks.prototype.methods = function () {
@ -17,7 +18,7 @@ Blocks.prototype.eth_getBlockByNumber = function (payload, cb) {
'gasUsed': '0x0',
'hash': '0xdb731f3622ef37b4da8db36903de029220dba74c41185f8429f916058b86559f',
'logsBloom': '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
'miner': '0x3333333333333333333333333333333333333333',
'miner': this.coinbase,
'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000',
'nonce': '0x0000000000000042',
'number': '0x0',

@ -8,7 +8,7 @@ const Net = require('./methods/net.js')
const Transactions = require('./methods/transactions.js')
const Whisper = require('./methods/whisper.js')
var Provider = function () {
var Provider = function (options) {
this.Accounts = new Accounts()
this.methods = {}

@ -6,8 +6,8 @@ const Provider = require('./provider')
const log = require('./utils/logs.js')
class Server {
constructor () {
this.provider = new Provider()
constructor (options) {
this.provider = new Provider(options)
}
start (host, port) {

Loading…
Cancel
Save