[dot/rpc] implement RPC system_accountNextIndex#1376
Merged
edwardmack merged 16 commits intodevelopmentfrom Feb 17, 2021
Merged
[dot/rpc] implement RPC system_accountNextIndex#1376edwardmack merged 16 commits intodevelopmentfrom
edwardmack merged 16 commits intodevelopmentfrom
Conversation
RyRy79261
approved these changes
Feb 9, 2021
arijitAD
approved these changes
Feb 10, 2021
noot
reviewed
Feb 10, 2021
dot/rpc/modules/system.go
Outdated
Comment on lines
+174
to
+175
| if req == nil || len(req.String) == 0 { | ||
| return errors.New("Account address must be valid") |
Contributor
There was a problem hiding this comment.
maybe move this to the top of the function so it checks it first?
Contributor
Author
|
Added check of pending transactions before looking in storage. codeclimate is complaining, so please take a re-look at this and let me know suggestions for cleaning it up. |
RyRy79261
approved these changes
Feb 16, 2021
noot
reviewed
Feb 17, 2021
Comment on lines
+185
to
+186
| if sigNonce.Uint64() > nonce { | ||
| nonce = sigNonce.Uint64() |
Contributor
There was a problem hiding this comment.
wouldn't the nonce always be greater unless it's 0, in which case it's fine to directly set it?
Contributor
Author
There was a problem hiding this comment.
Yes, but there may be more than one tx signed by that user in the tx pool, so did this to make sure we have the maximum nonce.
noot
reviewed
Feb 17, 2021
dot/rpc/modules/system_test.go
Outdated
| require.Equal(t, expected, *res) | ||
| } | ||
|
|
||
| func TestSystemModule_AccountNextIndex(t *testing.T) { |
Contributor
There was a problem hiding this comment.
is it possible to add a test for the non-pending case?
Contributor
Author
There was a problem hiding this comment.
Yes, I've added tests.
github-actions bot
pushed a commit
that referenced
this pull request
Feb 17, 2021
Edward Mack: [dot/rpc] implement RPC system_accountNextIndex (#1376) * stub AccountNextIndex * implement rpc system_accountNextIndex * lint * update testService_Methods * move parmeter check * add TransactionStateAPI to RPC systemModule * add check of pending transactions ot accountNextIndex * add test for pending tranactions * run lint * add tests
This was referenced Oct 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Tests
Checklist
Issues