Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

feat: added tests for transaction details #749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xObsidian
Copy link

This PR:

  • Added tests to prevent regression of DESC ordering:
    • Referring to the previously fixed issue where DESC + OFFSET incorrectly skipped recent transactions
  • Fixed query syntax compatibility between SQLite and PostgreSQL for LIMIT/OFFSET ordering

Key places to review:

  • src/data_source/storage/sql/queries/explorer.rs
  • The written test in it
  • Introduced syntax compatibility between SQLite and PostgreSQL

Things tested

  • Transaction ordering test to prevent DESC regression:
    cargo nextest run test_transaction_detail_asc_ordering
  • Verified with both --all-features and individual feature flags

Implementation Details

  • Added conditional query formatting based on database back-end
  • Introduced test for ordering stays ASC to prevent re-introduction of DESC + OFFSET bug that caused incorrect transaction skipping

Previous Error ( in the introduced test prior additionally addressing query compatibility ):

near OFFSET: syntax error

- Added tests to prevent regression of DESC ordering:
  - Refering to the previously fixed issue where DESC + OFFSET
  incorrectly skipped recent transactions
- Fixed query syntax compatibility between SQLite and PostgreSQL
  for LIMIT/OFFSET ordering

- `src/data_source/storage/sql/queries/explorer.rs`
- The written test in it
- Introduced syntax compatibility between SQLite and PostgreSQL

- Transaction ordering test to prevent DESC regression:
  ```
  cargo nextest run test_transaction_detail_asc_ordering
  ```
- Verified with both `--all-features` and individual feature flags

- Added conditional query formatting based on database backend
- Introduced test for ordering stays ASC to prevent re-introduction
  of DESC + OFFSET bug that caused incorrect transaction skipping

Previous Error (introduced test prior queury compatibilty):
```
near OFFSET: syntax error
```

* wip: verification for transaction ASC ordering to prevent offset regression
* fix: addressed OFFSET clause ordering in transaction query
* fix: handle SQLite vs PostgreSQL LIMIT/OFFSET
* refact: cargo fmt && cargo clippy
@0xObsidian
Copy link
Author

0xObsidian commented Dec 5, 2024

Hi @imabdulbasit
This PR addresses #724 --- specifically ---> #723
Feel free to let me know if you have any questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant