2020-04-01 18:49:21 +00:00
|
|
|
package ante_test
|
|
|
|
|
|
|
|
import (
|
2022-03-11 10:31:16 +00:00
|
|
|
"math"
|
2022-05-31 16:28:46 +00:00
|
|
|
"math/big"
|
2022-03-11 10:31:16 +00:00
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
2022-02-26 16:34:43 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
|
|
|
|
types2 "github.com/cosmos/cosmos-sdk/x/bank/types"
|
|
|
|
types3 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
|
|
"github.com/ethereum/go-ethereum/crypto"
|
2022-06-19 09:43:41 +00:00
|
|
|
"github.com/evmos/ethermint/ethereum/eip712"
|
|
|
|
"github.com/evmos/ethermint/types"
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2022-01-05 07:28:27 +00:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2021-06-01 17:14:33 +00:00
|
|
|
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
2021-05-31 09:05:32 +00:00
|
|
|
|
2020-04-01 18:49:21 +00:00
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
|
2021-05-31 09:05:32 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
|
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
2021-04-21 13:41:30 +00:00
|
|
|
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
2021-12-28 07:59:28 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
2021-04-17 10:00:07 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
2020-04-01 18:49:21 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2021-05-31 09:05:32 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
|
|
|
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
|
|
|
|
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
|
2021-04-17 10:00:07 +00:00
|
|
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2022-06-19 09:43:41 +00:00
|
|
|
"github.com/evmos/ethermint/app"
|
|
|
|
ante "github.com/evmos/ethermint/app/ante"
|
|
|
|
"github.com/evmos/ethermint/encoding"
|
|
|
|
"github.com/evmos/ethermint/tests"
|
|
|
|
"github.com/evmos/ethermint/x/evm/statedb"
|
|
|
|
evmtypes "github.com/evmos/ethermint/x/evm/types"
|
|
|
|
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-04-17 10:00:07 +00:00
|
|
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
2020-04-01 18:49:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type AnteTestSuite struct {
|
|
|
|
suite.Suite
|
|
|
|
|
2021-12-28 07:59:28 +00:00
|
|
|
ctx sdk.Context
|
|
|
|
app *app.EthermintApp
|
|
|
|
clientCtx client.Context
|
|
|
|
anteHandler sdk.AnteHandler
|
|
|
|
ethSigner ethtypes.Signer
|
|
|
|
enableFeemarket bool
|
|
|
|
enableLondonHF bool
|
2022-05-03 17:51:02 +00:00
|
|
|
evmParamsOption func(*evmtypes.Params)
|
2020-04-01 18:49:21 +00:00
|
|
|
}
|
|
|
|
|
2022-06-05 09:22:33 +00:00
|
|
|
const TestGasLimit uint64 = 100000
|
|
|
|
|
2022-01-05 07:28:27 +00:00
|
|
|
func (suite *AnteTestSuite) StateDB() *statedb.StateDB {
|
|
|
|
return statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes())))
|
|
|
|
}
|
|
|
|
|
2020-04-01 18:49:21 +00:00
|
|
|
func (suite *AnteTestSuite) SetupTest() {
|
|
|
|
checkTx := false
|
2021-10-19 08:49:29 +00:00
|
|
|
|
2021-12-28 07:59:28 +00:00
|
|
|
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
|
|
|
if suite.enableFeemarket {
|
|
|
|
// setup feemarketGenesis params
|
|
|
|
feemarketGenesis := feemarkettypes.DefaultGenesisState()
|
|
|
|
feemarketGenesis.Params.EnableHeight = 1
|
|
|
|
feemarketGenesis.Params.NoBaseFee = false
|
|
|
|
// Verify feeMarket genesis
|
|
|
|
err := feemarketGenesis.Validate()
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
genesis[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feemarketGenesis)
|
|
|
|
}
|
2022-05-03 17:51:02 +00:00
|
|
|
evmGenesis := evmtypes.DefaultGenesisState()
|
2022-06-22 10:51:14 +00:00
|
|
|
evmGenesis.Params.AllowUnprotectedTxs = false
|
2021-12-28 07:59:28 +00:00
|
|
|
if !suite.enableLondonHF {
|
|
|
|
maxInt := sdk.NewInt(math.MaxInt64)
|
|
|
|
evmGenesis.Params.ChainConfig.LondonBlock = &maxInt
|
2022-02-14 23:08:41 +00:00
|
|
|
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
|
2022-07-08 10:58:04 +00:00
|
|
|
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
|
|
|
|
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
|
2021-12-28 07:59:28 +00:00
|
|
|
}
|
2022-05-03 17:51:02 +00:00
|
|
|
if suite.evmParamsOption != nil {
|
|
|
|
suite.evmParamsOption(&evmGenesis.Params)
|
|
|
|
}
|
|
|
|
genesis[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis)
|
2021-12-28 07:59:28 +00:00
|
|
|
return genesis
|
|
|
|
})
|
2021-10-19 08:49:29 +00:00
|
|
|
|
2021-08-17 14:11:26 +00:00
|
|
|
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: "ethermint_9000-1", Time: time.Now().UTC()})
|
2021-05-31 09:05:32 +00:00
|
|
|
suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdk.OneInt())))
|
|
|
|
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000))
|
|
|
|
suite.app.EvmKeeper.WithChainID(suite.ctx)
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-05-31 09:05:32 +00:00
|
|
|
infCtx := suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
|
|
|
|
suite.app.AccountKeeper.SetParams(infCtx, authtypes.DefaultParams())
|
2020-09-02 19:41:05 +00:00
|
|
|
|
2021-06-04 13:45:37 +00:00
|
|
|
encodingConfig := encoding.MakeConfig(app.ModuleBasics)
|
2021-04-17 10:00:07 +00:00
|
|
|
// We're using TestMsg amino encoding in some tests, so register it here.
|
2021-05-31 09:05:32 +00:00
|
|
|
encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil)
|
|
|
|
|
|
|
|
suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig)
|
2021-04-17 10:00:07 +00:00
|
|
|
|
2022-07-19 04:50:31 +00:00
|
|
|
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
|
2022-03-11 10:31:16 +00:00
|
|
|
AccountKeeper: suite.app.AccountKeeper,
|
|
|
|
BankKeeper: suite.app.BankKeeper,
|
|
|
|
EvmKeeper: suite.app.EvmKeeper,
|
|
|
|
FeegrantKeeper: suite.app.FeeGrantKeeper,
|
|
|
|
IBCKeeper: suite.app.IBCKeeper,
|
|
|
|
FeeMarketKeeper: suite.app.FeeMarketKeeper,
|
|
|
|
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
|
|
|
|
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
|
2022-07-19 04:50:31 +00:00
|
|
|
})
|
|
|
|
suite.Require().NoError(err)
|
2022-01-02 22:44:46 +00:00
|
|
|
|
2022-07-19 04:50:31 +00:00
|
|
|
suite.anteHandler = anteHandler
|
2021-06-01 17:14:33 +00:00
|
|
|
suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
|
2020-04-01 18:49:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestAnteTestSuite(t *testing.T) {
|
2021-12-28 07:59:28 +00:00
|
|
|
suite.Run(t, &AnteTestSuite{
|
|
|
|
enableLondonHF: true,
|
|
|
|
})
|
2020-04-01 18:49:21 +00:00
|
|
|
}
|
|
|
|
|
2022-05-31 16:28:46 +00:00
|
|
|
func (s *AnteTestSuite) BuildTestEthTx(
|
|
|
|
from common.Address,
|
|
|
|
to common.Address,
|
|
|
|
amount *big.Int,
|
|
|
|
input []byte,
|
|
|
|
gasPrice *big.Int,
|
|
|
|
gasFeeCap *big.Int,
|
|
|
|
gasTipCap *big.Int,
|
|
|
|
accesses *ethtypes.AccessList,
|
|
|
|
) *evmtypes.MsgEthereumTx {
|
|
|
|
chainID := s.app.EvmKeeper.ChainID()
|
|
|
|
nonce := s.app.EvmKeeper.GetNonce(
|
|
|
|
s.ctx,
|
|
|
|
common.BytesToAddress(from.Bytes()),
|
|
|
|
)
|
2022-06-05 09:22:33 +00:00
|
|
|
|
2022-05-31 16:28:46 +00:00
|
|
|
msgEthereumTx := evmtypes.NewTx(
|
|
|
|
chainID,
|
|
|
|
nonce,
|
|
|
|
&to,
|
|
|
|
amount,
|
2022-06-05 09:22:33 +00:00
|
|
|
TestGasLimit,
|
2022-05-31 16:28:46 +00:00
|
|
|
gasPrice,
|
|
|
|
gasFeeCap,
|
|
|
|
gasTipCap,
|
|
|
|
input,
|
|
|
|
accesses,
|
|
|
|
)
|
|
|
|
msgEthereumTx.From = from.String()
|
|
|
|
return msgEthereumTx
|
|
|
|
}
|
|
|
|
|
2021-05-31 09:05:32 +00:00
|
|
|
// CreateTestTx is a helper function to create a tx given multiple inputs.
|
|
|
|
func (suite *AnteTestSuite) CreateTestTx(
|
2021-06-21 10:44:37 +00:00
|
|
|
msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64, signCosmosTx bool,
|
2021-12-23 16:07:23 +00:00
|
|
|
unsetExtensionOptions ...bool,
|
2021-05-31 09:05:32 +00:00
|
|
|
) authsigning.Tx {
|
2021-06-21 10:44:37 +00:00
|
|
|
return suite.CreateTestTxBuilder(msg, priv, accNum, signCosmosTx).GetTx()
|
2021-06-21 07:59:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CreateTestTxBuilder is a helper function to create a tx builder given multiple inputs.
|
|
|
|
func (suite *AnteTestSuite) CreateTestTxBuilder(
|
2021-06-21 10:44:37 +00:00
|
|
|
msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64, signCosmosTx bool,
|
2021-12-23 16:07:23 +00:00
|
|
|
unsetExtensionOptions ...bool,
|
2021-06-21 07:59:45 +00:00
|
|
|
) client.TxBuilder {
|
2021-12-23 16:07:23 +00:00
|
|
|
var option *codectypes.Any
|
|
|
|
var err error
|
|
|
|
if len(unsetExtensionOptions) == 0 {
|
|
|
|
option, err = codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{})
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
}
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-06-21 10:44:37 +00:00
|
|
|
txBuilder := suite.clientCtx.TxConfig.NewTxBuilder()
|
|
|
|
builder, ok := txBuilder.(authtx.ExtensionOptionsTxBuilder)
|
2021-05-31 09:05:32 +00:00
|
|
|
suite.Require().True(ok)
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-12-23 16:07:23 +00:00
|
|
|
if len(unsetExtensionOptions) == 0 {
|
|
|
|
builder.SetExtensionOptions(option)
|
|
|
|
}
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-06-01 17:14:33 +00:00
|
|
|
err = msg.Sign(suite.ethSigner, tests.NewSigner(priv))
|
2021-05-31 09:05:32 +00:00
|
|
|
suite.Require().NoError(err)
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2022-07-19 15:12:48 +00:00
|
|
|
msg.From = ""
|
2021-05-31 09:05:32 +00:00
|
|
|
err = builder.SetMsgs(msg)
|
2021-06-15 17:39:41 +00:00
|
|
|
suite.Require().NoError(err)
|
2021-07-05 16:39:08 +00:00
|
|
|
|
|
|
|
txData, err := evmtypes.UnpackTxData(msg.Data)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
fees := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewIntFromBigInt(txData.Fee())))
|
2021-05-31 09:05:32 +00:00
|
|
|
builder.SetFeeAmount(fees)
|
|
|
|
builder.SetGasLimit(msg.GetGas())
|
2020-04-01 18:49:21 +00:00
|
|
|
|
2021-06-21 10:44:37 +00:00
|
|
|
if signCosmosTx {
|
|
|
|
// First round: we gather all the signer infos. We use the "set empty
|
|
|
|
// signature" hack to do that.
|
|
|
|
sigV2 := signing.SignatureV2{
|
|
|
|
PubKey: priv.PubKey(),
|
|
|
|
Data: &signing.SingleSignatureData{
|
|
|
|
SignMode: suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(),
|
|
|
|
Signature: nil,
|
|
|
|
},
|
2021-07-05 16:39:08 +00:00
|
|
|
Sequence: txData.GetNonce(),
|
2021-06-21 10:44:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sigsV2 := []signing.SignatureV2{sigV2}
|
|
|
|
|
|
|
|
err = txBuilder.SetSignatures(sigsV2...)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
// Second round: all signer infos are set, so each signer can sign.
|
|
|
|
|
|
|
|
signerData := authsigning.SignerData{
|
|
|
|
ChainID: suite.ctx.ChainID(),
|
|
|
|
AccountNumber: accNum,
|
2021-07-05 16:39:08 +00:00
|
|
|
Sequence: txData.GetNonce(),
|
2021-06-21 10:44:37 +00:00
|
|
|
}
|
|
|
|
sigV2, err = tx.SignWithPrivKey(
|
|
|
|
suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(), signerData,
|
2021-07-05 16:39:08 +00:00
|
|
|
txBuilder, priv, suite.clientCtx.TxConfig, txData.GetNonce(),
|
2021-06-21 10:44:37 +00:00
|
|
|
)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
sigsV2 = []signing.SignatureV2{sigV2}
|
|
|
|
|
|
|
|
err = txBuilder.SetSignatures(sigsV2...)
|
|
|
|
suite.Require().NoError(err)
|
2021-05-31 09:05:32 +00:00
|
|
|
}
|
|
|
|
|
2021-06-21 10:44:37 +00:00
|
|
|
return txBuilder
|
2021-05-31 09:05:32 +00:00
|
|
|
}
|
2021-05-12 13:08:31 +00:00
|
|
|
|
2022-05-31 16:28:46 +00:00
|
|
|
func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice sdk.Int, denom string, msgs ...sdk.Msg) client.TxBuilder {
|
|
|
|
txBuilder := suite.clientCtx.TxConfig.NewTxBuilder()
|
|
|
|
|
2022-06-05 09:22:33 +00:00
|
|
|
txBuilder.SetGasLimit(TestGasLimit)
|
|
|
|
fees := &sdk.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(TestGasLimit))}}
|
2022-05-31 16:28:46 +00:00
|
|
|
txBuilder.SetFeeAmount(*fees)
|
|
|
|
err := txBuilder.SetMsgs(msgs...)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
return txBuilder
|
|
|
|
}
|
|
|
|
|
2022-02-26 16:34:43 +00:00
|
|
|
func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgSend(from sdk.AccAddress, priv cryptotypes.PrivKey, chainId string, gas uint64, gasAmount sdk.Coins) client.TxBuilder {
|
|
|
|
// Build MsgSend
|
|
|
|
recipient := sdk.AccAddress(common.Address{}.Bytes())
|
|
|
|
msgSend := types2.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(1))))
|
|
|
|
return suite.CreateTestEIP712CosmosTxBuilder(from, priv, chainId, gas, gasAmount, msgSend)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgDelegate(from sdk.AccAddress, priv cryptotypes.PrivKey, chainId string, gas uint64, gasAmount sdk.Coins) client.TxBuilder {
|
|
|
|
// Build MsgSend
|
|
|
|
valEthAddr := tests.GenerateAddress()
|
|
|
|
valAddr := sdk.ValAddress(valEthAddr.Bytes())
|
|
|
|
msgSend := types3.NewMsgDelegate(from, valAddr, sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)))
|
|
|
|
return suite.CreateTestEIP712CosmosTxBuilder(from, priv, chainId, gas, gasAmount, msgSend)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (suite *AnteTestSuite) CreateTestEIP712CosmosTxBuilder(
|
|
|
|
from sdk.AccAddress, priv cryptotypes.PrivKey, chainId string, gas uint64, gasAmount sdk.Coins, msg sdk.Msg,
|
|
|
|
) client.TxBuilder {
|
|
|
|
var err error
|
|
|
|
|
|
|
|
nonce, err := suite.app.AccountKeeper.GetSequence(suite.ctx, from)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
pc, err := types.ParseChainID(chainId)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
ethChainId := pc.Uint64()
|
|
|
|
|
|
|
|
// GenerateTypedData TypedData
|
|
|
|
var ethermintCodec codec.ProtoCodecMarshaler
|
|
|
|
fee := legacytx.NewStdFee(gas, gasAmount)
|
|
|
|
accNumber := suite.app.AccountKeeper.GetAccount(suite.ctx, from).GetAccountNumber()
|
|
|
|
|
|
|
|
data := legacytx.StdSignBytes(chainId, accNumber, nonce, 0, fee, []sdk.Msg{msg}, "")
|
|
|
|
typedData, err := eip712.WrapTxToTypedData(ethermintCodec, ethChainId, msg, data, &eip712.FeeDelegationOptions{
|
|
|
|
FeePayer: from,
|
|
|
|
})
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
sigHash, err := eip712.ComputeTypedDataHash(typedData)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
// Sign typedData
|
|
|
|
keyringSigner := tests.NewSigner(priv)
|
|
|
|
signature, pubKey, err := keyringSigner.SignByAddress(from, sigHash)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
signature[crypto.RecoveryIDOffset] += 27 // Transform V from 0/1 to 27/28 according to the yellow paper
|
|
|
|
|
|
|
|
// Add ExtensionOptionsWeb3Tx extension
|
|
|
|
var option *codectypes.Any
|
|
|
|
option, err = codectypes.NewAnyWithValue(&types.ExtensionOptionsWeb3Tx{
|
|
|
|
FeePayer: from.String(),
|
|
|
|
TypedDataChainID: ethChainId,
|
|
|
|
FeePayerSig: signature,
|
|
|
|
})
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
suite.clientCtx.TxConfig.SignModeHandler()
|
|
|
|
txBuilder := suite.clientCtx.TxConfig.NewTxBuilder()
|
|
|
|
builder, ok := txBuilder.(authtx.ExtensionOptionsTxBuilder)
|
|
|
|
suite.Require().True(ok)
|
|
|
|
|
|
|
|
builder.SetExtensionOptions(option)
|
|
|
|
builder.SetFeeAmount(gasAmount)
|
|
|
|
builder.SetGasLimit(gas)
|
|
|
|
|
|
|
|
sigsV2 := signing.SignatureV2{
|
|
|
|
PubKey: pubKey,
|
|
|
|
Data: &signing.SingleSignatureData{
|
|
|
|
SignMode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON,
|
|
|
|
},
|
|
|
|
Sequence: nonce,
|
|
|
|
}
|
|
|
|
|
|
|
|
err = builder.SetSignatures(sigsV2)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
err = builder.SetMsgs(msg)
|
|
|
|
suite.Require().NoError(err)
|
|
|
|
|
|
|
|
return builder
|
|
|
|
}
|
|
|
|
|
2022-06-05 09:22:33 +00:00
|
|
|
func NextFn(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) {
|
|
|
|
return ctx, nil
|
|
|
|
}
|
|
|
|
|
2021-05-31 09:05:32 +00:00
|
|
|
var _ sdk.Tx = &invalidTx{}
|
|
|
|
|
|
|
|
type invalidTx struct{}
|
|
|
|
|
|
|
|
func (invalidTx) GetMsgs() []sdk.Msg { return []sdk.Msg{nil} }
|
|
|
|
func (invalidTx) ValidateBasic() error { return nil }
|