Skip to content

Add unit test suite for xdr-parser.ts #14

Description

@Code-Paragon

Problem

The xdr-parser.ts file handles critical logic converting raw Soroban results into readable data, but currently lacks any unit tests to ensure it doesn't fail on complex structures.

Expected behavior

A new test suite provides base64 XDR strings of different types (i128, boolean, simple strings) and asserts that parseSorobanResult outputs the expected native TypeScript values.

Files to update

  • tests/xdr-parser.test.ts (create)

Project relevance

Parsing blockchain data correctly is the core function of the SDK middleware. Testing this ensures the frontend never displays corrupted data.

Acceptance criteria

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • At least 3 distinct XDR base64 mock strings are tested (including an i128 representing a large BigInt)
  • No TypeScript, lint, test, or build errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions