OpenZeppelin / OpenZeppelin/contracts-wizard
Stellar: Generated test asserts against the contract identifier instead of the stored token name
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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