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
ae985b90
Commit
ae985b90
authored
Aug 29, 2020
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor transactionReceiptResolver
parent
710cf55e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
make-udapp.js
apps/remix-ide/src/app/udapp/make-udapp.js
+14
-3
No files found.
apps/remix-ide/src/app/udapp/make-udapp.js
View file @
ae985b90
...
@@ -2,7 +2,6 @@ var registry = require('../../global/registry')
...
@@ -2,7 +2,6 @@ var registry = require('../../global/registry')
var
remixLib
=
require
(
'@remix-project/remix-lib'
)
var
remixLib
=
require
(
'@remix-project/remix-lib'
)
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
EventsDecoder
=
remixLib
.
execution
.
EventsDecoder
var
EventsDecoder
=
remixLib
.
execution
.
EventsDecoder
var
TransactionReceiptResolver
=
require
(
'../../lib/transactionReceiptResolver'
)
const
transactionDetailsLinks
=
{
const
transactionDetailsLinks
=
{
'Main'
:
'https://www.etherscan.io/tx/'
,
'Main'
:
'https://www.etherscan.io/tx/'
,
...
@@ -27,7 +26,19 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) {
...
@@ -27,7 +26,19 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) {
})
})
// ----------------- Tx listener -----------------
// ----------------- Tx listener -----------------
const
transactionReceiptResolver
=
new
TransactionReceiptResolver
(
blockchain
)
let
_transactionReceipts
=
{}
const
transactionReceiptResolver
=
(
tx
,
cb
)
=>
{
if
(
_transactionReceipts
[
tx
.
hash
])
{
return
cb
(
null
,
_transactionReceipts
[
tx
.
hash
])
}
blockchain
.
web3
().
eth
.
getTransactionReceipt
(
tx
.
hash
,
(
error
,
receipt
)
=>
{
if
(
error
)
{
return
cb
(
error
)
}
_transactionReceipts
[
tx
.
hash
]
=
receipt
cb
(
null
,
receipt
)
})
}
const
txlistener
=
blockchain
.
getTxListener
({
const
txlistener
=
blockchain
.
getTxListener
({
api
:
{
api
:
{
...
@@ -43,7 +54,7 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) {
...
@@ -43,7 +54,7 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) {
blockchain
.
startListening
(
txlistener
)
blockchain
.
startListening
(
txlistener
)
const
eventsDecoder
=
new
EventsDecoder
({
const
eventsDecoder
=
new
EventsDecoder
({
resolveReceipt
:
transactionReceiptResolver
.
resolve
.
bind
(
transactionReceiptResolver
)
resolveReceipt
:
transactionReceiptResolver
})
})
txlistener
.
startListening
()
txlistener
.
startListening
()
registry
.
put
({
api
:
eventsDecoder
,
name
:
'eventsDecoder'
})
registry
.
put
({
api
:
eventsDecoder
,
name
:
'eventsDecoder'
})
...
...
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