Skip to content

Commit

Permalink
configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Jun 11, 2024
1 parent 7e4a83c commit 741f2fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/strangelove-ventures/interchaintest/v8"
interchaintest "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"
Expand Down Expand Up @@ -105,8 +105,9 @@ var (
}

txCfg = e2e.TestTxConfig{
SmallSendsNum: 1,
LargeSendsNum: 400,
SmallSendsNum: 1,
LargeSendsNum: 400,
TargetIncreaseGasPrice: sdkmath.LegacyMustNewDecFromStr("0.1"),
}
)

Expand Down
15 changes: 12 additions & 3 deletions tests/e2e/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,24 @@ func GetOracleSideCar(node *cosmos.ChainNode) *cosmos.SidecarProcess {
}

type TestTxConfig struct {
SmallSendsNum int
LargeSendsNum int
SmallSendsNum int
LargeSendsNum int
TargetIncreaseGasPrice math.LegacyDec
}

func (tx *TestTxConfig) Validate() error {
if tx.SmallSendsNum < 1 || tx.LargeSendsNum < 1 {
return fmt.Errorf("sends num should be greater than 1")
}

if tx.TargetIncreaseGasPrice.IsNil() {
return fmt.Errorf("target increase gas price is nil")
}

if tx.TargetIncreaseGasPrice.LTE(math.LegacyZeroDec()) {
return fmt.Errorf("target increase gas price is less than or equal to 0")
}

return nil
}

Expand Down Expand Up @@ -517,7 +526,7 @@ func (s *TestSuite) TestSendTxIncrease() {
baseGasPrice = s.QueryDefaultGasPrice()
s.T().Log("gas price", baseGasPrice.String())

if baseGasPrice.Amount.GT(params.MinBaseGasPrice.Mul(math.LegacyNewDec(10))) {
if baseGasPrice.Amount.GT(s.txConfig.TargetIncreaseGasPrice) {
break
}
}
Expand Down

0 comments on commit 741f2fc

Please sign in to comment.