Skip to content

Commit

Permalink
latest I can take LSM module without forking WASMD and IBC
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Aug 23, 2023
1 parent 94b7cc4 commit bc2168a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 131 deletions.
13 changes: 8 additions & 5 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func NewAppKeepers(
appKeepers.keys[stakingtypes.StoreKey],
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
// govModAddress,
appKeepers.GetSubspace(stakingtypes.ModuleName), // TODO: Remove
)
appKeepers.MintKeeper = mintkeeper.NewKeeper(
appCodec,
Expand All @@ -263,6 +263,7 @@ func NewAppKeepers(
appKeepers.DistrKeeper = distrkeeper.NewKeeper(
appCodec,
appKeepers.keys[distrtypes.StoreKey],
appKeepers.GetSubspace(distrtypes.ModuleName), // TODO: Remove
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
stakingKeeper,
Expand All @@ -271,10 +272,10 @@ func NewAppKeepers(
)
appKeepers.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec,
cdc,
// cdc,
appKeepers.keys[slashingtypes.StoreKey],
stakingKeeper,
govModAddress,
appKeepers.GetSubspace(distrtypes.ModuleName),
)

invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
Expand Down Expand Up @@ -496,7 +497,8 @@ func NewAppKeepers(
"/cosmos.gov.v1beta1.Query/Vote": &govv1.QueryVoteResponse{},

// distribution
"/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationRewardsResponse{},
// "/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationRewardsResponse{},
"/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationTotalRewardsResponse{},

// staking
"/cosmos.staking.v1beta1.Query/Delegation": &stakingtypes.QueryDelegationResponse{},
Expand Down Expand Up @@ -524,7 +526,8 @@ func NewAppKeepers(
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,

Check failure on line 528 in app/keepers/keepers.go

View workflow job for this annotation

GitHub Actions / test

cannot use appKeepers.StakingKeeper (variable of type *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper) as "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper value in argument to wasmkeeper.NewKeeper: *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper does not implement "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper (wrong type for method GetValidator)

Check failure on line 528 in app/keepers/keepers.go

View workflow job for this annotation

GitHub Actions / build

cannot use appKeepers.StakingKeeper (variable of type *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper) as "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper value in argument to wasmkeeper.NewKeeper: *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper does not implement "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper (wrong type for method GetValidator)

Check failure on line 528 in app/keepers/keepers.go

View workflow job for this annotation

GitHub Actions / lint

cannot use appKeepers.StakingKeeper (variable of type *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper) as "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper value in argument to wasmkeeper.NewKeeper: *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper does not implement "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper (wrong type for method GetValidator)

Check failure on line 528 in app/keepers/keepers.go

View workflow job for this annotation

GitHub Actions / lint

cannot use appKeepers.StakingKeeper (variable of type *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper) as "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper value in argument to wasmkeeper.NewKeeper: *"github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper".Keeper does not implement "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper (wrong type for method GetValidator)
distrkeeper.NewQuerier(appKeepers.DistrKeeper),
// distrkeeper.NewQuerier(appKeepers.DistrKeeper),
appKeepers.DistrKeeper,
appKeepers.IBCFeeKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
Expand Down
3 changes: 2 additions & 1 deletion app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import (
// and genesis verification.
var ModuleBasics = module.NewBasicManager(
auth.AppModuleBasic{},
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
genutil.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
staking.AppModuleBasic{},
Expand Down Expand Up @@ -134,6 +134,7 @@ func appModules(
gov.NewAppModule(appCodec, &app.AppKeepers.GovKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
mint.NewAppModule(appCodec, app.AppKeepers.MintKeeper, app.AppKeepers.AccountKeeper, bondDenom),
slashing.NewAppModule(appCodec, app.AppKeepers.SlashingKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.AppKeepers.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)),
// distr.NewAppModule(appCodec, app.AppKeepers.DistrKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.AppKeepers.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
distr.NewAppModule(appCodec, app.AppKeepers.DistrKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.AppKeepers.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
staking.NewAppModule(appCodec, app.AppKeepers.StakingKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(app.AppKeepers.UpgradeKeeper),
Expand Down
30 changes: 14 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0

// merge-main-to-47 branch (unsure which is the correct)
github.com/iqlusioninc/liquidity-staking-module v1.0.1-0.20230508005656-8a39536dd357
github.com/iqlusioninc/liquidity-staking-module v1.0.1-0.20230508005656-8a39536dd357
github.com/prometheus/client_golang v1.16.0
github.com/skip-mev/pob v1.0.4
github.com/spf13/cast v1.5.1
Expand All @@ -47,7 +47,6 @@ require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -58,19 +57,13 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230226194802-02d779ffbc46 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.0.0-rc.1 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.21.0-beta.1 // indirect
github.com/cosmos/iavl v0.21.1 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
Expand All @@ -87,7 +80,6 @@ require (
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand Down Expand Up @@ -128,11 +120,9 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect; indirectprotobuf
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -154,7 +144,6 @@ require (
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.29.1 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
Expand Down Expand Up @@ -191,10 +180,16 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

// TODO: remove
require cosmossdk.io/simapp v0.0.0-20230320103358-f4a6feb9d4ee // indirect

replace (
// cosmos keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

// remove bc of the LSM
github.com/cosmos/iavl => github.com/cosmos/iavl v0.20.0

// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand All @@ -203,9 +198,12 @@ replace (
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0

// github.com/Reecepbcups/liquidity-staking-module@reece-sdk-v47
// github.com/iqlusioninc/liquidity-staking-module v1.0.1-0.20230508005656-8a39536dd357 => /home/reece/Desktop/liquidity-staking-module
github.com/iqlusioninc/liquidity-staking-module v1.0.1-0.20230508005656-8a39536dd357 => github.com/Reecepbcups/liquidity-staking-module v1.0.1-0.20230823165441-d1796c7c88cf

// TODO: for LSM right now
// https://github.com/cosmos/cosmos-sdk/issues/14949
// pin the version of goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 required by SDK v47 upgrade guide.
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)

// replace github.com/skip-mev/pob => ../pob
Loading

0 comments on commit bc2168a

Please sign in to comment.