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
93bc2a54
Commit
93bc2a54
authored
Aug 02, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming
parent
9ebde452
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
app.js
src/app.js
+2
-2
txListener.js
src/app/txListener.js
+10
-11
No files found.
src/app.js
View file @
93bc2a54
...
...
@@ -851,7 +851,7 @@ function run () {
// ----------------- Tx listener -----------------
var
txlistener
=
new
Txlistener
({
ap
pAPI
:
{
ap
i
:
{
web3
:
function
()
{
return
executionContext
.
web3
()
},
isVM
:
function
()
{
return
executionContext
.
isVM
()
},
vm
:
function
()
{
return
executionContext
.
vm
()
},
...
...
@@ -865,7 +865,7 @@ function run () {
return
executionContext
.
getProvider
()
}
},
appE
vent
:
{
e
vent
:
{
executionContext
:
executionContext
.
event
,
udapp
:
udapp
.
event
}
...
...
src/app/txListener.js
View file @
93bc2a54
...
...
@@ -17,19 +17,19 @@ var Web3VMProvider = remix.web3.web3VMProvider
class
TxListener
{
constructor
(
opt
)
{
this
.
event
=
new
EventManager
()
this
.
_ap
pAPI
=
opt
.
appAPI
this
.
_ap
i
=
opt
.
api
this
.
_web3VMProvider
=
new
Web3VMProvider
()
// TODO this should maybe be put in app.js
this
.
_web3VMProvider
.
setVM
(
opt
.
ap
pAPI
.
vm
())
this
.
_web3VMProvider
.
setVM
(
opt
.
ap
i
.
vm
())
this
.
_resolvedTransactions
=
{}
this
.
_resolvedContracts
=
{}
this
.
init
()
opt
.
appE
vent
.
executionContext
.
register
(
'contextChanged'
,
(
context
)
=>
{
opt
.
e
vent
.
executionContext
.
register
(
'contextChanged'
,
(
context
)
=>
{
if
(
this
.
loopId
)
{
this
.
startListening
(
context
)
}
})
opt
.
appE
vent
.
udapp
.
register
(
'transactionExecuted'
,
(
to
,
data
,
lookupOnly
,
txResult
)
=>
{
if
(
this
.
loopId
&&
this
.
_ap
pAPI
.
isVM
())
{
opt
.
e
vent
.
udapp
.
register
(
'transactionExecuted'
,
(
to
,
data
,
lookupOnly
,
txResult
)
=>
{
if
(
this
.
loopId
&&
this
.
_ap
i
.
isVM
())
{
this
.
_web3VMProvider
.
getTransaction
(
txResult
.
transactionHash
,
(
error
,
tx
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
this
.
_newBlock
({
...
...
@@ -59,15 +59,15 @@ class TxListener {
startListening
()
{
this
.
stopListening
()
this
.
init
()
if
(
this
.
_ap
pAPI
.
context
()
===
'vm'
)
{
if
(
this
.
_ap
i
.
context
()
===
'vm'
)
{
this
.
loopId
=
'vm-listener'
}
else
{
this
.
loopId
=
setInterval
(()
=>
{
this
.
_ap
pAPI
.
web3
().
eth
.
getBlockNumber
((
error
,
blockNumber
)
=>
{
this
.
_ap
i
.
web3
().
eth
.
getBlockNumber
((
error
,
blockNumber
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
!
this
.
lastBlock
||
blockNumber
>
this
.
lastBlock
)
{
this
.
lastBlock
=
blockNumber
this
.
_ap
pAPI
.
web3
().
eth
.
getBlock
(
this
.
lastBlock
,
true
,
(
error
,
result
)
=>
{
this
.
_ap
i
.
web3
().
eth
.
getBlock
(
this
.
lastBlock
,
true
,
(
error
,
result
)
=>
{
if
(
!
error
)
{
this
.
_newBlock
(
Object
.
assign
({
type
:
'web3'
},
result
))
}
...
...
@@ -79,7 +79,7 @@ class TxListener {
}
currentWeb3
()
{
// TODO this should maybe be put in app.js
return
this
.
_ap
pAPI
.
isVM
()
?
this
.
_web3VMProvider
:
this
.
_appAPI
.
web3
()
return
this
.
_ap
i
.
isVM
()
?
this
.
_web3VMProvider
:
this
.
_api
.
web3
()
}
/**
...
...
@@ -131,7 +131,7 @@ class TxListener {
}
_resolveTx
(
tx
,
cb
)
{
var
contracts
=
this
.
_ap
pAPI
.
contracts
()
var
contracts
=
this
.
_ap
i
.
contracts
()
if
(
!
contracts
)
return
cb
()
var
contractName
if
(
!
tx
.
to
)
{
...
...
@@ -240,7 +240,6 @@ class TxListener {
}
}
// those function will be duplicate after the merged of the compile and run tabs split
function
getConstructorInterface
(
abi
)
{
var
funABI
=
{
'name'
:
''
,
'inputs'
:
[],
'type'
:
'constructor'
,
'outputs'
:
[]
}
...
...
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