Skip to content

Add BigInt Serialization Regression Tests for Backend Public APIs #651

@Emmyt24

Description

@Emmyt24

title: Add BigInt Serialization Regression Tests for Backend Public APIs

Description:
Create regression tests that ensure all public APIs correctly serialize BigInt fields into strings and never crash or leak raw BigInt values.

Requirements and Context:

  • Tokens, campaigns, votes, analytics, and streams all use BigInt-heavy data
  • Serialization bugs often appear late in integration
  • Must cover all public JSON endpoints that expose numeric chain data

Suggested Execution:
Fork and Branch

  • git checkout -b test/bigint-api-serialization

Implement Changes::
Files to Edit:

  • backend/src/routes/tokens.ts - Confirm serialization consistency
  • backend/src/routes/campaigns.ts - Confirm serialization consistency
  • backend/src/routes/governance.ts - Confirm serialization consistency
  • backend/src/services/campaignProjectionService.ts - Avoid raw BigInt leaks

Files to Create:

  • backend/src/__tests__/bigintSerialization.routes.test.ts - Cross-route serialization tests

Test

  • Verify all numeric amount fields are serialized as strings
  • Verify no endpoint throws due to raw BigInt in JSON output
  • Verify frontend consumers can parse the payloads consistently

Commit

  • git add .
  • git commit -m "test(integration): add bigint serialization regression tests"

Guidelines:

  • Keep amount encoding consistent across routes
  • Document any exceptions explicitly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions