-
Notifications
You must be signed in to change notification settings - Fork 276
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
[fix] #2202: Fix total field in query response #2346
[fix] #2202: Fix total field in query response #2346
Conversation
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2346 +/- ##
==============================================
+ Coverage 65.50% 65.95% +0.45%
==============================================
Files 133 134 +1
Lines 24697 25416 +719
==============================================
+ Hits 16177 16764 +587
- Misses 8520 8652 +132
Continue to review full report at Codecov.
|
.len() | ||
.try_into() | ||
.map_err(|e: TryFromIntError| QueryError::Conversion(e.to_string()))?; | ||
|
||
let result = filter.filter(original_result); |
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.
@arndey Should we also include the number of filtered-out results in the total?
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
bac9c54
to
1be2e6f
Compare
Signed-off-by: Shanin Roman shanin1000@yandex.ru
Description of the Change
The
total
is the number of values returned in the top-most level of an iterable container after applying filter and before pagination.total
field calculation inhandle_queries
;torii_pagination
to check thattotal
field value is unaffected by pagination.Issue
Closes #2202.
Benefits
The
total
field is now what the SDK developers expect.Possible Drawbacks
None.
Usage Examples or Tests
cargo test --package iroha --lib -- torii::tests::torii_pagination --exact --nocapture