lint(ttx): split gocognit fixes out of #2327 - #2390
Open
atharrva01 wants to merge 1 commit into
Open
atharrva01 wants to merge 1 commit into
atharrva01 wants to merge 1 commit into
Conversation
This was referenced Sep 16, 2026
Closed
Contributor
Author
|
@Effi-S PTAL |
Effi-S
self-requested a review
September 16, 2026 18:45
Effi-S
force-pushed
the
gocognit-split-ttx
branch
from
September 16, 2026 18:46
158f04e to
0437194
Compare
Effi-S
approved these changes
Sep 17, 2026
atharrva01
force-pushed
the
gocognit-split-ttx
branch
from
September 17, 2026 13:10
0437194 to
b430fcf
Compare
atharrva01
force-pushed
the
gocognit-split-ttx
branch
from
September 17, 2026 13:13
b430fcf to
93532af
Compare
AkramBitar
force-pushed
the
gocognit-split-ttx
branch
from
September 18, 2026 12:44
93532af to
4f30002
Compare
Contributor
|
Could you please rebase and squash all the commits to one before I will merge it? Regards, |
atharrva01
force-pushed
the
gocognit-split-ttx
branch
from
September 18, 2026 13:04
4f30002 to
ce7818d
Compare
Splits token/services/ttx's slice of the gocognit complexity-reduction sweep out of LFDT-Panurus#2327 into its own PR, per LFDT-Panurus#2382. Extracts the flagged functions into named helpers along their existing logical boundaries (signature-collection strategies in collectendorsements.go, the recipient-identity request/respond/exchange handshakes in recipients.go, distribution-list construction, finality status handling, and the request/response marshalling helpers), and adds justified nolint waivers on the couple of view handshakes where splitting the decision from the response risks sending back something that doesn't match what was decided. This includes a fix that only showed up in LFDT-Panurus#2327's itest matrix: the first pass at splitting ExchangeRecipientIdentitiesView.Call into exchangeLocally/exchangeRemotely dropped the initiator's attestation signing step, so every cross-node recipient exchange (swap, DVP, HTLC) went out with an empty signature and the responder rejected it. That's restored here. Also drops an unreachable wallet-nil check in resolveRecipientIdentity. Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
atharrva01
force-pushed
the
gocognit-split-ttx
branch
from
September 18, 2026 15:17
ce7818d to
e7547c8
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.
Fixes #2382.
First slice of the gocognit split agreed on #2327 (tracking issue #2377): pulls just
token/services/ttx's complexity-reduction extraction out into its own reviewable PR, ahead of #2327 itself enabling the linter.Splits:
collectendorsements.go: the signer-strategy branches inrequestSignatures(multi-sig, policy, external wallet, local, remote) into namedtryXxxSignaturehelpers, and the distribution-list construction inprepareDistributionListintounwrapDistributionIDs/addPartyToDistributionList/addAuditorToDistributionList/resolveLongTermIdentity.recipients.go: the recipient-identity request/respond/exchange handshakes into per-case helpers.endorse.go,endorse_opts.go,finality.go,finality/listener.go,finality/recovery.go,marshaller.go: smaller, single-purpose extractions.A couple of view handshakes keep a justified
//nolint:gocognit: splitting the decision logic from the response send risks a response that doesn't match what was actually decided, so those stay as one function.Also fixes a real bug that only showed up in #2327's itest matrix, not in unit tests or lint: the first pass at
ExchangeRecipientIdentitiesView.Call'sexchangeLocally/exchangeRemotelysplit dropped the initiator's attestation-signing call, so every cross-node recipient exchange (swap, DVP, HTLC) went out with an empty signature and got rejected. That's restored here and itest-verified on #2327 before this split.Verified:
go build ./...,golangci-lint run(default set) ontoken/services/ttx/...,go test ./token/services/ttx/...,gofmt -l -s,go vet.