-
Notifications
You must be signed in to change notification settings - Fork 477
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
tools: new endpoints for block generator #5257
Conversation
|
||
func accountToIndex(a basics.Address) (addr uint64) { | ||
// Make sure we don't generate a zero address by adding 1 to i | ||
return binary.LittleEndian.Uint64(a[:]) - 1 |
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.
moved to utils.
Codecov Report
@@ Coverage Diff @@
## master #5257 +/- ##
=======================================
Coverage 53.75% 53.76%
=======================================
Files 450 450
Lines 56191 56236 +45
=======================================
+ Hits 30207 30235 +28
- Misses 23632 23656 +24
+ Partials 2352 2345 -7
... and 8 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Still reading through the PR, but asking a couple of questions down for now.
@cce how could we update the block generator interface so it could work for pingpong? |
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.
LGTM - but leaving an ignorable nit/qn
func parseAccount(path string) (string, error) { | ||
if !strings.HasPrefix(path, accountsQueryPrefix) { | ||
return "", fmt.Errorf("not a accounts query: %s", path) | ||
func parseURL(path string) (string, error) { |
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.
generalizing the parser for all endpoints. I didn't think it was necessary to check the path prefix since each handler function is associated with only one endpoint.
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.
Looks Good - just recommend reviving the spirit of a no longer obsolete unit test
tests updated. |
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.
Approving, but leaving a suggested renaming of a test-only struct field that can be ignored.
var testcases = []struct { | ||
name string | ||
url string | ||
expectedRound uint64 | ||
expectedRound string |
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.
expectedRound string | |
expectedParam string |
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.
Or maybe expectedPart
? No big deal regardless.
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.
I'll update this in the next PR.
this PR adds new endpoints
/v2/ledger/sync/
and/v2/deltas/{round}
to block generator.