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
7b8d7951
Commit
7b8d7951
authored
Aug 08, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add eth_unsubscribe
parent
978b8023
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
logsManager.js
remix-lib/src/execution/logsManager.js
+5
-0
README.md
remix-simulator/README.md
+2
-2
filters.js
remix-simulator/src/methods/filters.js
+13
-1
No files found.
remix-lib/src/execution/logsManager.js
View file @
7b8d7951
...
...
@@ -90,6 +90,11 @@ class LogsManager {
return
subscriptionId
}
unsubscribe
(
subscriptionId
)
{
let
subscriptionId
=
"0x"
+
crypto
.
randomBytes
(
16
).
toString
(
'hex'
)
delete
this
.
subscriptions
[
subscriptionId
]
}
getLogsFor
(
params
)
{
let
results
=
[{
"logIndex"
:
"0x1"
,
// 1
...
...
remix-simulator/README.md
View file @
7b8d7951
...
...
@@ -68,8 +68,8 @@ Implemented:
*
[
_
]
bzz_hive (stub)
*
[
_
]
bzz_info (stub)
*
[
_
]
debug_traceTransaction
*
[
_
]
eth_subscribe
*
[
_
]
eth_unsubscribe
*
[
X
]
eth_subscribe
*
[
X
]
eth_unsubscribe
*
[
_
]
miner_start
*
[
_
]
miner_stop
*
[
_
]
personal_listAccounts
...
...
remix-simulator/src/methods/filters.js
View file @
7b8d7951
...
...
@@ -8,7 +8,8 @@ var Filters = function (_options) {
Filters
.
prototype
.
methods
=
function
()
{
return
{
eth_getLogs
:
this
.
eth_getLogs
.
bind
(
this
),
eth_subscribe
:
this
.
eth_subscribe
.
bind
(
this
)
eth_subscribe
:
this
.
eth_subscribe
.
bind
(
this
),
eth_unsubscribe
:
this
.
eth_unsubscribe
.
bind
(
this
)
}
}
...
...
@@ -45,4 +46,15 @@ Filters.prototype.eth_subscribe = function (payload, cb) {
cb
(
null
,
subscriptionId
)
}
Filters
.
prototype
.
eth_unsubscribe
=
function
(
payload
,
cb
)
{
console
.
dir
(
"==============================="
)
console
.
dir
(
"==============================="
)
console
.
dir
(
"=== eth_unsubscribe"
)
console
.
dir
(
payload
.
params
)
executionContext
.
logsManager
.
unsubscribe
(
payload
.
params
[
0
])
cb
(
null
,
true
)
}
module
.
exports
=
Filters
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