fix(sdk): propagate PutSettings in token freeze/mint/unfreeze/set_price transitions#3132
Conversation
📝 WalkthroughWalkthroughFour token transition files now extract settings from their respective builders and pass them to broadcast calls instead of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
The PutSettings propagation bug fix for freeze/mint/unfreeze/set_price transitions has been split into its own PR (dashpay#3132) per review feedback. This PR now only contains the transition hash exposure feature.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
73b4947 to
1ca1bee
Compare
1ca1bee to
b2ec44d
Compare
…ce transitions Token transition methods for freeze, mint, unfreeze, and set_price_for_direct_purchase were passing None to broadcast_and_wait instead of the builder's settings field. This silently ignored any caller-provided PutSettings (retry config, timeout, etc.). Extract settings from the builder before sign() consumes it, matching the pattern already used in destroy_frozen_funds.
b2ec44d to
1eb6a89
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/rs-sdk/src/platform/tokens/transitions/unfreeze.rs (1)
80-82:⚠️ Potential issue | 🟡 MinorPre-existing copy-paste comment — "freezing" should be "unfreezing".
- // This means the token keeps freezing history + // This means the token keeps unfreezing history🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/rs-sdk/src/platform/tokens/transitions/unfreeze.rs` around lines 80 - 82, The comment above the UnfreezeResult::HistoricalDocument branch incorrectly says "freezing" — update the comment to use "unfreezing" (e.g., change "// This means the token keeps freezing history" to "// This means the token keeps unfreezing history" or a clearer phrase like "// This means the token keeps unfreezing history/document history") near the match arm that returns Ok(UnfreezeResult::HistoricalDocument(doc)) so the wording accurately reflects the Unfreeze flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/rs-sdk/src/platform/tokens/transitions/unfreeze.rs`:
- Around line 80-82: The comment above the UnfreezeResult::HistoricalDocument
branch incorrectly says "freezing" — update the comment to use "unfreezing"
(e.g., change "// This means the token keeps freezing history" to "// This means
the token keeps unfreezing history" or a clearer phrase like "// This means the
token keeps unfreezing history/document history") near the match arm that
returns Ok(UnfreezeResult::HistoricalDocument(doc)) so the wording accurately
reflects the Unfreeze flow.
Issue being fixed or feature implemented
Token transition methods for
freeze,mint,unfreeze, andset_price_for_direct_purchasepassNonetobroadcast_and_waitinstead of the builder'ssettingsfield. This silently ignores any caller-providedPutSettings(retry config, timeout, etc.).Split out from #3092 per review feedback ("1 PR = 1 thing").
What was done?
Extract
settingsfrom the transition builder beforesign()consumes it, then pass it tobroadcast_and_wait. This matches the pattern already used indestroy_frozen_funds.Before:
After:
Applied to:
freeze.rs,mint.rs,unfreeze.rs,set_price_for_direct_purchase.rsAll other token transitions (
burn,claim,config_update,direct_purchase,emergency_action,transfer,destroy_frozen_funds) already propagate settings correctly.How Has This Been Tested?
Code review — the fix is mechanical and matches the existing correct pattern in
destroy_frozen_funds.rs.Breaking Changes
None. This is a bug fix — callers who set
PutSettingson these builders will now have them respected as intended.Summary by CodeRabbit
Bug Fixes
Validation
What was tested
Results
Environment
dashpay/platform