Skip to content

test: cross-variant DataKey collision checker#686

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
Clinton6801:test/datakey-collision-checker
Jun 27, 2026
Merged

test: cross-variant DataKey collision checker#686
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
Clinton6801:test/datakey-collision-checker

Conversation

@Clinton6801

Copy link
Copy Markdown

Summary

Adds a generative collision-detection test for the DataKey enum
in storage.rs.

Changes

  • contracts/predictify-hybrid/tests/datakey_collision.rs (new)
    Constructs all 3 DataKey variants, encodes each via env.to_xdr(),
    and compares pairwise — fails with a clear message naming any
    colliding pair.

  • contracts/predictify-hybrid/src/storage.rs
    Added doc comment to DataKey enum referencing the collision test.

  • contracts/predictify-hybrid/Cargo.toml
    Registered the new integration test target.

Test output

[paste the terminal output Kiro showed you here]

Acceptance criteria

✅ Test fails if two variants encode identically
✅ Clear failure output naming the colliding pair
✅ No unwrap() — uses expect() throughout
✅ Documented in storage.rs
✅ No format!() for building keys
✅ Only 3 files changed

closes #624

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Clinton6801 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

@greatest0fallt1me greatest0fallt1me merged commit f912c1c into Predictify-org:master Jun 27, 2026
1 check failed
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 cross-module storage-key collision checker test in DataKey enum

3 participants