Skip to content

Stellar: Generated test asserts against the contract identifier instead of the stored token name #805

Description

@ericglau

packages/core/stellar/src/zip-shared.ts generates a Rust test that asserts client.name() == <contract identifier>. But at runtime client.name() returns the user-supplied token name (stored in the contract via toByteArray(opts.name)), not the contract identifier.

For any input where the token name isn't already a valid Rust identifier (e.g. 'My Token' → identifier MyToken), the generated test fails on cargo test. Existing fixtures use names that happen to be valid identifiers, so the bug isn't caught in CI.

Fix the assertion to compare against the value the contract actually stores, and add a fixture with a non-identifier name to lock it down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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