diff --git a/tests/app/testappd/cmd/root.go b/tests/app/testappd/cmd/root.go index 9ff2244..41f0645 100644 --- a/tests/app/testappd/cmd/root.go +++ b/tests/app/testappd/cmd/root.go @@ -74,7 +74,7 @@ func NewRootCmd() *cobra.Command { rootCmd := &cobra.Command{ Use: "testappd", - Short: "POB's simulation app", + Short: "Block SDK's simulation app", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) diff --git a/tests/integration/chain_setup.go b/tests/integration/chain_setup.go index 759652a..246587c 100644 --- a/tests/integration/chain_setup.go +++ b/tests/integration/chain_setup.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "cosmossdk.io/math" rpctypes "github.com/cometbft/cometbft/rpc/core/types" comettypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client/tx" @@ -47,8 +48,8 @@ func ChainBuilderFromChainSpec(t *testing.T, spec *interchaintest.ChainSpec) ibc return chain } -// BuildPOBInterchain creates a new Interchain testing env with the configured POB CosmosChain -func BuildPOBInterchain(t *testing.T, ctx context.Context, chain ibc.Chain) *interchaintest.Interchain { +// BuildInterchain creates a new Interchain testing env with the configured Block SDK CosmosChain +func BuildInterchain(t *testing.T, ctx context.Context, chain ibc.Chain) *interchaintest.Interchain { ic := interchaintest.NewInterchain() ic.AddChain(chain) @@ -97,7 +98,7 @@ func CreateTx(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user // update sequence number txf = txf.WithSequence(txf.Sequence() + seqIncrement) - txf = txf.WithGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(chain.Config().Denom, sdk.NewInt(GasPrice))).String()) + txf = txf.WithGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(chain.Config().Denom, math.NewInt(GasPrice))).String()) // sign the tx txBuilder, err := txf.BuildUnsignedTx(msgs...) diff --git a/tests/integration/go.mod b/tests/integration/go.mod index d13f587..6a4c01a 100644 --- a/tests/integration/go.mod +++ b/tests/integration/go.mod @@ -1,4 +1,4 @@ -module github.com/skip-mev/pob/tests/integration +module github.com/skip-mev/block-sdk/tests/integration go 1.20 @@ -11,7 +11,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 - + github.com/skip-mev/block-sdk => ../../ ) require ( diff --git a/tests/integration/pob_integration_test.go b/tests/integration/pob_integration_test.go index 0c98d49..3973d9e 100644 --- a/tests/integration/pob_integration_test.go +++ b/tests/integration/pob_integration_test.go @@ -20,7 +20,7 @@ var ( denom = "stake" image = ibc.DockerImage{ - Repository: "pob-integration", + Repository: "block-sdk-integration", Version: "latest", UidGid: "1000:1000", } @@ -37,8 +37,8 @@ var ( // interchain specification spec = &interchaintest.ChainSpec{ - ChainName: "pob", - Name: "pob", + ChainName: "block-sdk", + Name: "block-sdk", NumValidators: &numValidators, NumFullNodes: &numFullNodes, Version: "latest", @@ -50,7 +50,7 @@ var ( image, }, Type: "cosmos", - Name: "pob", + Name: "block-sdk", Denom: denom, ChainID: "chain-id-0", Bin: "testappd", @@ -76,5 +76,5 @@ func MakeEncodingConfig() *testutil.TestEncodingConfig { } func TestIntegrationTestSuite(t *testing.T) { - suite.Run(t, integration.NewPOBIntegrationTestSuiteFromSpec(spec)) + suite.Run(t, integration.NewIntegrationTestSuiteFromSpec(spec)) } diff --git a/tests/integration/pob_suite.go b/tests/integration/pob_suite.go index dde0672..1a926e0 100644 --- a/tests/integration/pob_suite.go +++ b/tests/integration/pob_suite.go @@ -18,8 +18,8 @@ const ( initBalance = 1000000000000 ) -// POBIntegrationTestSuite runs the POB integration test-suite against a given interchaintest specification -type POBIntegrationTestSuite struct { +// IntegrationTestSuite runs the Block SDK integration test-suite against a given interchaintest specification +type IntegrationTestSuite struct { suite.Suite // spec spec *interchaintest.ChainSpec @@ -33,19 +33,19 @@ type POBIntegrationTestSuite struct { denom string } -func NewPOBIntegrationTestSuiteFromSpec(spec *interchaintest.ChainSpec) *POBIntegrationTestSuite { - return &POBIntegrationTestSuite{ +func NewIntegrationTestSuiteFromSpec(spec *interchaintest.ChainSpec) *IntegrationTestSuite { + return &IntegrationTestSuite{ spec: spec, denom: "stake", } } -func (s *POBIntegrationTestSuite) WithDenom(denom string) *POBIntegrationTestSuite { +func (s *IntegrationTestSuite) WithDenom(denom string) *IntegrationTestSuite { s.denom = denom return s } -func (s *POBIntegrationTestSuite) SetupSuite() { +func (s *IntegrationTestSuite) SetupSuite() { // build the chain s.T().Log("building chain with spec", s.spec) s.chain = ChainBuilderFromChainSpec(s.T(), s.spec) @@ -53,7 +53,7 @@ func (s *POBIntegrationTestSuite) SetupSuite() { // build the interchain s.T().Log("building interchain") ctx := context.Background() - s.ic = BuildPOBInterchain(s.T(), ctx, s.chain) + s.ic = BuildInterchain(s.T(), ctx, s.chain) // get the users s.user1 = interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), initBalance, s.chain)[0] @@ -61,12 +61,12 @@ func (s *POBIntegrationTestSuite) SetupSuite() { s.user3 = interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), initBalance, s.chain)[0] } -func (s *POBIntegrationTestSuite) TearDownSuite() { +func (s *IntegrationTestSuite) TearDownSuite() { // close the interchain s.ic.Close() } -func (s *POBIntegrationTestSuite) SetupSubTest() { +func (s *IntegrationTestSuite) SetupSubTest() { // wait for 1 block height // query height height, err := s.chain.(*cosmos.CosmosChain).Height(context.Background()) @@ -74,7 +74,7 @@ func (s *POBIntegrationTestSuite) SetupSubTest() { WaitForHeight(s.T(), s.chain.(*cosmos.CosmosChain), height+1) } -func (s *POBIntegrationTestSuite) TestQueryParams() { +func (s *IntegrationTestSuite) TestQueryParams() { // query params params := QueryBuilderParams(s.T(), s.chain) @@ -89,7 +89,7 @@ func (s *POBIntegrationTestSuite) TestQueryParams() { // 2. All transactions execute as expected. // 3. The balance of the escrow account should be updated correctly. // 4. Top of block bids will be included in block proposals before other transactions -func (s *POBIntegrationTestSuite) TestValidBids() { +func (s *IntegrationTestSuite) TestValidBids() { params := QueryBuilderParams(s.T(), s.chain) escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String() @@ -321,7 +321,7 @@ func (s *POBIntegrationTestSuite) TestValidBids() { // that are included in the same block. // 5. If there is a block that has multiple valid bids with timeouts that are sufficiently far apart, // the bids should be executed respecting the highest bids until the timeout is reached. -func (s *POBIntegrationTestSuite) TestMultipleBids() { +func (s *IntegrationTestSuite) TestMultipleBids() { params := QueryBuilderParams(s.T(), s.chain) escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String() @@ -663,7 +663,7 @@ func (s *POBIntegrationTestSuite) TestMultipleBids() { }) } -func (s *POBIntegrationTestSuite) TestInvalidBids() { +func (s *IntegrationTestSuite) TestInvalidBids() { params := QueryBuilderParams(s.T(), s.chain) escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String() @@ -889,7 +889,7 @@ func escrowAddressIncrement(bid math.Int, proposerFee sdk.Dec) int64 { // // 1. Transactions that qualify as free should not be deducted any fees. // 2. Transactions that do not qualify as free should be deducted the correct fees. -func (s *POBIntegrationTestSuite) TestFreeLane() { +func (s *IntegrationTestSuite) TestFreeLane() { validators := QueryValidators(s.T(), s.chain.(*cosmos.CosmosChain)) require.True(s.T(), len(validators) > 0) @@ -995,7 +995,7 @@ func (s *POBIntegrationTestSuite) TestFreeLane() { }) } -func (s *POBIntegrationTestSuite) TestLanes() { +func (s *IntegrationTestSuite) TestLanes() { validators := QueryValidators(s.T(), s.chain.(*cosmos.CosmosChain)) require.True(s.T(), len(validators) > 0)