Skip to content

Commit

Permalink
Set block baseFeePerGas value in graphql response (#9974)
Browse files Browse the repository at this point in the history
Set baseFeePerGas value in graphql resolver for block
  • Loading branch information
scorring authored Apr 23, 2024
1 parent 49e39ab commit 6457ef3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
1 change: 1 addition & 0 deletions cmd/rpcdaemon/graphql/graph/schema.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions cmd/rpcdaemon/graphql/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func TestGraphQLQueryBlock(t *testing.T) {
want: `{"errors":[{"message":"Cannot query field \"bleh\" on type \"Query\".","locations":[{"line":1,"column":2}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}],"data":null}`,
code: 422,
},
{ // Should return baseFeePerGas
body: `{"query": "{block{number,baseFeePerGas}}","variables": null}`,
want: `{"data":{"block":{"number":\d{8,},"baseFeePerGas":\w+}}`,
code: 200,
comp: "regexp",
},
// should return `estimateGas` as decimal
/*
{
Expand Down
53 changes: 27 additions & 26 deletions cmd/rpcdaemon/graphql/query_block.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
extraData
gasLimit
gasUsed
baseFeePerGas
logsBloom
ommerHash
ommers {
Expand All @@ -25,33 +26,33 @@
transactionsRoot
totalDifficulty
transactions {
createdContract {
address
}
cumulativeGasUsed
from {
address
}
gasUsed
gasPrice
inputData
createdContract {
address
}
cumulativeGasUsed
from {
address
}
gasUsed
gasPrice
inputData
nonce
index
value
logs {
account {
address
}
data
index
topics
}
hash
index
to {
address
}
status
index
value
logs {
account {
address
}
data
index
topics
}
hash
index
to {
address
}
status
}
}
}

0 comments on commit 6457ef3

Please sign in to comment.