Test the "entered" event the gate publishes (nothing asserts it)
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
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.rslines 89-95 (the event) and 151-155 (publish).src/test.rshas noevents()assertion.Sorogate/sorogate'scontracts/gated-claim/src/test.rshasclaiming_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 --lockedpass.
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from Sorogate/example-consumer
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Sorogate/example-consumer#17 ·
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Sorogate/example-consumer#15 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Sorogate/example-consumer#14 ·
-
enhancement good first issue help wanted
Difficulty 2/5 Half a day Newbie friendliness 80/100
Sorogate/example-consumer#12 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Sorogate/example-consumer#11 ·
All issues in Sorogate/example-consumer
Similar issues
-
accounts bug decoding
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
wboayue/rust-ibapi#1088 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
`mise doctor` Shows Not Installed Lazy Tools as ProblemsPossibly taken @jdx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
area:kernel needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bherbruck/solvecraft#7179 · 1 comment ·
-
priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
storytold/photocraft#9704 · 3 comments ·
Maintainers usually reply within 1 day