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
8f2ae29b
Unverified
Commit
8f2ae29b
authored
Jul 28, 2023
by
Mario Vega
Committed by
GitHub
Jul 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/types: fix receipt blob fields marshaling (#27793)
parent
d9556533
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
gen_receipt_json.go
core/types/gen_receipt_json.go
+8
-8
receipt.go
core/types/receipt.go
+2
-0
No files found.
core/types/gen_receipt_json.go
View file @
8f2ae29b
...
...
@@ -26,8 +26,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
ContractAddress
common
.
Address
`json:"contractAddress"`
GasUsed
hexutil
.
Uint64
`json:"gasUsed" gencodec:"required"`
EffectiveGasPrice
*
hexutil
.
Big
`json:"effectiveGasPrice"`
BlobGasUsed
uint64
`json:"blobGasUsed,omitempty"`
BlobGasPrice
*
big
.
Int
`json:"blobGasPrice,omitempty"`
BlobGasUsed
hexutil
.
Uint64
`json:"blobGasUsed,omitempty"`
BlobGasPrice
*
hexutil
.
Big
`json:"blobGasPrice,omitempty"`
BlockHash
common
.
Hash
`json:"blockHash,omitempty"`
BlockNumber
*
hexutil
.
Big
`json:"blockNumber,omitempty"`
TransactionIndex
hexutil
.
Uint
`json:"transactionIndex"`
...
...
@@ -43,8 +43,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
enc
.
ContractAddress
=
r
.
ContractAddress
enc
.
GasUsed
=
hexutil
.
Uint64
(
r
.
GasUsed
)
enc
.
EffectiveGasPrice
=
(
*
hexutil
.
Big
)(
r
.
EffectiveGasPrice
)
enc
.
BlobGasUsed
=
r
.
BlobGasUsed
enc
.
BlobGasPrice
=
r
.
BlobGasPrice
enc
.
BlobGasUsed
=
hexutil
.
Uint64
(
r
.
BlobGasUsed
)
enc
.
BlobGasPrice
=
(
*
hexutil
.
Big
)(
r
.
BlobGasPrice
)
enc
.
BlockHash
=
r
.
BlockHash
enc
.
BlockNumber
=
(
*
hexutil
.
Big
)(
r
.
BlockNumber
)
enc
.
TransactionIndex
=
hexutil
.
Uint
(
r
.
TransactionIndex
)
...
...
@@ -64,8 +64,8 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
ContractAddress
*
common
.
Address
`json:"contractAddress"`
GasUsed
*
hexutil
.
Uint64
`json:"gasUsed" gencodec:"required"`
EffectiveGasPrice
*
hexutil
.
Big
`json:"effectiveGasPrice"`
BlobGasUsed
*
uint64
`json:"blobGasUsed,omitempty"`
BlobGasPrice
*
big
.
Int
`json:"blobGasPrice,omitempty"`
BlobGasUsed
*
hexutil
.
Uint64
`json:"blobGasUsed,omitempty"`
BlobGasPrice
*
hexutil
.
Big
`json:"blobGasPrice,omitempty"`
BlockHash
*
common
.
Hash
`json:"blockHash,omitempty"`
BlockNumber
*
hexutil
.
Big
`json:"blockNumber,omitempty"`
TransactionIndex
*
hexutil
.
Uint
`json:"transactionIndex"`
...
...
@@ -110,10 +110,10 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
r
.
EffectiveGasPrice
=
(
*
big
.
Int
)(
dec
.
EffectiveGasPrice
)
}
if
dec
.
BlobGasUsed
!=
nil
{
r
.
BlobGasUsed
=
*
dec
.
BlobGasUsed
r
.
BlobGasUsed
=
uint64
(
*
dec
.
BlobGasUsed
)
}
if
dec
.
BlobGasPrice
!=
nil
{
r
.
BlobGasPrice
=
dec
.
BlobGasPrice
r
.
BlobGasPrice
=
(
*
big
.
Int
)(
dec
.
BlobGasPrice
)
}
if
dec
.
BlockHash
!=
nil
{
r
.
BlockHash
=
*
dec
.
BlockHash
...
...
core/types/receipt.go
View file @
8f2ae29b
...
...
@@ -80,6 +80,8 @@ type receiptMarshaling struct {
CumulativeGasUsed
hexutil
.
Uint64
GasUsed
hexutil
.
Uint64
EffectiveGasPrice
*
hexutil
.
Big
BlobGasUsed
hexutil
.
Uint64
BlobGasPrice
*
hexutil
.
Big
BlockNumber
*
hexutil
.
Big
TransactionIndex
hexutil
.
Uint
}
...
...
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