Skip to content

Commit f60bafb

Browse files
committed
refactor: updated ante and cosmos package files to use gasless method from txpolicy package
1 parent 9ffbe2a commit f60bafb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

app/ante/account_init_decorator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
7-
uexecutortypes "github.com/pushchain/push-chain-node/x/uexecutor/types"
87

98
"google.golang.org/protobuf/types/known/anypb"
109

@@ -14,6 +13,7 @@ import (
1413
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1514
"github.com/cosmos/cosmos-sdk/types/tx/signing"
1615
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
16+
txpolicy "github.com/pushchain/push-chain-node/app/txpolicy"
1717
)
1818

1919
type AccountInitDecorator struct {
@@ -29,7 +29,7 @@ func NewAccountInitDecorator(ak AccountKeeper, signModeHandler *txsigning.Handle
2929
}
3030

3131
func (aid AccountInitDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
32-
if !uexecutortypes.IsGaslessTx(tx) {
32+
if !txpolicy.IsGaslessTx(tx) {
3333
// Skip account initialization for non-gasless transactions
3434
return next(ctx, tx, simulate)
3535
}

app/ante/fee.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1111
"github.com/cosmos/cosmos-sdk/x/auth/ante"
1212
"github.com/cosmos/cosmos-sdk/x/auth/types"
13-
uexecutortypes "github.com/pushchain/push-chain-node/x/uexecutor/types"
13+
txpolicy "github.com/pushchain/push-chain-node/app/txpolicy"
1414
)
1515

1616
// TxFeeChecker check if the provided fee is enough and returns the effective fee and tx priority,
@@ -56,9 +56,9 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo
5656
err error
5757
)
5858

59-
// Check if this is a MsgMintToken transaction
60-
if uexecutortypes.IsGaslessTx(tx) {
61-
// Skip fee deduction for MsgMintToken
59+
// Check if this is a gasless transaction
60+
if txpolicy.IsGaslessTx(tx) {
61+
// Skip fee deduction for Gasless messages
6262
return next(ctx, tx, simulate)
6363
}
6464

app/cosmos/min_gas_price.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
1313
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
1414
evmtypes "github.com/cosmos/evm/x/vm/types"
15-
uexecutortypes "github.com/pushchain/push-chain-node/x/uexecutor/types"
15+
txpolicy "github.com/pushchain/push-chain-node/app/txpolicy"
1616
)
1717

1818
// MinGasPriceDecorator will check if the transaction's fee is at least as large
@@ -78,8 +78,8 @@ func (mpd MinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
7878
}
7979
}
8080

81-
if uexecutortypes.IsGaslessTx(tx) {
82-
// Skip fee deduction for MsgGaslessUpdate
81+
if txpolicy.IsGaslessTx(tx) {
82+
// Skip fee deduction for Gasless messages
8383
return next(ctx, tx, simulate)
8484
}
8585

0 commit comments

Comments
 (0)