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
481b2212
Commit
481b2212
authored
Jul 4, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Decode full receipt storage
parent
80eb8f46
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/transaction_util.go
+15
-0
15 additions, 0 deletions
core/transaction_util.go
rpc/api/parsing.go
+4
-2
4 additions, 2 deletions
rpc/api/parsing.go
xeth/xeth.go
+2
-2
2 additions, 2 deletions
xeth/xeth.go
with
21 additions
and
4 deletions
core/transaction_util.go
+
15
−
0
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
[
:
]
...
))
...
...
This diff is collapsed.
Click to expand it.
rpc/api/parsing.go
+
4
−
2
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
}
...
...
This diff is collapsed.
Click to expand it.
xeth/xeth.go
+
2
−
2
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
{
...
...
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