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
481b2212
Commit
481b2212
authored
Jul 04, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decode full receipt storage
parent
80eb8f46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
transaction_util.go
core/transaction_util.go
+15
-0
parsing.go
rpc/api/parsing.go
+4
-2
xeth.go
xeth/xeth.go
+2
-2
No files found.
core/transaction_util.go
View file @
481b2212
...
...
@@ -54,6 +54,21 @@ func PutReceipts(db common.Database, receipts types.Receipts) error {
return
nil
}
// GetReceipt returns a receipt by hash
func
GetFullReceipt
(
db
common
.
Database
,
txHash
common
.
Hash
)
*
types
.
ReceiptForStorage
{
data
,
_
:=
db
.
Get
(
append
(
receiptsPre
,
txHash
[
:
]
...
))
if
len
(
data
)
==
0
{
return
nil
}
var
receipt
types
.
ReceiptForStorage
err
:=
rlp
.
DecodeBytes
(
data
,
&
receipt
)
if
err
!=
nil
{
glog
.
V
(
logger
.
Error
)
.
Infoln
(
"GetReceipt err:"
,
err
)
}
return
&
receipt
}
// GetReceipt returns a receipt by hash
func
GetReceipt
(
db
common
.
Database
,
txHash
common
.
Hash
)
*
types
.
Receipt
{
data
,
_
:=
db
.
Get
(
append
(
receiptsPre
,
txHash
[
:
]
...
))
...
...
rpc/api/parsing.go
View file @
481b2212
...
...
@@ -413,15 +413,17 @@ type ReceiptRes struct {
Logs
*
[]
interface
{}
`json:logs`
}
func
NewReceiptRes
(
rec
*
types
.
Receipt
)
*
ReceiptRes
{
func
NewReceiptRes
(
rec
*
types
.
Receipt
ForStorage
)
*
ReceiptRes
{
if
rec
==
nil
{
return
nil
}
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
)
return
v
}
...
...
xeth/xeth.go
View file @
481b2212
...
...
@@ -368,8 +368,8 @@ func (self *XEth) GetBlockReceipts(bhash common.Hash) types.Receipts {
return
self
.
backend
.
BlockProcessor
()
.
GetBlockReceipts
(
bhash
)
}
func
(
self
*
XEth
)
GetTxReceipt
(
txhash
common
.
Hash
)
*
types
.
Receipt
{
return
core
.
GetReceipt
(
self
.
backend
.
ExtraDb
(),
txhash
)
func
(
self
*
XEth
)
GetTxReceipt
(
txhash
common
.
Hash
)
*
types
.
Receipt
ForStorage
{
return
core
.
Get
Full
Receipt
(
self
.
backend
.
ExtraDb
(),
txhash
)
}
func
(
self
*
XEth
)
GasLimit
()
*
big
.
Int
{
...
...
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