contracts: add keystone forwarder report unit tests#364
Open
contracts: add keystone forwarder report unit tests#364
Conversation
Contributor
|
👋 Fletch153, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
1953495 to
cdd2d11
Compare
Port EVM KeystoneForwarder_ReportTest.t.sol to Move unit tests for both platform and platform_secondary forwarder contracts. Add 14 report validation tests per module covering: - Incorrect DON ID and inexistent config version - Malformed reports and signatures - Too few/too many signatures - Invalid signatures, invalid signers, duplicate signers - Already-processed report replay detection - Invalid report version - Config clear and multi-version lifecycle Extract test helpers (build_report, sign_report_n) to eliminate duplication and enable flexible test construction. Enhance test_happy_path with pre/post-condition assertions for transmission state and transmitter verification.
cdd2d11 to
798c09c
Compare
yashnevatia
approved these changes
Mar 5, 2026
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.
Summary
Port EVM
KeystoneForwarder_ReportTest.t.solto Move unit tests for bothplatformandplatform_secondaryforwarder contracts (NONEVM-98).build_report/sign_report_ntest helpers to eliminate duplicationtest_happy_pathwith pre/post-condition assertions for transmission state and transmitter verificationEVM Tests Ported (9)
test_RevertWhen_ReportHasIncorrectDONtest_report_incorrect_dontest_RevertWhen_ReportHasInexistentConfigVersiontest_report_inexistent_config_versiontest_RevertWhen_ReportIsMalformedtest_report_malformedtest_RevertWhen_TooFewSignaturestest_report_too_few_signaturestest_RevertWhen_TooManySignaturestest_report_too_many_signaturestest_RevertWhen_AnySignatureIsInvalidtest_report_invalid_signaturetest_RevertWhen_AnySignerIsInvalidtest_report_invalid_signertest_RevertWhen_ReportHasDuplicateSignaturestest_report_duplicate_signaturestest_RevertWhen_RetryingSuccessfulTransmissiontest_report_already_processedMove-Specific Tests (5)
test_report_invalid_versiontest_report_malformed_signaturetest_report_after_clear_configtest_report_config_version_lifecycletest_happy_path(enhanced)Skipped EVM Tests (7 — not applicable to Move)
Gas limit, receiver contract model, and retry-with-more-gas tests have no Move equivalent.
Test plan
aptos move test --skip-fetch-latest-git-deps --package-dir contracts/platform— 20 tests passaptos move test --skip-fetch-latest-git-deps --package-dir contracts/platform_secondary— 20 tests passmake move-test— full CI-equivalent check passes