Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wasmd clean up and updates #387

Merged
merged 4 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func NewComposableApp(
consensusparamtypes.ModuleName,
wasm08types.ModuleName,
icatypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
alliancemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
composable "github.com/notional-labs/composable/v6/app"
"github.com/stretchr/testify/require"

Expand All @@ -29,6 +28,7 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/cosmos/ibc-go/v7/testing/mock"
)

Expand Down Expand Up @@ -89,7 +89,7 @@ func Setup(t *testing.T, isCheckTx bool, invCheckPeriod uint) *composable.Compos
return app
}

func setup(withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*composable.ComposableApp, composable.GenesisState) {
func setup(withGenesis bool, invCheckPeriod uint, opts ...wasmkeeper.Option) (*composable.ComposableApp, composable.GenesisState) {
db := dbm.NewMemDB()
encCdc := composable.MakeEncodingConfig()
app := composable.NewComposableApp(
Expand Down
3 changes: 2 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
appKeepers.DistrKeeper,
authtypes.FeeCollectorName,
)

appKeepers.BankKeeper.RegisterKeepers(appKeepers.AllianceKeeper, appKeepers.StakingKeeper)
Expand All @@ -228,7 +229,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(

govModuleAuthority := authtypes.NewModuleAddress(govtypes.ModuleName).String()

appKeepers.Wasm08Keeper = wasmclientkeeper.NewKeeperWithVM(appCodec, appKeepers.keys[wasm08types.StoreKey], govModuleAuthority, homePath, &appKeepers.IBCKeeper.ClientKeeper)
appKeepers.Wasm08Keeper = wasmclientkeeper.NewKeeperWithVM(appCodec, appKeepers.keys[wasm08types.StoreKey], &appKeepers.IBCKeeper.ClientKeeper, govModuleAuthority, vm, bApp.GRPCQueryRouter())

// ICA Host keeper
appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper(
Expand Down
4 changes: 2 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
minttypes "github.com/notional-labs/composable/v6/x/mint/types"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -71,7 +71,7 @@ func setup(tb testing.TB, withGenesis bool, invCheckPeriod uint) (*ComposableApp
baseAppOpts := []func(*baseapp.BaseApp){baseapp.SetSnapshot(snapshotStore, types.SnapshotOptions{
KeepRecent: 2,
})}
var wasmOpts []wasm.Option
var wasmOpts []wasmkeeper.Option
db := dbm.NewMemDB()
app := NewComposableApp(
log.NewNopLogger(),
Expand Down
15 changes: 7 additions & 8 deletions cmd/centaurid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import (
"io"
"os"

"github.com/CosmWasm/wasmd/x/wasm"
"github.com/notional-labs/composable/v6/app"
"github.com/spf13/cast"
"github.com/spf13/cobra"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/debug"
Expand All @@ -28,11 +32,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"

dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
)

var ChainID string
Expand Down Expand Up @@ -266,7 +265,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a

baseappOptions := server.DefaultBaseappOptions(appOpts)

var emptyWasmOpts []wasm.Option
var emptyWasmOpts []wasmkeeper.Option
newApp := app.NewComposableApp(
logger, db, traceStore, true,
skipUpgradeHeights,
Expand All @@ -293,7 +292,7 @@ func (a appCreator) appExport(
if !ok || homePath == "" {
return servertypes.ExportedApp{}, errors.New("application home not set")
}
var emptyWasmOpts []wasm.Option
var emptyWasmOpts []wasmkeeper.Option

if height != -1 {
anApp = app.NewComposableApp(
Expand Down
63 changes: 63 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
description = "composable-cosmos";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
];
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aaarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [ pkgs.go pkgs.gnumake ];
};
};
};
};
}
Loading