Skip to content

[CT-18] Write comprehensive tests for assetsup tokenization module in opsce crate #821

@yusuftomilola

Description

@yusuftomilola

Problem

contracts/assetsup/src/tokenization.rs has minimal test coverage. Core functions like mint_tokens(), burn_tokens(), and transfer_tokens() are untested, meaning regressions in these critical financial operations go undetected.

Proposed Solution

Create contracts/opsce/src/tokenization_tests.rs as a dedicated test module using the Soroban SDK test environment (soroban_sdk::testutils).

Acceptance Criteria

  • tokenize_asset() — success, re-tokenization of already-tokenized asset fails
  • mint_tokens() — success, minting beyond max supply fails
  • burn_tokens() — success, burning more than owned balance fails
  • transfer_tokens() — success, transfer without sufficient balance fails, self-transfer is prevented
  • get_token_balance() — returns correct balance after a series of mints and transfers
  • All tests use soroban_sdk::testutils::Address::random for test addresses
  • Tests run cleanly with cargo test -p assetsup

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions