@ -327,27 +327,32 @@ 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 ( currentFile . match ( '.json$' ) ) {
if ( error ) {
try {
modalDialogCustom . alert ( 'Invalid Scenario File ' + error )
var obj = JSON . parse ( json )
} else {
var txArray = obj . transactions || [ ]
if ( currentFile . match ( '.json$' ) ) {
var accounts = obj . accounts || [ ]
try {
var options = obj . options
var obj = JSON . parse ( json )
var abis = obj . abis
var txArray = obj . transactions || [ ]
var linkReferences = obj . linkReferences || { }
var accounts = obj . accounts || [ ]
} catch ( e ) {
var options = obj . options
return modalDialogCustom . alert ( 'Invalid Scenario File, please try again' )
var abis = obj . abis
}
var linkReferences = obj . linkReferences || { }
if ( txArray . length ) {
} catch ( e ) {
noInstancesText . style . display = 'none'
return modalDialogCustom . alert ( 'Invalid Scenario File, please try again' )
recorder . run ( txArray , accounts , options , abis , linkReferences , ( abi , address , contractName ) => {
}
instanceContainer . appendChild ( appAPI . udapp ( ) . renderInstanceFromABI ( abi , address , contractName ) )
if ( txArray . length ) {
} )
noInstancesText . style . display = 'none'
recorder . run ( txArray , accounts , options , abis , linkReferences , ( abi , address , contractName ) => {
instanceContainer . appendChild ( appAPI . udapp ( ) . renderInstanceFromABI ( abi , address , contractName ) )
} )
}
} else {
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.' )
}
}
}
} else {
} )
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 }
}
}