Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
c01f0ae8
Commit
c01f0ae8
authored
Jan 22, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'b1971f46cce7d21be5f6277c9f8c406a0d195f78' into natspec
parents
29fa57e9
81bbe8c9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
50 deletions
+34
-50
ethereum.js
dist/ethereum.js
+15
-23
ethereum.js.map
dist/ethereum.js.map
+3
-3
ethereum.min.js
dist/ethereum.min.js
+1
-1
filter.js
lib/filter.js
+1
-3
providermanager.js
lib/providermanager.js
+14
-20
No files found.
dist/ethereum.js
View file @
c01f0ae8
...
...
@@ -558,8 +558,7 @@ var Filter = function(options, impl) {
this
.
callbacks
=
[];
this
.
id
=
impl
.
newFilter
(
options
);
web3
.
on
(
impl
.
changed
,
this
.
id
,
this
.
trigger
.
bind
(
this
));
web3
.
provider
.
startPolling
({
call
:
impl
.
changed
,
args
:
[
this
.
id
]},
this
.
id
);
web3
.
provider
.
startPolling
({
call
:
impl
.
changed
,
args
:
[
this
.
id
]},
this
.
id
,
this
.
trigger
.
bind
(
this
));
};
/// alias for changed*
...
...
@@ -583,7 +582,6 @@ Filter.prototype.trigger = function(messages) {
Filter
.
prototype
.
uninstall
=
function
()
{
this
.
impl
.
uninstallFilter
(
this
.
id
);
web3
.
provider
.
stopPolling
(
this
.
id
);
web3
.
off
(
impl
.
changed
,
this
.
id
);
};
/// should be called to manually trigger getting latest messages from the client
...
...
@@ -704,19 +702,26 @@ var web3 = require('./web3'); // jshint ignore:line
* and provider manager polling mechanism is not used
*/
var
ProviderManager
=
function
()
{
this
.
queued
=
[];
this
.
polls
=
[];
this
.
ready
=
false
;
this
.
provider
=
undefined
;
this
.
id
=
1
;
var
self
=
this
;
var
poll
=
function
()
{
if
(
self
.
provider
&&
self
.
provider
.
poll
)
{
if
(
self
.
provider
)
{
self
.
polls
.
forEach
(
function
(
data
)
{
data
.
data
.
_id
=
self
.
id
;
self
.
id
++
;
self
.
provider
.
poll
(
data
.
data
,
data
.
id
);
var
result
=
self
.
provider
.
send
(
data
.
data
);
result
=
JSON
.
parse
(
result
);
// dont call the callback if result is an error, empty array or false
if
(
result
.
error
||
(
result
.
result
instanceof
Array
?
result
.
result
.
length
===
0
:
!
result
.
result
))
{
return
;
}
data
.
callback
(
result
);
});
}
setTimeout
(
poll
,
12000
);
...
...
@@ -724,7 +729,7 @@ var ProviderManager = function() {
poll
();
};
/// sends outgoing requests
, if provider is not available, enqueue the request
/// sends outgoing requests
ProviderManager
.
prototype
.
send
=
function
(
data
)
{
data
.
args
=
data
.
args
||
[];
...
...
@@ -743,26 +748,13 @@ ProviderManager.prototype.send = function(data) {
/// setups provider, which will be used for sending messages
ProviderManager
.
prototype
.
set
=
function
(
provider
)
{
if
(
this
.
provider
!==
undefined
&&
this
.
provider
.
unload
!==
undefined
)
{
this
.
provider
.
unload
();
}
this
.
provider
=
provider
;
this
.
ready
=
true
;
};
/// @returns true if the provider i properly set
ProviderManager
.
prototype
.
installed
=
function
()
{
return
this
.
provider
!==
undefined
;
};
/// this method is only used, when we do not have native qt bindings and have to do polling on our own
/// should be callled, on start watching for eth/shh changes
ProviderManager
.
prototype
.
startPolling
=
function
(
data
,
pollId
)
{
if
(
!
this
.
provider
||
!
this
.
provider
.
poll
)
{
return
;
}
this
.
polls
.
push
({
data
:
data
,
id
:
pollId
});
ProviderManager
.
prototype
.
startPolling
=
function
(
data
,
pollId
,
callback
)
{
this
.
polls
.
push
({
data
:
data
,
id
:
pollId
,
callback
:
callback
});
};
/// should be called to stop polling for certain watch changes
...
...
dist/ethereum.js.map
View file @
c01f0ae8
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
c01f0ae8
This diff is collapsed.
Click to expand it.
lib/filter.js
View file @
c01f0ae8
...
...
@@ -32,8 +32,7 @@ var Filter = function(options, impl) {
this
.
callbacks
=
[];
this
.
id
=
impl
.
newFilter
(
options
);
web3
.
on
(
impl
.
changed
,
this
.
id
,
this
.
trigger
.
bind
(
this
));
web3
.
provider
.
startPolling
({
call
:
impl
.
changed
,
args
:
[
this
.
id
]},
this
.
id
);
web3
.
provider
.
startPolling
({
call
:
impl
.
changed
,
args
:
[
this
.
id
]},
this
.
id
,
this
.
trigger
.
bind
(
this
));
};
/// alias for changed*
...
...
@@ -57,7 +56,6 @@ Filter.prototype.trigger = function(messages) {
Filter
.
prototype
.
uninstall
=
function
()
{
this
.
impl
.
uninstallFilter
(
this
.
id
);
web3
.
provider
.
stopPolling
(
this
.
id
);
web3
.
off
(
impl
.
changed
,
this
.
id
);
};
/// should be called to manually trigger getting latest messages from the client
...
...
lib/providermanager.js
View file @
c01f0ae8
...
...
@@ -35,19 +35,26 @@ var web3 = require('./web3'); // jshint ignore:line
* and provider manager polling mechanism is not used
*/
var
ProviderManager
=
function
()
{
this
.
queued
=
[];
this
.
polls
=
[];
this
.
ready
=
false
;
this
.
provider
=
undefined
;
this
.
id
=
1
;
var
self
=
this
;
var
poll
=
function
()
{
if
(
self
.
provider
&&
self
.
provider
.
poll
)
{
if
(
self
.
provider
)
{
self
.
polls
.
forEach
(
function
(
data
)
{
data
.
data
.
_id
=
self
.
id
;
self
.
id
++
;
self
.
provider
.
poll
(
data
.
data
,
data
.
id
);
var
result
=
self
.
provider
.
send
(
data
.
data
);
result
=
JSON
.
parse
(
result
);
// dont call the callback if result is an error, empty array or false
if
(
result
.
error
||
(
result
.
result
instanceof
Array
?
result
.
result
.
length
===
0
:
!
result
.
result
))
{
return
;
}
data
.
callback
(
result
);
});
}
setTimeout
(
poll
,
12000
);
...
...
@@ -55,7 +62,7 @@ var ProviderManager = function() {
poll
();
};
/// sends outgoing requests
, if provider is not available, enqueue the request
/// sends outgoing requests
ProviderManager
.
prototype
.
send
=
function
(
data
)
{
data
.
args
=
data
.
args
||
[];
...
...
@@ -74,26 +81,13 @@ ProviderManager.prototype.send = function(data) {
/// setups provider, which will be used for sending messages
ProviderManager
.
prototype
.
set
=
function
(
provider
)
{
if
(
this
.
provider
!==
undefined
&&
this
.
provider
.
unload
!==
undefined
)
{
this
.
provider
.
unload
();
}
this
.
provider
=
provider
;
this
.
ready
=
true
;
};
/// @returns true if the provider i properly set
ProviderManager
.
prototype
.
installed
=
function
()
{
return
this
.
provider
!==
undefined
;
};
/// this method is only used, when we do not have native qt bindings and have to do polling on our own
/// should be callled, on start watching for eth/shh changes
ProviderManager
.
prototype
.
startPolling
=
function
(
data
,
pollId
)
{
if
(
!
this
.
provider
||
!
this
.
provider
.
poll
)
{
return
;
}
this
.
polls
.
push
({
data
:
data
,
id
:
pollId
});
ProviderManager
.
prototype
.
startPolling
=
function
(
data
,
pollId
,
callback
)
{
this
.
polls
.
push
({
data
:
data
,
id
:
pollId
,
callback
:
callback
});
};
/// should be called to stop polling for certain watch changes
...
...
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