test: cover schedule signatory scope across account key changes - #27220
Open
ruslanvelkov-beep wants to merge 7 commits into
Open
ruslanvelkov-beep wants to merge 7 commits into
ruslanvelkov-beep wants to merge 7 commits into
Conversation
…required Signed-off-by: Ruslan Velkov <ruslan.velkov@limechain.tech>
…ule signatories Signed-off-by: Ruslan Velkov <ruslan.velkov@limechain.tech>
Signed-off-by: Ruslan Velkov <ruslan.velkov@limechain.tech>
…opting that key Signed-off-by: Ruslan Velkov <ruslan.velkov@limechain.tech>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #27220 +/- ##
=========================================
Coverage 71.25% 71.25%
- Complexity 11906 11907 +1
=========================================
Files 2596 2596
Lines 109552 109552
Branches 12364 12364
=========================================
+ Hits 78061 78065 +4
+ Misses 27447 27446 -1
+ Partials 4044 4041 -3 see 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
AlexKehayov
approved these changes
Sep 17, 2026
🚨 All tests passed but jobs failed 🚨Failed Jobs without Test Failures❌ 600: [FLOW] PR Checks / CI Complete 🏷️ Commit: b1cc30b Learn more about TestLens at testlens.app/docs. |
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.
Adds test coverage for what a schedule's persisted
signatorieslist means when account keys change between signing and execution. All four cases are new coverage; no production code changes.Schedule.signatories(services/state/schedule/schedule.proto:165-181) stores only "primitive" keys, deliberately "regardless of signing order, intervening changes, or other situations", and requires that a scheduled transaction "SHALL execute only if, at the time of execution, this list contains sufficient public keys to satisfy the full requirements for signature". The suites already covered the case where requirements shrink so existing signatures become sufficient; these tests pin the surrounding invariants.AbstractScheduleHandlerTest— four cases for theKEY_LIST/THRESHOLD_KEYrecursion inaccumulateNewSignatories, which had no unit coverage at all (keyList(/thresholdKey(appeared zero times in the module's tests):recordsOnlySigningConstituentsOfARequiredThresholdKey— constituents are recorded individually, whether or not the threshold is metrecordsOnlySigningConstituentsOfARequiredKeyList— the key-list counterpartrecordsSigningConstituentsOfANestedThresholdKey— recursion at depthdoesNotRecordASigningKeyThatIsNotARequiredConstituent— signing is necessary but not sufficient; a key outside the required structure is not recordedScheduleSignatoryScopeTest(new,@HapiTest) — the same scope end to end:unrequiredKeyIsNotRecordedAcrossAKeyRotation— a key that was never required is not recorded, so rotating the sender onto that key later does not let the schedule execute; it executes only once that key signs while it is requiredaRecordedKeyAlsoSatisfiesAnAccountThatLaterAdoptsIt— documents the cross-account consequence of the flat primitive-key set: a key recorded for the sender also satisfies areceiverSigRequiredreceiver that later adopts it. No authority is created, since adopting a key needs signatures from both the account's existing key and the adopted keyRepeatableScheduleLongTermSignTest—growthInSigningReqsLeavesRecordedSignatoriesInsufficientAtExpiry, the complement of the existingreductionInSigningReqsAllowsTxnToGoThrough: awaitForExpiryschedule collects enough constituents to satisfy the key in force, the sender then raises its top-level threshold with the same constituents, and at expiry the schedule does not execute — the recorded signatories are re-checked against the current key and found insufficient. This is the only case in the suite exercising re-evaluation on the expiry-scan path.Each new assertion was checked by inverting it and confirming the test turns red, so none of them passes vacuously.
Verified locally:
:app-service-schedule-impl:test --tests "*AbstractScheduleHandlerTest"8/8;:test-clients:testSubprocess --tests "*ScheduleSignatoryScopeTest"2/2;:test-clients:testRepeatable --tests "*RepeatableScheduleLongTermSignTest"14/14; spotless clean.