auto checksuming address for atAddress

revert-1166-atadd
lianahus 4 years ago committed by Liana Husikyan
parent 325bfd3370
commit 609f7df9e7
  1. 10
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js

@ -97,7 +97,10 @@ class ContractDropdownUI {
enableAtAddress (enable) { enableAtAddress (enable) {
if (enable) { if (enable) {
const address = this.atAddressButtonInput.value const address = this.atAddressButtonInput.value
if (!address || !ethJSUtil.isValidChecksumAddress(address)) return if (!address || !ethJSUtil.isValidAddress(address)) {
this.enableAtAddress(false)
return
}
this.atAddress.removeAttribute('disabled') this.atAddress.removeAttribute('disabled')
this.atAddress.setAttribute('title', 'Interact with the given contract.') this.atAddress.setAttribute('title', 'Interact with the given contract.')
} else { } else {
@ -387,7 +390,10 @@ class ContractDropdownUI {
loadFromAddress () { loadFromAddress () {
this.event.trigger('clearInstance') this.event.trigger('clearInstance')
var address = this.atAddressButtonInput.value let address = this.atAddressButtonInput.value
if (!ethJSUtil.isValidChecksumAddress(address)) {
address = ethJSUtil.toChecksumAddress(address)
}
this.dropdownLogic.loadContractFromAddress(address, this.dropdownLogic.loadContractFromAddress(address,
(cb) => { (cb) => {
modalDialogCustom.confirm(null, 'Do you really want to interact with ' + address + ' using the current ABI definition?', cb) modalDialogCustom.confirm(null, 'Do you really want to interact with ' + address + ' using the current ABI definition?', cb)

Loading…
Cancel
Save