core
core copied to clipboard
Strath/tax2gas gasmeter
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
).
- Added
-
New Ante and Post Handlers:
- Implemented
Tax2GasDecorator
andGasRegisterDecorator
to manage gas limits and register gas in the context (x/tax2gas/keeper/ante.go
). - Modified
Tax2gasPostDecorator
to useTax2GasMeter
for post-transaction gas handling (x/tax2gas/post/post.go
). [1] [2] [3] [4]
- Implemented
-
Context and Gas Handling Adjustments:
- Updated
DispatchMsg
method to integrateTax2GasMeter
(custom/wasm/keeper/handler_plugin.go
). [1] [2] - Adjusted
AnteHandle
method to utilizeTax2GasMeter
for gas consumption (x/tax2gas/ante/ante.go
). [1] [2]
- Updated
Configuration and Testing:
-
Configuration Changes:
- Modified
go.mod
to update thecosmos-sdk
dependency (go.mod
).
- Modified
-
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]
- Updated test contexts to use
Code Cleanup:
-
Removed Unnecessary Decorators:
- Commented out old decorators and replaced them with the new
Tax2GasDecorator
(custom/auth/ante/ante.go
).
- Commented out old decorators and replaced them with the new
These changes collectively introduce the Tax2Gas
functionality, enhancing the gas management system within the Terra application.