|
|
|
@ -552,7 +552,6 @@ export const clearInstances = () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const loadAddress = (contract: ContractData, address: string) => { |
|
|
|
|
if (!contract) return dispatch(displayPopUp('No compiled contracts found.')) |
|
|
|
|
loadContractFromAddress(address, |
|
|
|
|
(cb) => { |
|
|
|
|
dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null)) |
|
|
|
@ -561,13 +560,14 @@ export const loadAddress = (contract: ContractData, address: string) => { |
|
|
|
|
if (error) { |
|
|
|
|
return dispatch(displayNotification('Alert', error, 'OK', null)) |
|
|
|
|
} |
|
|
|
|
if (loadType === 'abi') { |
|
|
|
|
return addInstance({ abi, address, name: '<at address>' }) |
|
|
|
|
} else if (loadType === 'instance') { |
|
|
|
|
if (!contract) return dispatch(displayPopUp('No compiled contracts found.')) |
|
|
|
|
const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name) |
|
|
|
|
const contractData = getSelectedContract(contract.name, compiler.name) |
|
|
|
|
|
|
|
|
|
if (loadType === 'abi') { |
|
|
|
|
return addInstance({ contractData, address, name: '<at address>' }) |
|
|
|
|
return addInstance({ contractData, address, name: contract.name }) |
|
|
|
|
} |
|
|
|
|
addInstance({ contractData, address, name: contract.name }) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|