Skip to content

[Frontend] frontend/src/utils/amount.ts and frontend/src/lib/amount.ts remain two parallel implementations after the wizard was flagged for importing the untested one #1124

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

A separate testing issue notes the create-stream wizard imports lib/amount.ts while only utils/amount.ts has test coverage, implying two independent amount-formatting implementations exist. Regardless of which one gets tests first, having two parallel utilities for the same concern (formatting/parsing token amounts) is itself a maintenance risk: a bug fixed in one won't be fixed in the other, and new code has a 50/50 chance of importing the wrong one.

Acceptance criteria

  • Compare frontend/src/utils/amount.ts and frontend/src/lib/amount.ts for behavioral differences
  • Consolidate into a single implementation and update all importers
  • Remove the redundant file

Files to touch

  • frontend/src/utils/amount.ts
  • frontend/src/lib/amount.ts

Out of scope

  • Adding the missing test coverage itself (tracked separately)
  • Changing the amount formatting rules/precision

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksrefactorRefactoring existing code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions