Skip to content

Commit

Permalink
fix tests and disable v1 upgrade e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis committed Nov 20, 2024
1 parent 098751b commit 836c8cd
Show file tree
Hide file tree
Showing 79 changed files with 379 additions and 17,673 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ jobs:
run: |
make test-e2e-cache-btc-staking-pre-approval
# Disable this test because v1 upgrade does not cover integration features
# TODO: Reenable this test after having v2 upgrade
e2e-run-upgrade-v1:
if: false
needs: [e2e-docker-build-babylon, e2e-docker-build-e2e-init-chain]
runs-on: ubuntu-22.04
steps:
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/babylonlabs-io/babylon/app/ante"
appkeepers "github.com/babylonlabs-io/babylon/app/keepers"
appparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/app/upgrades"
Expand All @@ -39,18 +40,17 @@ import (
"github.com/babylonlabs-io/babylon/x/checkpointing"
checkpointingtypes "github.com/babylonlabs-io/babylon/x/checkpointing/types"
"github.com/babylonlabs-io/babylon/x/epoching"
epochingkeeper "github.com/babylonlabs-io/babylon/x/epoching/keeper"
epochingtypes "github.com/babylonlabs-io/babylon/x/epoching/types"
"github.com/babylonlabs-io/babylon/x/finality"
finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types"
"github.com/babylonlabs-io/babylon/x/incentive"
incentivekeeper "github.com/babylonlabs-io/babylon/x/incentive/keeper"
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/types"
"github.com/babylonlabs-io/babylon/x/mint"
minttypes "github.com/babylonlabs-io/babylon/x/mint/types"
"github.com/babylonlabs-io/babylon/x/monitor"
monitortypes "github.com/babylonlabs-io/babylon/x/monitor/types"
"github.com/babylonlabs-io/babylon/x/zoneconcierge"
zckeeper "github.com/babylonlabs-io/babylon/x/zoneconcierge/keeper"
zctypes "github.com/babylonlabs-io/babylon/x/zoneconcierge/types"
abci "github.com/cometbft/cometbft/abci/types"
cmtos "github.com/cometbft/cometbft/libs/os"
Expand Down
22 changes: 6 additions & 16 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
mintkeeper "github.com/babylonlabs-io/babylon/x/mint/keeper"
minttypes "github.com/babylonlabs-io/babylon/x/mint/types"
"github.com/babylonlabs-io/babylon/x/zoneconcierge"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/runtime"
Expand Down Expand Up @@ -489,22 +490,6 @@ func (ak *AppKeepers) InitKeepers(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// add msgServiceRouter so that the epoching module can forward unwrapped messages to the staking module
epochingKeeper.SetMsgServiceRouter(bApp.MsgServiceRouter())
// make ZoneConcierge and Monitor to subscribe to the epoching's hooks
ak.EpochingKeeper = *epochingKeeper.SetHooks(
epochingtypes.NewMultiEpochingHooks(ak.MonitorKeeper.Hooks()),
)

// set up Checkpointing, BTCCheckpoint, and BTCLightclient keepers
ak.CheckpointingKeeper = *checkpointingKeeper.SetHooks(
checkpointingtypes.NewMultiCheckpointingHooks(ak.EpochingKeeper.Hooks(), ak.MonitorKeeper.Hooks()),
)
ak.BtcCheckpointKeeper = btcCheckpointKeeper
ak.BTCLightClientKeeper = *btclightclientKeeper.SetHooks(
btclightclienttypes.NewMultiBTCLightClientHooks(ak.BtcCheckpointKeeper.Hooks()),
)

// set up BTC staking keeper
ak.BTCStakingKeeper = btcstakingkeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -641,13 +626,18 @@ func (ak *AppKeepers) InitKeepers(
transferStack = transfer.NewIBCModule(ak.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, ak.IBCFeeKeeper)

var zoneConciergeStack porttypes.IBCModule
zoneConciergeStack = zoneconcierge.NewIBCModule(ak.ZoneConciergeKeeper)
zoneConciergeStack = ibcfee.NewIBCMiddleware(zoneConciergeStack, ak.IBCFeeKeeper)

var wasmStack porttypes.IBCModule
wasmStack = wasm.NewIBCHandler(ak.WasmKeeper, ak.IBCKeeper.ChannelKeeper, ak.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, ak.IBCFeeKeeper)

// Create static IBC router, add ibc-transfer module route, then set and seal it
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(zctypes.ModuleName, zoneConciergeStack).
AddRoute(wasmtypes.ModuleName, wasmStack)

// Setting Router will finalize all routes by sealing router
Expand Down
4 changes: 4 additions & 0 deletions proto/babylon/btcstaking/v1/packet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ message UnbondedBTCDelegation {
// unbonding_tx_sig is the signature on the unbonding tx signed by the BTC delegator
// It proves that the BTC delegator wants to unbond
bytes unbonding_tx_sig = 2;
// stake_spending_tx is the stake spending tx
bytes stake_spending_tx = 3;
// proof is the inclusion proof for the stake spending tx
InclusionProof proof = 4;
}

// BTCStakingConsumerEvent defines the structure for storing BTC staking events
Expand Down
Loading

0 comments on commit 836c8cd

Please sign in to comment.