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: liquidity module #2423

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2573951
add liquidity module for future removal
faddat Apr 20, 2023
7bbbfbe
add the liquidity module to the cosmos hub repo
faddat Apr 20, 2023
467055c
lint unused parameters
faddat Apr 20, 2023
d803572
ineffectual assignments
faddat Apr 20, 2023
4c695a0
ineffetual assignments
faddat Apr 20, 2023
5f34fa2
correct variable names
faddat Apr 20, 2023
e57bfc8
lint
faddat Apr 20, 2023
6e0beaa
lint the swap test
faddat Apr 20, 2023
2b49566
Merge branch 'main' into botique-modules-go-in-x
faddat Apr 20, 2023
418a5f4
Merge branch 'main' into botique-modules-go-in-x
faddat Apr 21, 2023
054c9ec
Merge remote-tracking branch 'origin/main' into botique-modules-go-in-x
faddat Apr 25, 2023
2e67308
fix redefinition of builtin types
faddat Apr 25, 2023
0905653
convert if-else to switch
faddat Apr 25, 2023
a597fc5
fix if-else chains
faddat Apr 25, 2023
2f31077
resolve empty block and additional testing improvements
faddat Apr 25, 2023
13d82df
fix protos
faddat Apr 25, 2023
2bbf3f3
update proto builder to v9
faddat Apr 28, 2023
66d59a2
Merge remote-tracking branch 'origin/main' into botique-modules-go-in-x
faddat May 3, 2023
f310dd5
Merge branch 'main' into use-ibc-proto-build
faddat May 6, 2023
4bcdc8e
make proto build stuff match main
faddat May 6, 2023
f71d499
Merge remote-tracking branch 'origin/main' into botique-modules-go-in-x
faddat May 8, 2023
3848dbb
build .proto files like most Cosmos projects
faddat May 3, 2023
77faa08
add the liquidity module to the cosmos hub, reducing the scope for error
faddat May 8, 2023
afb86c8
fix lint
faddat May 8, 2023
7f5e56d
Merge branch 'main' into botique-modules-go-in-x
faddat May 9, 2023
dad7b07
Merge branch 'main' into botique-modules-go-in-x
faddat May 9, 2023
7c50703
tidy
faddat May 9, 2023
a8c4ae8
fix
pysel May 10, 2023
a157186
Merge branch 'main' into botique-modules-go-in-x
faddat May 10, 2023
c2b374a
use the customized proto builder for this
faddat May 10, 2023
2c21074
return the version of go to 1.20
faddat May 10, 2023
174e7f0
Merge branch 'botique-modules-go-in-x' of https://github.com/faddat/g…
faddat May 10, 2023
d408fea
Merge branch 'main' into botique-modules-go-in-x
faddat May 11, 2023
ff31716
Merge remote-tracking branch 'origin/main' into botique-modules-go-in-x
faddat May 13, 2023
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
Next Next commit
add liquidity module for future removal
  • Loading branch information
faddat committed Apr 20, 2023
commit 2573951d2c07b45f1fdf9f016e7ff1faa36be7c6
4 changes: 2 additions & 2 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
@@ -42,6 +42,8 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gaia/v9/x/globalfee"
liquiditykeeper "github.com/cosmos/gaia/v9/x/liquidity/keeper"
liquiditytypes "github.com/cosmos/gaia/v9/x/liquidity/types"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper"
@@ -56,8 +58,6 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
ibcprovider "github.com/cosmos/interchain-security/x/ccv/provider"
ibcproviderkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper"
liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper"
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"
"github.com/strangelove-ventures/packet-forward-middleware/v4/router"
routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v4/router/keeper"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
2 changes: 1 addition & 1 deletion app/keepers/keys.go
Original file line number Diff line number Diff line change
@@ -16,11 +16,11 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
liquiditytypes "github.com/cosmos/gaia/v9/x/liquidity/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types"
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
)

4 changes: 2 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
@@ -38,6 +38,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gaia/v9/x/liquidity"
liquiditytypes "github.com/cosmos/gaia/v9/x/liquidity/types"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
@@ -48,8 +50,6 @@ import (
ibcprovider "github.com/cosmos/interchain-security/x/ccv/provider"
ibcproviderclient "github.com/cosmos/interchain-security/x/ccv/provider/client"
providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types"
"github.com/gravity-devs/liquidity/x/liquidity"
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"
"github.com/strangelove-ventures/packet-forward-middleware/v4/router"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"

9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -11,13 +11,12 @@ require (
github.com/golang/protobuf v1.5.3
github.com/golangci/golangci-lint v1.52.2
github.com/gorilla/mux v1.8.0
github.com/gravity-devs/liquidity v1.5.3
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1 // indirect
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4
github.com/stretchr/testify v1.8.2
@@ -29,7 +28,10 @@ require (

require (
cosmossdk.io/math v1.0.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2
github.com/ory/dockertest/v3 v3.9.1
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8
gopkg.in/yaml.v2 v2.4.0
)

require (
@@ -155,7 +157,6 @@ require (
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
@@ -294,9 +295,7 @@ require (
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.4.3 // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1638,8 +1638,6 @@ github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Rep
github.com/gotestyourself/gotestyourself v1.4.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/gravity-devs/liquidity v1.5.3 h1:QbMHk1q+dzlM76Zv3vxaHhq4lBdhaelB0g7NmLbsv2Q=
github.com/gravity-devs/liquidity v1.5.3/go.mod h1:ULtNk738lNb1Kh31larCNxZ7IK21TeKZmNzS/OkE0hw=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
27 changes: 27 additions & 0 deletions proto/tendermint/liquidity/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";
package tendermint.liquidity.v1beta1;

import "tendermint/liquidity/v1beta1/liquidity.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/gaia/v9/x/liquidity/types";

// records the state of each pool after genesis export or import, used to check variables
message PoolRecord {
Pool pool = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"pool\""];
PoolMetadata pool_metadata = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"pool_metadata\""];
PoolBatch pool_batch = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"pool_batch\""];
repeated DepositMsgState deposit_msg_states = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_msg_states\""];
repeated WithdrawMsgState withdraw_msg_states = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"withdraw_msg_states\""];
repeated SwapMsgState swap_msg_states = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"swap_msg_states\""];
}

// GenesisState defines the liquidity module's genesis state.
message GenesisState {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// params defines all the parameters for the liquidity module.
Params params = 1 [(gogoproto.nullable) = false];
repeated PoolRecord pool_records = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"pools\""];
}
Loading