Skip to content

Created Comprehensive Tests for Merchant Account Verification#157

Merged
codebestia merged 6 commits intoShadeProtocol:mainfrom
Ogstevyn:Comprehensive-Tests-for-Merchant-Account
Feb 27, 2026
Merged

Created Comprehensive Tests for Merchant Account Verification#157
codebestia merged 6 commits intoShadeProtocol:mainfrom
Ogstevyn:Comprehensive-Tests-for-Merchant-Account

Conversation

@Ogstevyn
Copy link
Contributor

Merchant Account Verification Tests

Summary

Adds comprehensive tests for the merchant account verification functionality and fixes several bugs discovered across the contract source files during implementation.

Changes

New

  • tests/test_merchant_verification.rs — four test cases covering the full verification lifecycle

Fixed

  • account.rs — removed duplicate use imports, duplicate is_restricted_account impl, and orphaned publish_account_restricted_event call
  • events.rs — added missing #[contractevent] macro on WithdrawalToEvent, removed duplicate AccountRestricted struct, fixed missing closing } on publish_account_restricted_event
  • types.rs — removed duplicate Restricted variant in DataKey enum

Test Coverage

Test Description
test_initial_state_is_unverified Newly initialized account returns false for is_verified_account
test_successful_verification Manager can verify account; status updates and AccountVerified event is emitted
test_unauthorized_verification_panics Non-manager address calling verify_account panics
test_verify_account_is_idempotent Calling verify_account twice does not panic and status remains verified

Closes

Closes #29

@codebestia codebestia merged commit be0e47a into ShadeProtocol:main Feb 27, 2026
4 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.

Create Comprehensive Tests for Merchant Account Verification

2 participants