diff --git a/contrib/images/ibcsim-bcd/setup-bcd.sh b/contrib/images/ibcsim-bcd/setup-bcd.sh index 63bb181..d91cb01 100755 --- a/contrib/images/ibcsim-bcd/setup-bcd.sh +++ b/contrib/images/ibcsim-bcd/setup-bcd.sh @@ -3,7 +3,16 @@ display_usage() { echo "Missing parameters. Please check if all parameters were specified." echo "Usage: setup-bcd.sh [CHAIN_ID] [CHAIN_DIR] [RPC_PORT] [P2P_PORT] [PROFILING_PORT] [GRPC_PORT] [BABYLON_CONTRACT_CODE_FILE] [BTCSTAKING_CONTRACT_CODE_FILE] [BTCFINALITY_CONTRACT_CODE_FILE] [INSTANTIATING_CFG]" - echo "Example: setup-bcd.sh test-chain-id ./data 26657 26656 6060 9090 ./babylon_contract.wasm '{"btc_confirmation_depth":1,"checkpoint_finalization_timeout":2,"network":"Regtest","babylon_tag":"bbn0", "notify_cosmos_zone":false, "btc_staking_code_id":2}'" + echo "Example: setup-bcd.sh test-chain-id ./data 26657 26656 6060 9090 ./babylon_contract.wasm ./btc_staking.wasm ./btc_finality.wasm '{ + "btc_confirmation_depth": 1, + "checkpoint_finalization_timeout": 2, + "network": "Regtest", + "babylon_tag": "01020304", + "notify_cosmos_zone": false, + "btc_staking_code_id": 2, + "btc_finality_code_id": 3 +}' +" exit 1 } @@ -105,7 +114,7 @@ sed -i 's/"btc_finality_contract_address": ""/"btc_finality_contract_address": " # Start echo "Starting $BINARY..." -$BINARY --home $CHAINDIR/$CHAINID start --pruning=nothing --grpc-web.enable=false --grpc.address="0.0.0.0:$GRPCPORT" --log_level trace --trace --log_format 'plain' 2>&1 | tee $CHAINDIR/$CHAINID.log & +$BINARY --home $CHAINDIR/$CHAINID start --pruning=nothing --grpc-web.enable=false --grpc.address="0.0.0.0:$GRPCPORT" --log_level trace --trace --log_format 'plain' --log_no_color 2>&1 | tee $CHAINDIR/$CHAINID.log & sleep 20 # upload contract code diff --git a/contrib/images/ibcsim-bcd/wrapper.sh b/contrib/images/ibcsim-bcd/wrapper.sh index 2ebd636..288825b 100755 --- a/contrib/images/ibcsim-bcd/wrapper.sh +++ b/contrib/images/ibcsim-bcd/wrapper.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh +# shellcheck disable=SC3037 # 0. Define configuration BABYLON_KEY="babylon-key" @@ -7,19 +8,41 @@ CONSUMER_KEY="bcd-key" CONSUMER_CHAIN_ID="bcd-test" # 1. Create a bcd testnet with Babylon contract -./setup-bcd.sh $CONSUMER_CHAIN_ID $CONSUMER_CONF 26657 26656 6060 9090 ./babylon_contract.wasm ./btc_staking.wasm ./btc_finality.wasm '{ - "network": "regtest", - "babylon_tag": "01020304", - "btc_confirmation_depth": 1, - "checkpoint_finalization_timeout": 2, - "notify_cosmos_zone": false, - "btc_staking_code_id": 2, - "consumer_name": "Test Consumer", - "consumer_description": "Test Consumer Description", - "btc_finality_code_id": 3 +FINALITY_MSG='{ + "params": { + "max_active_finality_providers": 100, + "min_pub_rand": 1, + "finality_inflation_rate": "0.035", + "epoch_length": 10 + } }' +echo "btc-finality instantiation msg:" +echo -n "$FINALITY_MSG" | jq '.' +ENCODED_FINALITY_MSG=$(echo -n "$FINALITY_MSG" | base64 -w0) +BABYLON_MSG="{ + \"network\": \"regtest\", + \"babylon_tag\": \"01020304\", + \"btc_confirmation_depth\": 1, + \"checkpoint_finalization_timeout\": 2, + \"notify_cosmos_zone\": false, + \"btc_staking_code_id\": 2, + \"consumer_name\": \"Test Consumer\", + \"consumer_description\": \"Test Consumer Description\", + \"btc_finality_code_id\": 3, + \"btc_finality_msg\": \"$ENCODED_FINALITY_MSG\", + \"transfer_info\": { + \"channel_id\": \"channel-1\", + \"recipient\": { + \"module_addr\": \"zoneconcierge\" + } + } +}" +echo "babylon-contract instantiation msg:" +echo -n "$BABYLON_MSG" | jq '.' -sleep 10 +./setup-bcd.sh $CONSUMER_CHAIN_ID $CONSUMER_CONF 26657 26656 6060 9090 ./babylon_contract.wasm ./btc_staking.wasm ./btc_finality.wasm "$BABYLON_MSG" + +sleep 5 CONTRACT_ADDRESS=$(bcd query wasm list-contract-by-code 1 | grep bbnc | cut -d' ' -f2) CONTRACT_PORT="wasm.$CONTRACT_ADDRESS" @@ -91,9 +114,10 @@ rly --home $RELAYER_CONF_DIR keys restore babylon $BABYLON_KEY "$BABYLON_MEMO" sleep 10 # 3. Start relayer -echo "Creating an IBC light clients, connection, and channel between the two CZs" +echo "Creating IBC light clients, connection, and channels between the two CZs" rly --home $RELAYER_CONF_DIR tx link bcd --src-port zoneconcierge --dst-port $CONTRACT_PORT --order ordered --version zoneconcierge-1 -echo "Created IBC channel successfully!" +[ $? -eq 0 ] && echo "Created custom IBC channel successfully!" || echo "Error creating custom IBC channel" +rly --home $RELAYER_CONF_DIR tx link bcd --src-port transfer --dst-port transfer --order unordered --version ics20-1 & sleep 10 diff --git a/go.work.sum b/go.work.sum index 3731230..fb7dbec 100644 --- a/go.work.sum +++ b/go.work.sum @@ -797,6 +797,7 @@ github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= diff --git a/tests/e2e/bcd_consumer_integration_test.go b/tests/e2e/bcd_consumer_integration_test.go index 61307fe..18ee311 100644 --- a/tests/e2e/bcd_consumer_integration_test.go +++ b/tests/e2e/bcd_consumer_integration_test.go @@ -33,6 +33,7 @@ import ( bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types" ckpttypes "github.com/babylonlabs-io/babylon/x/checkpointing/types" ftypes "github.com/babylonlabs-io/babylon/x/finality/types" + zctypes "github.com/babylonlabs-io/babylon/x/zoneconcierge/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/wire" @@ -63,6 +64,19 @@ var ( czDelBtcSk, czDelBtcPk, _ = datagen.GenRandomBTCKeyPair(r) ) +func getFirstIBCDenom(balance sdk.Coins) string { + // Look up the ugly IBC denom + denoms := balance.Denoms() + var denomB string + for _, d := range denoms { + if strings.HasPrefix(d, "ibc/") { + denomB = d + break + } + } + return denomB +} + // TestBCDConsumerIntegrationTestSuite includes babylon<->bcd integration related tests func TestBCDConsumerIntegrationTestSuite(t *testing.T) { suite.Run(t, new(BCDConsumerIntegrationTestSuite)) @@ -142,7 +156,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test2RegisterAndIntegrateConsumer() { // after the consumer is registered, wait till IBC connection/channel // between babylon<->bcd is established - s.waitForIBCConnection() + s.waitForIBCConnections() } // Test3CreateConsumerFinalityProvider @@ -152,6 +166,8 @@ func (s *BCDConsumerIntegrationTestSuite) Test2RegisterAndIntegrateConsumer() { func (s *BCDConsumerIntegrationTestSuite) Test3CreateConsumerFinalityProvider() { // generate a random number of finality providers from 1 to 5 numConsumerFPs := datagen.RandomInt(r, 5) + 1 + fmt.Println("Number of consumer finality providers: ", numConsumerFPs) + var consumerFps []*bstypes.FinalityProvider for i := 0; i < int(numConsumerFPs); i++ { consumerFp, SK, PK := s.createVerifyConsumerFP() @@ -257,7 +273,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test5ActivateDelegation() { s.Eventually(func() bool { dataFromContract, err = s.cosmwasmController.QueryDelegations() return err == nil && dataFromContract != nil && len(dataFromContract.Delegations) == 1 - }, time.Second*30, time.Second) + }, time.Second*60, time.Second) // Assert delegation details s.Empty(dataFromContract.Delegations[0].UndelegationInfo.DelegatorUnbondingInfo) @@ -283,7 +299,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test5ActivateDelegation() { }, time.Minute, time.Second*5) } -func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewardsGeneration() { +func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewards() { // Query consumer finality providers consumerFp, err := s.babylonController.QueryConsumerFinalityProvider(consumerID, bbn.NewBIP340PubKeyFromBTCPK(czFpBTCPK).MarshalHex()) s.Require().NoError(err) @@ -301,6 +317,11 @@ func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewardsGeneration() { s.NoError(err) s.Empty(rewards) + // Check that there are no tokens in the module account + balance, err := s.babylonController.QueryModuleAccountBalances(zctypes.ModuleName) + s.NoError(err) + s.Empty(balance) + // Commit public randomness at the activated block height on the consumer chain randListInfo, msgCommitPubRandList, err := datagen.GenRandomMsgCommitPubRandList(r, czFpBTCSK, uint64(czActivatedHeight), 100) s.NoError(err) @@ -342,18 +363,26 @@ func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewardsGeneration() { s.Equal(hex.EncodeToString(finalizedBlock.AppHash), hex.EncodeToString(czActivatedBlock.AppHash)) s.True(finalizedBlock.Finalized) - // Ensure consumer rewards are generated and sent to the staking contract + // Ensure consumer rewards are generated (initially sent to the finality contract, + // then sent to the Babylon contract, after Consumer-side distribution, and then sent to the Babylon zoneconcierge + // module account) s.Eventually(func() bool { - rewards, err := s.cosmwasmController.QueryFinalityContractBalances() + balance, err := s.babylonController.QueryModuleAccountBalances(zctypes.ModuleName) if err != nil { - s.T().Logf("failed to query rewards: %s", err.Error()) + s.T().Logf("failed to query balance: %s", err.Error()) return false } - if len(rewards) == 0 { + if len(balance) == 0 { return false } - fmt.Println("Consumer rewards: ", rewards) - return true + ibcDenom := getFirstIBCDenom(balance) + if ibcDenom == "" { + s.T().Logf("failed to get IBC denom") + return false + } + fmt.Printf("Balance of IBC denom '%s': %s\n", ibcDenom, balance.AmountOf(ibcDenom).String()) + // Check that the balance of the IBC denom is greater than 0 + return balance.AmountOf(ibcDenom).IsPositive() }, 30*time.Second, time.Second*5) } @@ -482,7 +511,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test8ConsumerFPCascadedSlashing() { s.Eventually(func() bool { dataFromContract, err = s.cosmwasmController.QueryDelegations() return err == nil && dataFromContract != nil && len(dataFromContract.Delegations) == 2 - }, time.Second*20, time.Second) + }, time.Second*30, time.Second) // query and assert consumer finality provider's voting power is equal to the total stake s.Eventually(func() bool { @@ -718,7 +747,7 @@ func (s *BCDConsumerIntegrationTestSuite) submitCovenantSigs(consumerFp *bsctype return false } return activatedHeight != nil && activatedHeight.Height > 0 - }, time.Minute, time.Second*5) + }, 90*time.Second, time.Second*5) } // helper function: createBabylonDelegation creates a random BTC delegation restaking to Babylon and consumer finality providers @@ -784,7 +813,7 @@ func (s *BCDConsumerIntegrationTestSuite) createBabylonDelegation(babylonFp *bst } headers := make([]bbn.BTCHeaderBytes, 0) headers = append(headers, blockWithStakingTx.HeaderBytes) - for i := 0; i < int(params.ComfirmationTimeBlocks); i++ { + for i := 0; i < int(params.ConfirmationTimeBlocks); i++ { headerInfo := datagen.GenRandomValidBTCHeaderInfoWithParent(r, *parentBlockHeaderInfo) headers = append(headers, *headerInfo.Header) parentBlockHeaderInfo = headerInfo @@ -984,6 +1013,7 @@ func (s *BCDConsumerIntegrationTestSuite) initCosmwasmController() error { s.T().Fatalf("Failed to get current working directory: %v", err) } + cfg.BabylonContractAddress = "bbnc14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9syx25zf" cfg.BtcStakingContractAddress = "bbnc1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgn0kq0" cfg.BtcFinalityContractAddress = "bbnc17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgssg3nft" cfg.ChainID = "bcd-test" @@ -1010,9 +1040,11 @@ func (s *BCDConsumerIntegrationTestSuite) initCosmwasmController() error { return nil } -// helper function: waitForIBCConnection waits for the IBC connection to be established between Babylon and the consumer. -func (s *BCDConsumerIntegrationTestSuite) waitForIBCConnection() { +// helper function: waitForIBCConnections waits for the IBC connections to be established between Babylon and the +// Consumer. +func (s *BCDConsumerIntegrationTestSuite) waitForIBCConnections() { var babylonChannel *channeltypes.IdentifiedChannel + // Wait for the custom channel s.Eventually(func() bool { babylonChannelsResp, err := s.babylonController.IBCChannels() if err != nil { @@ -1025,13 +1057,13 @@ func (s *BCDConsumerIntegrationTestSuite) waitForIBCConnection() { } babylonChannel = babylonChannelsResp.Channels[0] if babylonChannel.State != channeltypes.OPEN { - s.T().Logf("Babylon channel state is not OPEN, got %s", babylonChannel.State) + s.T().Logf("Babylon custom channel state is not OPEN, got %s", babylonChannel.State) return false } s.Equal(channeltypes.ORDERED, babylonChannel.Ordering) s.Contains(babylonChannel.Counterparty.PortId, "wasm.") return true - }, time.Minute*3, time.Second*10, "Failed to get expected Babylon IBC channel") + }, time.Minute*4, time.Second*10, "Failed to get expected Babylon custom IBC channel") var consumerChannel *channeltypes.IdentifiedChannel s.Eventually(func() bool { @@ -1049,15 +1081,49 @@ func (s *BCDConsumerIntegrationTestSuite) waitForIBCConnection() { } s.Equal(channeltypes.ORDERED, consumerChannel.Ordering) s.Equal(babylonChannel.PortId, consumerChannel.Counterparty.PortId) - s.T().Logf("IBC channel established successfully") + s.T().Logf("IBC custom channel established successfully") return true - }, time.Minute, time.Second*2, "Failed to get expected Consumer IBC channel") + }, time.Minute, time.Second*2, "Failed to get expected Consumer custom IBC channel") - // Query the channel client state - //babylonChannelState, err := s.babylonController.QueryChannelClientState(babylonChannel.ChannelId, babylonChannel.PortId) - //s.Require().NoError(err, "Failed to query Babylon channel client state") - // - //return babylonChannelState.IdentifiedClientState.ClientId + // Wait for the transfer channel + s.Eventually(func() bool { + babylonChannelsResp, err := s.babylonController.IBCChannels() + if err != nil { + s.T().Logf("Error querying Babylon IBC channels: %v", err) + return false + } + if len(babylonChannelsResp.Channels) != 2 { + s.T().Logf("Expected 2 Babylon IBC channels, got %d", len(babylonChannelsResp.Channels)) + return false + } + babylonChannel = babylonChannelsResp.Channels[0] + if babylonChannel.State != channeltypes.OPEN { + s.T().Logf("Babylon transfer channel state is not OPEN, got %s", babylonChannel.State) + return false + } + s.Equal(channeltypes.UNORDERED, babylonChannel.Ordering) + s.Contains(babylonChannel.Counterparty.PortId, "transfer") + return true + }, time.Minute*3, time.Second*10, "Failed to get expected Babylon transfer IBC channel") + + s.Eventually(func() bool { + consumerChannelsResp, err := s.cosmwasmController.IBCChannels() + if err != nil { + s.T().Logf("Error querying Consumer IBC channels: %v", err) + return false + } + if len(consumerChannelsResp.Channels) != 2 { + return false + } + consumerChannel = consumerChannelsResp.Channels[0] + if consumerChannel.State != channeltypes.OPEN { + return false + } + s.Equal(channeltypes.UNORDERED, consumerChannel.Ordering) + s.Equal(babylonChannel.PortId, consumerChannel.Counterparty.PortId) + s.T().Logf("IBC transfer channel established successfully") + return true + }, time.Minute, time.Second*2, "Failed to get expected Consumer transfer IBC channel") } // helper function: verifyConsumerRegistration verifies the automatic registration of a consumer diff --git a/tests/e2e/cosmos-integration-e2e/clientcontroller/babylon/babylon.go b/tests/e2e/cosmos-integration-e2e/clientcontroller/babylon/babylon.go index 9eafb5e..d891a56 100644 --- a/tests/e2e/cosmos-integration-e2e/clientcontroller/babylon/babylon.go +++ b/tests/e2e/cosmos-integration-e2e/clientcontroller/babylon/babylon.go @@ -12,7 +12,13 @@ import ( "context" "fmt" "github.com/babylonlabs-io/babylon-sdk/tests/e2e/cosmos-integration-e2e/clientcontroller/types" + "github.com/cosmos/cosmos-sdk/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "math/rand" + "net/url" sdkErr "cosmossdk.io/errors" "cosmossdk.io/math" @@ -521,7 +527,7 @@ func (bc *BabylonController) QueryStakingParams() (*types.StakingParams, error) } return &types.StakingParams{ - ComfirmationTimeBlocks: ckptParamRes.Params.BtcConfirmationDepth, + ConfirmationTimeBlocks: ckptParamRes.Params.BtcConfirmationDepth, FinalizationTimeoutBlocks: ckptParamRes.Params.CheckpointFinalizationTimeout, MinSlashingTxFeeSat: btcutil.Amount(stakingParamRes.Params.MinSlashingTxFeeSat), CovenantPks: covenantPks, @@ -706,3 +712,48 @@ func (bc *BabylonController) QueryChannelClientState(channelID, portID string) ( return resp, err } + +func (bc *BabylonController) QueryModuleAccountBalances(module string) (sdk.Coins, error) { + moduleAccountAddress := sdk.MustBech32ifyAddressBytes(bc.cfg.AccountPrefix, authtypes.NewModuleAddress(module)) + return bc.QueryBalances(moduleAccountAddress) +} + +// QueryBalances returns balances at the address +func (bc *BabylonController) QueryBalances(address string) (sdk.Coins, error) { + grpcConn, err := bc.createGrpcConnection() + if err != nil { + return nil, err + } + defer grpcConn.Close() + + // create a gRPC client to query the x/bank service. + bankClient := banktypes.NewQueryClient(grpcConn) + bankRes, err := bankClient.AllBalances( + context.Background(), + &banktypes.QueryAllBalancesRequest{Address: address}, + ) + if err != nil { + return nil, err + } + return bankRes.GetBalances(), nil +} + +func (bc *BabylonController) createGrpcConnection() (*grpc.ClientConn, error) { + // Create a connection to the gRPC server. + parsedUrl, err := url.Parse(bc.cfg.GRPCAddr) + if err != nil { + return nil, fmt.Errorf("grpc-address is not correctly formatted: %w", err) + } + endpoint := fmt.Sprintf("%s:%s", parsedUrl.Hostname(), parsedUrl.Port()) + grpcConn, err := grpc.NewClient( + endpoint, + grpc.WithTransportCredentials(insecure.NewCredentials()), // The Cosmos SDK doesn't support any transport security mechanism. + // This instantiates a general gRPC codec which handles proto bytes. We pass in a nil interface registry + // if the request/response types contain interface instead of 'nil' you should pass the application specific codec. + grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(nil).GRPCCodec())), + ) + if err != nil { + return nil, err + } + return grpcConn, nil +} diff --git a/tests/e2e/cosmos-integration-e2e/clientcontroller/config/cosmwasm.go b/tests/e2e/cosmos-integration-e2e/clientcontroller/config/cosmwasm.go index 9c5909a..fc62f67 100644 --- a/tests/e2e/cosmos-integration-e2e/clientcontroller/config/cosmwasm.go +++ b/tests/e2e/cosmos-integration-e2e/clientcontroller/config/cosmwasm.go @@ -25,6 +25,7 @@ type CosmwasmConfig struct { BlockTimeout time.Duration `long:"block-timeout" description:"block timeout when waiting for block events"` OutputFormat string `long:"output-format" description:"default output when printint responses"` SignModeStr string `long:"sign-mode" description:"sign mode to use"` + BabylonContractAddress string `long:"babylon-contract-address" description:"address of the Babylon contract"` BtcStakingContractAddress string `long:"btc-staking-contract-address" description:"address of the BTC staking contract"` BtcFinalityContractAddress string `long:"btc-finality-contract-address" description:"address of the BTC finality contract"` } @@ -46,7 +47,15 @@ func (cfg *CosmwasmConfig) Validate() error { return fmt.Errorf("block-timeout can't be negative") } - _, _, err := bech32.Decode(cfg.BtcStakingContractAddress, len(cfg.BtcStakingContractAddress)) + _, _, err := bech32.Decode(cfg.BabylonContractAddress, len(cfg.BabylonContractAddress)) + if err != nil { + return fmt.Errorf("babylon-contract-address: invalid bech32 address: %w", err) + } + if !strings.HasPrefix(cfg.BabylonContractAddress, cfg.AccountPrefix) { + return fmt.Errorf("babylon-contract-address: invalid address prefix: %w", err) + } + + _, _, err = bech32.Decode(cfg.BtcStakingContractAddress, len(cfg.BtcStakingContractAddress)) if err != nil { return fmt.Errorf("btc-staking-contract-address: invalid bech32 address: %w", err) } @@ -79,6 +88,7 @@ func DefaultCosmwasmConfig() *CosmwasmConfig { BlockTimeout: 1 * time.Minute, OutputFormat: "direct", SignModeStr: "", + BabylonContractAddress: "", BtcStakingContractAddress: "", BtcFinalityContractAddress: "", } diff --git a/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go b/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go index 3f88f44..057cfe3 100644 --- a/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go +++ b/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go @@ -584,6 +584,10 @@ func (cc *CosmwasmConsumerController) QueryDelegations() (*ConsumerDelegationsRe return &resp, nil } +func (cc *CosmwasmConsumerController) QueryBabylonContractBalances() (sdk.Coins, error) { + return cc.QueryBalances(cc.cfg.BabylonContractAddress) +} + func (cc *CosmwasmConsumerController) QueryFinalityContractBalances() (sdk.Coins, error) { return cc.QueryBalances(cc.cfg.BtcFinalityContractAddress) } diff --git a/tests/e2e/cosmos-integration-e2e/clientcontroller/types/stakingparams.go b/tests/e2e/cosmos-integration-e2e/clientcontroller/types/stakingparams.go index 9d91c43..4d43e8b 100644 --- a/tests/e2e/cosmos-integration-e2e/clientcontroller/types/stakingparams.go +++ b/tests/e2e/cosmos-integration-e2e/clientcontroller/types/stakingparams.go @@ -8,7 +8,7 @@ import ( type StakingParams struct { // K-deep - ComfirmationTimeBlocks uint32 + ConfirmationTimeBlocks uint32 // W-deep FinalizationTimeoutBlocks uint32 diff --git a/tests/testdata/babylon_contract.wasm b/tests/testdata/babylon_contract.wasm index 8420796..1d0047a 100644 Binary files a/tests/testdata/babylon_contract.wasm and b/tests/testdata/babylon_contract.wasm differ diff --git a/tests/testdata/btc_finality.wasm b/tests/testdata/btc_finality.wasm index 1266820..c0343f1 100644 Binary files a/tests/testdata/btc_finality.wasm and b/tests/testdata/btc_finality.wasm differ diff --git a/tests/testdata/btc_staking.wasm b/tests/testdata/btc_staking.wasm index 873274e..1a88ff9 100644 Binary files a/tests/testdata/btc_staking.wasm and b/tests/testdata/btc_staking.wasm differ diff --git a/tests/testdata/version.txt b/tests/testdata/version.txt index c08d334..f27b84a 100644 --- a/tests/testdata/version.txt +++ b/tests/testdata/version.txt @@ -1 +1 @@ -84130eb706e1fb60e16cecf9ce8ade94b66ffa62 +9fdc9a15de1f082bc0a0686fe4be6bf320a03a53