feat: expand contract integration test coverage (24 new tests)#188
Open
sungdark wants to merge 1 commit intoANAVHEOBA:mainfrom
Open
feat: expand contract integration test coverage (24 new tests)#188sungdark wants to merge 1 commit intoANAVHEOBA:mainfrom
sungdark wants to merge 1 commit intoANAVHEOBA:mainfrom
Conversation
Implements 24 new integration tests for ANAVHEOBA/PrivacyLayer contracts, covering the full scope specified in bounty issue ANAVHEOBA#14. New tests cover: - Deposit tests: max commitment, paused state, insufficient balance, sequential deposits with merkle state verification - Withdrawal tests: stale root in history, fee exceeds amount, relayer with zero fee, zero recipient, fresh nullifier - Admin tests: multiple pause/unpause cycles, VK update cycles, admin authorization enforcement for all admin operations - State tests: circular buffer behavior, nullifier tracking, view function consistency, token balance precision, deposit count Total: 38 integration tests (14 original + 24 new) Target: >85% code coverage
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands integration test coverage for the PrivacyLayer Soroban smart contracts with 24 new test cases, bringing the total to 38 integration tests.
Changes
New Deposit Tests (4)
test_deposit_max_commitment_value— Validates deposit with maximum field elementtest_deposit_while_paused_rejected— Ensures PoolPaused error on paused pooltest_deposit_by_user_without_tokens_rejected— Rejects deposit from zero-balance accounttest_merkle_tree_state_after_deposits— Verifies tree state after sequential depositsNew Withdrawal Tests (4)
test_withdraw_with_stale_root_still_in_history_succeeds— Root still valid before evictiontest_withdraw_fee_exceeds_amount_rejected— Fee validation enforcementtest_withdraw_relayer_non_zero_with_zero_fee_rejected— InvalidRelayerFee errortest_withdraw_zero_recipient_rejected— InvalidRecipient errortest_withdraw_with_fresh_nullifier— Fresh nullifier preconditionsNew Admin Tests (5)
test_pause_unpause_multiple_cycles— Multiple pause/unpause cyclestest_vk_update_multiple_times— Repeated VK updatestest_admin_operations_with_wrong_admin_rejected— UnauthorizedAdmin for all admin opstest_initialize_by_non_admin_rejected— Non-admin cannot initializetest_admin_authorization_required_for_all_admin_ops— Full admin auth enforcementNew State Tests (6)
test_root_history_circular_buffer_no_duplicates— Circular buffer behaviortest_nullifier_tracking_across_deposits— Nullifier uniqueness trackingtest_view_functions_consistency— All view functions track state correctlytest_deposit_same_commitment_twice_different_indices— Same commitment, different nullifierstest_multiple_users_deposit_independently— Alice + Bob independent depositstest_deposit_count_matches_actual_deposits— Deposit counter accuracyNew Utility Tests (3)
test_config_view_returns_correct_config— PoolConfig matches initializationtest_token_balance_precision_across_deposits— Balance arithmetic correctnesstest_is_known_root_boolean_results— Boolean correctness for known/unknown rootsAcceptance Criteria
Payment
收款地址(Solana/USDC via Drips Wave):
eB51DWp1uECrLZRLsE2cnyZUzfRWvzUzaJzkatTpQV9