Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis committed Jul 30, 2024
1 parent 6ecfdf4 commit ce31233
Show file tree
Hide file tree
Showing 58 changed files with 357 additions and 336 deletions.
56 changes: 28 additions & 28 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
appkeepers "github.com/babylonlabs-io/babylon/app/keepers"
appparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/app/upgrades"
"github.com/babylonlabs-io/babylon/client/docs"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/babylon/x/btccheckpoint"
btccheckpointtypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
"github.com/babylonlabs-io/babylon/x/btclightclient"
btclightclienttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
"github.com/babylonlabs-io/babylon/x/btcstaking"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/babylon/x/btcstkconsumer"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
"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"
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/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"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
Expand Down Expand Up @@ -92,33 +119,6 @@ import (
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
"github.com/spf13/cast"

"github.com/babylonlabs-io/babylon/app/upgrades"
bbn "github.com/babylonlabs-io/babylon/types"

appkeepers "github.com/babylonlabs-io/babylon/app/keepers"
appparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/client/docs"
"github.com/babylonlabs-io/babylon/x/btccheckpoint"
btccheckpointtypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
"github.com/babylonlabs-io/babylon/x/btclightclient"
btclightclienttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
"github.com/babylonlabs-io/babylon/x/btcstaking"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"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"
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/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"
)

const (
Expand Down Expand Up @@ -576,7 +576,7 @@ func NewBabylonApp(

// At startup, after all modules have been registered, check that all proto
// annotations are correct.
// FIXME (https://github.com/babylonchain/babylon-private/issues/266): This is a temporary fix
// FIXME (https://github.com/babylonlabs-io/babylon-private/issues/266): This is a temporary fix
protoFiles, _ := proto.MergedRegistry()
// if err != nil {
// panic(err)
Expand Down
63 changes: 39 additions & 24 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ import (
btclightclienttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
btcstakingkeeper "github.com/babylonlabs-io/babylon/x/btcstaking/keeper"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
bsckeeper "github.com/babylonlabs-io/babylon/x/btcstkconsumer/keeper"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
checkpointingkeeper "github.com/babylonlabs-io/babylon/x/checkpointing/keeper"
checkpointingtypes "github.com/babylonlabs-io/babylon/x/checkpointing/types"
epochingkeeper "github.com/babylonlabs-io/babylon/x/epoching/keeper"
Expand Down Expand Up @@ -129,11 +131,14 @@ type AppKeepers struct {
MonitorKeeper monitorkeeper.Keeper

// IBC-related modules
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper // for relayer incentivization - https://github.com/cosmos/ibc/tree/main/spec/app/ics-029-fee-payment
TransferKeeper ibctransferkeeper.Keeper // for cross-chain fungible token transfers
IBCWasmKeeper ibcwasmkeeper.Keeper // for IBC wasm light clients
ZoneConciergeKeeper zckeeper.Keeper // for cross-chain fungible token transfers
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper // for relayer incentivization - https://github.com/cosmos/ibc/tree/main/spec/app/ics-029-fee-payment
TransferKeeper ibctransferkeeper.Keeper // for cross-chain fungible token transfers
IBCWasmKeeper ibcwasmkeeper.Keeper // for IBC wasm light clients

// Integration-related modules
BTCStkConsumerKeeper bsckeeper.Keeper
ZoneConciergeKeeper zckeeper.Keeper

// BTC staking related modules
BTCStakingKeeper btcstakingkeeper.Keeper
Expand Down Expand Up @@ -463,25 +468,6 @@ func (ak *AppKeepers) InitKeepers(
ak.IBCKeeper.PortKeeper, ak.AccountKeeper, ak.BankKeeper,
)

zcKeeper := zckeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[zctypes.StoreKey]),
ak.IBCFeeKeeper,
ak.IBCKeeper.ClientKeeper,
ak.IBCKeeper.ChannelKeeper,
ak.IBCKeeper.PortKeeper,
ak.AccountKeeper,
ak.BankKeeper,
&btclightclientKeeper,
&checkpointingKeeper,
&btcCheckpointKeeper,
epochingKeeper,
storeQuerier,
scopedZoneConciergeKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
ak.ZoneConciergeKeeper = *zcKeeper

// Create Transfer Keepers
ak.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -518,13 +504,22 @@ func (ak *AppKeepers) InitKeepers(
btclightclienttypes.NewMultiBTCLightClientHooks(ak.BtcCheckpointKeeper.Hooks()),
)

ak.BTCStkConsumerKeeper = bsckeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[bsctypes.StoreKey]),
ak.AccountKeeper,
ak.BankKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// set up BTC staking keeper
ak.BTCStakingKeeper = btcstakingkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[btcstakingtypes.StoreKey]),
&btclightclientKeeper,
&btcCheckpointKeeper,
&checkpointingKeeper,
&ak.BTCStkConsumerKeeper,
btcNetParams,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
Expand All @@ -540,6 +535,26 @@ func (ak *AppKeepers) InitKeepers(
ak.BTCStakingKeeper = *ak.BTCStakingKeeper.SetHooks(btcstakingtypes.NewMultiBtcStakingHooks(ak.FinalityKeeper.Hooks()))
ak.FinalityKeeper = *ak.FinalityKeeper.SetHooks(finalitytypes.NewMultiFinalityHooks(ak.BTCStakingKeeper.Hooks()))

zcKeeper := zckeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[zctypes.StoreKey]),
ak.IBCFeeKeeper,
ak.IBCKeeper.ClientKeeper,
ak.IBCKeeper.ChannelKeeper,
ak.IBCKeeper.PortKeeper,
ak.AccountKeeper,
ak.BankKeeper,
&btclightclientKeeper,
&checkpointingKeeper,
&btcCheckpointKeeper,
epochingKeeper,
storeQuerier,
&ak.BTCStakingKeeper,
scopedZoneConciergeKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
ak.ZoneConciergeKeeper = *zcKeeper

// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec,
Expand Down
2 changes: 1 addition & 1 deletion client/query/btcstkconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package query
import (
"context"

bsctypes "github.com/babylonchain/babylon/x/btcstkconsumer/types"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
"github.com/cosmos/cosmos-sdk/client"
sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query"
)
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ require (
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/x/nft v0.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand All @@ -157,7 +156,6 @@ require (
github.com/aead/siphash v1.0.1 // indirect
github.com/aws/aws-sdk-go v1.44.312 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/bufbuild/connect-go v1.5.2 // indirect
github.com/bufbuild/protocompile v0.6.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion proto/babylon/btcstaking/v1/packet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "cosmos/staking/v1beta1/staking.proto";
import "babylon/btcstaking/v1/pop.proto";
import "babylon/btcstaking/v1/btcstaking.proto";

option go_package = "github.com/babylonchain/babylon/x/btcstaking/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstaking/types";

// ConsumerIBCPacket is an IBC packet sent from consumer to Babylon
// upon a finality provider being slashed on the consumer
Expand Down
2 changes: 1 addition & 1 deletion proto/babylon/btcstkconsumer/v1/btcstkconsumer.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";
package babylon.btcstkconsumer.v1;

option go_package = "github.com/babylonchain/babylon/x/btcstkconsumer/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types";

// ConsumerRegister is the registration information of a consumer
message ConsumerRegister {
Expand Down
2 changes: 1 addition & 1 deletion proto/babylon/btcstkconsumer/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "babylon/btcstkconsumer/v1/params.proto";

option go_package = "github.com/babylonchain/babylon/x/btcstkconsumer/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types";

// GenesisState defines the btcstkconsumer module's genesis state.
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion proto/babylon/btcstkconsumer/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package babylon.btcstkconsumer.v1;
import "amino/amino.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/babylonchain/babylon/x/btcstkconsumer/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types";

// Params defines the parameters for the module.
message Params {
Expand Down
4 changes: 2 additions & 2 deletions proto/babylon/btcstkconsumer/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "babylon/btcstaking/v1/pop.proto";
import "babylon/btcstkconsumer/v1/btcstkconsumer.proto";
import "babylon/btcstkconsumer/v1/params.proto";

option go_package = "github.com/babylonchain/babylon/x/btcstkconsumer/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types";

// Query defines the gRPC querier service.
service Query {
Expand Down Expand Up @@ -124,7 +124,7 @@ message FinalityProviderResponse {
string addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// btc_pk is the Bitcoin secp256k1 PK of this finality provider
// the PK follows encoding in BIP-340 spec
bytes btc_pk = 4 [ (gogoproto.customtype) = "github.com/babylonchain/babylon/types.BIP340PubKey" ];
bytes btc_pk = 4 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/types.BIP340PubKey" ];
// pop is the proof of possession of babylon_pk and btc_pk
btcstaking.v1.ProofOfPossessionBTC pop = 5;
// slashed_babylon_height indicates the Babylon height when
Expand Down
2 changes: 1 addition & 1 deletion proto/babylon/btcstkconsumer/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "babylon/btcstkconsumer/v1/params.proto";

option go_package = "github.com/babylonchain/babylon/x/btcstkconsumer/types";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types";

// Msg defines the Msg service.
service Msg {
Expand Down
4 changes: 2 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ deps:
- remote: buf.build
owner: cosmos
repository: ibc
commit: 6b221c7d310545198c1dafe70287d254
digest: shake256:c5ea4d89af1c47f4d02057892eacdcb863359178079d9599f30d853b374fe9e9bfb3d9ca6720361c3439999a885a4f87fff4cd41c6c26b1f1142d60c386f8323
commit: ef1dd1634b6c429bb2b52d983a683ce3
digest: shake256:8325b0de8e8a2e027a8d33e0585a13273ce34b510cbedf7b785882a785baa62d42405ab2a836ea42fb1ddf098580f5cfc2414b1851dfcdd0b7c84851e96afeb9
- remote: buf.build
owner: cosmos
repository: ics23
Expand Down
10 changes: 8 additions & 2 deletions test/e2e/btc_staking_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

sdkmath "cosmossdk.io/math"
feegrantcli "cosmossdk.io/x/feegrant/client/cli"

"github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/crypto/eots"
"github.com/babylonlabs-io/babylon/test/e2e/configurer"
Expand All @@ -21,6 +20,12 @@ import (
bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
ftypes "github.com/babylonlabs-io/babylon/x/finality/types"
itypes "github.com/babylonlabs-io/babylon/x/incentive/types"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/wire"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/suite"
)

var (
Expand Down Expand Up @@ -704,8 +709,9 @@ func (s *BTCStakingTestSuite) Test8BTCDelegationFeeGrantTyped() {
// s.Require().Contains(output, feegrant.ErrFeeLimitExceeded.Error())

// submit the message to create BTC delegation using the fee grant at the max of spend limit
btcPKs := []bbn.BIP340PubKey{*bbn.NewBIP340PubKeyFromBTCPK(delBTCPK)}
node.CreateBTCDelegation(
delBTCPKs,
btcPKs,
pop,
stakingTxInfo,
[]*bbn.BIP340PubKey{cacheFP.BtcPk},
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/btc_staking_integration_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/babylonchain/babylon/test/e2e/configurer"
"github.com/babylonchain/babylon/test/e2e/configurer/chain"
"github.com/babylonchain/babylon/test/e2e/initialization"
"github.com/babylonchain/babylon/testutil/datagen"
bbn "github.com/babylonchain/babylon/types"
btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types"
bstypes "github.com/babylonchain/babylon/x/btcstaking/types"
bsctypes "github.com/babylonchain/babylon/x/btcstkconsumer/types"
"github.com/babylonlabs-io/babylon/test/e2e/configurer"
"github.com/babylonlabs-io/babylon/test/e2e/configurer/chain"
"github.com/babylonlabs-io/babylon/test/e2e/initialization"
"github.com/babylonlabs-io/babylon/testutil/datagen"
bbn "github.com/babylonlabs-io/babylon/types"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/btc_timestamping_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"
"time"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/babylonlabs-io/babylon/test/e2e/configurer"
"github.com/babylonlabs-io/babylon/test/e2e/initialization"
bbn "github.com/babylonlabs-io/babylon/types"
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/configurer/chain/commands_btcstaking_integration.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package chain

import (
sdkmath "cosmossdk.io/math"
"fmt"
bbn "github.com/babylonchain/babylon/types"
bstypes "github.com/babylonchain/babylon/x/btcstaking/types"

sdkmath "cosmossdk.io/math"
bbn "github.com/babylonlabs-io/babylon/types"
bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/configurer/chain/queries_btcstaking_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type ConsumerFpsResponse struct {

// ConsumerFpResponse represents the finality provider data returned by the contract query.
// For more details, refer to the following links:
// https://github.com/babylonchain/babylon-contract/blob/v0.7.0/contracts/btc-staking/src/msg.rs
// https://github.com/babylonchain/babylon-contract/blob/v0.7.0/contracts/btc-staking/schema/btc-staking.json
// https://github.com/babylonlabs-io/babylon-contract/blob/v0.7.0/contracts/btc-staking/src/msg.rs
// https://github.com/babylonlabs-io/babylon-contract/blob/v0.7.0/contracts/btc-staking/schema/btc-staking.json
type ConsumerFpResponse struct {
BtcPkHex string `json:"btc_pk_hex"`
SlashedHeight uint64 `json:"slashed_height"`
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/configurer/chain/queries_btcstaking_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/url"
"strconv"

"github.com/babylonchain/babylon/test/e2e/util"
bsctypes "github.com/babylonchain/babylon/x/btcstkconsumer/types"
"github.com/babylonlabs-io/babylon/test/e2e/util"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
"github.com/cosmos/cosmos-sdk/types/query"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion testutil/datagen/btcstkconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package datagen
import (
"math/rand"

bsctypes "github.com/babylonchain/babylon/x/btcstkconsumer/types"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
)

func GenRandomConsumerRegister(r *rand.Rand) *bsctypes.ConsumerRegister {
Expand Down
Loading

0 comments on commit ce31233

Please sign in to comment.