Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
f14e82da
Commit
f14e82da
authored
Oct 16, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add status info
parent
f2c47edb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
txListener.js
src/app/execution/txListener.js
+1
-0
txLogger.js
src/app/execution/txLogger.js
+18
-2
txRunner.js
src/app/execution/txRunner.js
+1
-0
No files found.
src/app/execution/txListener.js
View file @
f14e82da
...
...
@@ -76,6 +76,7 @@ class TxListener {
}
tx
.
envMode
=
executionContext
.
getProvider
()
tx
.
status
=
txResult
.
result
.
status
// 0x0 or 0x1
this
.
_resolve
([
tx
],
()
=>
{
})
})
...
...
src/app/execution/txLogger.js
View file @
f14e82da
...
...
@@ -182,7 +182,8 @@ function renderKnownTransaction (self, data) {
logs
:
data
.
logs
,
val
:
data
.
tx
.
value
,
transactionCost
:
data
.
tx
.
transactionCost
,
executionCost
:
data
.
tx
.
executionCost
executionCost
:
data
.
tx
.
executionCost
,
status
:
data
.
tx
.
status
})
tx
.
appendChild
(
table
)
}
...
...
@@ -248,7 +249,8 @@ function renderUnknownTransaction (self, data) {
gas
:
data
.
tx
.
gas
,
logs
:
data
.
logs
,
transactionCost
:
data
.
tx
.
transactionCost
,
executionCost
:
data
.
tx
.
executionCost
executionCost
:
data
.
tx
.
executionCost
,
status
:
data
.
tx
.
status
})
tx
.
appendChild
(
table
)
}
...
...
@@ -289,6 +291,20 @@ module.exports = TxLogger
function
createTable
(
opts
)
{
var
table
=
yo
`<table class="
${
css
.
txTable
}
" id="txTable"></table>`
if
(
opts
.
status
)
{
var
msg
=
''
if
(
opts
.
status
===
'0x0'
)
{
msg
=
' Transaction mined but execution failed'
}
else
if
(
opts
.
status
===
'0x1'
)
{
msg
=
' Transaction mined and execution succeed'
}
table
.
appendChild
(
yo
`
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> status </td>
<td class="
${
css
.
td
}
">
${
opts
.
status
}${
msg
}
</td>
</tr class="
${
css
.
tr
}
">`
)
}
var
contractAddress
=
yo
`
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> contractAddress </td>
...
...
src/app/execution/txRunner.js
View file @
f14e82da
...
...
@@ -120,6 +120,7 @@ TxRunner.prototype.execute = function (args, callback) {
executionContext
.
vm
().
stateManager
.
revert
(
function
()
{})
}
err
=
err
?
err
.
message
:
err
result
.
status
=
'0x'
+
result
.
vm
.
exception
.
toString
(
16
)
callback
(
err
,
{
result
:
result
,
transactionHash
:
ethJSUtil
.
bufferToHex
(
new
Buffer
(
tx
.
hash
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment