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
1e7ea020
Commit
1e7ea020
authored
Aug 18, 2021
by
davidzagi93@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creating a KnownTransaction function
parent
650d7bd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
12 deletions
+52
-12
remix-ui-terminal.tsx
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+52
-12
No files found.
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
View file @
1e7ea020
...
@@ -663,16 +663,14 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -663,16 +663,14 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
</
td
>
</
td
>
</
tr
>
</
tr
>
)
}
)
}
{
console
.
log
(
opts
[
'decoded input'
],
'opts["decoded input"]'
)
}
{
opts
[
'decoded input'
]
&&
(
{
console
.
log
(
opts
.
log
,
'opts log'
)
}
{
/* {opts['decoded input'] && (
<
tr
className=
'tr'
>
<
tr
className=
'tr'
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
decode input
</
td
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
decode input
</
td
>
<
td
className=
'td'
data
-
id=
{
`txLoggerTableHash${opts.hash}`
}
data
-
shared=
{
`pair_${opts.hash}`
}
>
{
opts
[
'decoded input'
]
}
<
td
className=
'td'
data
-
id=
{
`txLoggerTableHash${opts.hash}`
}
data
-
shared=
{
`pair_${opts.hash}`
}
>
{
opts
[
'decoded input'
]
}
<
CopyToClipboard
content=
{
opts
[
'decoded input'
]
}
/>
<
CopyToClipboard
content=
{
opts
[
'decoded input'
]
}
/>
</
td
>
</
td
>
</
tr
>
</
tr
>
)}
*/
}
)
}
{
opts
[
'decoded output'
]
&&
(
{
opts
[
'decoded output'
]
&&
(
<
tr
className=
'tr'
>
<
tr
className=
'tr'
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
decode output
</
td
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
decode output
</
td
>
...
@@ -681,7 +679,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -681,7 +679,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
</
td
>
</
td
>
</
tr
>
</
tr
>
)
}
)
}
{
/* {
opts.logs && (
{
opts
.
logs
&&
(
<
tr
className=
'tr'
>
<
tr
className=
'tr'
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
logs
</
td
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
logs
</
td
>
<
td
className=
'td'
data
-
id=
{
`txLoggerTableHash${opts.hash}`
}
data
-
shared=
{
`pair_${opts.hash}`
}
>
<
td
className=
'td'
data
-
id=
{
`txLoggerTableHash${opts.hash}`
}
data
-
shared=
{
`pair_${opts.hash}`
}
>
...
@@ -690,7 +688,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -690,7 +688,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
<
CopyToClipboard
content=
{
JSON
.
stringify
(
opts
.
logs
.
raw
||
'0'
)
}
/>
<
CopyToClipboard
content=
{
JSON
.
stringify
(
opts
.
logs
.
raw
||
'0'
)
}
/>
</
td
>
</
td
>
</
tr
>
</
tr
>
)}
*/
}
)
}
{
opts
.
val
&&
(
{
opts
.
val
&&
(
<
tr
className=
'tr'
>
<
tr
className=
'tr'
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
val
</
td
>
<
td
className=
'td'
data
-
shared=
{
`key_${opts.hash}`
}
>
val
</
td
>
...
@@ -718,11 +716,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -718,11 +716,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
}
}
}
}
const
renderUnKnownTransactions
=
(
tx
,
receipt
,
resolvedData
,
logs
,
index
)
=>
{
const
renderUnKnownTransactions
=
(
tx
,
receipt
,
index
)
=>
{
const
from
=
tx
.
from
const
from
=
tx
.
from
const
to
=
tx
.
to
?
tx
.
to
:
resolvedData
.
contractName
+
'.'
+
resolvedData
.
fn
const
to
=
tx
.
to
const
obj
=
{
from
,
to
}
const
obj
=
{
from
,
to
}
const
txType
=
resolvedData
?
'knownTx'
:
'unknown'
+
(
tx
.
isCall
?
'Call'
:
'Tx'
)
const
txType
=
'unknown'
+
(
tx
.
isCall
?
'Call'
:
'Tx'
)
console
.
log
(
'render unknown transaction '
)
console
.
log
(
'render unknown transaction '
)
return
(
return
(
<
span
id=
{
`tx${tx.hash}`
}
key=
{
index
}
>
<
span
id=
{
`tx${tx.hash}`
}
key=
{
index
}
>
...
@@ -732,7 +730,44 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -732,7 +730,44 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
{
context
({
from
,
to
,
tx
},
props
.
blockchain
)
}
{
context
({
from
,
to
,
tx
},
props
.
blockchain
)
}
{
console
.
log
(
'under context and checkTxStatus'
)
}
{
console
.
log
(
'under context and checkTxStatus'
)
}
<
div
className=
'buttons'
>
<
div
className=
'buttons'
>
<
div
className=
'debug btn btn-primary btn-sm'
onClick=
{
(
event
)
=>
debug
(
event
,
tx
)
}
>
Debug
</
div
>
<
div
className=
'debug btn btn-primary btn-sm'
data
-
shared=
'txLoggerDebugButton'
data
-
id=
{
`txLoggerDebugButton${tx.hash}`
}
onClick=
{
(
event
)
=>
debug
(
event
,
tx
)
}
>
Debug
</
div
>
</
div
>
<
i
className
=
{`
arrow
fas
$
{(
showTableHash
.
includes
(
tx
.
hash
))
?
'
fa
-
angle
-
up
'
:
'
fa
-
angle
-
down
'}`}
></
i
>
</
div
>
{
showTableHash
.
includes
(
tx
.
hash
)
?
showTable
({
hash
:
tx
.
hash
,
status
:
receipt
!==
null
?
receipt
.
status
:
null
,
isCall
:
tx
.
isCall
,
contractAddress
:
tx
.
contractAddress
,
data
:
tx
,
from
,
to
,
gas
:
tx
.
gas
,
input
:
tx
.
input
,
'decoded output'
:
' - '
,
val
:
tx
.
value
,
transactionCost
:
tx
.
transactionCost
,
executionCost
:
tx
.
executionCost
})
:
null
}
{
console
.
log
(
'end'
)
}
</
span
>
)
}
const
renderKnownTransactions
=
(
tx
,
receipt
,
resolvedData
,
logs
,
index
)
=>
{
const
from
=
tx
.
from
const
to
=
resolvedData
.
contractName
+
'.'
+
resolvedData
.
fn
const
obj
=
{
from
,
to
}
const
txType
=
'knownTx'
console
.
log
(
'render unknown transaction '
)
return
(
<
span
id=
{
`tx${tx.hash}`
}
key=
{
index
}
>
<
div
className=
"log"
onClick=
{
(
event
)
=>
txDetails
(
event
,
tx
,
obj
)
}
>
{
/* onClick={e => txDetails(e, tx, data, obj)} */
}
{
checkTxStatus
(
receipt
,
txType
)
}
{
context
({
from
,
to
,
tx
},
props
.
blockchain
)
}
<
div
className=
'buttons'
>
<
div
className=
'debug btn btn-primary btn-sm'
data
-
shared=
'txLoggerDebugButton'
data
-
id=
{
`txLoggerDebugButton${tx.hash}`
}
onClick=
{
(
event
)
=>
debug
(
event
,
tx
)
}
>
Debug
</
div
>
</
div
>
</
div
>
<
i
className
=
{`
arrow
fas
$
{(
showTableHash
.
includes
(
tx
.
hash
))
?
'
fa
-
angle
-
up
'
:
'
fa
-
angle
-
down
'}`}
></
i
>
<
i
className
=
{`
arrow
fas
$
{(
showTableHash
.
includes
(
tx
.
hash
))
?
'
fa
-
angle
-
up
'
:
'
fa
-
angle
-
down
'}`}
></
i
>
</
div
>
</
div
>
...
@@ -854,10 +889,15 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -854,10 +889,15 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
<
span
className=
'tx'
><
div
className=
'txItem'
>
[
<
span
className=
'txItemTitle'
>
block:
{
x
.
message
}
-
</
span
>
0
{
'transactions'
}
]
</
div
></
span
></
span
>
<
span
className=
'tx'
><
div
className=
'txItem'
>
[
<
span
className=
'txItemTitle'
>
block:
{
x
.
message
}
-
</
span
>
0
{
'transactions'
}
]
</
div
></
span
></
span
>
</
div
>
</
div
>
)
)
}
else
if
(
x
.
name
===
'unknownTransaction'
||
x
.
name
===
'knownTransaction'
)
{
}
else
if
(
x
.
name
===
'unknownTransaction'
)
{
return
x
.
message
.
filter
(
x
=>
x
.
tx
.
hash
.
includes
(
searchInput
)
||
x
.
tx
.
from
.
includes
(
searchInput
)
||
(
x
.
tx
.
to
.
includes
(
searchInput
))).
map
((
trans
)
=>
{
return
x
.
message
.
filter
(
x
=>
x
.
tx
.
hash
.
includes
(
searchInput
)
||
x
.
tx
.
from
.
includes
(
searchInput
)
||
(
x
.
tx
.
to
.
includes
(
searchInput
))).
map
((
trans
)
=>
{
console
.
log
({
trans
},
'first output from deploy'
)
console
.
log
({
trans
},
'first output from deploy'
)
return
(<
div
className=
'px-4 block'
data
-
id=
{
`block_tx${trans.tx.hash}`
}
key=
{
index
}
>
{
renderUnKnownTransactions
(
trans
.
tx
,
trans
.
receipt
,
trans
.
resolvedData
,
trans
.
logs
,
index
)
}
</
div
>)
return
(<
div
className=
'px-4 block'
data
-
id=
{
`block_tx${trans.tx.hash}`
}
key=
{
index
}
>
{
renderUnKnownTransactions
(
trans
.
tx
,
trans
.
receipt
,
index
)
}
</
div
>)
})
}
else
if
(
x
.
name
===
'knownTransaction'
)
{
return
x
.
message
.
map
((
trans
)
=>
{
console
.
log
({
trans
},
'first output from deploy'
)
return
(<
div
className=
'px-4 block'
data
-
id=
{
`block_tx${trans.tx.hash}`
}
key=
{
index
}
>
{
renderKnownTransactions
(
trans
.
tx
,
trans
.
receipt
,
trans
.
resolvedData
,
trans
.
logs
,
index
)
}
</
div
>)
})
})
}
else
{
}
else
{
console
.
log
({
x
},
'second output from deploy'
)
console
.
log
({
x
},
'second output from deploy'
)
...
...
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