Skip to content

test_fixture crate for main branch and v4 bindings#335

Merged
0xgleb merged 16 commits into
upd/alloyfrom
2025-06-06-test-fixture-main-branch
Jun 9, 2025
Merged

test_fixture crate for main branch and v4 bindings#335
0xgleb merged 16 commits into
upd/alloyfrom
2025-06-06-test-fixture-main-branch

Conversation

@rouzwelt
Copy link
Copy Markdown
Contributor

@rouzwelt rouzwelt commented Jun 6, 2025

Motivation

⚠️ Do NOT merge before #333

Related to rainlanguage/raindex#1878
This PR adds test_fixtures crate for the main branch (i9r v4), which is a local evm helper for testing, this now enables us to remove env crate.

Solution

  • add test_fixtures crate, this is a wrapped anvil structure with rain i9r contracts already deployed on it as well as helper functions to to easily interact with it for testing purpose.
  • remove env crate
  • update bindings to include i9r v4 contracts
  • update crates tests to use v4 contracts and local evm helper

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

@rouzwelt rouzwelt self-assigned this Jun 6, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 6, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rouzwelt rouzwelt changed the title init test_fixture crate for main branch and v4 bindings Jun 6, 2025
@rouzwelt rouzwelt added the enhancement New feature or request label Jun 6, 2025
@hardyjosh hardyjosh requested review from 0xgleb and hardyjosh June 6, 2025 21:30
Comment thread crates/cli/src/commands/eval.rs Outdated
pub decode_errors: bool,

// Accept inputs vector as array of uint256
#[arg(short, long, help = "The inputs vectore")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
#[arg(short, long, help = "The inputs vectore")]
#[arg(short, long, help = "The inputs vector")]

Comment thread crates/env/src/lib.rs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also update .env.example and CI to no longer use redundant env vars?

Comment thread crates/eval/src/eval.rs Outdated
Comment on lines 76 to 91
/// * `deployer` - The address of the deployer.
/// * `namespace` - The fully qualified namespace.
/// * `context` - The context vector.
/// * `inputs` - The inputs vector.
/// * `state_overlay` - The state_overlay vector.
/// * `decode_errors` - Whether to decode errors from registry or not
///
/// # Returns
///
/// The typed return of the eval, plus Foundry's RawCallResult struct, including the trace.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these docs be on the type itself rather than on the method? Also, descriptions like "The state_overlay vector" don't add any info since it's already clear that the field name is state_overlay and that its type is a vector

Comment thread crates/test_fixtures/src/lib.rs Outdated
Comment on lines +48 to +63
pub type LocalEvmFillers = JoinFill<
JoinFill<
alloy::providers::Identity,
JoinFill<
alloy::providers::fillers::GasFiller,
JoinFill<
alloy::providers::fillers::BlobGasFiller,
JoinFill<
alloy::providers::fillers::NonceFiller,
alloy::providers::fillers::ChainIdFiller,
>,
>,
>,
>,
WalletFiller<EthereumWallet>,
>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to list all of these out explicitly instead of referring to RecommendedFiller because BlobGasFiller doesn't include BlobGasFiller?

Comment thread crates/test_fixtures/src/lib.rs
@0xgleb 0xgleb mentioned this pull request Jun 7, 2025
4 tasks
@rouzwelt rouzwelt requested a review from 0xgleb June 8, 2025 00:19
Copy link
Copy Markdown
Contributor

@0xgleb 0xgleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff. thank you

@0xgleb 0xgleb force-pushed the 2025-06-06-test-fixture-main-branch branch from d72807b to d3141a6 Compare June 8, 2025 14:13
@0xgleb 0xgleb merged commit a2e6a4e into upd/alloy Jun 9, 2025
11 checks passed
@0xgleb 0xgleb deleted the 2025-06-06-test-fixture-main-branch branch June 9, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants