fix checksum address

pull/5370/head
yann300 5 years ago
parent 3df1cc6b2a
commit 45c4bc58de
  1. 2
      remix-simulator/src/methods/accounts.js
  2. 8
      remix-simulator/src/methods/transactions.js

@ -45,7 +45,7 @@ Accounts.prototype.methods = function () {
} }
Accounts.prototype.eth_accounts = function (payload, cb) { 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) { Accounts.prototype.eth_getBalance = function (payload, cb) {

@ -26,6 +26,10 @@ Transactions.prototype.methods = function () {
} }
Transactions.prototype.eth_sendTransaction = function (payload, cb) { 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) processTx(this.accounts, payload, false, cb)
} }
@ -70,6 +74,10 @@ Transactions.prototype.eth_getCode = function (payload, cb) {
} }
Transactions.prototype.eth_call = 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) processTx(this.accounts, payload, true, cb)
} }

Loading…
Cancel
Save