Skip to content

wrote Test cases for the contribute and getAdasheMember Functions - #17

Open
i-amdaveee wants to merge 1 commit into
BlockheaderWeb3-Community:mainfrom
i-amdaveee:dave-test
Open

wrote Test cases for the contribute and getAdasheMember Functions#17
i-amdaveee wants to merge 1 commit into
BlockheaderWeb3-Community:mainfrom
i-amdaveee:dave-test

Conversation

@i-amdaveee

@i-amdaveee i-amdaveee commented Jul 27, 2026

Copy link
Copy Markdown

@aji70

Summary

Wrote test cases for the contribute() and getAdasheMember() functions in Adashe.ts, and fixed bugs in Adashe.sol.

Changes

contracts/Adashe.sol

  • Converted 3 string requires to custom errors (AdasheFull, AlreadyRegistered, EmptyName)

test/Adashe.ts

  • Updated register tests to use revertedWithCustomError (matching the custom error fix above)
  • Added contribute() tests:
    • Reverts before circle is packed (AdasheNotPacked)
    • Reverts for non-member (NotRegistered)
    • Reverts for wrong amount (InvalidAmount)
    • Allows registered member to contribute and marks hasPaid = true
    • Reverts on double payment (AlreadyPaid)
  • Added getAdasheMember() tests:
    • Returns correct member data by id
    • Reverts for out-of-range id (InvalidPersonId)
    • Reverts for id 0 (InvalidPersonId)

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.

1 participant