Repository navigation
Conversation
This branch has not been deployed
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.
Closes #31
Hardens
AccountManager.signMultiSigTransaction(src/core/account.ts) so thresholds, signer secrets, and optional signer weight maps are validated upfront andtransactionis never mutated when validation or threshold checks fail:src/core/account.ts):requiredThresholdas a finite integer in1..255(MIN_SIGNING_THRESHOLD..MAX_SIGNING_THRESHOLD), throwingToolkitError(ERR_INVALID_THRESHOLD) on zero, negative, fractional, non-finite, or excessive values.signerWeights(when supplied) as a plain object whose entries are finite integers in1..255(MIN_SIGNER_WEIGHT..MAX_SIGNER_WEIGHT), throwingValidationErroron invalid entries.signerWeightsis omitted, each unique signer contributes weight1.signerWeightsis provided, every participating signer must have an explicit own property (Object.prototype.hasOwnProperty.call); missing entries throwValidationErrorinstead of silently defaulting to1and inflating accumulated weight.signerSecrets(including whitespace-trimmed duplicates) by Stellar public key so duplicate signers never contribute weight or signatures twice.accumulatedWeight >= requiredThreshold(throwingToolkitErrorwithERR_INSUFFICIENT_SIGNATURESwhen insufficient) before callingtransaction.sign(kp), leavingtransaction.signaturescompletely untouched on any failure.src/__tests__/account.test.ts,docs/api/account-manager.md):docs/api/account-manager.md.Local Verification
npx prettier --check "src/**/*.ts"-> all matched files formatted cleanlynpm run lint->0warnings,0errorsnpm test -- --coverage --runInBand->7suites passed (77 / 77tests,93.91%statement coverage)npm run build && npx tsc --noEmit->0errorsnpm audit --audit-level=moderate->0moderate/high/critical vulnerabilities