Skip to content

Conversation

@ethanoroshiba
Copy link
Contributor

Summary

Refactored calculation of total transfers made in a transaction to helper function for clarity.

Background

See here: #1905 (review)

I think we should remove this function entirely in favor of two functions, calculate_fees_for_transaction (already exists) and calculate_funds_moved_by_transaction (essentially move the loop over the actions to it). The check for enough funds would then take the result of both methods.

Changes

  • Moved calculation of all transfers made in a transaction to helper function, and called this helper function in get_total_transaction_cost().

Testing

Passing all tests, no additional tests needed.

Changelogs

No updates required.

Related Issues

closes #1907

@ethanoroshiba ethanoroshiba added sequencer pertaining to the astria-sequencer crate code-quality labels Jan 10, 2025
@ethanoroshiba ethanoroshiba marked this pull request as ready for review January 14, 2025 19:21
@ethanoroshiba ethanoroshiba requested a review from a team as a code owner January 14, 2025 19:21
@ethanoroshiba ethanoroshiba added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit d34fb06 Jan 21, 2025
88 checks passed
@ethanoroshiba ethanoroshiba deleted the eoroshiba/refactor_cost_estimation branch January 21, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality sequencer pertaining to the astria-sequencer crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(sequencer): clarify transaction cost estimation

3 participants