feat: 🎸 add unlockInstruction to complete the lock/relock cycle - #1630
Open
prashantasdeveloper wants to merge 1 commit into
Open
feat: 🎸 add unlockInstruction to complete the lock/relock cycle#1630prashantasdeveloper wants to merge 1 commit into
unlockInstruction to complete the lock/relock cycle#1630prashantasdeveloper wants to merge 1 commit into
Conversation
`Instruction.unlockForExecution` moves a `LockedForExecution` instruction back to `Pending`, and `Instruction.getRelockStatus` exposes the mediator's last unlock timestamp, relock count, and the on-chain relock cooldown window, so callers can implement the full lock/relock flow that `lockForExecution` alone couldn't complete.
prashantasdeveloper
force-pushed
the
feat/unlock-instruction
branch
from
July 30, 2026 12:38
dbb6521 to
463b693
Compare
|
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.



Description
Instruction.unlockForExecution— a mediator-only procedure that moves an instruction fromLockedForExecutionback toPending(mirrors the existinglockForExecution, dispatchingsettlement.unlockInstructionon-chain).Instruction.getRelockStatus()— readsunlockedTimestamp/instructionRelockCountstorage plus therelockCooldown/maxRelockCountchain consts, returning{ unlockedAt, relockCount, maxRelockCount, cooldownEndsAt }so callers can show/enforce the cooldown before relocking.assertInstructionValidForUnlockingguard (mirrorsassertInstructionValidForLocking, validatingLockedForExecutionstatus).This completes the lock/relock cycle —
lockForExecutionexisted already, but there was no way to unlock a locked instruction back toPending.Breaking Changes
NA
JIRA Link
Checklist
unlockInstructionForExecution.ts), the new guard (utils.ts), and the new entity methods (Instruction/__tests__/index.ts)yarn test,tsc --noEmit, andeslintall passpolymesh:8.0.2-testnet-debianviapolymesh-dev-envdocker compose): created aSettleAfterLockinstruction with a mediator, locked it, confirmedgetRelockStatus()before/after unlock, unlocked it back toPending, and confirmed the chain rejects an immediate relock during the cooldown window