Skip to content

Test/transaction service coverage - #981

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Dataguru-tech:test/transaction-service-coverage
Aug 31, 2026
Merged

Test/transaction service coverage#981
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Dataguru-tech:test/transaction-service-coverage

Conversation

@Dataguru-tech

Copy link
Copy Markdown

PR 1
Summary

Adds test coverage for src/lib/transactionService.ts, the API client for transaction history (GET /api/transactions). Previously only the mapApiTransaction helper had tests — the actual TransactionService.getTransactions() client itself was uncovered.

What's covered

  • Request construction — verifies getTransactions() calls fetch with the correct endpoint URL, and that the wallet address is properly URL-encoded.
  • Response mapping — verifies a successful response is correctly mapped from raw ApiTransaction[] into the app's Transaction[] shape.
  • Error paths:
    • Non-OK response with a JSON { error: "..." } body throws that exact server-provided message.
    • Non-OK response with a malformed/non-JSON body falls back to a generic error instead of crashing.
    • A rejected fetch call (network failure) propagates as a thrown error.

All new tests use a stubbed global.fetch — no real network calls.

Why

Per the issue: this client is the mock seam for #9 (the transactions API mock). Pinning its contract now — URL, params, response mapping, and error behavior — means the upcoming mock-to-real-API migration can't silently break consumers of this client.

PR 2
Summary
Adds docs/architecture/c4-model.md with C4 model diagrams for the PropChain platform: a System Context diagram and a Container diagram covering the Web Client, NestJS API, Redis, PostgreSQL, and Soroban WASM contracts.

Notes

  • The backend (NestJS + PostgreSQL) lives in a separate repo (MettaChain/PropChain-BackEnd); the diagram was cross-checked against its actual stack rather than assumed.
  • Soroban isn't wired up in either repo yet — BLOCKCHAIN_NETWORKS here only supports Ethereum/Polygon/BSC today. It's included per the issue's acceptance criteria as the platform's target settlement layer, with a note in the doc calling that out explicitly.
  • Both Mermaid diagrams were validated with mermaid's parser to confirm they're syntactically correct before submitting.

Testing
N/A — documentation only. Verified both C4Context and C4Container blocks parse without errors.

PR 3
Summary

Add a privacy policy documenting telemetry and data collection practices across the platform.

Changes
Added docs/privacy/privacy-policy.md.
Documented handling of public wallet addresses, IP-based rate limiting, and browser cookies.
Clarified that no personal identity information (PII) is collected.
Linked the privacy policy from the frontend footer.
Validation
Verified the privacy policy is present and linked correctly from the frontend.

Closes #928
Closes #976
Closes #977

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Dataguru-tech 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

@nanaf6203-bit
nanaf6203-bit merged commit d86be66 into MettaChain:main Aug 31, 2026
@github-actions

Copy link
Copy Markdown

🔒 Preview Environment Destroyed

The preview environment for this PR has been torn down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants