Skip to content
Snippets Groups Projects

Add runtime api DuniterAccountApi_estimate_costto estimate net tx cost for the end user

This MR adds a runtime API DuniterAccountApi_estimate_cost(tx) that estimates transaction fees and quota refunds. It returns an object with three fields:

    // The estimated effective cost for the user (fees - refund)
    cost: Balance,
    // The estimated amount of fees for the extrinsic
    fees: Balance,
    // The estimated amount of refund from quota
    refund: Balance,

For reviewers

The implementation introduces a new trait, GetSigner, to extract the signer from the transaction. Substrate doesn’t provide a way to retrieve the signer without verifying the signature via the Checkable trait. To avoid unnecessary computation on the node side, this runtime API skips signature verification.

Closes #308 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading