good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
2c5a32eb
Commit
2c5a32eb
authored
Mar 26, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Undo XEth changes
parent
1f381414
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rpc/api.go
+7
-7
7 additions, 7 deletions
rpc/api.go
xeth/xeth.go
+2
-5
2 additions, 5 deletions
xeth/xeth.go
with
9 additions
and
12 deletions
rpc/api.go
+
7
−
7
View file @
2c5a32eb
...
@@ -126,7 +126,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -126,7 +126,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
block
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
))
block
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
.
Hex
()
))
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
case
"eth_getBlockTransactionCountByNumber"
:
case
"eth_getBlockTransactionCountByNumber"
:
args
:=
new
(
GetBlockByNumberArgs
)
args
:=
new
(
GetBlockByNumberArgs
)
...
@@ -142,7 +142,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -142,7 +142,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
)
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
.
Hex
()
)
br
:=
NewBlockRes
(
block
)
br
:=
NewBlockRes
(
block
)
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
case
"eth_getUncleCountByBlockNumber"
:
case
"eth_getUncleCountByBlockNumber"
:
...
@@ -191,7 +191,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -191,7 +191,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
)
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
BlockHash
.
Hex
()
)
br
:=
NewBlockRes
(
block
)
br
:=
NewBlockRes
(
block
)
br
.
fullTx
=
args
.
IncludeTxs
br
.
fullTx
=
args
.
IncludeTxs
...
@@ -222,7 +222,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -222,7 +222,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
Hash
)
block
:=
api
.
xeth
()
.
EthBlockByHash
(
args
.
Hash
.
Hex
()
)
br
:=
NewBlockRes
(
block
)
br
:=
NewBlockRes
(
block
)
br
.
fullTx
=
true
br
.
fullTx
=
true
...
@@ -250,14 +250,14 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -250,14 +250,14 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
br
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByHash
(
args
.
Hash
))
br
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByHash
(
args
.
Hash
.
Hex
()
))
if
args
.
Index
>
int64
(
len
(
br
.
Uncles
))
||
args
.
Index
<
0
{
if
args
.
Index
>
int64
(
len
(
br
.
Uncles
))
||
args
.
Index
<
0
{
return
NewValidationError
(
"Index"
,
"does not exist"
)
return
NewValidationError
(
"Index"
,
"does not exist"
)
}
}
uhash
:=
br
.
Uncles
[
args
.
Index
]
.
Hex
()
uhash
:=
br
.
Uncles
[
args
.
Index
]
.
Hex
()
uncle
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByH
exstring
(
uhash
))
uncle
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByH
ash
(
uhash
))
*
reply
=
uncle
*
reply
=
uncle
case
"eth_getUncleByBlockNumberAndIndex"
:
case
"eth_getUncleByBlockNumberAndIndex"
:
...
@@ -275,7 +275,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -275,7 +275,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
}
uhash
:=
v
.
Uncles
[
args
.
Index
]
.
Hex
()
uhash
:=
v
.
Uncles
[
args
.
Index
]
.
Hex
()
uncle
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByH
exstring
(
uhash
))
uncle
:=
NewBlockRes
(
api
.
xeth
()
.
EthBlockByH
ash
(
uhash
))
*
reply
=
uncle
*
reply
=
uncle
case
"eth_getCompilers"
:
case
"eth_getCompilers"
:
...
...
This diff is collapsed.
Click to expand it.
xeth/xeth.go
+
2
−
5
View file @
2c5a32eb
...
@@ -160,16 +160,13 @@ func (self *XEth) BlockByHash(strHash string) *Block {
...
@@ -160,16 +160,13 @@ func (self *XEth) BlockByHash(strHash string) *Block {
return
NewBlock
(
block
)
return
NewBlock
(
block
)
}
}
func
(
self
*
XEth
)
EthBlockByHash
(
hash
common
.
Hash
)
*
types
.
Block
{
func
(
self
*
XEth
)
EthBlockByHash
(
strHash
string
)
*
types
.
Block
{
hash
:=
common
.
HexToHash
(
strHash
)
block
:=
self
.
backend
.
ChainManager
()
.
GetBlock
(
hash
)
block
:=
self
.
backend
.
ChainManager
()
.
GetBlock
(
hash
)
return
block
return
block
}
}
func
(
self
*
XEth
)
EthBlockByHexstring
(
strHash
string
)
*
types
.
Block
{
return
self
.
EthBlockByHash
(
common
.
HexToHash
(
strHash
))
}
func
(
self
*
XEth
)
EthTransactionByHash
(
hash
string
)
*
types
.
Transaction
{
func
(
self
*
XEth
)
EthTransactionByHash
(
hash
string
)
*
types
.
Transaction
{
data
,
_
:=
self
.
backend
.
ExtraDb
()
.
Get
(
common
.
FromHex
(
hash
))
data
,
_
:=
self
.
backend
.
ExtraDb
()
.
Get
(
common
.
FromHex
(
hash
))
if
len
(
data
)
!=
0
{
if
len
(
data
)
!=
0
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment