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
a31835c8
Unverified
Commit
a31835c8
authored
7 years ago
by
rjl493456442
Committed by
Péter Szilágyi
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/ethapi: add status code to receipt rpc return
parent
d78ad226
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
api.go
internal/ethapi/api.go
+14
-3
No files found.
internal/ethapi/api.go
View file @
a31835c8
...
...
@@ -44,8 +44,10 @@ import (
)
const
(
defaultGas
=
90000
defaultGasPrice
=
50
*
params
.
Shannon
defaultGas
=
90000
defaultGasPrice
=
50
*
params
.
Shannon
receiptStatusSuccessful
=
1
receiptStatusFailed
=
0
)
// PublicEthereumAPI provides an API to access Ethereum related information.
...
...
@@ -991,7 +993,6 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[
from
,
_
:=
types
.
Sender
(
signer
,
tx
)
fields
:=
map
[
string
]
interface
{}{
"root"
:
hexutil
.
Bytes
(
receipt
.
PostState
),
"blockHash"
:
blockHash
,
"blockNumber"
:
hexutil
.
Uint64
(
blockNumber
),
"transactionHash"
:
hash
,
...
...
@@ -1004,6 +1005,16 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[
"logs"
:
receipt
.
Logs
,
"logsBloom"
:
receipt
.
Bloom
,
}
// Assign receipt status or post state.
if
len
(
receipt
.
PostState
)
>
0
{
fields
[
"root"
]
=
hexutil
.
Bytes
(
receipt
.
PostState
)
}
else
{
fields
[
"status"
]
=
hexutil
.
Uint
(
receiptStatusSuccessful
)
if
receipt
.
Failed
{
fields
[
"status"
]
=
hexutil
.
Uint
(
receiptStatusFailed
)
}
}
if
receipt
.
Logs
==
nil
{
fields
[
"logs"
]
=
[][]
*
types
.
Log
{}
}
...
...
This diff is collapsed.
Click to expand it.
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