Skip to content

Commit

Permalink
Make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
alpe committed Jun 14, 2023
1 parent e521bf1 commit ca75b8e
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions tests/system/fraud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
package system

import (
sdkmath "cosmossdk.io/math"
"fmt"
"github.com/stretchr/testify/require"
"math"
"strconv"
"testing"

sdkmath "cosmossdk.io/math"

"github.com/stretchr/testify/require"
)

func TestRecursiveMsgsExternalTrigger(t *testing.T) {
Expand All @@ -31,10 +28,6 @@ func TestRecursiveMsgsExternalTrigger(t *testing.T) {
gas: "auto",
expErrMatcher: ErrOutOfGasMatcher,
},
"tx": { // tx will be rejected by CometBFT in post abci checkTX operation
gas: strconv.Itoa(maxBlockGas * 100),
expErrMatcher: require.NoError,
},
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
Expand All @@ -55,16 +48,6 @@ func TestRecursiveMsgsExternalTrigger(t *testing.T) {
}
}

// with default gas factor and token
func calcMinFeeRequired(t *testing.T, gas string) string {
x, ok := sdkmath.NewIntFromString(gas)
require.True(t, ok)
const defaultTestnetFee = "0.000006"
minFee, err := sdkmath.LegacyNewDecFromStr(defaultTestnetFee)
require.NoError(t, err)
return fmt.Sprintf("%sstake", minFee.Mul(sdkmath.LegacyNewDecFromInt(x)).RoundInt().String())
}

func TestRecursiveSmartQuery(t *testing.T) {
sut.ResetDirtyChain(t)
sut.StartChain(t)
Expand All @@ -82,3 +65,13 @@ func TestRecursiveSmartQuery(t *testing.T) {
}
sut.AwaitNextBlock(t)
}

// with default gas factor and token
func calcMinFeeRequired(t *testing.T, gas string) string {
x, ok := sdkmath.NewIntFromString(gas)
require.True(t, ok)
const defaultTestnetFee = "0.000006"
minFee, err := sdkmath.LegacyNewDecFromStr(defaultTestnetFee)
require.NoError(t, err)
return fmt.Sprintf("%sstake", minFee.Mul(sdkmath.LegacyNewDecFromInt(x)).RoundInt().String())
}

0 comments on commit ca75b8e

Please sign in to comment.