Skip to content

test: Add invalid signature test with wrong admin public key - #829

Open
0xtrendz wants to merge 1 commit into
zintarh:mainfrom
0xtrendz:fix/reopen-234
Open

test: Add invalid signature test with wrong admin public key#829
0xtrendz wants to merge 1 commit into
zintarh:mainfrom
0xtrendz:fix/reopen-234

Conversation

@0xtrendz

@0xtrendz 0xtrendz commented Sep 1, 2026

Copy link
Copy Markdown

Overview

This PR adds a regression test for the admin signature validation path. Initialization with one admin public key must reject signatures produced by a different private key. The test initializes the contract with pubkey A, signs a mint attempt with key B, asserts the mint attempt fails, and verifies that balance and latest period remain untouched.

Related Issue

Changes

🔐 Invalid Signature Test

  • [ADD] src/test.rs
    • Adds test_invalid_admin_signature covering the wrong-admin-key rejection path.
    • Initializes the contract with admin pubkey A.
    • Signs the mint attempt with key B (derived from a different private key).
    • Asserts the mint attempt fails.
    • Verifies the failure path leaves balance and latest period unchanged.

Verification Results

cargo test
✅ 1/1 passed (test_invalid_admin_signature)

Live acceptance check:
✅ Initialized with pubkey A, signed with key B
✅ Mint attempt fails
✅ Balance and latest period remain unchanged
Acceptance Criteria Status
Test initializes with pubkey A and signs with key B test_invalid_admin_signature initializes with pubkey A and signs with key B
The mint attempt fails ✅ Mint attempt is asserted to fail
Failure path leaves balance and latest period untouched ✅ Balance and latest period asserted unchanged after the failed mint

Closes #234

@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@0xtrendz 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.

test: Add invalid signature test with wrong admin public key

1 participant