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
1678b0e9
Commit
1678b0e9
authored
Nov 30, 2020
by
aniket-engg
Committed by
Aniket
Dec 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logsManager and txExecution
parent
2aa25bc4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
logsManager.ts
libs/remix-lib/src/execution/logsManager.ts
+13
-9
txExecution.ts
libs/remix-lib/src/execution/txExecution.ts
+0
-0
No files found.
libs/remix-lib/src/execution/logsManager.ts
View file @
1678b0e9
const
async
=
require
(
'async'
)
const
crypto
=
require
(
'crypto'
)
import
{
eachOf
}
from
'async'
import
{
randomBytes
}
from
'crypto'
class
LogsManager
{
export
class
LogsManager
{
notificationCallbacks
subscriptions
filters
filterTracking
oldLogs
constructor
()
{
this
.
notificationCallbacks
=
[]
...
...
@@ -12,7 +18,7 @@ class LogsManager {
}
checkBlock
(
blockNumber
,
block
,
web3
)
{
async
.
eachOf
(
block
.
transactions
,
(
tx
,
i
,
next
)
=>
{
eachOf
(
block
.
transactions
,
(
tx
,
i
,
next
)
=>
{
let
txHash
=
'0x'
+
tx
.
hash
().
toString
(
'hex'
)
web3
.
eth
.
getTransactionReceipt
(
txHash
,
(
_error
,
receipt
)
=>
{
...
...
@@ -97,7 +103,7 @@ class LogsManager {
}
subscribe
(
params
)
{
let
subscriptionId
=
'0x'
+
crypto
.
randomBytes
(
16
).
toString
(
'hex'
)
let
subscriptionId
=
'0x'
+
randomBytes
(
16
).
toString
(
'hex'
)
this
.
subscriptions
[
subscriptionId
]
=
params
return
subscriptionId
}
...
...
@@ -107,7 +113,7 @@ class LogsManager {
}
newFilter
(
filterType
,
params
)
{
const
filterId
=
'0x'
+
crypto
.
randomBytes
(
16
).
toString
(
'hex'
)
const
filterId
=
'0x'
+
randomBytes
(
16
).
toString
(
'hex'
)
if
(
filterType
===
'block'
||
filterType
===
'pendingTransactions'
)
{
this
.
filters
[
filterId
]
=
{
filterType
}
}
...
...
@@ -123,7 +129,7 @@ class LogsManager {
}
getLogsForFilter
(
filterId
,
logsOnly
)
{
const
{
filterType
,
params
}
=
this
.
filter
[
filterId
]
const
{
filterType
,
params
}
=
this
.
filter
s
[
filterId
]
const
tracking
=
this
.
filterTracking
[
filterId
]
if
(
logsOnly
||
filterType
===
'filter'
)
{
...
...
@@ -161,5 +167,3 @@ class LogsManager {
}
}
module
.
exports
=
LogsManager
libs/remix-lib/src/execution/txExecution.ts
View file @
1678b0e9
This diff is collapsed.
Click to expand it.
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