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
3ccd6b6d
Unverified
Commit
3ccd6b6d
authored
Jan 05, 2022
by
Sina Mahmoodi
Committed by
GitHub
Jan 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graphql: fix block resolving for parent field (#24191)
Fixes #24161
parent
c20de3c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
graphql.go
graphql/graphql.go
+10
-13
No files found.
graphql/graphql.go
View file @
3ccd6b6d
...
@@ -599,21 +599,18 @@ func (b *Block) BaseFeePerGas(ctx context.Context) (*hexutil.Big, error) {
...
@@ -599,21 +599,18 @@ func (b *Block) BaseFeePerGas(ctx context.Context) (*hexutil.Big, error) {
}
}
func
(
b
*
Block
)
Parent
(
ctx
context
.
Context
)
(
*
Block
,
error
)
{
func
(
b
*
Block
)
Parent
(
ctx
context
.
Context
)
(
*
Block
,
error
)
{
// If the block header hasn't been fetched, and we'll need it, fetch it.
if
_
,
err
:=
b
.
resolveHeader
(
ctx
);
err
!=
nil
{
if
b
.
numberOrHash
==
nil
&&
b
.
header
==
nil
{
return
nil
,
err
if
_
,
err
:=
b
.
resolveHeader
(
ctx
);
err
!=
nil
{
return
nil
,
err
}
}
}
if
b
.
header
!=
nil
&&
b
.
header
.
Number
.
Uint64
()
>
0
{
if
b
.
header
==
nil
||
b
.
header
.
Number
.
Uint64
()
<
1
{
num
:=
rpc
.
BlockNumberOrHashWithNumber
(
rpc
.
BlockNumber
(
b
.
header
.
Number
.
Uint64
()
-
1
))
return
nil
,
nil
return
&
Block
{
backend
:
b
.
backend
,
numberOrHash
:
&
num
,
hash
:
b
.
header
.
ParentHash
,
},
nil
}
}
return
nil
,
nil
num
:=
rpc
.
BlockNumberOrHashWithNumber
(
rpc
.
BlockNumber
(
b
.
header
.
Number
.
Uint64
()
-
1
))
return
&
Block
{
backend
:
b
.
backend
,
numberOrHash
:
&
num
,
hash
:
b
.
header
.
ParentHash
,
},
nil
}
}
func
(
b
*
Block
)
Difficulty
(
ctx
context
.
Context
)
(
hexutil
.
Big
,
error
)
{
func
(
b
*
Block
)
Difficulty
(
ctx
context
.
Context
)
(
hexutil
.
Big
,
error
)
{
...
...
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