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

Consensus min gas fee of .0025 uosmo #4244

Merged
merged 25 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dfe43ca
Refactor tests a bit
ValarDragon Feb 7, 2023
38946b7
Add consensus min gas fee
ValarDragon Feb 7, 2023
c676d48
Fix tests
ValarDragon Feb 7, 2023
923b45e
Delete more crud
ValarDragon Feb 7, 2023
7a82e14
Cleanup more duplicate test cases
ValarDragon Feb 7, 2023
125d59d
flip isCheckTx sign
ValarDragon Feb 7, 2023
13679ce
One more test needed
ValarDragon Feb 7, 2023
295aebb
Run invalid fee denom test across both check & deliver
ValarDragon Feb 7, 2023
a374529
Remove extra line
ValarDragon Feb 7, 2023
8c7f27d
Merge branch 'main' into dev/consensus_min_gas_fee
ValarDragon Feb 7, 2023
e42e675
Add hack to get around txfee problem in ibctesting
ValarDragon Feb 8, 2023
f40b0c7
Handle genesis
ValarDragon Feb 8, 2023
b278a48
Minor code cleanup
ValarDragon Feb 8, 2023
5db078c
tryfix simulation
ValarDragon Feb 8, 2023
a8b5c4c
Fix for legacy simulator
ValarDragon Feb 8, 2023
275cfb8
Update x/txfees/keeper/feedecorator_test.go
ValarDragon Feb 8, 2023
e7db7e1
Apply matt comments
ValarDragon Feb 8, 2023
1896d2e
See what happens by adding fees
ValarDragon Feb 8, 2023
f3ffdcb
Merge branch 'main' into dev/consensus_min_gas_fee
ValarDragon Feb 13, 2023
bf1b8bc
Add genesis logic update
ValarDragon Feb 13, 2023
81ea3fd
Try fixing e2e
ValarDragon Feb 13, 2023
efe1326
Add some better logging to find error
ValarDragon Feb 13, 2023
540eaff
remove stat, fix typo
ValarDragon Feb 13, 2023
63c07fa
fix(e2e): fix e2e test for consensus min gas fee #4244 (#4317)
p0mvn Feb 16, 2023
af6f4a0
Temp disable geo twap E2E
ValarDragon Feb 16, 2023
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
2 changes: 1 addition & 1 deletion simulation/simtypes/txbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (sim *SimCtx) defaultTxBuilder(
txConfig := params.MakeEncodingConfig().TxConfig // TODO: unhardcode
// TODO: Consider making a default tx builder that charges some random fees
// Low value for amount of work right now though.
fees := sdk.Coins{}
fees := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 25000))
tx, err := genTx(
txConfig,
[]sdk.Msg{msg},
Expand Down
23 changes: 16 additions & 7 deletions tests/e2e/configurer/chain/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
app "github.com/osmosis-labs/osmosis/v14/app"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/p2p"
coretypes "github.com/tendermint/tendermint/rpc/core/types"

app "github.com/osmosis-labs/osmosis/v14/app"
)

func (n *NodeConfig) CreateBalancerPool(poolFile, from string) uint64 {
Expand Down Expand Up @@ -127,7 +128,7 @@ func (n *NodeConfig) SendIBCTransfer(from, recipient, amount, memo string) {

cmd := []string{"osmosisd", "tx", "ibc-transfer", "transfer", "transfer", "channel-0", recipient, amount, fmt.Sprintf("--from=%s", from), "--memo", memo}

_, _, err := n.containerManager.ExecTxCmdWithSuccessString(n.t, n.chainId, n.Name, cmd, "code: 0")
_, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, cmd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this done?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a driveby change to get the execution stack to have one entry point. (At the time I did this line, I thought I'd do the gas if statement in this method, ended up not doing that)

So can be reverted, but looks identical to the ExecTxCmd as far as I can tell?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this is fine, was getting sidetracked by this but the change LGTM now.

I think I found the main problem. Should have the fix soon

require.NoError(n.t, err)

n.LogActionF("successfully submitted sent IBC transfer")
Expand Down Expand Up @@ -277,6 +278,8 @@ func (n *NodeConfig) BankSend(amount string, sendAddress string, receiveAddress
n.LogActionF("successfully sent bank sent %s from address %s to %s", amount, sendAddress, receiveAddress)
}

// This method also funds fee tokens from the `initialization.ValidatorWalletName` account.
// TODO: Abstract this to be a fee token provider account.
func (n *NodeConfig) CreateWallet(walletName string) string {
n.LogActionF("creating wallet %s", walletName)
cmd := []string{"osmosisd", "keys", "add", walletName, "--keyring-backend=test"}
Expand All @@ -285,19 +288,25 @@ func (n *NodeConfig) CreateWallet(walletName string) string {
re := regexp.MustCompile("osmo1(.{38})")
walletAddr := fmt.Sprintf("%s\n", re.FindString(outBuf.String()))
walletAddr = strings.TrimSuffix(walletAddr, "\n")
n.LogActionF("created wallet %s, waller address - %s", walletName, walletAddr)
n.LogActionF("created wallet %s, wallet address - %s", walletName, walletAddr)
n.BankSend(initialization.WalletFeeTokens.String(), initialization.ValidatorWalletName, walletAddr)
n.LogActionF("Sent fee tokens from %s", initialization.ValidatorWalletName)
return walletAddr
}

func (n *NodeConfig) CreateWalletAndFund(walletName string, tokensToFund []string) string {
n.LogActionF("Sending tokens to %s", walletName)
return n.CreateWalletAndFundFrom(walletName, initialization.ValidatorWalletName, tokensToFund)
}

func (n *NodeConfig) CreateWalletAndFundFrom(newWalletName string, fundingWalletName string, tokensToFund []string) string {
n.LogActionF("Sending tokens to %s", newWalletName)

walletAddr := n.CreateWallet(walletName)
walletAddr := n.CreateWallet(newWalletName)
for _, tokenToFund := range tokensToFund {
n.BankSend(tokenToFund, initialization.ValidatorWalletName, walletAddr)
n.BankSend(tokenToFund, fundingWalletName, walletAddr)
}

n.LogActionF("Successfully sent tokens to %s", walletName)
n.LogActionF("Successfully sent tokens to %s", newWalletName)
return walletAddr
}

Expand Down
20 changes: 18 additions & 2 deletions tests/e2e/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/stretchr/testify/require"

"github.com/osmosis-labs/osmosis/v14/tests/e2e/initialization"
)

const (
Expand Down Expand Up @@ -58,11 +60,25 @@ func (m *Manager) ExecTxCmd(t *testing.T, chainId string, containerName string,
return m.ExecTxCmdWithSuccessString(t, chainId, containerName, command, "code: 0")
}

var txArgs = []string{"-b=block", "--yes", "--keyring-backend=test", "--log_format=json"}
var txDefaultGasArgs = []string{"--gas=400000", "--fees=1000" + initialization.E2EFeeToken}

// ExecTxCmdWithSuccessString Runs ExecCmd, with flags for txs added.
// namely adding flags `--chain-id={chain-id} -b=block --yes --keyring-backend=test "--log_format=json"`,
// namely adding flags `--chain-id={chain-id} -b=block --yes --keyring-backend=test "--log_format=json" --gas=400000`,
// and searching for `successStr`
func (m *Manager) ExecTxCmdWithSuccessString(t *testing.T, chainId string, containerName string, command []string, successStr string) (bytes.Buffer, bytes.Buffer, error) {
allTxArgs := []string{fmt.Sprintf("--chain-id=%s", chainId), "-b=block", "--yes", "--keyring-backend=test", "--log_format=json"}
allTxArgs := []string{fmt.Sprintf("--chain-id=%s", chainId)}
allTxArgs = append(allTxArgs, txArgs...)
// parse to see if command has gas flags. If not, add default gas flags.
addGasFlags := true
for _, cmd := range command {
if strings.HasPrefix(cmd, "--gas") || strings.HasPrefix(cmd, "--fees") {
addGasFlags = false
}
}
if addGasFlags {
allTxArgs = append(allTxArgs, txDefaultGasArgs...)
}
txCommand := append(command, allTxArgs...)
return m.ExecCmd(t, containerName, txCommand, successStr)
}
Expand Down
30 changes: 17 additions & 13 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package e2e
import (
"encoding/json"
"fmt"
transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
"github.com/iancoleman/orderedmap"
"github.com/osmosis-labs/osmosis/v14/tests/e2e/configurer/chain"
"io"
"os"
"path/filepath"
"strconv"
"strings"
"time"

transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
"github.com/iancoleman/orderedmap"

"github.com/osmosis-labs/osmosis/v14/tests/e2e/configurer/chain"

packetforwardingtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"

ibchookskeeper "github.com/osmosis-labs/osmosis/x/ibc-hooks/keeper"
Expand Down Expand Up @@ -212,11 +214,11 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
chainA.EnableSuperfluidAsset(fmt.Sprintf("gamm/pool/%d", poolId))

// setup wallets and send gamm tokens to these wallets (both chains)
superfluildVotingWallet := chainANode.CreateWallet("TestSuperfluidVoting")
chainANode.BankSend(fmt.Sprintf("10000000000000000000gamm/pool/%d", poolId), chainA.NodeConfigs[0].PublicAddress, superfluildVotingWallet)
chainANode.LockTokens(fmt.Sprintf("%v%s", sdk.NewInt(1000000000000000000), fmt.Sprintf("gamm/pool/%d", poolId)), "240s", superfluildVotingWallet)
superfluidVotingWallet := chainANode.CreateWallet("TestSuperfluidVoting")
chainANode.BankSend(fmt.Sprintf("10000000000000000000gamm/pool/%d", poolId), chainA.NodeConfigs[0].PublicAddress, superfluidVotingWallet)
chainANode.LockTokens(fmt.Sprintf("%v%s", sdk.NewInt(1000000000000000000), fmt.Sprintf("gamm/pool/%d", poolId)), "240s", superfluidVotingWallet)
chainA.LatestLockNumber += 1
chainANode.SuperfluidDelegate(chainA.LatestLockNumber, chainA.NodeConfigs[1].OperatorAddress, superfluildVotingWallet)
chainANode.SuperfluidDelegate(chainA.LatestLockNumber, chainA.NodeConfigs[1].OperatorAddress, superfluidVotingWallet)

// create a text prop, deposit and vote yes
chainANode.SubmitTextProposal("superfluid vote overwrite test", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinDeposit)), false)
Expand All @@ -227,7 +229,7 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
}

// set delegator vote to no
chainANode.VoteNoProposal(superfluildVotingWallet, chainA.LatestProposalNumber)
chainANode.VoteNoProposal(superfluidVotingWallet, chainA.LatestProposalNumber)

s.Eventually(
func() bool {
Expand Down Expand Up @@ -524,15 +526,17 @@ func (s *IntegrationTestSuite) TestAddToExistingLock() {
chainA := s.configurer.GetChainConfig(0)
chainANode, err := chainA.GetDefaultNode()
s.NoError(err)
funder := chainA.NodeConfigs[0].PublicAddress
// ensure we can add to new locks and superfluid locks
// create pool and enable superfluid assets
poolId := chainANode.CreateBalancerPool("nativeDenomPool.json", chainA.NodeConfigs[0].PublicAddress)
poolId := chainANode.CreateBalancerPool("nativeDenomPool.json", funder)
chainA.EnableSuperfluidAsset(fmt.Sprintf("gamm/pool/%d", poolId))

// setup wallets and send gamm tokens to these wallets on chainA
lockupWalletAddr, lockupWalletSuperfluidAddr := chainANode.CreateWallet("TestAddToExistingLock"), chainANode.CreateWallet("TestAddToExistingLockSuperfluid")
chainANode.BankSend(fmt.Sprintf("10000000000000000000gamm/pool/%d", poolId), chainA.NodeConfigs[0].PublicAddress, lockupWalletAddr)
chainANode.BankSend(fmt.Sprintf("10000000000000000000gamm/pool/%d", poolId), chainA.NodeConfigs[0].PublicAddress, lockupWalletSuperfluidAddr)
gammShares := fmt.Sprintf("10000000000000000000gamm/pool/%d", poolId)
fundTokens := []string{gammShares, initialization.WalletFeeTokens.String()}
lockupWalletAddr := chainANode.CreateWalletAndFundFrom("TestAddToExistingLock", funder, fundTokens)
lockupWalletSuperfluidAddr := chainANode.CreateWalletAndFundFrom("TestAddToExistingLockSuperfluid", funder, fundTokens)

// ensure we can add to new locks and superfluid locks on chainA
chainA.LockAndAddToExistingLock(sdk.NewInt(1000000000000000000), fmt.Sprintf("gamm/pool/%d", poolId), lockupWalletAddr, lockupWalletSuperfluidAddr)
Expand Down Expand Up @@ -566,7 +570,7 @@ func (s *IntegrationTestSuite) TestArithmeticTWAP() {

// Triggers the creation of TWAP records.
poolId := chainANode.CreateBalancerPool(poolFile, initialization.ValidatorWalletName)
swapWalletAddr := chainANode.CreateWallet(walletName)
swapWalletAddr := chainANode.CreateWalletAndFund(walletName, []string{initialization.WalletFeeTokens.String()})

timeBeforeSwap := chainANode.QueryLatestBlockTime()
// Wait for the next height so that the requested twap
Expand Down
43 changes: 38 additions & 5 deletions tests/e2e/initialization/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
tmjson "github.com/tendermint/tendermint/libs/json"

epochtypes "github.com/osmosis-labs/osmosis/v14/x/epochs/types"
"github.com/osmosis-labs/osmosis/v14/x/gamm/pool-models/balancer"
gammtypes "github.com/osmosis-labs/osmosis/v14/x/gamm/types"
incentivestypes "github.com/osmosis-labs/osmosis/v14/x/incentives/types"
minttypes "github.com/osmosis-labs/osmosis/v14/x/mint/types"
Expand All @@ -27,6 +28,8 @@ import (
twaptypes "github.com/osmosis-labs/osmosis/v14/x/twap/types"
txfeestypes "github.com/osmosis-labs/osmosis/v14/x/txfees/types"

types1 "github.com/cosmos/cosmos-sdk/codec/types"

"github.com/osmosis-labs/osmosis/v14/tests/e2e/util"
)

Expand All @@ -52,6 +55,7 @@ const (
AtomDenom = "uatom"
OsmoIBCDenom = "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518"
StakeIBCDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B7787"
E2EFeeToken = "e2e-default-feetoken"
MinGasPrice = "0.000"
IbcSendAmount = 3300000000
ValidatorWalletName = "val"
Expand All @@ -62,11 +66,13 @@ const (
StakeBalanceA = 110000000000
StakeAmountA = 100000000000
// chainB
ChainBID = "osmo-test-b"
OsmoBalanceB = 500000000000
IonBalanceB = 100000000000
StakeBalanceB = 440000000000
StakeAmountB = 400000000000
ChainBID = "osmo-test-b"
OsmoBalanceB = 500000000000
IonBalanceB = 100000000000
StakeBalanceB = 440000000000
StakeAmountB = 400000000000
GenesisFeeBalance = 100000000000
WalletFeeBalance = 100000000

EpochDuration = time.Second * 60
TWAPPruningKeepPeriod = EpochDuration / 4
Expand All @@ -84,6 +90,7 @@ var (
StakeToken = sdk.NewInt64Coin(StakeDenom, IbcSendAmount) // 3,300ustake
tenOsmo = sdk.Coins{sdk.NewInt64Coin(OsmoDenom, 10_000_000)}
fiftyOsmo = sdk.Coins{sdk.NewInt64Coin(OsmoDenom, 50_000_000)}
WalletFeeTokens = sdk.NewCoin(E2EFeeToken, sdk.NewInt(WalletFeeBalance))
)

func addAccount(path, moniker, amountStr string, accAddr sdk.AccAddress, forkHeight int) error {
Expand All @@ -97,6 +104,7 @@ func addAccount(path, moniker, amountStr string, accAddr sdk.AccAddress, forkHei
if err != nil {
return fmt.Errorf("failed to parse coins: %w", err)
}
coins = coins.Add(sdk.NewCoin(E2EFeeToken, sdk.NewInt(GenesisFeeBalance)))

balances := banktypes.Balance{Address: accAddr.String(), Coins: coins.Sort()}
genAccount := authtypes.NewBaseAccount(accAddr, nil, 0, 0)
Expand Down Expand Up @@ -347,10 +355,35 @@ func updateMintGenesis(mintGenState *minttypes.GenesisState) {

func updateTxfeesGenesis(txfeesGenState *txfeestypes.GenesisState) {
txfeesGenState.Basedenom = OsmoDenom
txfeesGenState.Feetokens = []txfeestypes.FeeToken{
{Denom: E2EFeeToken, PoolID: 1},
}
}

func updateGammGenesis(gammGenState *gammtypes.GenesisState) {
gammGenState.Params.PoolCreationFee = tenOsmo
// setup fee pool, between "e2e_default_fee_token" and "uosmo"
feePoolParams := balancer.NewPoolParams(sdk.MustNewDecFromStr("0.01"), sdk.ZeroDec(), nil)
feePoolAssets := []balancer.PoolAsset{
{
Weight: sdk.NewInt(100),
Token: sdk.NewCoin("uosmo", sdk.NewInt(100000000000)),
},
{
Weight: sdk.NewInt(100),
Token: sdk.NewCoin(E2EFeeToken, sdk.NewInt(100000000000)),
},
}
pool1, err := balancer.NewBalancerPool(1, feePoolParams, feePoolAssets, "", time.Unix(0, 0))
if err != nil {
panic(err)
}
anyPool, err := types1.NewAnyWithValue(&pool1)
if err != nil {
panic(err)
}
gammGenState.Pools = []*types1.Any{anyPool}
gammGenState.NextPoolNumber = 2
Comment on lines +365 to +386
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this and instead re-create this via CLI?

This interferes with pool IDs that we are creating via CLI

Copy link
Member Author

@ValarDragon ValarDragon Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions:

  • Why does it interfere?
  • Where do I do it in CLI such that it comes first? It needs to be first so that other txs can pay fees, and we'd have to make distinct custom methods for paying fees to set this up.

Copy link
Member

@p0mvn p0mvn Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The reason is that we also create pre-upgrade pools as a result the pool id of 1 is already assigned after upgrade. It is possible to work around this by first making a separate PR to v14 genesis.

  2. Makes sense. I will work around number 1 then and make the changes to v14 before main

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, for 2, it should be possible to create a pool with the fee via pool file, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pool file doesn't contain the tx fee. (Adding something custom for the tx fee for initialization isn't really a big deal. It just has to come first, if you point me to where I do that, I can add it in relatively easily)

}

func updatePoolManagerGenesis(appGenState map[string]json.RawMessage) func(*poolmanagertypes.GenesisState) {
Expand Down
10 changes: 10 additions & 0 deletions tests/ibc-hooks/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/osmosis-labs/osmosis/v14/x/gamm/pool-models/balancer"
gammtypes "github.com/osmosis-labs/osmosis/v14/x/gamm/types"
minttypes "github.com/osmosis-labs/osmosis/v14/x/mint/types"
txfeetypes "github.com/osmosis-labs/osmosis/v14/x/txfees/types"

"github.com/osmosis-labs/osmosis/v14/app/apptesting"

Expand Down Expand Up @@ -42,7 +43,11 @@ type HooksTestSuite struct {
path *ibctesting.Path
}

var oldConsensusMinFee = txfeetypes.ConsensusMinFee

func (suite *HooksTestSuite) SetupTest() {
// TODO: This needs to get removed. Waiting on https://github.com/cosmos/ibc-go/issues/3123
txfeetypes.ConsensusMinFee = sdk.ZeroDec()
suite.Setup()
ibctesting.DefaultTestingAppInit = osmosisibctesting.SetupTestingApp
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)
Expand All @@ -60,6 +65,11 @@ func (suite *HooksTestSuite) SetupTest() {
suite.coordinator.Setup(suite.path)
}

// TODO: This needs to get removed. Waiting on https://github.com/cosmos/ibc-go/issues/3123
func (suite *HooksTestSuite) TearDownSuite() {
txfeetypes.ConsensusMinFee = oldConsensusMinFee
}

func TestIBCHooksTestSuite(t *testing.T) {
suite.Run(t, new(HooksTestSuite))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/osmosisibctesting/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) {
return osmosisApp, app.NewDefaultGenesisState()
}

// SendMsgsNoCheck overrides ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller
// SendMsgsNoCheck is an alternative to ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller
func (chain *TestChain) SendMsgsNoCheck(msgs ...sdk.Msg) (*sdk.Result, error) {
// ensure the chain has the latest time
chain.Coordinator.UpdateTimeForChain(chain.TestChain)
Expand Down
6 changes: 6 additions & 0 deletions tests/simulator/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/simapp/helpers"
sdk "github.com/cosmos/cosmos-sdk/types"

osmosim "github.com/osmosis-labs/osmosis/v14/simulation/executor"
"github.com/osmosis-labs/osmosis/v14/simulation/simtypes/simlogger"
txfeetypes "github.com/osmosis-labs/osmosis/v14/x/txfees/types"
)

// Profile with:
Expand Down Expand Up @@ -45,6 +47,8 @@ func TestFullAppSimulation(t *testing.T) {
}

func fullAppSimulation(tb testing.TB, is_testing bool) {
// TODO: Get SDK simulator fixed to have min fees possible
txfeetypes.ConsensusMinFee = sdk.ZeroDec()
config, db, logger, cleanup, err := osmosim.SetupSimulation("goleveldb-app-sim", "Simulation")
if err != nil {
tb.Fatalf("simulation setup failed: %s", err.Error())
Expand Down Expand Up @@ -79,6 +83,8 @@ func TestAppStateDeterminism(t *testing.T) {
// if !osmosim.FlagEnabledValue {
// t.Skip("skipping application simulation")
// }
// TODO: Get SDK simulator fixed to have min fees possible
txfeetypes.ConsensusMinFee = sdk.ZeroDec()

config := osmosim.NewConfigFromFlags()
config.ExportConfig.ExportParamsPath = ""
Expand Down
11 changes: 11 additions & 0 deletions x/ibc-rate-limit/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
ibctesting "github.com/cosmos/ibc-go/v4/testing"
"github.com/stretchr/testify/suite"

txfeetypes "github.com/osmosis-labs/osmosis/v14/x/txfees/types"

"github.com/osmosis-labs/osmosis/v14/app/apptesting"
"github.com/osmosis-labs/osmosis/v14/tests/osmosisibctesting"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/types"
Expand All @@ -31,6 +33,8 @@ type MiddlewareTestSuite struct {
path *ibctesting.Path
}

var oldConsensusMinFee = txfeetypes.ConsensusMinFee

// Setup
func TestMiddlewareTestSuite(t *testing.T) {
suite.Run(t, new(MiddlewareTestSuite))
Expand All @@ -46,6 +50,8 @@ func NewTransferPath(chainA, chainB *osmosisibctesting.TestChain) *ibctesting.Pa
}

func (suite *MiddlewareTestSuite) SetupTest() {
// TODO: This needs to get removed. Waiting on https://github.com/cosmos/ibc-go/issues/3123
txfeetypes.ConsensusMinFee = sdk.ZeroDec()
suite.Setup()
ibctesting.DefaultTestingAppInit = osmosisibctesting.SetupTestingApp
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)
Expand All @@ -64,6 +70,11 @@ func (suite *MiddlewareTestSuite) SetupTest() {
suite.coordinator.Setup(suite.path)
}

// TODO: This needs to get removed. Waiting on https://github.com/cosmos/ibc-go/issues/3123
func (suite *MiddlewareTestSuite) TearDownSuite() {
txfeetypes.ConsensusMinFee = oldConsensusMinFee
}

// Helpers
func (suite *MiddlewareTestSuite) MessageFromAToB(denom string, amount sdk.Int) sdk.Msg {
coin := sdk.NewCoin(denom, amount)
Expand Down
Loading