Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Test the "entered" event the gate publishes (nothing asserts it)

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

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing-qa

Research direction

The event is built around src/lib.rs lines 89-95 and published through publish at lines 151-155; src/test.rs currently has no event assertions. Read the existing tests first, then follow the claiming_publishes_an_event_that_names_the_policy_version pattern in Sorogate/sorogate's contracts/gated-claim/src/test.rs. Done means three tests pass: one for the entered event with topics gate and entered, one for version 2 after a policy update, and one for no event on refusal, and removing .publish(&env) makes the first fail.

Written by the indexing model from the issue text.

Description

enhancement good first issue help wanted

Written against commit 78d0a89; later commits may have moved things, so check the code first.

Size: Trivial

Description
When someone is let in, enter publishes Entered { subject, policy_version } with topics ["gate", "entered"]. An indexer or a front end would follow that event, and the version it carries is the version the decision was made under, which is what makes an entry auditable after the rule changes. No test in this repository looks at events: they would pass if the event were dropped, had the wrong topic, or carried a constant version.

Current state

  • src/lib.rs lines 89-95 (the event) and 151-155 (publish).
  • src/test.rs has no events() assertion.
  • Sorogate/sorogate's contracts/gated-claim/src/test.rs has claiming_publishes_an_event_that_names_the_policy_version, which shows the pattern for this soroban-sdk version.

What to build
Tests that: a successful enter publishes exactly one event from the gate with the topics gate and entered and the subject, and a policy_version equal to the policy's version; after the owner updates the policy (version 2) and the subject enters, the event carries 2; a refused enter publishes no entered event.

Acceptance criteria

  • Three tests as above.
  • Removing the .publish(&env) call locally makes the first one fail (check and revert).
  • cargo fmt --all -- --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked pass.

Out of scope
Changing the event.

Verification
cargo test --locked.

Dominant language
Rust
Stars
2
Forks
2
Avg merge
2h 30m
Merged PRs (30d)
2

Getting set up

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.

More from Sorogate/example-consumer

All issues in Sorogate/example-consumer

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.