Skip to content

Commit

Permalink
Merge pull request #258 from persistenceOne/f/stkxprt
Browse files Browse the repository at this point in the history
feat: liquidstake stkxprt
  • Loading branch information
Max Kupriianov authored Dec 2, 2023
2 parents b8497f5 + eec4f0b commit 2754372
Show file tree
Hide file tree
Showing 20 changed files with 518 additions and 86 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
- "ictest-ibchooks"
- "ictest-pfm"
- "ictest-lsm"
- "ictest-liquidstake"
fail-fast: false

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ build/
release/
bin/

.DS_Store
*.swp
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ ictest-lsm: rm-testcache
ictest-haltfork: rm-testcache
cd interchaintest && go test -race -v -run TestPersistenceLSMHaltFork .

# Executes Liquidstake tests
ictest-liquidstake: rm-testcache
cd interchaintest && go test -race -v -run TestLiquidStakeStkXPRT .

rm-testcache:
go clean -testcache

.PHONY: test ictest-all ictest-basic ictest-ibchooks ictest-pfm ictest-upgrade ictest-upgrade-local ictest-ibc ictest-pob ictest-lsm
.PHONY: test ictest-all ictest-basic ictest-ibchooks ictest-pfm ictest-upgrade ictest-upgrade-local ictest-ibc ictest-pob ictest-lsm ictest-liquidstake
16 changes: 16 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ import (
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
oraclekeeper "github.com/persistenceOne/persistence-sdk/v2/x/oracle/keeper"
oracletypes "github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
liquidstakekeeper "github.com/persistenceOne/pstake-native/v2/x/liquidstake/keeper"
liquidstaketypes "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"
"github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc"
liquidstakeibckeeper "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/keeper"
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"
Expand Down Expand Up @@ -126,6 +128,7 @@ type AppKeepers struct {
InterchainQueryKeeper *interchainquerykeeper.Keeper
TransferHooksKeeper *ibchookerkeeper.Keeper
LiquidStakeIBCKeeper *liquidstakeibckeeper.Keeper
LiquidStakeKeeper *liquidstakekeeper.Keeper
ConsensusParamsKeeper *consensusparamskeeper.Keeper
GroupKeeper *groupkeeper.Keeper
PacketForwardKeeper *packetforwardkeeper.Keeper
Expand Down Expand Up @@ -433,6 +436,19 @@ func NewAppKeeper(
)
appKeepers.LiquidStakeIBCKeeper = &liquidStakeIBCKeeper

liquidStakeKeeper := liquidstakekeeper.NewKeeper(
appCodec,
appKeepers.keys[liquidstaketypes.StoreKey],
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
appKeepers.DistributionKeeper,
appKeepers.SlashingKeeper,
bApp.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
appKeepers.LiquidStakeKeeper = &liquidStakeKeeper

err := appKeepers.InterchainQueryKeeper.SetCallbackHandler(liquidstakeibctypes.ModuleName, appKeepers.LiquidStakeIBCKeeper.CallbackHandler())
if err != nil {
panic(err)
Expand Down
2 changes: 2 additions & 0 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/persistenceOne/persistence-sdk/v2/x/halving"
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
oracletypes "github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
liquidstaketypes "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"
buildertypes "github.com/skip-mev/pob/x/builder/types"
)
Expand Down Expand Up @@ -61,6 +62,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
icahosttypes.StoreKey,
interchainquerytypes.StoreKey,
liquidstakeibctypes.StoreKey,
liquidstaketypes.StoreKey,
minttypes.StoreKey,
oracletypes.StoreKey,
paramstypes.StoreKey,
Expand Down
2 changes: 2 additions & 0 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/persistenceOne/persistence-sdk/v2/x/ibchooker"
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery"
"github.com/persistenceOne/persistence-sdk/v2/x/oracle"
"github.com/persistenceOne/pstake-native/v2/x/liquidstake"
"github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc"
"github.com/persistenceOne/pstake-native/v2/x/lscosmos"
buildermodule "github.com/skip-mev/pob/x/builder"
Expand Down Expand Up @@ -84,6 +85,7 @@ var AppModuleBasics = []module.AppModuleBasic{
oracle.AppModuleBasic{},
lscosmos.AppModuleBasic{},
liquidstakeibc.AppModuleBasic{},
liquidstake.AppModuleBasic{},
consensus.AppModuleBasic{},
groupmodule.AppModuleBasic{},
ibchooks.AppModuleBasic{},
Expand Down
7 changes: 7 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import (
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
"github.com/persistenceOne/persistence-sdk/v2/x/oracle"
oracletypes "github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
"github.com/persistenceOne/pstake-native/v2/x/liquidstake"
liquidstaketypes "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"
"github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc"
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"
"github.com/skip-mev/pob/x/builder"
Expand All @@ -81,6 +83,7 @@ var ModuleAccountPermissions = map[string][]string{
liquidstakeibctypes.DepositModuleAccount: nil,
liquidstakeibctypes.UndelegationModuleAccount: {authtypes.Burner},
buildertypes.ModuleName: nil,
liquidstaketypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}

var receiveAllowedMAcc = map[string]bool{
Expand Down Expand Up @@ -127,6 +130,7 @@ func appModules(
epochs.NewAppModule(*app.EpochsKeeper),
app.InterchainQueryModule,
liquidstakeibc.NewAppModule(*app.LiquidStakeIBCKeeper),
liquidstake.NewAppModule(*app.LiquidStakeKeeper),
oracle.NewAppModule(appCodec, *app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
builder.NewAppModule(appCodec, *app.BuilderKeeper),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
Expand Down Expand Up @@ -178,6 +182,7 @@ func orderBeginBlockers() []string {
ibchookertypes.ModuleName,
interchainquerytypes.ModuleName,
liquidstakeibctypes.ModuleName,
liquidstaketypes.ModuleName,
oracletypes.ModuleName,
}
}
Expand Down Expand Up @@ -214,6 +219,7 @@ func orderEndBlockers() []string {
ibchookertypes.ModuleName,
interchainquerytypes.ModuleName,
liquidstakeibctypes.ModuleName,
liquidstaketypes.ModuleName,
oracletypes.ModuleName,
buildertypes.ModuleName,
}
Expand Down Expand Up @@ -256,6 +262,7 @@ func orderInitGenesis() []string {
ibchookertypes.ModuleName,
interchainquerytypes.ModuleName,
liquidstakeibctypes.ModuleName,
liquidstaketypes.ModuleName,
oracletypes.ModuleName,
buildertypes.ModuleName,
}
Expand Down
5 changes: 4 additions & 1 deletion app/upgrades/v11/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
liquidstaketypes "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"
)

const (
Expand All @@ -15,6 +16,8 @@ var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{},
Added: []string{
liquidstaketypes.StoreKey,
},
},
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ require (
github.com/cosmos/ibc-go/v7 v7.1.0
github.com/gorilla/mux v1.8.1
github.com/persistenceOne/persistence-sdk/v2 v2.1.1
github.com/persistenceOne/pstake-native/v2 v2.6.0
github.com/persistenceOne/pstake-native/v2 v2.7.1
github.com/prometheus/client_golang v1.15.0
github.com/rakyll/statik v0.1.7
github.com/skip-mev/pob v1.0.1
github.com/spf13/cast v1.5.1
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
Expand Down Expand Up @@ -1022,8 +1022,8 @@ github.com/persistenceOne/persistence-sdk/v2 v2.1.1 h1:fo8Og2QkjsqqhH/wiEiOSB99M
github.com/persistenceOne/persistence-sdk/v2 v2.1.1/go.mod h1:6ufKMowypJB865CT5Gm6Gs42YCtSkX7k3ZqKzx63y+8=
github.com/persistenceOne/pob v1.0.3-lsm3 h1:dhJa84Lp5eKeyqwFrimrL8eQJ09CvlIPWH1WV3YGuEs=
github.com/persistenceOne/pob v1.0.3-lsm3/go.mod h1:kwZ0T3o6unLjnx8ynntI4v2WVJTPzvr1R+PI9pvH28k=
github.com/persistenceOne/pstake-native/v2 v2.6.0 h1:dRqQiGY3rvQA349riu6pHlsUSrV50YLGR0ZeOBtAXXg=
github.com/persistenceOne/pstake-native/v2 v2.6.0/go.mod h1:gew8e6tF5ufSnKyt6l7nxryqYEbZKOBponYO7m33x/o=
github.com/persistenceOne/pstake-native/v2 v2.7.1 h1:4rsAdABLLOf8ygy4ItHMnILFTTe6C9tP7mO5lpcpgW8=
github.com/persistenceOne/pstake-native/v2 v2.7.1/go.mod h1:ksqU+x2hb0hTwMjsPGtcbJmgCzG1u80dejTDUAsFqDU=
github.com/persistenceOne/wasmd v0.40.2-lsm3 h1:JdUu2TNEA+rJVYX7gt7EP/WUUA78f67joBOWtWAEShg=
github.com/persistenceOne/wasmd v0.40.2-lsm3/go.mod h1:xF6v70lqO7+Ys2wsfAHybuQXQI7IOqGf2LCq/XK8Fk8=
github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
Expand Down Expand Up @@ -1132,8 +1132,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
Expand Down
2 changes: 2 additions & 0 deletions interchaintest/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ A list of the contracts here which are pre-compiled in other repos.

> cw_template -> <https://github.com/CosmWasm/cw-template>
> ibchooks_counter.wasm -> <https://github.com/osmosis-labs/osmosis/blob/64393a14e18b2562d72a3892eec716197a3716c7/tests/ibc-hooks/bytecode/counter.wasm>
> dexter_superfluid_lp.wasm -> <https://github.com/dexter-zone/dexter_core/blob/betterclever/lsm-lp/artifacts/dexter_superfluid_lp-aarch64.wasm>
Binary file not shown.
30 changes: 14 additions & 16 deletions interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ module github.com/persistenceOne/persistenceCore/v11/interchaintest
go 1.21

require (
cosmossdk.io/math v1.1.2
cosmossdk.io/math v1.2.0
github.com/CosmWasm/wasmd v0.41.0
github.com/avast/retry-go/v4 v4.5.0
github.com/cometbft/cometbft v0.37.2
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v7 v7.3.0
github.com/persistenceOne/pstake-native/v2 v2.7.1
github.com/pkg/errors v0.9.1
github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230905210439-3e17efc70581
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.25.0
)

require (
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute v1.21.0 // indirect
cloud.google.com/go v0.110.7 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
Expand Down Expand Up @@ -98,7 +99,7 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -107,11 +108,11 @@ require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
Expand Down Expand Up @@ -164,10 +165,8 @@ require (
github.com/multiformats/go-multicodec v0.8.1 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/onsi/gomega v1.27.6 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect
Expand All @@ -184,11 +183,10 @@ require (
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
Expand All @@ -208,7 +206,7 @@ require (
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
Expand All @@ -217,10 +215,10 @@ require (
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.0 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading

0 comments on commit 2754372

Please sign in to comment.