test(indexer): cover compliance-status normalization, cent precision,… - #136
Merged
Merged
Conversation
… ratio edges, and holder ordering - Assert all four KYC statuses (Approved/Pending/Rejected/Suspended) normalize from both the plain-string and array-wrapped enum forms. - Assert cents_to_usd behavior/precision at large i128 magnitudes, including the documented f64 precision limit past 2^53. - Assert ratio_percent on 0/0, part > whole (clamped), and rounding to 2 decimal places. - Add a mock-RPC integration test asserting index_compliance_and_holders orders holders by balance descending. Also restores metrics/metrics-exporter-prometheus as Cargo dependencies and two `use` imports (main.rs, indexer/mod.rs) plus AppState::last_indexed_ledger, all of which were silently dropped by the feat/api-hardening merge (59c9fdd) and left the crate not compiling; the new tests need the crate to build to run at all.
|
@Valreb001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #41
Closes #42
Closes #43
Closes #44
Summary
Added four test-coverage improvements to api/src/indexer/mod.rs — compliance status normalization (all four statuses, plain + array-wrapped), large cent-value precision limits for cents_to_usd, ratio_percent edge cases (0/0, part>whole, 2-decimal rounding), and a mock-RPC integration test proving index_compliance_and_holders sorts holders by balance descending. I also had to restore three lines a prior bad merge had silently dropped (Cargo metrics deps, two use imports, and AppState::last_indexed_ledger)