Skip to content

Commit 55ffcff

Browse files
committed
test: add back previous generated xdr into test fixture for roundtrip testing
1 parent 0da588f commit 55ffcff

9 files changed

Lines changed: 53782 additions & 4 deletions

File tree

test/fixtures/legacy-xdr/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Legacy XDR fixtures
2+
3+
These are the `@stellar/js-xdr`-backed generated XDR classes as they existed
4+
at master (commit `6ba32bc5^`), copied here verbatim. They are **not** shipped
5+
as part of the library — `src/` does not import from this directory.
6+
7+
## Role
8+
9+
Source of truth for byte-compatibility testing. Round-trip tests in
10+
`test/unit/base/xdr/` use this layer as an oracle: encode the same logical
11+
value through both the new class-based runtime (`src/xdr/`) and this legacy
12+
layer, then assert byte equality. If the bytes diverge, the new layer has a
13+
bug.
14+
15+
## Files
16+
17+
- `curr_generated.{js,d.ts}` — generated XDR primitives for the curr
18+
protocol, depend on `@stellar/js-xdr` (still in `dependencies`).
19+
- `curr.d.ts` — high-level type wrapper around `curr_generated`.
20+
- `next_*` — same, for the next protocol.
21+
22+
The only edit from master is fixing the `OperationRecord` import path in
23+
`curr.d.ts` / `next.d.ts` (was `../operations/types.js`, now points at
24+
`src/base/operations/types.js` via three-levels-up).
25+
26+
## When to delete
27+
28+
Once the class-based runtime has been in production for a couple releases
29+
and we're confident in byte-for-byte equivalence, this directory can be
30+
removed. The round-trip tests stay relevant via the new-XDR side; the
31+
legacy oracle is a transitional confidence-builder.

0 commit comments

Comments
 (0)