Skip to content

Conversation

@HenriqueNogara
Copy link
Contributor

@HenriqueNogara HenriqueNogara commented Dec 22, 2025

changelog

other

  • Fix tx_payment TransactionExtensions;
  • Change total_weight to call_weight;

@HenriqueNogara HenriqueNogara changed the title V8 fix Fix tx_payment TransactionExtensions; Use call_weight instead of total_weight Dec 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes TransactionExtensions in the tx_payment pallet by changing from total_weight() method calls to direct call_weight field access across multiple pallets. The PR also refactors the transaction payment logic by splitting fee checking and withdrawal into separate methods (can_withdraw_fee and withdraw_fee) and renaming the fee parameter to the more descriptive fee_with_tip in the OnChargeTransaction trait methods.

Key Changes

  • Replaced all total_weight() method calls with direct call_weight field access on DispatchInfo structs across utility, transaction-payment, multisig, contracts, and committee pallets
  • Refactored ChargeTransactionPayment to implement proper TransactionExtension trait with separate validate and prepare methods
  • Renamed fee parameter to fee_with_tip in OnChargeTransaction trait for clarity

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pallets/utility/src/lib.rs Changed total_weight() to call_weight in weight calculation functions
pallets/transaction-payment/src/payment.rs Renamed fee parameter to fee_with_tip for better clarity
pallets/transaction-payment/src/lib.rs Refactored transaction payment extension, added can_withdraw_fee and withdraw_fee methods, updated validate and prepare implementations
pallets/runtime/tests/src/utility_test.rs Updated tests to use call_weight instead of total_weight()
pallets/runtime/tests/src/transaction_payment_test.rs Updated tests to call validate before prepare following new TransactionExtension pattern
pallets/runtime/tests/src/relayer_test.rs Updated tests to call validate before prepare
pallets/runtime/tests/src/balances_test.rs Updated test to use validate instead of prepare directly
pallets/runtime/build_tool/src/lib.rs Removed disable_runtime_version_section_check() call
pallets/multisig/src/lib.rs Changed total_weight() to call_weight
pallets/contracts/src/chain_extension.rs Changed total_weight() to call_weight
pallets/committee/src/lib.rs Changed total_weight() to call_weight

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Neopallium Neopallium merged commit 36bff6c into develop_v8 Jan 2, 2026
16 of 19 checks passed
@Neopallium Neopallium deleted the v8-fix branch January 2, 2026 13:30
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.

3 participants