Skip to content

Add integration/unit test coverage for transaction history, search, holders, and sell payout - #715

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
CeceOs92:feat/integration/unit-test-coverage-for-transaction-history-search-holders-and-sell-payout
Jul 29, 2026
Merged

Add integration/unit test coverage for transaction history, search, holders, and sell payout#715
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
CeceOs92:feat/integration/unit-test-coverage-for-transaction-history-search-holders-and-sell-payout

Conversation

@CeceOs92

Copy link
Copy Markdown
Contributor

Summary

Adds test coverage (and, where the feature didn't exist yet, the minimal implementation to support it) across four areas of the public API and pricing logic:

  • Transaction history ordering — real-DB integration test seeding wallet activity out of chronological order and asserting the /wallets/:address/activity endpoint always returns entries newest-first, with sort order preserved across paginated pages.
  • Creator search — real-DB integration test seeding overlapping display names (Alice/Alicia/Bob/Bobby) and asserting /creators?search= returns only correct partial, case-insensitive matches.
  • Key holder sort order/creators/:id/holders was missing key_count, share_percent, rank, and a deterministic tie-break. Added these (additive, non-breaking) plus a secondary ownerAddress asc sort, and a real-DB integration test verifying descending key-count order, alphabetical tie-break, required response fields, and that share_percent sums to 100% across all holders.
  • Sell payout calculation — added computeSellPayout, the sell-side counterpart to computeBuyCost, applying the bonding curve formula and deducting the protocol fee. Added unit tests for 5%/0%/100% fee rates, the last-key-sell case, and the non-negative payout guarantee.

Changes

  • src/modules/creators/creator-holders.service.ts — add key_count, share_percent, rank fields; add ownerAddress tie-break to sort.
  • src/modules/creators/creator-holders.integration.test.ts, creator-holders-held-since.integration.test.ts — update fixtures for new required HolderRecord fields.
  • src/utils/pricing.utils.ts — add computeSellPayout.
  • src/utils/pricing.utils.test.ts — unit tests for computeSellPayout.
  • src/__tests__/integration/wallet-activity-order.integration.test.ts — new.
  • src/__tests__/integration/creator-holders-key-count-sort.integration.test.ts — new.
  • src/modules/creators/creator-list-search-partial-name.integration.test.ts — new.

Closes #683
Closes #685
Closes #692
Closes #694

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@CeceOs92 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! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit f97085b into accesslayerorg:main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment