Skip to content

[contract] Move lib.rs and market tests into integration suites#478

Merged
Olowodarey merged 1 commit intoArena1X:mainfrom
Jay-Peter-Egemasi:codex/contract-test-migrations-324-326
Mar 29, 2026
Merged

[contract] Move lib.rs and market tests into integration suites#478
Olowodarey merged 1 commit intoArena1X:mainfrom
Jay-Peter-Egemasi:codex/contract-test-migrations-324-326

Conversation

@Jay-Peter-Egemasi
Copy link
Copy Markdown
Contributor

Description

Moves the remaining inline contract tests out of lib.rs and market.rs into dedicated integration test files, while adding coverage for config fee validation, leaderboard ties, and duplicate market outcomes.
Closes #324
Closes #326

Changes proposed

What were you told to do?

Combine the contract testing refactors for issues #324 and #326 into one PR by moving the inline lib.rs and market.rs tests into contract/tests/, adding one new test per requested suite, updating imports, removing the inline test blocks, and running the contract tests.

What did I do?

Test Suite Migration

  • Moved the lib.rs config tests into contract/tests/config_tests.rs.
  • Moved the lib.rs leaderboard tests into contract/tests/leaderboard_tests.rs.
  • Moved the market.rs test suite into contract/tests/market_tests.rs and removed the unused contract/src/market_tests.rs file.
  • Removed the inline #[cfg(test)] blocks from contract/src/lib.rs and contract/src/market.rs.

New Coverage And Validation

  • Added test_config_update_validation to verify invalid protocol fee updates are rejected and existing config remains unchanged.
  • Added test_leaderboard_tie_handling to verify equal-point entries are preserved and readable through season point lookups.
  • Added test_create_market_with_duplicate_outcomes and implemented duplicate-outcome validation in market creation.
  • Exposed calculate_price for the moved market tests and added protocol fee validation used by the new config coverage.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

Validated with cargo test --manifest-path contract/Cargo.toml --test config_tests, cargo test --manifest-path contract/Cargo.toml --test leaderboard_tests, cargo test --manifest-path contract/Cargo.toml --test market_tests, and a full cargo test --manifest-path contract/Cargo.toml pass.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview, Comment Mar 29, 2026 1:54pm

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@Jay-Peter-Egemasi 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

@Olowodarey Olowodarey merged commit d9ee349 into Arena1X:main Mar 29, 2026
3 checks passed
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.

[contract] Move lib.rs Tests and Add New Tests [contract] Move Market Tests and Add New Test

2 participants