Repository navigation
test(host-function-contract): harden fixture, tests, and harness docs - #761
Merged
mallison031 merged 4 commits intoSep 30, 2026
Merged
mallison031 merged 4 commits into
mallison031 merged 4 commits into
Conversation
Resolve four maintenance issues in the host-function benchmark fixture: - Tollcraft#718: extract the duplicated identity-Map seeding loop shared by every map_* entry point into a documented private `support` submodule, leaving the public contract interface unchanged. - Tollcraft#716: cover every fixture entry point (ledger reads, crypto, allocation, Map ops) in both native and WASM registration, including the zero/empty edge cases. - Tollcraft#717: document the shared WASM loader's purpose, control flow, item behaviour, and panics. - Tollcraft#715: load the WASM artifact once per test through the shared helper and reuse it across sizes instead of re-reading the file for every measurement, removing the fragile hardcoded relative path. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@aigbagbobila 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! 🚀 |
|
MergeKeeper review unavailable AI provider failed: gemini-3.5-flash-lite (200) No approval or merge action was taken. |
The expanded entry-point coverage added for Tollcraft#716 creates a bare Env::default() and asserts only on return values, but Env::default() installs a finite Budget::default() (100M CPU instructions, 40MB memory) alongside the mainnet per-invocation resource limits. A correctness assertion can therefore fail with a budget error rather than a value mismatch, and the resulting exit code 101 is indistinguishable from a real assertion failure in CI. Every measure_* harness in this crate already calls reset_unlimited() for the same reason. Do it in the two client helpers so all tests in the file inherit it, including the zero/empty edge cases added by Tollcraft#716.
main is currently red on the Code Quality workflow: \cargo fmt --all -- --check\ reports a diff in amm-pool-contract/src/lib.rs, which fails the lint gate on every open PR (PR 761 included) because pull_request runs check the merge with the base tip. The violation was introduced on main by the pool_logic refactor (c37e6f9, 831e319, 59aa304): the \/// Internal module for AMM pool logic\ doc comment was left abutting the preceding item's closing brace, and a second blank line was left after \mod pool_logic;\. rustfmt's default blank_lines_upper_bound is 1, so the extra blank line is the reported diff. Add the missing blank line before the doc comment and collapse the duplicate blank line. No behaviour change.
3 of 4 tasks
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
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.
Resolve four maintenance issues in the host-function benchmark fixture:
-Closes #718: extract the duplicated identity-Map seeding loop shared by every map_* entry point into a documented private
supportsubmodule, leaving the public contract interface unchanged.-Closes #716: cover every fixture entry point (ledger reads, crypto, allocation, Map ops) in both native and WASM registration, including the zero/empty edge cases.
-Closes #717: document the shared WASM loader's purpose, control flow, item behaviour, and panics.
-Closes #715: load the WASM artifact once per test through the shared helper and reuse it across sizes instead of re-reading the file for every measurement, removing the fragile hardcoded relative path.
🤖 Generated with Codebuff
Description
Related Issue
Closes #
Motivation and Context
How Has This Been Tested?
cargo testcargo clippycargo fmtamm-pool-contract/tests/budget_test.rswhen contract, build profile, or toolchain changes may affect themTypes of changes