Skip to content

Issue 372 contract event topics - #385

Merged
dark-sarge merged 2 commits into
arflexx:mainfrom
Elizzy01:issue-372-contract-event-topics
Sep 25, 2026
Merged

dark-sarge merged 2 commits into
arflexx:mainfrom
Elizzy01:issue-372-contract-event-topics

Conversation

@Elizzy01

Copy link
Copy Markdown
Contributor

Summary

Reviews and documents the 9-byte ASCII limit on symbol_short! event topics across the escrow and marketplace contracts. Borderline topics ("completed", "cancelled") and the need for Symbol::new(&env, "...") for longer topics (>9 chars) are clearly documented, along with unit tests validating topic lengths and long topic handling.

Closes #372


Type of Change

  • feat — new feature
  • fix — bug fix
  • refactor — code change with no behaviour change
  • docs — documentation only
  • chore — build, deps, config
  • contract — Soroban smart contract change

What Changed.

File Change
contracts/escrow/src/lib.rs Documented 9-character symbol_short! limit for event topic functions (noting "completed" and "cancelled" at 9 chars) and added test asserting topic lengths and Symbol::new(&env, ...) for longer topics
contracts/marketplace/src/lib.rs Documented 9-character symbol_short! limit for event topic functions (noting "cancelled" at 9 chars) and added test asserting topic lengths and Symbol::new(&env, ...) for longer topics

How to Test

Run contract test suites:

cargo test --manifest-path contracts/Cargo.toml

Checklist

General

  • Code compiles / builds without errors
  • Follows existing code style and patterns
  • No secrets, keys, or credentials committed
  • .env.example updated if new env vars were added

API changes

  • Request/response shapes documented in docs/api-reference.md
  • Zod validation added for all request inputs
  • Correct HTTP status codes returned
  • Auth middleware applied where required

Smart contract changes

  • require_auth() called on all state-changing functions
  • extend_ttl() called on all new persistent storage entries
  • Tested on testnet before merge
  • docs/smart-contract.md updated
  • New contract address added to server/.env.example if redeployed

Database changes

  • Migration script included
  • Indexes added for queried columns

Docs changes

  • Relevant doc in docs/ updated or created
  • README updated if structure or setup changed

Screenshots / Logs

test test::test_event_topic_lengths_and_long_topic_handling ... ok

Notes for Reviewer

All topics using symbol_short! are strictly $\le 9$ characters. Any new topics exceeding 9 characters must use Symbol::new(&env, "...").

@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@Elizzy01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dark-sarge
dark-sarge merged commit 6a594cd into arflexx:main Sep 25, 2026
3 of 11 checks passed
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.

[contract] - Both contracts use symbol_short! macros for event topics limiting topics to 9 bytes preventing descriptive longer names

2 participants