Commit 04b04e31 authored by yann300's avatar yann300

switch to the solidity target

parent 3f005689
...@@ -366,18 +366,21 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -366,18 +366,21 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
loadFromGist({gist: id}) loadFromGist({gist: id})
}) })
cmdInterpreter.event.register('loadswarm', (url) => { cmdInterpreter.event.register('loadswarm', (url) => {
swarmgw.get(url, function (err, ret) { swarmgw.get(url, function (err, content) {
if (err) { if (err) {
modalDialogCustom.log(`Unable to load ${url} from swarm: ${err}`) modalDialogCustom.log(`Unable to load ${url} from swarm: ${err}`)
} else { } else {
ret = JSON.parse(ret) content = JSON.parse(content)
for (var k in ret.sources) { for (var k in content.sources) {
var url = ret.sources[k].urls[0] // @TODO retrieve all other content var url = content.sources[k].urls[0] // @TODO retrieve all other contents ?
swarmgw.get(url, (error, content) => { swarmgw.get(url, (error, content) => {
if (!error) { if (!error) {
filesProviders['browser'].addReadOnly(k, content) filesProviders['browser'].addReadOnly(k, content)
} else { } else {
filesProviders['browser'].addReadOnly(k, `Cannot retrieve the content of ${url}: ${error}`) filesProviders['browser'].addReadOnly(k, `Cannot retrieve the content of ${url}: ${error}`)
if (content.settings && Object.keys(content.settings.compilationTarget)[0] === k) {
fileManager.switchFile(Object.keys(content.settings.compilationTarget)[0])
}
} }
}) })
} }
......
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