Skip to content

Centralize Stellar amount unit conversions - #391

Open
silentgeckoaudit3801 wants to merge 6 commits into
Quantarq:mainfrom
silentgeckoaudit3801:refactor/stellar-amount-helpers-222
Open

Centralize Stellar amount unit conversions#391
silentgeckoaudit3801 wants to merge 6 commits into
Quantarq:mainfrom
silentgeckoaudit3801:refactor/stellar-amount-helpers-222

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown

Closes #222.

Changes:

  • adds contract_tools/amounts.py with typed from_stellar_units() and to_stellar_units() helpers
  • centralizes raw-unit conversion in deposit transaction data, extra-deposit preparation, and health-ratio debt conversion
  • documents the rounding policy with focused helper tests
  • adds static wiring coverage so scattered Decimal(...) * 10 ** decimals conversions do not return

Validation:

  • parsed changed Python files with ast.parse
  • did not run the full project test suite locally because that would require installing/executing project dependencies in this environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typed Decimal boundary helpers for Soroban amounts

1 participant