Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Sep 5, 2024
1 parent 9f111d5 commit b6e9ec2
Show file tree
Hide file tree
Showing 32 changed files with 37 additions and 41 deletions.
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,11 @@ endif

test-e2e: build-docker-e2e test-e2e-cache

test-e2e-btc-staking-integration2:
$(MAKE) -C test/e2e/consumer build-integration-test
$(MAKE) -C test/e2e/consumer start-integration-test
$(MAKE) test-e2e-cache-btc-staking-integration2
$(MAKE) -C test/e2e/consumer stop-integration-test

test-e2e-cache:
go test -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-btc-staking-integration2:
go test -run TestBTCStakingIntegration2TestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e
test-e2e-bcd-integration:
go test -run TestBCDIntegrationTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-ibc-transfer:
go test -run TestIBCTranferTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e
Expand Down Expand Up @@ -463,6 +457,8 @@ build-docker-e2e:
$(MAKE) -C contrib/images babylond-e2e
$(MAKE) -C contrib/images babylond-before-upgrade
$(MAKE) -C contrib/images e2e-init-chain
$(MAKE) -C test/e2e/bcd_integration build-integration-test
$(MAKE) -C test/e2e/bcd_integration start-integration-test

build-cosmos-relayer-docker: ## Build Docker image for the Cosmos relayer
$(MAKE) -C contrib/images cosmos-relayer
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"cosmossdk.io/math"
bbnclient "github.com/babylonlabs-io/babylon/client/client"
"github.com/babylonlabs-io/babylon/client/config"
types2 "github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/types"
types2 "github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/types"
bbntypes "github.com/babylonlabs-io/babylon/types"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/config"
"github.com/cosmos/btcutil/bech32"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
sdkErr "cosmossdk.io/errors"
wasmdparams "github.com/CosmWasm/wasmd/app/params"
wasmdtypes "github.com/CosmWasm/wasmd/x/wasm/types"
cwconfig "github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/config"
"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/types"
cwcclient "github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/client"
cwconfig "github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/types"
cwcclient "github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/client"
bbntypes "github.com/babylonlabs-io/babylon/types"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

wasmdparams "github.com/CosmWasm/wasmd/app/params"
"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/config"
"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/query"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/query"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config_test
import (
"testing"

"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/config"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/cosmwasmclient/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/cosmwasmclient/config"
rpcclient "github.com/cometbft/cometbft/rpc/client"
"github.com/cosmos/cosmos-sdk/client"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
bcdparams "github.com/babylonlabs-io/babylon-sdk/demo/app/params"
bbnparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/client/config"
"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/babylon"
cwconfig "github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/config"
"github.com/babylonlabs-io/babylon/test/e2e/babylon_bcd_integration/clientcontroller/cosmwasm"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/babylon"
cwconfig "github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/config"
"github.com/babylonlabs-io/babylon/test/e2e/bcd_integration/clientcontroller/cosmwasm"
"github.com/babylonlabs-io/babylon/test/e2e/initialization"
"github.com/babylonlabs-io/babylon/testutil/datagen"
"github.com/babylonlabs-io/babylon/types"
Expand All @@ -39,14 +39,14 @@ import (

var MinCommissionRate = sdkmath.LegacyNewDecWithPrec(5, 2) // 5%

type BabylonBCDIntegrationTestSuite struct {
type BCDIntegrationTestSuite struct {
suite.Suite

babylonController *babylon.BabylonController
cosmwasmController *cosmwasm.CosmwasmConsumerController
}

func (s *BabylonBCDIntegrationTestSuite) SetupSuite() {
func (s *BCDIntegrationTestSuite) SetupSuite() {
s.T().Log("setting up e2e integration test suite...")

err := s.initBabylonController()
Expand All @@ -56,7 +56,7 @@ func (s *BabylonBCDIntegrationTestSuite) SetupSuite() {
s.Require().NoError(err, "Failed to initialize CosmwasmConsumerController")
}

func (s *BabylonBCDIntegrationTestSuite) TearDownSuite() {
func (s *BCDIntegrationTestSuite) TearDownSuite() {
s.T().Log("tearing down e2e integration test suite...")

// Get the current working directory
Expand All @@ -67,7 +67,7 @@ func (s *BabylonBCDIntegrationTestSuite) TearDownSuite() {
}

// Construct the path to the Makefile directory
makefileDir := filepath.Join(currentDir, "babylon_bcd_integration")
makefileDir := filepath.Join(currentDir, "bcd_integration")

// Run the stop-integration-test make target
cmd := exec.Command("make", "-C", makefileDir, "stop-integration-test")
Expand All @@ -79,7 +79,7 @@ func (s *BabylonBCDIntegrationTestSuite) TearDownSuite() {
}
}

func (s *BabylonBCDIntegrationTestSuite) Test1ChainStartup() {
func (s *BCDIntegrationTestSuite) Test1ChainStartup() {
var (
babylonStatus *coretypes.ResultStatus
consumerStatus *coretypes.ResultStatus
Expand All @@ -101,13 +101,13 @@ func (s *BabylonBCDIntegrationTestSuite) Test1ChainStartup() {
s.T().Logf("Consumer node status: %v", consumerStatus.SyncInfo.LatestBlockHeight)
}

func (s *BabylonBCDIntegrationTestSuite) Test2AutoRegisterAndVerifyNewConsumer() {
func (s *BCDIntegrationTestSuite) Test2AutoRegisterAndVerifyNewConsumer() {
// TODO: getting some error in ibc client-state, hardcode consumer id for now
consumerID := "07-tendermint-0" // s.getIBCClientID()
s.verifyConsumerRegistration(consumerID)
}

func (s *BabylonBCDIntegrationTestSuite) Test3CreateConsumerFinalityProvider() {
func (s *BCDIntegrationTestSuite) Test3CreateConsumerFinalityProvider() {
consumerID := "07-tendermint-0"

// generate a random number of finality providers from 1 to 5
Expand Down Expand Up @@ -138,7 +138,7 @@ func (s *BabylonBCDIntegrationTestSuite) Test3CreateConsumerFinalityProvider() {
}
}

func (s *BabylonBCDIntegrationTestSuite) Test4RestakeDelegationToMultipleFPs() {
func (s *BCDIntegrationTestSuite) Test4RestakeDelegationToMultipleFPs() {
consumerID := "07-tendermint-0"

consumerFps, err := s.babylonController.QueryConsumerFinalityProviders(consumerID)
Expand Down Expand Up @@ -176,7 +176,7 @@ func (s *BabylonBCDIntegrationTestSuite) Test4RestakeDelegationToMultipleFPs() {
s.Len(pendingDels.Dels[0].CovenantSigs, 0)
}

func (s *BabylonBCDIntegrationTestSuite) Test5ActivateDelegation() {
func (s *BCDIntegrationTestSuite) Test5ActivateDelegation() {
consumerId := "07-tendermint-0"

// Query consumer finality providers
Expand Down Expand Up @@ -230,7 +230,7 @@ func (s *BabylonBCDIntegrationTestSuite) Test5ActivateDelegation() {
s.Require().NotNil(fpsByPower)
}

func (s *BabylonBCDIntegrationTestSuite) submitCovenantSigs(consumerFp *bsctypes.FinalityProviderResponse) {
func (s *BCDIntegrationTestSuite) submitCovenantSigs(consumerFp *bsctypes.FinalityProviderResponse) {
cvSK, _, _, err := getDeterministicCovenantKey()
s.NoError(err)

Expand Down Expand Up @@ -347,7 +347,7 @@ func (s *BabylonBCDIntegrationTestSuite) submitCovenantSigs(consumerFp *bsctypes
}, time.Minute, time.Second*15, "BTC staking was not activated within the expected time")
}

func (s *BabylonBCDIntegrationTestSuite) createBabylonDelegation(babylonFp *bstypes.FinalityProviderResponse, consumerFp *bsctypes.FinalityProviderResponse) (*btcec.PublicKey, string) {
func (s *BCDIntegrationTestSuite) createBabylonDelegation(babylonFp *bstypes.FinalityProviderResponse, consumerFp *bsctypes.FinalityProviderResponse) (*btcec.PublicKey, string) {
/*
create a random BTC delegation restaking to Babylon and consumer finality providers
*/
Expand Down Expand Up @@ -471,7 +471,7 @@ func (s *BabylonBCDIntegrationTestSuite) createBabylonDelegation(babylonFp *bsty
}

// helper function: create a random Babylon finality provider and verify it
func (s *BabylonBCDIntegrationTestSuite) createVerifyBabylonFP() *bstypes.FinalityProviderResponse {
func (s *BCDIntegrationTestSuite) createVerifyBabylonFP() *bstypes.FinalityProviderResponse {

/*
create a random finality provider on Babylon
Expand Down Expand Up @@ -513,7 +513,7 @@ func (s *BabylonBCDIntegrationTestSuite) createVerifyBabylonFP() *bstypes.Finali
return actualFps[0]
}

func (s *BabylonBCDIntegrationTestSuite) createVerifyConsumerFP(consumerId string) *bstypes.FinalityProvider {
func (s *BCDIntegrationTestSuite) createVerifyConsumerFP(consumerId string) *bstypes.FinalityProvider {
/*
create a random consumer finality provider on Babylon
*/
Expand Down Expand Up @@ -553,7 +553,7 @@ func (s *BabylonBCDIntegrationTestSuite) createVerifyConsumerFP(consumerId strin
return czFp
}

func (s *BabylonBCDIntegrationTestSuite) initBabylonController() error {
func (s *BCDIntegrationTestSuite) initBabylonController() error {
cfg := config.DefaultBabylonConfig()

btcParams := &chaincfg.RegressionNetParams // or whichever network you're using
Expand All @@ -567,7 +567,7 @@ func (s *BabylonBCDIntegrationTestSuite) initBabylonController() error {
}

// Construct the path to the Makefile directory
cfg.KeyDirectory = filepath.Join(currentDir, "babylon_bcd_integration/.testnets/node0/babylond")
cfg.KeyDirectory = filepath.Join(currentDir, "bcd_integration/.testnets/node0/babylond")
cfg.GasPrices = "0.02ubbn"
cfg.GasAdjustment = 20

Expand All @@ -582,7 +582,7 @@ func (s *BabylonBCDIntegrationTestSuite) initBabylonController() error {
return nil
}

func (s *BabylonBCDIntegrationTestSuite) initCosmwasmController() error {
func (s *BCDIntegrationTestSuite) initCosmwasmController() error {
cfg := cwconfig.DefaultCosmwasmConfig()
cfg.BtcStakingContractAddress = "bbnc1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgn0kq0"

Expand All @@ -606,7 +606,7 @@ func (s *BabylonBCDIntegrationTestSuite) initCosmwasmController() error {
return nil
}

func (s *BabylonBCDIntegrationTestSuite) getIBCClientID() string {
func (s *BCDIntegrationTestSuite) getIBCClientID() string {

Check failure on line 609 in test/e2e/bcd_integration_test.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

func `(*BCDIntegrationTestSuite).getIBCClientID` is unused (unused)
var babylonChannel *channeltypes.IdentifiedChannel
s.Eventually(func() bool {
babylonChannelsResp, err := s.babylonController.IBCChannels()
Expand Down Expand Up @@ -656,7 +656,7 @@ func (s *BabylonBCDIntegrationTestSuite) getIBCClientID() string {
return babylonChannelState.IdentifiedClientState.ClientId
}

func (s *BabylonBCDIntegrationTestSuite) verifyConsumerRegistration(consumerID string) *bsctypes.ConsumerRegister {
func (s *BCDIntegrationTestSuite) verifyConsumerRegistration(consumerID string) *bsctypes.ConsumerRegister {
var consumerRegistry []*bsctypes.ConsumerRegister

s.Eventually(func() bool {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func TestBTCStakingIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(BTCStakingIntegrationTestSuite))
}

// TestBabylonBCDIntegrationTestSuite includes babylon<->bcd integration related tests
func TestBabylonBCDIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(BabylonBCDIntegrationTestSuite))
// TestBCDIntegrationTestSuite includes babylon<->bcd integration related tests
func TestBCDIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(BCDIntegrationTestSuite))
}

// TestSoftwareUpgradeTestSuite tests software upgrade protocol end-to-end
Expand Down

0 comments on commit b6e9ec2

Please sign in to comment.