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
ea304842
Commit
ea304842
authored
Oct 22, 2014
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block, transaction, uncle by hash and number separately
parent
5cd93a06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
http.js
http.js
+0
-2
index.html
index.html
+2
-0
main.js
main.js
+6
-7
No files found.
http.js
View file @
ea304842
...
...
@@ -4,7 +4,6 @@
this
.
host
=
host
;
};
//TODO unify the format of object passed to 'send method'
function
formatJsonRpcObject
(
object
)
{
return
{
jsonrpc
:
'2.0'
,
...
...
@@ -14,7 +13,6 @@
}
};
//TODO unify the format of output messages, maybe there should be objects instead
function
formatJsonRpcMessage
(
message
)
{
var
object
=
JSON
.
parse
(
message
);
...
...
index.html
View file @
ea304842
...
...
@@ -5,7 +5,9 @@
<script
type=
"text/javascript"
src=
"main.js"
></script>
<script
type=
"text/javascript"
src=
"websocket.js"
></script>
<script
type=
"text/javascript"
src=
"qt.js"
></script>
<script
type=
"text/javascript"
src=
"http.js"
></script>
<script
type=
"text/javascript"
>
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
'http://localhost:8080'
));
function
registerName
()
{
var
name
=
document
.
querySelector
(
"#name"
).
value
;
name
=
web3
.
fromAscii
(
name
);
...
...
main.js
View file @
ea304842
...
...
@@ -49,11 +49,10 @@
eth
:
{
prototype
:
Object
(),
//TODO solve the issue with numberOrHash impl
block
:
function
(
numberOrHash
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
args
=
typeof
numberOrHash
===
"string"
?
[
0
,
numberOrHash
]
:
[
numberOrHash
,
""
]
;
web3
.
provider
.
send
({
call
:
"block"
,
args
:
args
},
function
(
block
)
{
var
call
=
typeof
numberOrHash
===
"string"
?
'blockByHash'
:
'blockByNumber'
;
web3
.
provider
.
send
({
call
:
call
,
args
:
[
numberOrHash
]
},
function
(
block
)
{
if
(
block
)
resolve
(
block
);
else
...
...
@@ -64,8 +63,8 @@
transaction
:
function
(
numberOrHash
,
nth
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
args
=
typeof
numberOrHash
===
"string"
?
[
0
,
numberOrHash
,
nth
]
:
[
numberOrHash
,
""
,
nth
]
;
web3
.
provider
.
send
({
call
:
"transaction"
,
args
:
args
},
function
(
block
)
{
var
call
=
typeof
numberOrHash
===
"string"
?
'transactionByHash'
:
'transactonByNumber'
;
web3
.
provider
.
send
({
call
:
call
,
args
:
[
numberOrHash
,
nth
]
},
function
(
block
)
{
if
(
block
)
resolve
(
block
);
else
...
...
@@ -76,8 +75,8 @@
uncle
:
function
(
numberOrHash
,
nth
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
args
=
typeof
numberOrHash
===
"string"
?
[
0
,
numberOrHash
,
nth
]
:
[
numberOrHash
,
""
,
nth
]
;
web3
.
provider
.
send
({
call
:
"uncle"
,
args
:
args
},
function
(
block
)
{
var
call
=
typeof
numberOrHash
===
"string"
?
'uncleByHash'
:
'uncleByNumber'
;
web3
.
provider
.
send
({
call
:
call
,
args
:
[
numberOrHash
,
nth
]
},
function
(
block
)
{
if
(
block
)
resolve
(
block
);
else
...
...
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