Skip to content

feat(ethexe/service): append tests for reply message with call == true#5224

Open
StackOverflowExcept1on wants to merge 2 commits intomasterfrom
av/ethexe-reply-callback-tests
Open

feat(ethexe/service): append tests for reply message with call == true#5224
StackOverflowExcept1on wants to merge 2 commits intomasterfrom
av/ethexe-reply-callback-tests

Conversation

@StackOverflowExcept1on
Copy link
Member

Resolves #5110

@StackOverflowExcept1on StackOverflowExcept1on added A0-pleasereview PR is ready to be reviewed by the team D8-ethexe ethexe-related PR labels Mar 16, 2026
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 16, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  ethexe/service/src/tests/mod.rs  5% smaller
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  Makefile Unsupported file format
  ethexe/contracts/test/DemoCaller.sol Unsupported file format
  ethexe/contracts/test/IDemoCallbacks.sol Unsupported file format
  ethexe/ethereum/abi/DemoCaller.json  0% smaller
  ethexe/ethereum/src/abi/mod.rs  0% smaller
  ethexe/service/Cargo.toml Unsupported file format
  examples/reply-callback/Cargo.toml Unsupported file format
  examples/reply-callback/build.rs  0% smaller
  examples/reply-callback/src/lib.rs  0% smaller
  examples/reply-callback/src/wasm.rs  0% smaller

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the ethexe service by adding robust testing for reply message handling. It introduces a new demo program and corresponding Solidity contracts to simulate and verify how the service processes replies, ensuring correct behavior for both successful message callbacks and error conditions. This improves the reliability and test coverage of the ethexe service's message processing capabilities.

Highlights

  • New Example Program: Introduced a new demo-reply-callback example program to demonstrate and test reply message functionality within the ethexe service.
  • Solidity Contracts for Testing: Added new Solidity contracts, DemoCaller.sol and IDemoCallbacks.sol, which are used to interact with the ethexe service and verify the behavior of reply messages, including both successful replies and error handling.
  • Reply Message Test Case: Implemented a new comprehensive test case in ethexe/service/src/tests/mod.rs to validate the ethexe service's ability to correctly process reply messages when call == true, covering both successful and error scenarios.
  • Build System Updates: Updated Cargo.lock, Cargo.toml, and Makefile to integrate the new demo-reply-callback example and its associated DemoCaller contract artifacts into the build system.
Changelog
  • Cargo.lock
    • Added demo-reply-callback package with its dependencies.
    • Included demo-reply-callback in the main package's dependencies.
  • Cargo.toml
    • Registered the new demo-reply-callback example with its path.
  • Makefile
    • Added a command to copy the DemoCaller.json artifact to the ethexe/ethereum/abi directory.
  • ethexe/contracts/test/DemoCaller.sol
    • Created a new Solidity contract DemoCaller that implements IDemoCallbacks and interacts with IMirror to test replyOn_methodName and onErrorReply callbacks.
  • ethexe/contracts/test/IDemoCallbacks.sol
    • Created a new Solidity interface IDemoCallbacks extending ICallbacks and defining the replyOn_methodName function.
  • ethexe/ethereum/src/abi/mod.rs
    • Added IDemoCaller to the sol! macro for ABI generation, enabling Rust bindings for the DemoCaller contract.
  • ethexe/service/Cargo.toml
    • Added demo-reply-callback as a workspace dependency with debug and ethexe features enabled.
  • ethexe/service/src/tests/mod.rs
    • Imported IDemoCaller for use in tests.
    • Added a new asynchronous test reply_callback to verify the ethexe service's handling of successful and error reply messages from a program.
  • examples/reply-callback/Cargo.toml
    • Added a new Cargo.toml file for the demo-reply-callback example, defining its package metadata and dependencies.
  • examples/reply-callback/build.rs
    • Added a new build.rs script for the demo-reply-callback example, utilizing gear_wasm_builder.
  • examples/reply-callback/src/lib.rs
    • Added a new lib.rs file for the demo-reply-callback example, handling WASM binary inclusion based on features.
  • examples/reply-callback/src/wasm.rs
    • Added new wasm.rs file containing the init and handle functions for the demo-reply-callback program, demonstrating conditional reply or panic based on input payload.
Ignored Files
  • Ignored by pattern: ethexe/ethereum/abi/*.json (1)
    • ethexe/ethereum/abi/DemoCaller.json
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new integration test for handling reply messages with call == true, covering both successful replies and error handling on panic. The changes include a new test contract, a wasm example program, and the corresponding integration test. My review focuses on improving the robustness and maintainability of the new test code. I've identified a potential panic in the wasm example and suggested improvements for code clarity in both the wasm example and the test contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview PR is ready to be reviewed by the team D8-ethexe ethexe-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ethexe: append tests for reply message with call == true

1 participant