Skip to content

fix(tbtcpg): use RedemptionParameters struct return, not old 8-tuple - #4237

Open
piotr-roslaniec wants to merge 1 commit into
mainfrom
fix/redemption-parameters-struct-call
Open

fix(tbtcpg): use RedemptionParameters struct return, not old 8-tuple#4237
piotr-roslaniec wants to merge 1 commit into
mainfrom
fix/redemption-parameters-struct-call

Conversation

@piotr-roslaniec

@piotr-roslaniec piotr-roslaniec commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

main currently fails to build. client-scan, client-vet, client-lint, and client-build-test-publish all fail on the latest main commit (fac4b79b1):

pkg/tbtcpg/redemptions.go:225:50: assignment mismatch: 8 variables but rt.chain.GetRedemptionParameters returns 2 values

Root cause

Two same-day (2026-07-23) divergent commits landed without either being an ancestor of the other:

  • c4cc0addd refactored GetRedemptionParameters() from an 8-value positional return to a single tbtc.RedemptionParameters struct + error.
  • ad89b38d9/6a7060800 (separate branch, same day) added a new call site in redemptions.go:225 still using the old 8-value destructuring.

The merge that combined both branches didn't catch the mismatch.

Fix

Use the already-fetched redemptionParameters struct (same pattern as the call site at line 155) instead of the stale positional destructuring. txMaxFee/txMaxTotalFee become redemptionParameters.TxMaxFee/redemptionParameters.TxMaxTotalFee.

Verification

  • go vet ./pkg/tbtcpg/... clean.
  • go build ./pkg/tbtcpg/... succeeds.
  • go test ./pkg/tbtcpg/... -run TestEstimate — all pass (TestEstimateRedemptionFee, TestEstimateDepositsSweepFee_MinimumFloorAndBuffer, TestEstimateMovedFundsSweepFee, TestEstimateMovingFundsFee).

Summary by CodeRabbit

  • Bug Fixes
    • Improved redemption fee estimation and fee-share warnings by using the correct transaction fee limits.

GetRedemptionParameters() was refactored in c4cc0ad to return a single
tbtc.RedemptionParameters struct + error, but a same-day divergent branch
(ad89b38/6a7060800) added a new call site still using the old 8-value
positional destructuring. Neither commit was an ancestor of the other; the
merge that combined them didn't catch the mismatch, breaking the build on
main (client-scan, client-vet, client-lint, client-build-test-publish all
fail on GetRedemptionParameters returns 2 values, not 8).
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19e87557-cf45-4409-950e-db10123fb693

📥 Commits

Reviewing files that changed from the base of the PR and between fac4b79 and b13ccea.

📒 Files selected for processing (1)
  • pkg/tbtcpg/redemptions.go

📝 Walkthrough

Walkthrough

ProposeRedemption now uses named fields from structured redemption parameters for fee estimation and per-request fee-share warnings.

Changes

Redemption fee parameter usage

Layer / File(s) Summary
Fee parameter consumption
pkg/tbtcpg/redemptions.go
ProposeRedemption uses TxMaxTotalFee for fee estimation and TxMaxFee for per-request fee-share warnings.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: lrsaturnino

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating redemption parameter handling from an outdated tuple to the RedemptionParameters struct.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/redemption-parameters-struct-call

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant