OpenZeppelin / OpenZeppelin/contracts-wizard

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

Open Beginner friendly
#805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
294
Forks
186
Avg merge
6h 46m
Merged PRs (30d)
22

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/core/stellar/src/zip-shared.ts and inspect how the generated Rust test builds its client.name() assertion. Use a fixture with a token name such as “My Token,” then run the generated cargo test to confirm the assertion matches the stored token name and the existing fixtures still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
blockchain, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.