Commit a347a390 authored by Iuri Matias's avatar Iuri Matias

address code review suggestions

parent e62e7947
...@@ -107,7 +107,7 @@ class LogsManager { ...@@ -107,7 +107,7 @@ class LogsManager {
} }
newFilter (filterType, params) { newFilter (filterType, params) {
let filterId = '0x' + crypto.randomBytes(16).toString('hex') const filterId = '0x' + crypto.randomBytes(16).toString('hex')
if (filterType === 'block' || filterType === 'pendingTransactions') { if (filterType === 'block' || filterType === 'pendingTransactions') {
this.filters[filterId] = { filterType } this.filters[filterId] = { filterType }
} }
...@@ -135,7 +135,6 @@ class LogsManager { ...@@ -135,7 +135,6 @@ class LogsManager {
return blocks.map(block => ('0x' + block.hash().toString('hex'))) return blocks.map(block => ('0x' + block.hash().toString('hex')))
} }
if (filterType === 'pendingTransactions') { if (filterType === 'pendingTransactions') {
// TODO: pending transaction hashes
return [] return []
} }
} }
......
...@@ -61,16 +61,16 @@ Accounts.prototype.eth_getBalance = function (payload, cb) { ...@@ -61,16 +61,16 @@ Accounts.prototype.eth_getBalance = function (payload, cb) {
} }
Accounts.prototype.eth_sign = function (payload, cb) { Accounts.prototype.eth_sign = function (payload, cb) {
let address = payload.params[0] const address = payload.params[0]
let message = payload.params[1] const message = payload.params[1]
let privateKey = this.accountsKeys[ethJSUtil.toChecksumAddress(address)] const privateKey = this.accountsKeys[ethJSUtil.toChecksumAddress(address)]
if (!privateKey) { if (!privateKey) {
return cb(new Error('unknown account')) return cb(new Error('unknown account'))
} }
let account = this.web3.eth.accounts.privateKeyToAccount(privateKey) const account = this.web3.eth.accounts.privateKeyToAccount(privateKey)
let data = account.sign(message) const data = account.sign(message)
cb(null, data.signature) cb(null, data.signature)
} }
......
...@@ -28,7 +28,7 @@ Blocks.prototype.eth_getBlockByNumber = function (payload, cb) { ...@@ -28,7 +28,7 @@ Blocks.prototype.eth_getBlockByNumber = function (payload, cb) {
blockIndex = executionContext.latestBlockNumber blockIndex = executionContext.latestBlockNumber
} }
var block = executionContext.blocks[blockIndex] const block = executionContext.blocks[blockIndex]
if (!block) { if (!block) {
return cb(new Error('block not found')) return cb(new Error('block not found'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment