Skip to content

fixes issue 275 - add regression test for buy revert when creator not…#532

Open
razeprasine wants to merge 1 commit into
accesslayerorg:mainfrom
razeprasine:fix-issue-275-clean
Open

fixes issue 275 - add regression test for buy revert when creator not…#532
razeprasine wants to merge 1 commit into
accesslayerorg:mainfrom
razeprasine:fix-issue-275-clean

Conversation

@razeprasine

Copy link
Copy Markdown
Contributor

Summary

  • creator-keys/tests/buy_key.rs: Added regression test test_buy_key_unregistered_creator_no_state_mutation — calls buy_key with an unregistered creator, asserts NotRegistered error, and uses capture_snapshot + assert_unchanged to confirm no state mutation
  • creator-keys/tests/key_supply.rs: Added test_get_total_key_supply_increments_after_three_sequential_buys (Add unit tests for creator supply read after multiple sequential buys #274) and fixed register_creator calls to pass optional params (&None, &None, &None)

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Checklist

  • Linked issue or backlog item
  • Added or updated creator-keys unit/integration tests for every changed contract behavior, including failure paths for new or reachable ContractError variants
  • Ran cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace, or explained exactly why a command was not run
  • Reviewed persistent storage changes against docs/storage-key-invariants.md; any storage layout change includes a migration/backward-compatibility note
  • Confirmed event names, topic order, payload field order, and field meanings remain compatible with docs/contract-event-conventions.md, or documented the breaking change and versioning plan
  • Updated docs for any changed public contract interface, read-only method, event schema, storage behavior, fee logic, or deployment workflow
  • Scope stays limited to one contract concern and does not include unrelated formatting, lockfile, generated artifact, or dependency changes
    This PR has only 2 files changed with clean focused changes — it should pass CI.

Closes #274
Closes #275

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.

Add regression test for buy revert when creator is not registered Add unit tests for creator supply read after multiple sequential buys

1 participant