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
0316490c
Commit
0316490c
authored
Nov 11, 2014
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common fixes
parent
838ca2fd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
9 deletions
+6
-9
ethereum.js
dist/ethereum.js
+1
-1
ethereum.js.map
dist/ethereum.js.map
+1
-1
ethereum.min.js
dist/ethereum.min.js
+1
-1
autoprovider.js
lib/autoprovider.js
+3
-6
No files found.
dist/ethereum.js
View file @
0316490c
require
=
(
function
e
(
t
,
n
,
r
){
function
s
(
o
,
u
){
if
(
!
n
[
o
]){
if
(
!
t
[
o
]){
var
a
=
typeof
require
==
"function"
&&
require
;
if
(
!
u
&&
a
)
return
a
(
o
,
!
0
);
if
(
i
)
return
i
(
o
,
!
0
);
var
f
=
new
Error
(
"Cannot find module '"
+
o
+
"'"
);
throw
f
.
code
=
"MODULE_NOT_FOUND"
,
f
}
var
l
=
n
[
o
]
=
{
exports
:{}};
t
[
o
][
0
].
call
(
l
.
exports
,
function
(
e
){
var
n
=
t
[
o
][
1
][
e
];
return
s
(
n
?
n
:
e
)},
l
,
l
.
exports
,
e
,
t
,
n
,
r
)}
return
n
[
o
].
exports
}
var
i
=
typeof
require
==
"function"
&&
require
;
for
(
var
o
=
0
;
o
<
r
.
length
;
o
++
)
s
(
r
[
o
]);
return
s
})({
1
:[
function
(
require
,
module
,
exports
){
require
=
(
function
e
(
t
,
n
,
r
){
function
s
(
o
,
u
){
if
(
!
n
[
o
]){
if
(
!
t
[
o
]){
var
a
=
typeof
require
==
"function"
&&
require
;
if
(
!
u
&&
a
)
return
a
(
o
,
!
0
);
if
(
i
)
return
i
(
o
,
!
0
);
var
f
=
new
Error
(
"Cannot find module '"
+
o
+
"'"
);
throw
f
.
code
=
"MODULE_NOT_FOUND"
,
f
}
var
l
=
n
[
o
]
=
{
exports
:{}};
t
[
o
][
0
].
call
(
l
.
exports
,
function
(
e
){
var
n
=
t
[
o
][
1
][
e
];
return
s
(
n
?
n
:
e
)},
l
,
l
.
exports
,
e
,
t
,
n
,
r
)}
return
n
[
o
].
exports
}
var
i
=
typeof
require
==
"function"
&&
require
;
for
(
var
o
=
0
;
o
<
r
.
length
;
o
++
)
s
(
r
[
o
]);
return
s
})({
1
:[
function
(
require
,
module
,
exports
){
var
AutoProvider
=
function
(
userOptions
){
var
options
,
self
,
closeWithSuccess
,
ws
;
if
(
!
web3
.
haveProvider
()){
if
(
this
.
sendQueue
=
[],
this
.
onmessageQueue
=
[],
navigator
.
qt
)
return
void
(
this
.
provider
=
new
web3
.
providers
.
QtProvider
);
userOptions
=
userOptions
||
{},
options
=
{
httprpc
:
userOptions
.
httprpc
||
"http://localhost:8080"
,
websockets
:
userOptions
.
websockets
||
"ws://localhost:40404/eth"
},
self
=
this
,
closeWithSuccess
=
function
(
success
){
return
ws
.
close
(),
success
?
void
(
self
.
provider
=
new
web3
.
providers
.
WebSocketProvider
(
options
.
websockets
)):(
self
.
provider
=
new
web3
.
providers
.
HttpRpcProvider
(
options
.
httprpc
),
self
.
poll
=
self
.
provider
.
poll
.
bind
(
self
.
provider
),
self
.
sendQueue
.
forEach
(
function
(
payload
){
self
.
provider
(
payload
)}),
void
self
.
onmessageQueue
.
forEach
(
function
(
handler
){
self
.
provider
.
onmessage
=
handler
})
)},
ws
=
new
WebSocket
(
options
.
websockets
),
ws
.
onopen
=
function
(){
closeWithSuccess
(
!
0
)},
ws
.
onerror
=
function
(){
closeWithSuccess
(
!
1
)}}};
AutoProvider
.
prototype
.
send
=
function
(
payload
){
return
this
.
provider
?
void
this
.
provider
.
send
(
payload
):
void
this
.
sendQueue
.
push
(
payload
)},
Object
.
defineProperty
(
AutoProvider
.
prototype
,
"onmessage"
,{
set
:
function
(
handler
){
return
this
.
provider
?
void
(
this
.
provider
.
onmessage
=
handler
):
void
this
.
onmessageQueue
.
push
(
handler
)}}),
module
.
exports
=
AutoProvider
;
var
AutoProvider
=
function
(
userOptions
){
var
options
,
self
,
closeWithSuccess
,
ws
;
if
(
!
web3
.
haveProvider
()){
if
(
this
.
sendQueue
=
[],
this
.
onmessageQueue
=
[],
navigator
.
qt
)
return
void
(
this
.
provider
=
new
web3
.
providers
.
QtProvider
);
userOptions
=
userOptions
||
{},
options
=
{
httprpc
:
userOptions
.
httprpc
||
"http://localhost:8080"
,
websockets
:
userOptions
.
websockets
||
"ws://localhost:40404/eth"
},
self
=
this
,
closeWithSuccess
=
function
(
success
){
ws
.
close
(),
success
?
self
.
provider
=
new
web3
.
providers
.
WebSocketProvider
(
options
.
websockets
):(
self
.
provider
=
new
web3
.
providers
.
HttpRpcProvider
(
options
.
httprpc
),
self
.
poll
=
self
.
provider
.
poll
.
bind
(
self
.
provider
)),
self
.
sendQueue
.
forEach
(
function
(
payload
){
self
.
provider
(
payload
)}),
self
.
onmessageQueue
.
forEach
(
function
(
handler
){
self
.
provider
.
onmessage
=
handler
}
)},
ws
=
new
WebSocket
(
options
.
websockets
),
ws
.
onopen
=
function
(){
closeWithSuccess
(
!
0
)},
ws
.
onerror
=
function
(){
closeWithSuccess
(
!
1
)}}};
AutoProvider
.
prototype
.
send
=
function
(
payload
){
return
this
.
provider
?
void
this
.
provider
.
send
(
payload
):
void
this
.
sendQueue
.
push
(
payload
)},
Object
.
defineProperty
(
AutoProvider
.
prototype
,
"onmessage"
,{
set
:
function
(
handler
){
return
this
.
provider
?
void
(
this
.
provider
.
onmessage
=
handler
):
void
this
.
onmessageQueue
.
push
(
handler
)}}),
module
.
exports
=
AutoProvider
;
},{}],
2
:[
function
(
require
,
module
,
exports
){
},{}],
2
:[
function
(
require
,
module
,
exports
){
function
formatJsonRpcObject
(
object
){
return
{
jsonrpc
:
"2.0"
,
method
:
object
.
call
,
params
:
object
.
args
,
id
:
object
.
_id
}}
function
formatJsonRpcMessage
(
message
){
var
object
=
JSON
.
parse
(
message
);
return
{
_id
:
object
.
id
,
data
:
object
.
result
,
error
:
object
.
error
}}
var
HttpRpcProvider
=
function
(
host
){
this
.
handlers
=
[],
this
.
host
=
host
};
HttpRpcProvider
.
prototype
.
sendRequest
=
function
(
payload
,
cb
){
var
data
=
formatJsonRpcObject
(
payload
),
request
=
new
XMLHttpRequest
;
request
.
open
(
"POST"
,
this
.
host
,
!
0
),
request
.
send
(
JSON
.
stringify
(
data
)),
request
.
onreadystatechange
=
function
(){
4
===
request
.
readyState
&&
cb
&&
cb
(
request
)}},
HttpRpcProvider
.
prototype
.
send
=
function
(
payload
){
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
){
self
.
handlers
.
forEach
(
function
(
handler
){
handler
.
call
(
self
,
formatJsonRpcMessage
(
request
.
responseText
))})})},
HttpRpcProvider
.
prototype
.
poll
=
function
(
payload
,
id
){
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
){
var
parsed
=
JSON
.
parse
(
request
.
responseText
);
!
parsed
.
error
&&
(
parsed
.
result
instanceof
Array
?
0
!==
parsed
.
result
.
length
:
parsed
.
result
)
&&
self
.
handlers
.
forEach
(
function
(
handler
){
handler
.
call
(
self
,{
_event
:
payload
.
call
,
_id
:
id
,
data
:
parsed
.
result
})})})},
Object
.
defineProperty
(
HttpRpcProvider
.
prototype
,
"onmessage"
,{
set
:
function
(
handler
){
this
.
handlers
.
push
(
handler
)}}),
module
.
exports
=
HttpRpcProvider
;
function
formatJsonRpcObject
(
object
){
return
{
jsonrpc
:
"2.0"
,
method
:
object
.
call
,
params
:
object
.
args
,
id
:
object
.
_id
}}
function
formatJsonRpcMessage
(
message
){
var
object
=
JSON
.
parse
(
message
);
return
{
_id
:
object
.
id
,
data
:
object
.
result
,
error
:
object
.
error
}}
var
HttpRpcProvider
=
function
(
host
){
this
.
handlers
=
[],
this
.
host
=
host
};
HttpRpcProvider
.
prototype
.
sendRequest
=
function
(
payload
,
cb
){
var
data
=
formatJsonRpcObject
(
payload
),
request
=
new
XMLHttpRequest
;
request
.
open
(
"POST"
,
this
.
host
,
!
0
),
request
.
send
(
JSON
.
stringify
(
data
)),
request
.
onreadystatechange
=
function
(){
4
===
request
.
readyState
&&
cb
&&
cb
(
request
)}},
HttpRpcProvider
.
prototype
.
send
=
function
(
payload
){
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
){
self
.
handlers
.
forEach
(
function
(
handler
){
handler
.
call
(
self
,
formatJsonRpcMessage
(
request
.
responseText
))})})},
HttpRpcProvider
.
prototype
.
poll
=
function
(
payload
,
id
){
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
){
var
parsed
=
JSON
.
parse
(
request
.
responseText
);
!
parsed
.
error
&&
(
parsed
.
result
instanceof
Array
?
0
!==
parsed
.
result
.
length
:
parsed
.
result
)
&&
self
.
handlers
.
forEach
(
function
(
handler
){
handler
.
call
(
self
,{
_event
:
payload
.
call
,
_id
:
id
,
data
:
parsed
.
result
})})})},
Object
.
defineProperty
(
HttpRpcProvider
.
prototype
,
"onmessage"
,{
set
:
function
(
handler
){
this
.
handlers
.
push
(
handler
)}}),
module
.
exports
=
HttpRpcProvider
;
},{}],
3
:[
function
(
require
,
module
,
exports
){
},{}],
3
:[
function
(
require
,
module
,
exports
){
...
...
dist/ethereum.js.map
View file @
0316490c
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
0316490c
This diff is collapsed.
Click to expand it.
lib/autoprovider.js
View file @
0316490c
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
*/
*/
if
(
process
.
env
.
NODE_ENV
!==
'build'
)
{
if
(
process
.
env
.
NODE_ENV
!==
'build'
)
{
var
WebSocket
=
require
(
'ws'
);
// jshint ignore:line
var
WebSocket
=
require
(
'ws'
);
// jshint ignore:line
}
if
(
process
.
env
.
NODE_ENV
!==
'build'
)
{
var
web3
=
require
(
'./web3'
);
// jshint ignore:line
var
web3
=
require
(
'./web3'
);
// jshint ignore:line
}
}
...
@@ -59,10 +56,10 @@ var AutoProvider = function (userOptions) {
...
@@ -59,10 +56,10 @@ var AutoProvider = function (userOptions) {
ws
.
close
();
ws
.
close
();
if
(
success
)
{
if
(
success
)
{
self
.
provider
=
new
web3
.
providers
.
WebSocketProvider
(
options
.
websockets
);
self
.
provider
=
new
web3
.
providers
.
WebSocketProvider
(
options
.
websockets
);
return
;
}
else
{
self
.
provider
=
new
web3
.
providers
.
HttpRpcProvider
(
options
.
httprpc
);
self
.
poll
=
self
.
provider
.
poll
.
bind
(
self
.
provider
);
}
}
self
.
provider
=
new
web3
.
providers
.
HttpRpcProvider
(
options
.
httprpc
);
self
.
poll
=
self
.
provider
.
poll
.
bind
(
self
.
provider
);
self
.
sendQueue
.
forEach
(
function
(
payload
)
{
self
.
sendQueue
.
forEach
(
function
(
payload
)
{
self
.
provider
(
payload
);
self
.
provider
(
payload
);
});
});
...
...
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