refactor(abstract-substrate): extract MPCv2 helpers into SubstrateCoin - #9408
Open
vibhavgo wants to merge 1 commit into
Open
refactor(abstract-substrate): extract MPCv2 helpers into SubstrateCoin#9408vibhavgo wants to merge 1 commit into
vibhavgo wants to merge 1 commit into
Conversation
Contributor
Add protected isMpcv2SigningMaterial() and addSubstrateRecoverySignature() to SubstrateCoin so DOT and POLYX can call shared methods rather than duplicating ~40 lines of identical MPCv2 signing logic. Refactors recover() to delegate to these helpers; MPCv1 path unchanged. Ticket: WCI-1239
vibhavgo
force-pushed
the
feat/abstract-substrate/WCI-1239
branch
from
August 4, 2026 10:48
3fbbf21 to
9c6f68e
Compare
vibhavgo
marked this pull request as ready for review
August 4, 2026 11:20
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
Extracts
isMpcv2SigningMaterial()andaddSubstrateRecoverySignature()as protected methods onSubstrateCoinso DOT (WCI-1227) and POLYX (WCI-1228) can call shared helpers rather than duplicating ~40 lines of identical MPCv2 signing logic.Linear: WCI-1239
Changes
protected isMpcv2SigningMaterial()— detects MPCv2 vs MPCv1 keycard by invertingisEddsaMpcV1SigningMaterialprotected addSubstrateRecoverySignature()— dispatches MPCv1/MPCv2 signing; MPCv2 path prepends0x00Ed25519 discriminant required by SubstrateMultiSignatureenumrecover()to delegate to both helpers; MPCv1 path unchangedmodules/abstract-substrate/test/unit/abstractSubstrateCoin.tsusingTtaoas the concreteSubstrateCoinsubclassTest Plan
npx mochainmodules/abstract-substrate— 6 passingyarn unit-testinmodules/sdk-coin-tao— 91 passing, no regressionsyarn unit-testinmodules/sdk-coin-polyx— 252 passing, no regressions