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

Add tax2gas module and move all handle fees logic to tax2gas module #491

Closed
wants to merge 51 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
419ce91
Add tax2gas module and move all handle fees logic to tax2gas module
phamminh0811 Jun 24, 2024
7500c39
lint
phamminh0811 Jun 24, 2024
1599911
proto lint
phamminh0811 Jun 24, 2024
8fe545d
revert change in protocgen
phamminh0811 Jun 24, 2024
c40fa96
add tax2gas module and implementation
expertdicer Jul 8, 2024
22a7186
remove redundant files
expertdicer Jul 8, 2024
ef4264f
remove wasm file
expertdicer Jul 8, 2024
226de57
remove wasm file
expertdicer Jul 8, 2024
a2ae5c9
change proto
expertdicer Jul 8, 2024
4cd85c9
v8_1 upgrade handler
expertdicer Jul 8, 2024
cce285f
rename var and add comment
expertdicer Jul 9, 2024
af547c2
remove redundant check
expertdicer Jul 9, 2024
1203f0f
add comment and rename var
expertdicer Jul 9, 2024
b272150
correctly set ctx.Value
expertdicer Jul 9, 2024
2db4512
feat: oracle split as per governance (#495)
fragwuerdig Jul 10, 2024
c131733
remove tax2gas subspace and add authority
expertdicer Jul 11, 2024
bb99053
register msg service
expertdicer Jul 11, 2024
92ef82c
add msg update params
expertdicer Jul 11, 2024
c016cc6
register codec and unit tests
expertdicer Jul 11, 2024
e6d8242
proto update
expertdicer Jul 11, 2024
023cdfe
refactor tax2gas querier
expertdicer Jul 11, 2024
829a7d2
fix: wrong interface cast
fragwuerdig Jul 11, 2024
01932fe
Adjust oracle split logic (#496)
StrathCole Jul 14, 2024
2fc2c60
refactor structure
expertdicer Jul 15, 2024
2d94166
adding unit tests
expertdicer Jul 16, 2024
a16d4df
deduct from tx origin
expertdicer Jul 16, 2024
ed0ad82
Allow to paid by multiple fees denom
phamminh0811 Jul 16, 2024
d57e4ce
consume tax gas in wasm plugin
expertdicer Jul 16, 2024
3c9b03a
Compute feeRequired base on gasPrice and gasRemaining
phamminh0811 Jul 16, 2024
0b55dd8
Handle fee grant in post handle
phamminh0811 Jul 17, 2024
ee60e0c
Handle fee grant in post handle
phamminh0811 Jul 17, 2024
9131a18
Add test scenario to tax2gas
phamminh0811 Jul 17, 2024
f615e83
Merge branch 'minh/tax2gas' of github-expertdicer:classic-terra/core …
expertdicer Jul 17, 2024
d83b8b3
add simulate condition
expertdicer Jul 17, 2024
052f7fb
update tests and checkTxFee
expertdicer Jul 17, 2024
e2b6dc1
lint
phamminh0811 Jul 17, 2024
2f779bf
lint
phamminh0811 Jul 17, 2024
8ecad7e
fix interchain test
phamminh0811 Jul 17, 2024
b7aa915
update tests and minor fix
expertdicer Jul 17, 2024
d66c1f4
Merge branch 'minh/tax2gas' of github-expertdicer:classic-terra/core …
expertdicer Jul 17, 2024
51a080f
fix: use wasmvm v1.5.2 to prevent memory leak (#497)
phamminh0811 Jul 17, 2024
3e816ea
Move burn tax process to post handler
phamminh0811 Jul 18, 2024
af2336c
add bypass msg types and max gas, unit tests
expertdicer Jul 18, 2024
3f22cf0
Merge branch 'minh/tax2gas' of github-expertdicer:classic-terra/core …
expertdicer Jul 18, 2024
75bd097
update tests
expertdicer Jul 18, 2024
693a641
Merge branch 'main' into minh/tax2gas
expertdicer Jul 22, 2024
fb0344f
update post handler
expertdicer Jul 22, 2024
3deac13
Use taxGasMeter in sdk to handle tax2Gas logic (#499)
phamminh0811 Jul 23, 2024
56ea70b
fix e2e test
phamminh0811 Jul 23, 2024
1327e9d
fix test
expertdicer Jul 24, 2024
644d5f4
Merge branch 'minh/tax2gas' of github-expertdicer:classic-terra/core …
expertdicer Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change proto
  • Loading branch information
expertdicer committed Jul 8, 2024
commit a2ae5c9e3d77844cf2a3cc9aa8622221bf40074a
7 changes: 1 addition & 6 deletions proto/terra/tax2gas/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -9,12 +9,7 @@ message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = true;

string burn_rate = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];

repeated cosmos.base.v1beta1.DecCoin gas_prices = 2 [
repeated cosmos.base.v1beta1.DecCoin gas_prices = 1 [
(gogoproto.moretags) = "yaml:\"gas_prices\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
(gogoproto.nullable) = false
4 changes: 0 additions & 4 deletions x/tax2gas/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -46,10 +46,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
}
}

func (k Keeper) GetBurnRate(ctx sdk.Context) sdk.Dec {
return k.GetParams(ctx).BurnRate
}

func (k Keeper) GetGasPrices(ctx sdk.Context) sdk.DecCoins {
return k.GetParams(ctx).GasPrices
}
3 changes: 1 addition & 2 deletions x/tax2gas/post/post.go
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@ func (dd Tax2gasPostDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate b

taxGas, ok := ctx.Value(types.TaxGas).(uint64)
if !ok {
// TODO
return ctx, errorsmod.Wrap(types.ErrParsing, "Error parsing tax gas")
}
// we consume the gas here as we need to calculate the tax for consumed gas
@@ -94,5 +93,5 @@ func (dd Tax2gasPostDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate b
}
}

return ctx, nil
return next(ctx, tx, simulate, success)
}
100 changes: 24 additions & 76 deletions x/tax2gas/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions x/tax2gas/types/params.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package types

import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)
@@ -23,7 +22,6 @@ func NewParams() Params {
// DefaultParams are the default tax2gas module parameters.
func DefaultParams() Params {
return Params{
BurnRate: sdk.NewDecFromIntWithPrec(math.NewInt(1), 2),
GasPrices: sdk.NewDecCoins(
sdk.NewDecCoinFromDec("uluna", sdk.NewDecWithPrec(28325, 3)),
sdk.NewDecCoinFromDec("usdr", sdk.NewDecWithPrec(52469, 5)),
Loading