Repository navigation
fix(transaction): reject empty and whitespace-only memos by default (… - #884
Merged
Just-Bamford merged 1 commit intoOct 22, 2026
Merged
Conversation
|
@DANTE-1903 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
fix(transaction): reject empty and whitespace-only memos by default (#846)
──────
### Summary
TransactionBuilder, transaction builder functions, andcompose(), while allowing callers toexplicitly opt-in to empty or whitespace memos when needed.
passed an empty or whitespace-only string, with
{ allowEmpty: true }opt-in support.- Memo Policy Enforcement:
- Updated
validateMemoPolicy()insrc/transaction/buildTransaction.tsto reject empty orwhitespace-only memos by default with
TX_BUILD_FAILED("Memo cannot be empty or whitespace- only").- Supported opt-in via
allowEmptyMemo?: booleanormemoValidation: { allowEmpty: true }.- Preserved backward compatibility for
rule: "prohibit"where omitting or passing an emptymemo string represents no attached memo.
- Builders & Compose Integration:
- Updated
resolveMemoinbuildHelpers.tsandtransactionContext.tsto respectallowEmptyconfigurations.- Added
allowEmptyMemo?: booleantoComposeOptionsand{ allowEmpty?: boolean }optionsparameter to
compose().addMemo().- Types & Exports:
- Added
allowEmpty?: booleantoMemoValidationConfig.- Added
allowEmptyMemo?: booleantoMemoParams.- Exported
SetMemoOptionsfromsrc/transaction/index.ts.- Tests:
- Added comprehensive test coverage in
src/tests/memo-validation-length.test.tstestingcreateTransactionBuilder().setMemo(),validateMemoPolicy(), andcompose().addMemo()edgecases (zero-length strings, whitespace characters
\t\n, and opt-ins).- Updated existing builder tests in
src/tests/transaction.test.ts.closes #846