using saved data

pull/698/head
LianaHus 4 years ago committed by yann300
parent 911946b39d
commit 9c8687f336
  1. 4
      apps/remix-ide/src/app/compiler/compiler-sourceVerifier-fetchAndCompile.js
  2. 15
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js

@ -33,8 +33,9 @@ export default class FetchAndCompile extends Plugin {
contractAddress = ethutil.toChecksumAddress(contractAddress)
const compilersartefacts = globalRegistry.get('compilersartefacts').api
const localCompilation = () => compilersartefacts.get('__last') ? compilersartefacts.get('__last') : null
const localCompilation = () => compilersartefacts.get(contractAddress) ? compilersartefacts.get(contractAddress) : compilersartefacts.get('__last') ? compilersartefacts.get('__last') : null
console.log("localCompilation - ", localCompilation)
const resolved = compilersartefacts.get(contractAddress)
if (resolved) return resolved
if (this.unresolvedAddresses.includes(contractAddress)) return localCompilation()
@ -54,6 +55,7 @@ export default class FetchAndCompile extends Plugin {
// check if the contract if part of the local compilation result
const codeAtAddress = await web3.eth.getCode(contractAddress)
const compilation = localCompilation()
console.log("compilationResult= ", compilation)
if (compilation) {
let found = false
compilation.visitContracts((contract) => {

@ -284,6 +284,8 @@ class ContractDropdownUI {
}
}
let self = this
var promptCb = (okCb, cancelCb) => {
modalDialogCustom.promptPassphrase('Passphrase requested', 'Personal mode is enabled. Please provide passphrase of account', '', okCb, cancelCb)
}
@ -293,18 +295,19 @@ class ContractDropdownUI {
}
var finalCb = (error, contractObject, address) => {
this.event.trigger('clearInstance')
self.event.trigger('clearInstance')
if (error) {
return this.logCallback(error)
}
this.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name])
self.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name])
this.runView.compilersArtefacts.addResolvedContract(address, this.runView.compilersArtefacts.addressToCompilationResults[contractObject.name + '-' + contractObject.file])
console.log("this.runView.compilersArtefacts.addressToCompilationResults[contractObject.name + '-' + contractObject.file]", this.runView.compilersArtefacts.addressToCompilationResults[contractObject.name + '-' + contractObject.file])
if (this.ipfsCheckedState) {
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, selectedContract)
const data = self.runView.compilersArtefacts.addressToCompilationResults[contractObject.name + '-' + contractObject.file]
self.runView.compilersArtefacts.addResolvedContract(address, data)
console.log("this.runView.compilersArtefacts.addressToCompilationResults[contractObject.name + '-' + contractObject.file]", data)
if (self.ipfsCheckedState) {
publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract)
}
}

Loading…
Cancel
Save