-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into terpay/max-to-target-ratio
- Loading branch information
Showing
31 changed files
with
1,313 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ jobs: | |
- name: tests | ||
if: env.GIT_DIFF | ||
run: | | ||
go work init && make test-integration | ||
go work init && make test-e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ on: | |
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- tests/** | ||
|
||
permissions: | ||
contents: read | ||
|
@@ -16,7 +14,7 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
test-unit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -35,4 +33,24 @@ jobs: | |
- name: tests | ||
if: env.GIT_DIFF | ||
run: | | ||
make test | ||
make test-unit | ||
test-integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.4 | ||
cache: true | ||
cache-dependency-path: go.sum | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/*.go | ||
go.mod | ||
go.sum | ||
- name: tests | ||
if: env.GIT_DIFF | ||
run: | | ||
make test-integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package e2e_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module/testutil" | ||
interchaintest "github.com/strangelove-ventures/interchaintest/v7" | ||
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" | ||
"github.com/strangelove-ventures/interchaintest/v7/ibc" | ||
ictestutil "github.com/strangelove-ventures/interchaintest/v7/testutil" | ||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/skip-mev/feemarket/tests/e2e" | ||
feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" | ||
) | ||
|
||
var ( | ||
// config params | ||
numValidators = 3 | ||
numFullNodes = 1 | ||
denom = "stake" | ||
|
||
image = ibc.DockerImage{ | ||
Repository: "feemarket-e2e", | ||
Version: "latest", | ||
UidGid: "1000:1000", | ||
} | ||
encodingConfig = MakeEncodingConfig() | ||
noHostMount = false | ||
gasAdjustment = 10.0 | ||
|
||
genesisKV = []cosmos.GenesisKV{ | ||
{ | ||
Key: "app_state.feemarket.params", | ||
Value: feemarkettypes.NewParams( | ||
feemarkettypes.DefaultWindow, | ||
feemarkettypes.DefaultAlpha, | ||
feemarkettypes.DefaultBeta, | ||
feemarkettypes.DefaultTheta, | ||
feemarkettypes.DefaultDelta, | ||
feemarkettypes.DefaultTargetBlockUtilization, | ||
feemarkettypes.DefaultMaxBlockUtilization, | ||
sdk.NewInt(1000), | ||
feemarkettypes.DefaultMinLearningRate, | ||
feemarkettypes.DefaultMaxLearningRate, | ||
feemarkettypes.DefaultFeeDenom, | ||
true, | ||
), | ||
}, | ||
{ | ||
Key: "app_state.feemarket.state", | ||
Value: feemarkettypes.NewState( | ||
feemarkettypes.DefaultWindow, | ||
sdk.NewInt(1000), | ||
feemarkettypes.DefaultMaxLearningRate, | ||
), | ||
}, | ||
} | ||
|
||
consensusParams = ictestutil.Toml{ | ||
"timeout_commit": "3500ms", | ||
} | ||
|
||
// interchain specification | ||
spec = &interchaintest.ChainSpec{ | ||
ChainName: "feemarket", | ||
Name: "feemarket", | ||
NumValidators: &numValidators, | ||
NumFullNodes: &numFullNodes, | ||
Version: "latest", | ||
NoHostMount: &noHostMount, | ||
ChainConfig: ibc.ChainConfig{ | ||
EncodingConfig: encodingConfig, | ||
Images: []ibc.DockerImage{ | ||
image, | ||
}, | ||
Type: "cosmos", | ||
Name: "feemarket", | ||
Denom: denom, | ||
ChainID: "chain-id-0", | ||
Bin: "feemarketd", | ||
Bech32Prefix: "cosmos", | ||
CoinType: "118", | ||
GasAdjustment: gasAdjustment, | ||
GasPrices: fmt.Sprintf("50%s", denom), | ||
TrustingPeriod: "48h", | ||
NoHostMount: noHostMount, | ||
ModifyGenesis: cosmos.ModifyGenesis(genesisKV), | ||
ConfigFileOverrides: map[string]any{"config/config.toml": ictestutil.Toml{"consensus": consensusParams}}, | ||
}, | ||
} | ||
) | ||
|
||
func MakeEncodingConfig() *testutil.TestEncodingConfig { | ||
cfg := cosmos.DefaultEncoding() | ||
feemarkettypes.RegisterInterfaces(cfg.InterfaceRegistry) | ||
return &cfg | ||
} | ||
|
||
func TestE2ETestSuite(t *testing.T) { | ||
s := e2e.NewE2ETestSuiteFromSpec(spec) | ||
suite.Run(t, s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.