Unverified Commit 0dadc779 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #979 from ethereum/fixremixdscenario

Fix running scenario from remixd
parents d50dcc4b 1bd694b6
...@@ -348,6 +348,7 @@ function filepanel (appAPI, filesProvider) { ...@@ -348,6 +348,7 @@ function filepanel (appAPI, filesProvider) {
packageFiles(filesProvider['browser'], (error, packaged) => { packageFiles(filesProvider['browser'], (error, packaged) => {
if (error) { if (error) {
console.log(error) console.log(error)
modalDialogCustom.alert('Failed to create gist: ' + error)
} else { } else {
var description = 'Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=' + queryParams.get().version + '&optimize=' + queryParams.get().optimize + '&gist=' var description = 'Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=' + queryParams.get().version + '&optimize=' + queryParams.get().optimize + '&gist='
console.log(packaged) console.log(packaged)
......
...@@ -327,7 +327,10 @@ function makeRecorder (events, appAPI, appEvents) { ...@@ -327,7 +327,10 @@ function makeRecorder (events, appAPI, appEvents) {
} }
runButton.onclick = () => { runButton.onclick = () => {
var currentFile = appAPI.config.get('currentFile') var currentFile = appAPI.config.get('currentFile')
var json = appAPI.filesProviders['browser'].get(currentFile) appAPI.fileProviderOf(currentFile).get(currentFile, (error, json) => {
if (error) {
modalDialogCustom.alert('Invalid Scenario File ' + error)
} else {
if (currentFile.match('.json$')) { if (currentFile.match('.json$')) {
try { try {
var obj = JSON.parse(json) var obj = JSON.parse(json)
...@@ -349,6 +352,8 @@ function makeRecorder (events, appAPI, appEvents) { ...@@ -349,6 +352,8 @@ function makeRecorder (events, appAPI, appEvents) {
modalDialogCustom.alert('A Scenario File is required. The file must be of type JSON. Use the "Save Transactions" Button to generate a new Scenario File.') modalDialogCustom.alert('A Scenario File is required. The file must be of type JSON. Use the "Save Transactions" Button to generate a new Scenario File.')
} }
} }
})
}
return { recordButton, runButton } return { recordButton, runButton }
} }
/* ------------------------------------------------ /* ------------------------------------------------
......
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