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
30afd376
Commit
30afd376
authored
Jul 04, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compose additional fields
parent
cd4cc309
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
eth.go
rpc/api/eth.go
+6
-1
parsing.go
rpc/api/parsing.go
+12
-4
No files found.
rpc/api/eth.go
View file @
30afd376
...
@@ -605,13 +605,18 @@ func (self *ethApi) GetTransactionReceipt(req *shared.Request) (interface{}, err
...
@@ -605,13 +605,18 @@ func (self *ethApi) GetTransactionReceipt(req *shared.Request) (interface{}, err
}
}
txhash
:=
common
.
BytesToHash
(
common
.
FromHex
(
args
.
Hash
))
txhash
:=
common
.
BytesToHash
(
common
.
FromHex
(
args
.
Hash
))
tx
,
bhash
,
bnum
,
txi
:=
self
.
xeth
.
EthTransactionByHash
(
args
.
Hash
)
rec
:=
self
.
xeth
.
GetTxReceipt
(
txhash
)
rec
:=
self
.
xeth
.
GetTxReceipt
(
txhash
)
// We could have an error of "not found". Should disambiguate
// We could have an error of "not found". Should disambiguate
// if err != nil {
// if err != nil {
// return err, nil
// return err, nil
// }
// }
if
rec
!=
nil
{
if
rec
!=
nil
&&
tx
!=
nil
{
v
:=
NewReceiptRes
(
rec
)
v
:=
NewReceiptRes
(
rec
)
v
.
BlockHash
=
newHexData
(
bhash
)
v
.
BlockNumber
=
newHexNum
(
bnum
)
v
.
GasUsed
=
newHexNum
(
tx
.
Gas
()
.
Bytes
())
v
.
TransactionIndex
=
newHexNum
(
txi
)
return
v
,
nil
return
v
,
nil
}
}
...
...
rpc/api/parsing.go
View file @
30afd376
package
api
package
api
import
(
import
(
"bytes"
"encoding/binary"
"encoding/binary"
"encoding/hex"
"encoding/hex"
"encoding/json"
"encoding/json"
...
@@ -419,11 +420,18 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
...
@@ -419,11 +420,18 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
}
}
var
v
=
new
(
ReceiptRes
)
var
v
=
new
(
ReceiptRes
)
// TODO fill out rest of object
// ContractAddress is all 0 when not a creation tx
v
.
ContractAddress
=
newHexData
(
rec
.
ContractAddress
)
v
.
CumulativeGasUsed
=
newHexNum
(
rec
.
CumulativeGasUsed
)
v
.
TransactionHash
=
newHexData
(
rec
.
TxHash
)
v
.
TransactionHash
=
newHexData
(
rec
.
TxHash
)
// v.TransactionIndex = newHexNum(input) // transaction
// v.BlockNumber = newHexNum(input) // transaction
// v.BlockHash = newHexData(input) //transaction
v
.
CumulativeGasUsed
=
newHexNum
(
rec
.
CumulativeGasUsed
)
// v.GasUsed = newHexNum(input) // CumulativeGasUsed (blocknum-1)
// If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation
if
bytes
.
Compare
(
rec
.
ContractAddress
.
Bytes
(),
bytes
.
Repeat
([]
byte
{
0
},
20
))
!=
0
{
v
.
ContractAddress
=
newHexData
(
rec
.
ContractAddress
)
}
// v.Logs = rec.Logs()
return
v
return
v
}
}
...
...
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