Aleph-302: fix messages.json start_block and end_block params #653
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.
Query like
http://0.0.0.0:4024/api/v0/messages.json?msgType=POST&tags=mainnet&contentTypes=balances-update&pagination=50&sort_order=1&start_block=21135862&addresses=0xa1B3bb7d2332383D96b7796B908fB7f7F3c2Be10
was broken and generating a 500 errorRelated Clickup or Jira tickets : ALEPH-302
Self proofreading checklist
Changes
So, basically until this commit the
start_block/end_block
part of the code was never reached and was not working (except if you call the html query paramsStartBlock
)height
attribute on the tablemessage_confirmations
that doesn't have any heightheight
valueGROUP BY
|
has less precedence than>=
order_by_columns
because in some branches of theif/elif/else
block it can be uninitializedHow to test
Launch pyaleph then run this query:
http://0.0.0.0:4024/api/v0/messages.json?msgType=POST&tags=mainnet&contentTypes=balances-update&pagination=50&sort_order=1&start_block=21135862&addresses=0xa1B3bb7d2332383D96b7796B908fB7f7F3c2Be10
Notes
I'm not 100% sure that the modification of the
GROUP BY
and of the default value fororder_by_columns
are the behavior we want but this part of the code just never worked before 😕We also probably really want to have some tests here that handle that situation but I understand that this PR is urgent and 301 is also so I'm prioritizing this.