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
30fe405b
Commit
30fe405b
authored
Dec 27, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use blockchain object instead of executionContext in transactionReceiptResolver
parent
a12d40fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app.js
src/app.js
+1
-1
make-udapp.js
src/app/udapp/make-udapp.js
+2
-2
transactionReceiptResolver.js
src/lib/transactionReceiptResolver.js
+3
-3
No files found.
src/app.js
View file @
30fe405b
...
...
@@ -235,7 +235,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const
compilersArtefacts
=
new
CompilersArtefacts
()
// store all the compilation results (key represent a compiler name)
registry
.
put
({
api
:
compilersArtefacts
,
name
:
'compilersartefacts'
})
const
{
eventsDecoder
,
txlistener
}
=
makeUdapp
(
udapp
,
executionContext
,
compilersArtefacts
,
(
domEl
)
=>
mainview
.
getTerminal
().
logHtml
(
domEl
))
const
{
eventsDecoder
,
txlistener
}
=
makeUdapp
(
blockchain
,
udapp
,
executionContext
,
compilersArtefacts
,
(
domEl
)
=>
mainview
.
getTerminal
().
logHtml
(
domEl
))
// ----------------- network service (resolve network id / name) ----------------------------
const
networkModule
=
new
NetworkModule
(
executionContext
)
// ----------------- convert offset to line/column service ----------------------------
...
...
src/app/udapp/make-udapp.js
View file @
30fe405b
...
...
@@ -5,7 +5,7 @@ var Txlistener = remixLib.execution.txListener
var
EventsDecoder
=
remixLib
.
execution
.
EventsDecoder
var
TransactionReceiptResolver
=
require
(
'../../lib/transactionReceiptResolver'
)
export
function
makeUdapp
(
udapp
,
executionContext
,
compilersArtefacts
,
logHtmlCallback
)
{
export
function
makeUdapp
(
blockchain
,
udapp
,
executionContext
,
compilersArtefacts
,
logHtmlCallback
)
{
// ----------------- UniversalDApp -----------------
// TODO: to remove when possible
udapp
.
event
.
register
(
'transactionBroadcasted'
,
(
txhash
,
networkName
)
=>
{
...
...
@@ -14,7 +14,7 @@ export function makeUdapp (udapp, executionContext, compilersArtefacts, logHtmlC
})
// ----------------- Tx listener -----------------
const
transactionReceiptResolver
=
new
TransactionReceiptResolver
(
executionContext
)
const
transactionReceiptResolver
=
new
TransactionReceiptResolver
(
blockchain
)
const
txlistener
=
new
Txlistener
({
api
:
{
...
...
src/lib/transactionReceiptResolver.js
View file @
30fe405b
'use strict'
module
.
exports
=
class
TransactionReceiptResolver
{
constructor
(
executionContext
)
{
constructor
(
blockchain
)
{
this
.
_transactionReceipts
=
{}
this
.
executionContext
=
executionContext
this
.
blockchain
=
blockchain
}
resolve
(
tx
,
cb
)
{
if
(
this
.
_transactionReceipts
[
tx
.
hash
])
{
return
cb
(
null
,
this
.
_transactionReceipts
[
tx
.
hash
])
}
this
.
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
tx
.
hash
,
(
error
,
receipt
)
=>
{
this
.
blockchain
.
web3
().
eth
.
getTransactionReceipt
(
tx
.
hash
,
(
error
,
receipt
)
=>
{
if
(
!
error
)
{
this
.
_transactionReceipts
[
tx
.
hash
]
=
receipt
cb
(
null
,
receipt
)
...
...
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