-
Notifications
You must be signed in to change notification settings - Fork 10
Add Alternate Mocking Framework (1-of-3 / Initial Scaffolding) #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add mockall mocking framework. - Introduce a new trait that defineds all host functions (host_bindings_trait.rs) - Wire-in proper host function definitions for different build profiles. - Add sample test in error_code.rs - Update host function audit script to use correct repo and check all host function definitions in each profile.
This was referenced Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
Co-authored-by: Mayukha Vadari <[email protected]>
sappenin
commented
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
reviewed
Dec 17, 2025
mvadari
approved these changes
Dec 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Context of Change
This PR is number-1 in a series of three PRs that offers an alternative design to the proposal in #102. In particular:
mockallframework.Note on LOC in this PR
The astute observer will notice that this PR has a reasonably large number of lines-of-code changed. There are two primary culprits here, mostly falling into the changes required for
host_bindings_wasm.rs. Overall, to pull off our current design (where all host functions are accessible from thehost::namespace), we need to replicate the host functions (there are quite a lot of them on their own) three times. The first is to define the C abstraction (required by rippled/WASM VM). The second is to implement the trait, which delegates to the C abstraction (trait is required for mocking), and the third is to hide the overall implementation of the first two (to maintain thehost::namespace).While this is a large changeset, the changes are mostly just boilerplate. I've tried to reduce this boilerplate as much as possible using macros. This helped, but not everything can be macro'd.