Skip to content

Commit

Permalink
feat: fall back to default cosmos sdk fee deductor (#99)
Browse files Browse the repository at this point in the history
* beauty

* enable all

* format

* fix

* clean

* mod

* fix?

* fix?

* fix

* push
  • Loading branch information
Alex Johnson authored Jun 4, 2024
1 parent 7b6193a commit 4b6c5fc
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 46 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/skip-mev/feemarket
go 1.22.3

require (
cosmossdk.io/api v0.7.4
cosmossdk.io/api v0.7.5
cosmossdk.io/client/v2 v2.0.0-00010101000000-000000000000
cosmossdk.io/core v0.11.0
cosmossdk.io/depinject v1.0.0-alpha.4
Expand All @@ -16,13 +16,13 @@ require (
cosmossdk.io/x/evidence v0.1.1
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/nft v0.1.1
cosmossdk.io/x/tx v0.13.2
cosmossdk.io/x/tx v0.13.3
cosmossdk.io/x/upgrade v0.1.2
github.com/client9/misspell v0.3.4
github.com/cometbft/cometbft v0.38.7
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.6
github.com/cosmos/cosmos-sdk v0.50.7
github.com/cosmos/gogoproto v1.4.12
github.com/golang/protobuf v1.5.4
github.com/golangci/golangci-lint v1.59.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
cosmossdk.io/api v0.7.4 h1:sPo8wKwCty1lht8kgL3J7YL1voJywP3YWuA5JKkBz30=
cosmossdk.io/api v0.7.4/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ=
cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1nbFC7hLs0Xvy9WAiH7Iti5iVLXMM5C37F0=
cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
Expand All @@ -216,8 +216,8 @@ cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8=
cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ=
cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8=
cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY=
cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o=
cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU=
cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g=
cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys=
cosmossdk.io/x/upgrade v0.1.2 h1:O2FGb0mVSXl7P6BQm9uV3hRVKom1zBLDGhd4G8jysJg=
cosmossdk.io/x/upgrade v0.1.2/go.mod h1:P+e4/ZNd8km7lTAX5hC2pXz/042YDcB7gzKTHuY53nc=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -419,8 +419,8 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK
github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk=
github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40=
github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4=
github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
4 changes: 4 additions & 0 deletions tests/app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func NewAnteHandler(options AnteHandlerOptions) (sdk.AnteHandler, error) {
authante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
feemarketante.NewFeeMarketCheckDecorator( // fee market check replaces fee deduct decorator
options.FeeMarketKeeper,
options.AccountKeeper,
options.BaseOptions.BankKeeper,
options.BaseOptions.FeegrantKeeper,
options.BaseOptions.TxFeeChecker,
), // fees are deducted in the fee market deduct post handler
authante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
authante.NewValidateSigCountDecorator(options.AccountKeeper),
Expand Down
27 changes: 16 additions & 11 deletions tests/e2e/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ func CCVChainConstructor(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos
zaptest.NewLogger(t),
[]*interchaintest.ChainSpec{
spec,
{Name: "ics-provider", Version: providerVersion, NumValidators: &providerNumValidators, ChainConfig: ibc.ChainConfig{
GasPrices: "0.0uatom",
ChainID: providerChainID,
TrustingPeriod: "336h",
ModifyGenesis: cosmos.ModifyGenesis(
[]cosmos.GenesisKV{
cosmos.NewGenesisKV("app_state.provider.params.blocks_per_epoch", "1"),
},
),
}},
{
Name: "ics-provider",
Version: providerVersion,
NumValidators: &providerNumValidators,
ChainConfig: ibc.ChainConfig{
GasPrices: "1uatom",
GasAdjustment: 1.5,
ChainID: providerChainID,
TrustingPeriod: "336h",
ModifyGenesis: cosmos.ModifyGenesis(
[]cosmos.GenesisKV{
cosmos.NewGenesisKV("app_state.provider.params.blocks_per_epoch", "1"),
},
),
}},
},
)

Expand Down Expand Up @@ -76,7 +81,7 @@ func CCVInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmo
// create a relayer
client, network := interchaintest.DockerSetup(t)
r := interchaintest.NewBuiltinRelayerFactory(
ibc.Hermes,
ibc.CosmosRly,
zaptest.NewLogger(t),
).Build(t, client, network)

Expand Down
8 changes: 3 additions & 5 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ import (
"fmt"
"testing"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/gov"

"github.com/skip-mev/feemarket/x/feemarket"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/stretchr/testify/suite"

"github.com/skip-mev/feemarket/tests/e2e"
"github.com/skip-mev/feemarket/x/feemarket"
feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ replace (
require (
cosmossdk.io/math v1.3.0
github.com/cometbft/cometbft v0.38.7
github.com/cosmos/cosmos-sdk v0.50.6
github.com/cosmos/cosmos-sdk v0.50.7
github.com/pelletier/go-toml/v2 v2.2.2
github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610
github.com/skip-mev/feemarket v0.0.1-alpha.2.0.20240529211541-57d7094237da
Expand All @@ -33,7 +33,7 @@ require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
cosmossdk.io/api v0.7.4 // indirect
cosmossdk.io/api v0.7.5 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
cosmossdk.io/api v0.7.4 h1:sPo8wKwCty1lht8kgL3J7YL1voJywP3YWuA5JKkBz30=
cosmossdk.io/api v0.7.4/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ=
cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1nbFC7hLs0Xvy9WAiH7Iti5iVLXMM5C37F0=
cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
Expand Down Expand Up @@ -369,8 +369,8 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK
github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk=
github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40=
github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4=
github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand Down
9 changes: 4 additions & 5 deletions tests/e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (s *TestSuite) QueryParams() types.Params {
grpcAddr := s.chain.GetHostGRPCAddress()

// create the client
cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
cc, err := grpc.NewClient(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
s.Require().NoError(err)

// create the oracle client
Expand All @@ -97,8 +97,7 @@ func (s *TestSuite) QueryState() types.State {
// get grpc address
grpcAddr := s.chain.GetHostGRPCAddress()

// create the client
cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
cc, err := grpc.NewClient(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
s.Require().NoError(err)

// create the oracle client
Expand All @@ -117,7 +116,7 @@ func (s *TestSuite) QueryDefaultGasPrice() sdk.DecCoin {
grpcAddr := s.chain.GetHostGRPCAddress()

// create the client
cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
cc, err := grpc.NewClient(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
s.Require().NoError(err)

// create the oracle client
Expand All @@ -137,7 +136,7 @@ func (s *TestSuite) QueryValidators(chain *cosmos.CosmosChain) []sdk.ValAddress

// get grpc client of the node
grpcAddr := chain.GetHostGRPCAddress()
cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
cc, err := grpc.NewClient(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
s.Require().NoError(err)
defer cc.Close()

Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ func (s *TestSuite) TestSendTxIncrease() {
gas := int64(20000100)
sendAmt := int64(100)

params := s.QueryParams()

s.Run("expect fee market gas price to increase", func() {
s.T().Log("performing sends...")
for {
Expand Down Expand Up @@ -480,7 +482,7 @@ func (s *TestSuite) TestSendTxIncrease() {
baseGasPrice = s.QueryDefaultGasPrice()
s.T().Log("gas price", baseGasPrice.String())

if baseGasPrice.Amount.GT(math.LegacyNewDec(10)) {
if baseGasPrice.Amount.GT(params.MinBaseGasPrice.Mul(math.LegacyNewDec(10))) {
break
}
}
Expand Down
43 changes: 38 additions & 5 deletions x/feemarket/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,63 @@ import (

errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"

feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types"
)

type feeMarketCheckDecorator struct {
feemarketKeeper FeeMarketKeeper
}

func newFeeMarketCheckDecorator(fmk FeeMarketKeeper) feeMarketCheckDecorator {
return feeMarketCheckDecorator{
feemarketKeeper: fmk,
}
}

// FeeMarketCheckDecorator checks sufficient fees from the fee payer based off of the current
// state of the feemarket.
// If the fee payer does not have the funds to pay for the fees, return an InsufficientFunds error.
// Call next AnteHandler if fees successfully checked.
//
// If x/feemarket is disabled (params.Enabled == false), the handler will fall back to the default
// Cosmos SDK fee deduction antehandler.
//
// CONTRACT: Tx must implement FeeTx interface
type FeeMarketCheckDecorator struct {
feemarketKeeper FeeMarketKeeper
feemarketKeeper FeeMarketKeeper
feemarketDecorator feeMarketCheckDecorator
cosmosDecorator ante.DeductFeeDecorator
}

func NewFeeMarketCheckDecorator(fmk FeeMarketKeeper) FeeMarketCheckDecorator {
func NewFeeMarketCheckDecorator(fmk FeeMarketKeeper, ak AccountKeeper, bk BankKeeper, fgk FeeGrantKeeper, txfc ante.TxFeeChecker) FeeMarketCheckDecorator {
return FeeMarketCheckDecorator{
feemarketKeeper: fmk,
feemarketDecorator: newFeeMarketCheckDecorator(
fmk,
),
cosmosDecorator: ante.NewDeductFeeDecorator(ak, bk, fgk, txfc),
}
}

// AnteHandle calls the feemarket internal antehandler if the keeper is enabled. If disabled, the Cosmos SDK
// fee antehandler is fallen back to.
func (d FeeMarketCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
params, err := d.feemarketKeeper.GetParams(ctx)
if err != nil {
return ctx, err
}
if params.Enabled {
return d.feemarketDecorator.anteHandle(ctx, tx, simulate, next)
}
return d.cosmosDecorator.AnteHandle(ctx, tx, simulate, next)
}

// AnteHandle checks if the tx provides sufficient fee to cover the required fee from the fee market.
func (dfd FeeMarketCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// anteHandle checks if the tx provides sufficient fee to cover the required fee from the fee market.
func (dfd feeMarketCheckDecorator) anteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// GenTx consume no fee
if ctx.BlockHeight() == 0 {
return next(ctx, tx, simulate)
Expand Down
4 changes: 2 additions & 2 deletions x/feemarket/ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAnteHandle(t *testing.T) {
RunPost: false,
Simulate: false,
ExpPass: false,
ExpErr: sdkerrors.ErrInvalidGasLimit,
ExpErr: sdkerrors.ErrOutOfGas,
},
// test --gas=auto flag settings
// when --gas=auto is set, cosmos-sdk sets gas=0 and simulate=true
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestAnteHandle(t *testing.T) {
RunPost: false,
Simulate: false,
ExpPass: false,
ExpErr: sdkerrors.ErrInvalidGasLimit,
ExpErr: sdkerrors.ErrOutOfGas,
},
{
Name: "signer has enough funds, should pass",
Expand Down
4 changes: 4 additions & 0 deletions x/feemarket/ante/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func (s *TestSuite) SetupHandlers(mock bool) {
authante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
feemarketante.NewFeeMarketCheckDecorator( // fee market replaces fee deduct decorator
s.FeeMarketKeeper,
s.AccountKeeper,
s.BankKeeper,
s.FeeGrantKeeper,
nil,
),
authante.NewSigGasConsumeDecorator(s.AccountKeeper, authante.DefaultSigVerificationGasConsumer),
}
Expand Down
4 changes: 2 additions & 2 deletions x/feemarket/post/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, acc sdk.AccountI, coins

err := bankKeeper.SendCoinsFromAccountToModule(ctx, acc.GetAddress(), targetModuleAcc, coins)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
return err
}

return nil
Expand All @@ -237,7 +237,7 @@ func SendTip(bankKeeper BankKeeper, ctx sdk.Context, acc, proposer sdk.AccAddres

err := bankKeeper.SendCoins(ctx, acc, proposer, coins)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
return err
}

return nil
Expand Down

0 comments on commit 4b6c5fc

Please sign in to comment.