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] net_peerCount
* [X] eth_protocolVersion * [X] eth_protocolVersion
* [X] eth_syncing * [X] eth_syncing
* [_] eth_coinbase * [X] eth_coinbase
* [X] eth_mining * [X] eth_mining
* [X] eth_hashrate * [X] eth_hashrate
* [~] eth_gasPrice * [~] eth_gasPrice

@ -22,9 +22,12 @@ program
program program
.option('-p, --port [port]', 'specify port') .option('-p, --port [port]', 'specify port')
.option('-b, --ip [host]', 'specify host') .option('-b, --ip [host]', 'specify host')
.option('-c, --coinbase [coinbase]', 'specify host')
.parse(process.argv) .parse(process.argv)
const Server = require('../src/server') 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) 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 () { Blocks.prototype.methods = function () {
@ -17,7 +18,7 @@ Blocks.prototype.eth_getBlockByNumber = function (payload, cb) {
'gasUsed': '0x0', 'gasUsed': '0x0',
'hash': '0xdb731f3622ef37b4da8db36903de029220dba74c41185f8429f916058b86559f', 'hash': '0xdb731f3622ef37b4da8db36903de029220dba74c41185f8429f916058b86559f',
'logsBloom': '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'logsBloom': '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
'miner': '0x3333333333333333333333333333333333333333', 'miner': this.coinbase,
'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000', 'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000',
'nonce': '0x0000000000000042', 'nonce': '0x0000000000000042',
'number': '0x0', 'number': '0x0',

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

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

Loading…
Cancel
Save