-
Notifications
You must be signed in to change notification settings - Fork 44
Introduce blockStartingTxNoncesQuery
#2720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
66da16b
to
4373876
Compare
tipStartingTxNoncesQuery
blockStartingTxNoncesQuery
a3aa923
to
4f4804b
Compare
4f4804b
to
d12e010
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add a new GraphQL query to fetch starting transaction nonces for each signer in a specified block (by hash or index) or the tip if no arguments are provided.
- Define
blockStartingTxNoncesQuery
withhash
/index
arguments and fallback to tip - Create
BlockStartingTxNoncesType
to map signer/nonces tuples - Add a unit test covering the hash-based case
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
NineChronicles.Headless/GraphTypes/StandaloneQuery.cs | Add blockStartingTxNoncesQuery field with argument parsing and resolve logic |
NineChronicles.Headless/GraphTypes/BlockStartingTxNoncesType.cs | Define GraphQL type for (Address Signer, long Nonce) tuples |
NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs | Implement test for the new query when called with a block hash |
Comments suppressed due to low confidence (2)
NineChronicles.Headless/GraphTypes/StandaloneQuery.cs:603
- [nitpick] The error message could be clearer. For example: "Provide either 'hash' or 'index', but not both."
=> throw new ArgumentException("Only one of 'hash' and 'index' must be given."),
NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs:779
- Coverage currently only tests the
hash
argument case. Consider adding tests for theindex
parameter and the default (no-argument) tip case to fully exercise the new query.
[Fact]
NineChronicles.Headless/GraphTypes/BlockStartingTxNoncesType.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new GraphQL query, blockStartingTxNoncesQuery, to retrieve the starting transaction nonces for a given block before execution. Key changes include:
- Adding the new query to StandaloneQuery.cs with tuple-based input handling.
- Creating a new GraphQL object type for block starting transaction nonces.
- Implementing tests in StandaloneQueryTest.cs to verify the query returns the expected nonce grouping.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
NineChronicles.Headless/GraphTypes/StandaloneQuery.cs | Introduces the blockStartingTxNoncesQuery with input validation and grouping logic. |
NineChronicles.Headless/GraphTypes/BlockStartingTxNoncesType.cs | Defines the GraphQL type used by the new query. |
NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs | Adds tests for the new query using the hash parameter. |
Comments suppressed due to low confidence (1)
NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs:780
- [nitpick] Consider adding additional tests for scenarios when the query is called with the 'index' argument and when both 'hash' and 'index' are provided, to fully cover all input variations.
public async Task BlockStartingTxNonces()
특정 블록 실행 전의 논스값들을 가져올 수 있는 쿼리를 추가합니다.