Skip to content

feat: Comprehensive Hardhat test suite for ListingRegistry.sol#14

Open
KarelTestSpecial wants to merge 2 commits into
Nobayprotocol:mainfrom
KarelTestSpecial:feat/hardhat-test-suite
Open

feat: Comprehensive Hardhat test suite for ListingRegistry.sol#14
KarelTestSpecial wants to merge 2 commits into
Nobayprotocol:mainfrom
KarelTestSpecial:feat/hardhat-test-suite

Conversation

@KarelTestSpecial
Copy link
Copy Markdown

Description

This PR adds a comprehensive unit test suite for the ListingRegistry.sol contract, addressing all requirements from Issue #3.

What's Included:

  • Signature Validity: Verified EIP-712 typed data signing and on-chain recovery.
  • Invalid Signatures: Added tests to ensure unauthorized or mismatched signatures are rejected.
  • Event Emission: Verified that ListingVerified and ListingRevoked events are emitted with correct arguments.
  • Seller Mapping & State: Verified mapping accuracy, listing counter increments, and support for multiple listings per seller.
  • Access Control: Verified that only the seller (or owner via force) can revoke listings.

Technical Details:

  • Framework: Hardhat v2.22.15
  • Library: ethers.js v6.12.1
  • Compilers: Solidity 0.8.20 (Paris target)
  • Security: Environment hardened with ignore-scripts and maturity cooldowns.

Tested and verified with 8 passing test cases.

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.

2 participants