Skip to content

Fix issue 102#184

Open
DARAKU17 wants to merge 4 commits into
scout-off:mainfrom
DARAKU17:fix-issue-102
Open

Fix issue 102#184
DARAKU17 wants to merge 4 commits into
scout-off:mainfrom
DARAKU17:fix-issue-102

Conversation

@DARAKU17
Copy link
Copy Markdown

Closes #102

Summary of Changes

  1. Modified events.rs:

    • Added the contract_initialized helper function to publish the event with the admin address.
  2. Updated initialize in lib.rs:

    • The initialize function now calls events::contract_initialized at the end of a successful first-time initialization.
  3. Added test_initialize_event:

    • This new unit test verifies that the contract_initialized event is emitted on the first call to initialize.
    • It also confirms that duplicate calls to initialize (which fail with AlreadyInitialized) do not emit additional events, satisfying the security and indexing requirements.

All 16 tests in the scoutchain-scout-access package are passing.

1 running 16 tests
2 test tests::test_initialize_and_health ... ok
3 test tests::test_initialize_event ... ok
4 test tests::test_contact_without_subscription_fails - should panic ... ok
5 test tests::test_duplicate_contact_fails - should panic ... ok
6 test tests::test_fee_accumulation_overflow ... ok
7 test tests::test_full_scout_workflow ... ok
8 test tests::test_log_trial_offer_elite ... ok
9 test tests::test_subscribe_basic ... ok

10 test tests::test_subscribe_elite_and_pay_to_contact ... ok
11 test tests::test_subscription_expiry - should panic ... ok
12 test tests::test_subscription_ttl_extended_after_ledger_advance ... ok
13 test tests::test_trial_offer_rejected_for_basic_tier - should panic ... ok
14 test tests::test_trial_offer_requires_elite - should panic ... ok
15 test tests::test_trial_offer_ttl_extended_after_ledger_advance ... ok
16 test tests::test_withdraw_fees_insufficient ... ok
17 test tests::test_withdraw_fees_success ... ok
18
19 test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.21s

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@DARAKU17 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

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.

initialize emits no event [scout_access]

1 participant