Skip to content

Commit

Permalink
Fixing a recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabreznik authored and yann300 committed May 10, 2018
1 parent 64383e1 commit 875a498
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/app/tabs/run-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
--------------------------- */
var self = this
var event = new EventManager()
appEvents.eventManager = event
self._view = {}
self.data = {
count: 0,
text: `All transactions (deployed contracts and function executions)
in this environment can be saved and replayed in
another environment. i.e. Transactions created in
Javascript VM can be replayed in the Ropsten network.`
Javascript VM can be replayed in the Injected Web3.`
}

self._view.recorderCount = yo`<span>0</span>`
Expand All @@ -51,7 +52,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
</div>`

var container = yo`<div class="${css.runTabView}" id="runTabView" ></div>`
var recorderInterface = makeRecorder(event, appAPI, appEvents, opts, self)
var recorderInterface = makeRecorder(appAPI, appEvents, opts, self)

self._view.collapsedView = yo`
<div class=${css.recorderCollapsedView}>
Expand Down Expand Up @@ -186,12 +187,12 @@ function updateAccountBalances (container, appAPI) {
/* ------------------------------------------------
RECORDER
------------------------------------------------ */
function makeRecorder (events, appAPI, appEvents, opts, self) {
function makeRecorder (appAPI, appEvents, opts, self) {
var recorder = new Recorder(opts.compiler, {
events: {
udapp: appEvents.udapp,
executioncontext: executionContext.event,
runtab: events
runtab: appEvents.eventManager
},
api: appAPI
})
Expand Down Expand Up @@ -241,16 +242,16 @@ function makeRecorder (events, appAPI, appEvents, opts, self) {
var obj = JSON.parse(json)
var txArray = obj.transactions || []
var accounts = obj.accounts || []
var options = obj.options
var abis = obj.abis
var options = obj.options || {}
var abis = obj.abis || {}
var linkReferences = obj.linkReferences || {}
} catch (e) {
return modalDialogCustom.alert('Invalid Scenario File, please try again')
}
if (txArray.length) {
var noInstancesText = self._view.noInstancesText
if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) }
recorder.run(txArray, accounts, options, abis, linkReferences, (abi, address, contractName) => {
recorder.run(txArray, accounts, options, abis, linkReferences, opts.udapp, (abi, address, contractName) => {
self._view.instanceContainer.appendChild(opts.udappUI.renderInstanceFromABI(abi, address, contractName))
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/universal-dapp-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var css = csjs`
margin-bottom: 10px;
}
.noInstancesText {
}
.titleLine {
display: flex;
Expand Down Expand Up @@ -84,6 +84,7 @@ var css = csjs`
cursor: pointer;
margin-left: 5px;
}
.udapp {}
.udappClose {
display: flex;
justify-content: flex-end;
Expand Down

0 comments on commit 875a498

Please sign in to comment.