Commit d8ec51ad authored by yann300's avatar yann300

fix checksum address

parent 561648d3
......@@ -45,7 +45,7 @@ Accounts.prototype.methods = function () {
}
Accounts.prototype.eth_accounts = function (payload, cb) {
return cb(null, this.accountsList.map((x) => x.address))
return cb(null, this.accountsList.map((x) => ethJSUtil.toChecksumAddress(x.address)))
}
Accounts.prototype.eth_getBalance = function (payload, cb) {
......
......@@ -26,6 +26,10 @@ Transactions.prototype.methods = function () {
}
Transactions.prototype.eth_sendTransaction = function (payload, cb) {
// from might be lowercased address (web3)
if (payload.params && payload.params.length > 0 && payload.params[0].from) {
payload.params[0].from = ethJSUtil.toChecksumAddress(payload.params[0].from)
}
processTx(this.accounts, payload, false, cb)
}
......@@ -70,6 +74,10 @@ Transactions.prototype.eth_getCode = function (payload, cb) {
}
Transactions.prototype.eth_call = function (payload, cb) {
// from might be lowercased address (web3)
if (payload.params && payload.params.length > 0 && payload.params[0].from) {
payload.params[0].from = ethJSUtil.toChecksumAddress(payload.params[0].from)
}
processTx(this.accounts, payload, true, cb)
}
......
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