core icon indicating copy to clipboard operation
core copied to clipboard

Strath/tax2gas gasmeter

Open StrathCole opened this issue 5 months ago • 0 comments

Fixes for the tax2gas implementation and gas handling

Copilot Summary

This pull request introduces a new Tax2Gas feature to the Terra application, which includes significant changes to the handling of gas consumption and taxation. The most important changes include the addition of the Tax2GasMeter for gas metering, the implementation of new decorators and handlers, and the adjustment of existing code to integrate with the new Tax2Gas system.

Integration of Tax2Gas Feature:

  • New Gas Meter Implementation:

    • Added Tax2GasMeter to handle gas consumption and taxation (x/tax2gas/types/gas.go).
  • New Ante and Post Handlers:

    • Implemented Tax2GasDecorator and GasRegisterDecorator to manage gas limits and register gas in the context (x/tax2gas/keeper/ante.go).
    • Modified Tax2gasPostDecorator to use Tax2GasMeter for post-transaction gas handling (x/tax2gas/post/post.go). [1] [2] [3] [4]
  • Context and Gas Handling Adjustments:

    • Updated DispatchMsg method to integrate Tax2GasMeter (custom/wasm/keeper/handler_plugin.go). [1] [2]
    • Adjusted AnteHandle method to utilize Tax2GasMeter for gas consumption (x/tax2gas/ante/ante.go). [1] [2]

Configuration and Testing:

  • Configuration Changes:

    • Modified go.mod to update the cosmos-sdk dependency (go.mod).
  • Testing Enhancements:

    • Updated test contexts to use Tax2GasMeter in various test files (wasmbinding/test/tax_test.go, x/tax2gas/ante/ante_test.go, x/tax2gas/ante/fee_test.go). [1] [2] [3] [4]

Code Cleanup:

  • Removed Unnecessary Decorators:
    • Commented out old decorators and replaced them with the new Tax2GasDecorator (custom/auth/ante/ante.go).

These changes collectively introduce the Tax2Gas functionality, enhancing the gas management system within the Terra application.

StrathCole avatar Sep 23 '24 06:09 StrathCole