Skip to content

feat: transaction validation, integration tests, and performance benchmarks#79

Merged
Just-Bamford merged 2 commits into
Sorokit:mainfrom
amandasmyths:feature/issues-48-49-50
Jun 30, 2026
Merged

feat: transaction validation, integration tests, and performance benchmarks#79
Just-Bamford merged 2 commits into
Sorokit:mainfrom
amandasmyths:feature/issues-48-49-50

Conversation

@amandasmyths

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • npm run test — all new tests pass (pre-existing failures in transaction.test.ts and soroban.test.ts are unchanged from main)
  • npm run typecheck — only the pre-existing deployContract.ts error remains
  • npm run bench — benchmark suite runs without error
  • CI test.yml and build.yml workflows pass (pre-existing DTS failure in build.yml is on main too)
  • New benchmark.yml workflow runs benchmarks on Node 18 and 20

Closes #48
Closes #49
Closes #50

…ce benchmarks

Implements three improvements to strengthen correctness and observability:

- **Sorokit#48 validateTransaction()**: Adds `validateTransaction(xdr, rules?)` to
  `src/transaction/validateTransaction.ts`. Runs pre-submission checks against
  an XDR string — receiver public key validity, positive amounts, fee sanity
  (100–100,000 stroops default), and optional network passphrase match. Accepts
  custom validation rules via `rules.custom[]`. Returns a typed
  `TransactionValidationReport` with `valid`, per-field `issues`, and summary
  metadata. Exported from `src/transaction/index.ts` and `src/index.ts`.
  25 tests added in `src/tests/validateTransaction.test.ts`.

- **Sorokit#49 Integration tests**: Creates `src/tests/integration/` with four test
  suites covering real interaction patterns with mocked Horizon/RPC boundaries:
  wallet-account workflow, buildPayment→sign→submit flow, Soroban contract
  simulate→execute chain, and account/transaction streaming and monitoring.

- **Sorokit#50 Performance benchmarks**: Creates `src/tests/benchmarks/index.bench.ts`
  using vitest bench API. Covers result construction, XDR validation, utility
  functions, client construction, and fee arithmetic. Adds `npm run bench` script.
  Adds `.github/workflows/benchmark.yml` CI workflow that runs benchmarks on
  Node 18 and 20 and posts results as PR comments.

Closes Sorokit#48
Closes Sorokit#49
Closes Sorokit#50
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@amandasmyths 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

@Just-Bamford

Copy link
Copy Markdown
Collaborator

@amandasmyths kindly resolve the conflict. nice work.

@Just-Bamford

Copy link
Copy Markdown
Collaborator

@amandasmyths kindly resolve the conflict. Nice work.

…c/transaction/index.ts

Kept both validateTransaction (PR Sorokit#79) and validateTransactionXdr (upstream).
Removed duplicate export blocks; types from validateTransaction.ts with name
collisions (ValidationRules, TransactionValidationReport) are intentionally
scoped to ./transaction/validateTransaction to avoid re-export ambiguity.
@Just-Bamford Just-Bamford merged commit 28efd35 into Sorokit:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants