Skip to content
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

Extending queries by modifing TxPaginationMeta #1092

Merged
merged 1 commit into from
Jul 30, 2021
Merged

Extending queries by modifing TxPaginationMeta #1092

merged 1 commit into from
Jul 30, 2021

Conversation

Pawlak00
Copy link
Contributor

@Pawlak00 Pawlak00 commented Jun 18, 2021

Description of the Change

This is prove of concept for extending queries with time interval (from,to). Protobufs were modified and some basic logic was added. Validation of passed strings is not provided yet. Modified queries are getAccountTransactions and GetAccountAssetTransactions
Protobufs were modified, then neccesary getters were added.
Passed parameters are attached to sql query in executeTransactionsQuery, by applyer lamba function,
created separately in each function

Benefits

What benefits will be realized by the code change?
Allowing to query for Transactions in given time interval and beetwen two given block heights

Possible Drawbacks

What are the possible side-effects or negative impacts of the code change?
Usage of many if's in GetAccountTransactions/GetAccountAssetTransactions in postgres_specific_query_executor.cpp

Usage Examples or Tests [optional]

By rebuilding python library with protbuffs from code you can use it in Python library

Alternate Designs [optional]

Usage of different types for passing data as timestamp was considered, but I decided to use string, as it is not needed to cast from int to string

@baziorek baziorek self-requested a review June 18, 2021 13:49
@baziorek
Copy link
Contributor

There is reply from Iroha Core Team:
image
It looks like we have to change string format to protobuf datetime format.

@Pawlak00 Pawlak00 marked this pull request as draft June 29, 2021 16:05
Copy link
Contributor

@baziorek baziorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global changes to correct:

  • Please don't change whitecharacters of lines which You don't change
  • Please don't remove/add newlines at the end of existing files
  • Please don't add/remove newlines between lines which You don't change

Copy link
Contributor

@baziorek baziorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still changes in whitespaces/newline removing in files with not changed code. Please correct its (remove Your changes from the files). Also it would be good not to change parts of files not around changed code.

Copy link
Contributor

@baziorek baziorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is almost ready. Just few small corrections and adding the test I've mentioned in the review.
The next thing is to update documentation. Then please let me know.
If the next version would be good we can ask Iroha-Core-Team to take a look into the code.

@kuvaldini
Copy link
Contributor

Please
git rebase support/1.2.x --signof

Copy link
Contributor

@baziorek baziorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes, but rather IMO it looks good.
Now correct suggestions from iroha core team. Then change from Draft into normal PR. Then we can ask Iroha Core Team on chat for review.

@Pawlak00 Pawlak00 marked this pull request as ready for review July 16, 2021 09:26
@kamilsa kamilsa requested review from iceseer and kuvaldini July 16, 2021 11:26
Copy link
Contributor

@baziorek baziorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks really good now. So I'm satisfied with the code, now it is time to satisfy Iroha Team:).

@Pawlak00 Pawlak00 requested review from kuvaldini July 20, 2021 11:59
@kuvaldini
Copy link
Contributor

Did you check this PR does not break existing API?

@kamilsa
Copy link
Contributor

kamilsa commented Jul 22, 2021

@Pawlak00 can you please rebase your commits on the latest support/1.2.x?

@kamilsa
Copy link
Contributor

kamilsa commented Jul 22, 2021

Did you check this PR does not break existing API?

@kuvaldini I think it does not. Fields added queries.proto are optional and order is preserved

@baziorek
Copy link
Contributor

Something happend during rebasing from:
main branch into support/1.2.x

@kamilsa
Copy link
Contributor

kamilsa commented Jul 23, 2021

Something happend during rebasing from:
main branch into support/1.2.x

@Pawlak00 I think the easiest thing to remove redundant commits is just squash everything into a single commit. Otherwise there are no major issues

@Pawlak00 Pawlak00 requested a review from iceseer July 27, 2021 13:39
@kuvaldini
Copy link
Contributor

kuvaldini commented Jul 28, 2021

Please make sure you include only your own changes to this PR.

These commits must be removed from PR.
изображение

The best approach is to squash all in one commit. I suggest

cd iroha
git checkout origin/support/1.2.x -b new-tx-pagination-meta
git checkout Pawlak00/main -- .
git add .....................
git commit -m"[client-api] GOOD short with exhaustive description commit message"

This need to be carefully validated.

@kuvaldini
Copy link
Contributor

@Pawlak00 ^^

If need help, You can reach me for help in telegram for instant messaging https://t.me/kuvaldini

cc @baziorek

@Pawlak00
Copy link
Contributor Author

I messed up with one test, so it is not ready to merge now, hope i will figure it out today

@kuvaldini
Copy link
Contributor

kuvaldini commented Jul 28, 2021 via email

@Pawlak00
Copy link
Contributor Author

Issue is solved, so it is ready to proceed @kuvaldini @baziorek

…tAccountAssetsTransactions

Signed-off-by: Piotr Pawlowski <[email protected]>

validation improved, tests added

Signed-off-by: Piotr Pawlowski <[email protected]>

validation fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

time validation fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

const introduced

Signed-off-by: Piotr Pawlowski <[email protected]>

space fixed

Signed-off-by: Piotr Pawlowski <[email protected]>
@kamilsa kamilsa merged commit 09d8d18 into hyperledger-iroha:support/1.2.x Jul 30, 2021
kuvaldini pushed a commit that referenced this pull request Jul 30, 2021
…tAccountAssetsTransactions (#1092)


Signed-off-by: Piotr Pawlowski <[email protected]>
kuvaldini pushed a commit that referenced this pull request Jul 30, 2021
…tAccountAssetsTransactions (#1092)


Signed-off-by: Piotr Pawlowski <[email protected]>
Signed-off-by: Piotr Pawłowski <[email protected]>
kuvaldini pushed a commit that referenced this pull request Aug 31, 2021
…tAccountAssetsTransactions (#1092)


Signed-off-by: Piotr Pawlowski <[email protected]>
kuvaldini pushed a commit that referenced this pull request Aug 31, 2021
…tAccountAssetsTransactions (#1092)


Signed-off-by: Piotr Pawlowski <[email protected]>
Signed-off-by: Piotr Pawłowski <[email protected]>
baziorek pushed a commit to petermetz/iroha that referenced this pull request Dec 30, 2021
…tAccountAssetsTransactions (hyperledger-iroha#1092)

Signed-off-by: Piotr Pawlowski <[email protected]>
Signed-off-by: Piotr Pawłowski <[email protected]>
Signed-off-by: G.Bazior <[email protected]>
@nxsaken nxsaken added the iroha1 The legacy version of Iroha. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants