[Test] Add cross-language conformance vectors for vault math

Open
#1,444 5 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@VeronicDev is already working on this.

Since Nov 20, 2026.

  • #1 by @VeronicDev — open
  • #1452 by @VeronicDev — open

Assessment

This issue has not been assessed yet.

Description

contracts medium sdk Stellar Wave testing

Summary

Add a shared JSON vector suite for the vault's share and fee math, consumed by both the Rust and the TypeScript implementations.

Motivation

The ERC-4626 conversion math exists in Rust and in TypeScript with separate tests and no shared fixtures, so the two can drift without either suite failing. The SDK tests already note that the withdrawal path differs.

Proposed Solution

  • Add a versioned JSON vector file covering deposit minting, withdrawal payout, the virtual offset, the performance fee, split withdrawals, rounding, and zero or one-stroop edges.
  • Add a Rust runner and a TypeScript runner that read the same file.
  • Include the partial-withdraw fee case.
  • Document how the vectors are generated and versioned with the contract.

Scope

Field Value
Area Contracts, SDK
Protocol affected Both
Network testnet and mainnet
Breaking change? No

Alternatives Considered

  • Keep separate tests per language. Rejected because they cannot detect drift between the two.
  • Generate vectors from the TypeScript code only. Rejected because the contract is the source of truth.

Acceptance Criteria

  • Both implementations consume the same vectors.
  • Vectors cover the partial-withdraw fee case.
  • CI fails on a mismatch.
  • Vectors are versioned with the contract.
  • The generation process is documented.

Additional Context

The contract math is in packages/contracts/vault/src/pricing.rs and the SDK math is in packages/sdk/src/vault-base.ts.

Dominant language
TypeScript
Stars
17
Forks
129
Avg merge
3d 13h
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from drydocs/meridian

All issues in drydocs/meridian

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.