Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Description

This PR adds a comprehensive how-to guide for using the MockEntropy contract to test Entropy integrations locally. The guide covers installation, basic usage patterns, advanced testing scenarios, key differences from the production Entropy contract, and best practices.

This documentation corresponds to the MockEntropy contract added in pyth-crosschain PR #3121, which was requested by Jayant in this Slack thread.

Type of Change

  • New Page
  • Page update/improvement
  • Fix typo/grammar
  • Restructure/reorganize content
  • Update links/references
  • Other (please describe):

Areas Affected

  • pages/entropy/test-with-mock-entropy.mdx (new file - 327 lines)
  • pages/entropy/_meta.json (added navigation entry)

Changes Made

New Documentation Page

Created test-with-mock-entropy.mdx with the following sections:

  • Introduction: Why use MockEntropy for local testing
  • Prerequisites: Links to prerequisite guides and setup requirements
  • Installation: SDK installation and Foundry configuration
  • Basic Usage: Core request/reveal pattern with code examples
  • Advanced Testing Patterns:
    • Multiple requests with out-of-order reveals
    • Testing with multiple providers
    • Gas limit configuration testing
    • Deterministic testing with edge case values
  • Key Differences from Real Entropy: Critical limitations including no fee enforcement, no gas limit enforcement, synchronous callbacks
  • Best Practices: Testing edge cases, measuring gas usage, testnet verification, CI reproducibility
  • Additional Resources: Links to related guides and source code

Navigation Update

Added "Test with MockEntropy" to the How-To Guides section in _meta.json.

Checklist

  • I ran pre-commit run --all-files to check for linting errors
  • I have reviewed my changes for clarity and accuracy
  • All links are valid and working (internal links verified)
  • Images (if any) are properly formatted and include alt text (N/A)
  • Code examples (if any) are complete and functional
  • Content follows the established style guide
  • Changes are properly formatted in Markdown
  • Preview renders correctly in development environment

Important Review Points

⚠️ Please pay special attention to:

  1. Dependency on pyth-crosschain PR #3121: This documentation describes the MockEntropy contract from PR #3121. The PRs should be coordinated so this docs PR is only merged after (or simultaneously with) the MockEntropy PR to avoid publishing docs for unavailable features.

  2. Code Examples: The Solidity code examples are based on the test file from pyth-crosschain. Please verify they are syntactically correct and accurately represent the MockEntropy API.

  3. Version Number: The guide states MockEntropy is available in @pythnetwork/entropy-sdk-solidity v2.1.0+. Please confirm this version number is accurate or will be accurate when the pyth-crosschain PR merges.

  4. GitHub Source Links: The guide links to MockEntropy.sol and MockEntropy.t.sol using /main/ branch URLs. These links won't work until PR #3121 is merged to main.

  5. Technical Accuracy: The "Key Differences from Real Entropy" section describes five important limitations. Please verify these are accurate, especially:

    • No gas limit enforcement (mentioned in Slack thread)
    • Zero fees returned
    • Synchronous callback execution

Related Issues

Relates to pyth-crosschain PR #3121

Additional Notes

Testing Limitations: The repository's test script is not available (npm test command missing), so I verified the page renders correctly in the development server but could not run automated tests. The linting passed successfully.

Screenshots:

Documentation page preview

Contributor Information

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

vercel bot commented Oct 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 10, 2025 9:04pm
documentation Error Error Oct 10, 2025 9:04pm

@aditya520 aditya520 merged commit 73e07f4 into main Oct 13, 2025
3 of 5 checks passed
@aditya520 aditya520 deleted the devin/1760127404-test-with-mock-entropy branch October 13, 2025 05:59
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.

2 participants