Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sequencer): clarify transaction cost estimation #1908

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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
1 participant