Conversation
- Add reveal_prediction function with commit-reveal scheme validation - Reconstruct hash from outcome + amount + salt and verify against commitment - Update YES/NO pools and total volume on successful reveal - Move predictions from pending commits to predictions map - Emit PredictionRevealed event with full transaction data - Add comprehensive error handling for invalid revelations
- Add test_reveal_prediction_happy_path: validates complete commit-reveal flow - Add test_reveal_prediction_wrong_salt_rejected: hash validation error handling - Add test_reveal_prediction_without_commit_rejected: missing commitment handling - Add test_reveal_prediction_yes_and_no_outcomes: both outcome paths tested - Add test_reveal_prediction_event_payload_correct: event emission verification - Fix multiple BytesN vs Bytes type mismatches in hash computations
- Add test_commit_reveal_flow_with_pool_updates: multi-user commit-reveal scenario - Test complete flow from market creation through prediction revelation - Verify pool updates, commitment cleanup, and event emission - Fix integration test initialization calls (treasury, oracle argument counts) - Fix BytesN vs Bytes type mismatches in hash computations - Fix event access issues with simplified verification approach
|
@aguilar1x fix conflict |
Ready, compliments are appreciated! |
|
Hey @GoSTEAN Updates with the pr? |
|
@aguilar1x i am so sorry for the delay, i was cleaning up my repo and fixing up something |
|
Ready! |
|
Can you run cl again? To check if the format is working now. |
|
@aguilar1x |
Approve the workflow again |
|
@aguilar1x contract failed |
|
maybe already |
|
@aguilar1x contract is still failing |
You have an error in your CI/CD because when compiling from contracts/contracts/boxmeout, Cargo writes the WASM file to the workspace target (contracts/target), not the crate target. That's why |
|
@aguilar1x my CI/CD works well the last time i checked, so how then doesn't it work for you? |
That's strange, because the CI/CD couldn't find the path to the tests, which is why they weren't compiling. On the other hand, it gave errors in tests I didn't run, but I improved my own.
|








Description
This PR implements the
Market.reveal_prediction()function as specified in issue #4, completing the tier-3 prediction market reveal phase functionality.Changes Made
Core Implementation
reveal_prediction()function incontracts/contracts/boxmeout/src/market.rsPredictionRevealedeventData Structures
Predictionstruct for storing revealed predictionsTesting
Unit tests in
contracts/contracts/boxmeout/tests/market_test.rs:Integration test in
contracts/contracts/boxmeout/tests/integration_test.rs:Bug Fixes
Acceptance Criteria Fulfilled
Technical Details
Security Features
Storage Management
Error Handling
MarketError::InvalidRevelationfor hash mismatchesFiles Modified
contracts/contracts/boxmeout/src/market.rs- Main implementationcontracts/contracts/boxmeout/tests/market_test.rs- Unit testscontracts/contracts/boxmeout/tests/integration_test.rs- Integration testsTesting
All tests pass with comprehensive coverage of: