CGD-576: Remove unreachable _counter undefined guard in abstract-eth#8504
Draft
pritam-gembali wants to merge 1 commit intomasterfrom
Draft
CGD-576: Remove unreachable _counter undefined guard in abstract-eth#8504pritam-gembali wants to merge 1 commit intomasterfrom
pritam-gembali wants to merge 1 commit intomasterfrom
Conversation
_counter is typed as `number` and initialized to 0 in the constructor, making the `_counter === undefined` check in validateBaseTransactionFields permanently unreachable dead code. Remove it and the associated test assertions that relied on the dead guard. Ticket: CGD-576
b314202 to
5a09eb2
Compare
Contributor
Author
|
The guard That said, since this changes no runtime behavior and TypeScript already prevents |
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
Removes a dead code guard in
abstract-ethTransactionBuilderthat was flagged in the internal security audit. The_counter === undefinedcheck invalidateBaseTransactionFieldscan never be true since_counteris typed asnumberand always initialized to0in the constructor.Jira: WP-8439
Linear: CGD-576
Changes
if (this._counter === undefined)guard fromvalidateBaseTransactionFieldsinmodules/abstract-eth/src/lib/transactionBuilder.tsTest Plan
abstract-ethcover transaction validation — no behavior change expected.CLOSES TICKET: CGD-576