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

adjustment calculation #520

Merged

Conversation

StrathCole
Copy link
Collaborator

@StrathCole StrathCole commented Sep 23, 2024

This is an improvement over the implementation with just setting max block gas.
It calculates the multiplier potentially used by the user.

Copilot Summary

This pull request includes changes to the TerraApp and Tax2gasPostDecorator to handle tax gas calculations and logging. The most important changes include adding logic to parse and adjust gas values based on tax gas, and emitting events for tax gas consumption.

Handling tax gas calculations:

  • app/app.go: Added logic to parse tax_gas from events and adjust the GasWanted value accordingly. This includes calculating a multiplier to determine how often tax gas can be subtracted and adjusting the GasWanted value if necessary.

Emitting events:

  • x/tax2gas/post/post.go: Added an event emission for tax_gas to the transaction logs to track the consumed tax gas.

Import changes:

  • app/app.go: Added import for sdkmath to handle mathematical operations related to gas calculations.

@StrathCole StrathCole merged commit 43223e3 into strath/tax2gas-gasmeter Oct 10, 2024
11 checks passed
@StrathCole StrathCole deleted the strath/tax2gas-gasmeter-adjustment branch October 10, 2024 14:22
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.

1 participant