Skip to content

Commit

Permalink
pass concrete keeper
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis committed Dec 3, 2024
1 parent 411d4ac commit 7a46385
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions x/babylon/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/babylonlabs-io/babylon-sdk/x/babylon/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -21,7 +22,7 @@ type Keeper struct {
cdc codec.Codec
bank types.BankKeeper
Staking types.StakingKeeper
wasm types.WasmKeeper
wasm *wasmkeeper.Keeper
// the address capable of executing a MsgUpdateParams message. Typically, this
// should be the x/gov module account.
authority string
Expand All @@ -34,7 +35,7 @@ func NewKeeper(
memoryStoreKey storetypes.StoreKey,
bank types.BankKeeper,
staking types.StakingKeeper,
wasm types.WasmKeeper,
wasm *wasmkeeper.Keeper,
authority string,
opts ...Option,
) *Keeper {
Expand Down
2 changes: 1 addition & 1 deletion x/babylon/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func NewTestKeepers(t testing.TB, opts ...keeper.Option) TestKeepers {
memKeys[types.MemStoreKey],
bankKeeper,
stakingKeeper,
wasmKeeper,
&wasmKeeper,
authority,
opts...,
)
Expand Down
4 changes: 2 additions & 2 deletions x/babylon/keeper/options.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package keeper

import "github.com/babylonlabs-io/babylon-sdk/x/babylon/types"
import wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

// option that is applied after keeper is setup with the VM. Used for decorators mainly.
type postOptsFn func(*Keeper)
Expand All @@ -10,7 +10,7 @@ func (f postOptsFn) apply(keeper *Keeper) {
}

// WithWasmKeeperDecorated can set a decorator to the wasm keeper
func WithWasmKeeperDecorated(cb func(types.WasmKeeper) types.WasmKeeper) Option {
func WithWasmKeeperDecorated(cb func(*wasmkeeper.Keeper) *wasmkeeper.Keeper) Option {
return postOptsFn(func(keeper *Keeper) {
keeper.wasm = cb(keeper.wasm)
})
Expand Down
4 changes: 4 additions & 0 deletions x/babylon/keeper/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k Keeper) StoreBabylonContracts(ctx sdk.Context) error {
return nil
}

func (k Keeper) getBTCStakingContractAddr(ctx sdk.Context) sdk.AccAddress {
// get address of the BTC staking contract
addrStr := k.GetParams(ctx).BtcStakingContractAddress
Expand Down

0 comments on commit 7a46385

Please sign in to comment.