From 957cf62ecc20376e4c49f29b0d9232fc2f7630ff Mon Sep 17 00:00:00 2001 From: stackman27 Date: Tue, 25 Jul 2023 17:18:45 -0700 Subject: [PATCH] feat: CreateCLPool & LinkCFMMtoCL pool into one gov-prop --- CHANGELOG.md | 1 + app/keepers/modules.go | 1 + go.mod | 2 +- go.sum | 2 - .../osmosis/concentrated-liquidity/gov.proto | 1 + proto/osmosis/gamm/v1beta1/gov.proto | 39 + x/concentrated-liquidity/gov.go | 1 + x/concentrated-liquidity/types/gov.pb.go | 78 +- x/gamm/client/cli/flags.go | 2 + x/gamm/client/cli/tx.go | 134 +++ x/gamm/client/proposal_handler.go | 5 +- x/gamm/client/rest/tx.go | 7 + x/gamm/handler.go | 6 + x/gamm/keeper/gov.go | 59 ++ x/gamm/types/codec.go | 2 + x/gamm/types/expected_keepers.go | 3 + x/gamm/types/gov.go | 88 +- x/gamm/types/gov.pb.go | 798 +++++++++++++++++- 18 files changed, 1158 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9125ed0c6a..bcb3273e395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#5534](https://github.com/osmosis-labs/osmosis/pull/5534) fix: fix the account number of x/tokenfactory module account * [#5750](https://github.com/osmosis-labs/osmosis/pull/5750) feat: add cli commmand for converting proto structs to proto marshalled bytes +* [#5890](https://github.com/osmosis-labs/osmosis/pull/5890) feat: CreateCLPool & LinkCFMMtoCL pool into one gov-prop ### Minor improvements & Bug Fixes diff --git a/app/keepers/modules.go b/app/keepers/modules.go index 4f8dbb039a8..4f83f48a050 100644 --- a/app/keepers/modules.go +++ b/app/keepers/modules.go @@ -82,6 +82,7 @@ var AppModuleBasics = []module.AppModuleBasic{ superfluidclient.UpdateUnpoolWhitelistProposalHandler, gammclient.ReplaceMigrationRecordsProposalHandler, gammclient.UpdateMigrationRecordsProposalHandler, + gammclient.CreateCLPoolAndLinkToCFMMProposalHandler, clclient.CreateConcentratedLiquidityPoolProposalHandler, clclient.TickSpacingDecreaseProposalHandler, cwpoolclient.UploadCodeIdAndWhitelistProposalHandler, diff --git a/go.mod b/go.mod index 125ffbabe5d..22df7304747 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 github.com/CosmWasm/wasmd v0.31.0 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/cosmos-sdk v0.47.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-apps/modules/async-icq/v4 v4.0.0-20230524151648-c02fa46c2860 github.com/cosmos/ibc-go/v4 v4.3.1 diff --git a/go.sum b/go.sum index 11253d7df11..5b5a72bfaef 100644 --- a/go.sum +++ b/go.sum @@ -950,8 +950,6 @@ github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:Ylmch github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230629191111-f375469de8b6 h1:Kmkx5Rh72+LB8AL6dc6fZA+IVR0INu0YIiMF2ScDhaQ= github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230629191111-f375469de8b6/go.mod h1:JTym95/bqrSnG5MPcXr1YDhv43JdCeo3p+iDbazoX68= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230709024311-81c831b050de h1:W2lMduMgpNA5zheEIIialw08n1pWJ44Y4t2F924tpDU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230709024311-81c831b050de/go.mod h1:Pl8Nzx6O6ow/+aqfMoMSz4hX+zz6RrnDYsooptECGxM= github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230715164027-b45d8bd42434 h1:MXPrA3sDtqOHYUa9zl4HMGMW+IJwGMqUf6+Hl9nhrCA= github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230715164027-b45d8bd42434/go.mod h1:Pl8Nzx6O6ow/+aqfMoMSz4hX+zz6RrnDYsooptECGxM= github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304 h1:RIrWLzIiZN5Xd2JOfSOtGZaf6V3qEQYg6EaDTAkMnCo= diff --git a/proto/osmosis/concentrated-liquidity/gov.proto b/proto/osmosis/concentrated-liquidity/gov.proto index a86ebd1e1f5..806ff7a8eab 100644 --- a/proto/osmosis/concentrated-liquidity/gov.proto +++ b/proto/osmosis/concentrated-liquidity/gov.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package osmosis.concentratedliquidity.v1beta1; import "gogoproto/gogo.proto"; +import "osmosis/gamm/v1beta1/shared.proto"; option go_package = "github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/types"; diff --git a/proto/osmosis/gamm/v1beta1/gov.proto b/proto/osmosis/gamm/v1beta1/gov.proto index b66d63c1643..92d0f251449 100644 --- a/proto/osmosis/gamm/v1beta1/gov.proto +++ b/proto/osmosis/gamm/v1beta1/gov.proto @@ -58,3 +58,42 @@ message UpdateMigrationRecordsProposal { repeated BalancerToConcentratedPoolLink records = 3 [ (gogoproto.nullable) = false ]; } + +message PoolRecordWithCFMMLink { + option (gogoproto.equal) = true; + + string denom0 = 1 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 2 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + uint64 tick_spacing = 3 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + string exponent_at_price_one = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"exponent_at_price_one\"", + (gogoproto.nullable) = false + ]; + string spread_factor = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; + uint64 balancer_pool_id = 6 + [ (gogoproto.moretags) = "yaml:\"balancer_pool_id\"" ]; +} + +// CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type +// for creating concentrated liquidity pools and linking it to a CFMM pool. +message CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = + "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated PoolRecordWithCFMMLink pool_records_with_cfmm_link = 3 [ + (gogoproto.moretags) = "yaml:\"create_cl_pool_and_link_to_cfmm\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/x/concentrated-liquidity/gov.go b/x/concentrated-liquidity/gov.go index 0f74215983a..6d691e3ce55 100644 --- a/x/concentrated-liquidity/gov.go +++ b/x/concentrated-liquidity/gov.go @@ -9,6 +9,7 @@ import ( clmodel "github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v16/x/poolmanager/types" ) diff --git a/x/concentrated-liquidity/types/gov.pb.go b/x/concentrated-liquidity/types/gov.pb.go index 85d27755728..bf0389aa91f 100644 --- a/x/concentrated-liquidity/types/gov.pb.go +++ b/x/concentrated-liquidity/types/gov.pb.go @@ -8,6 +8,7 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/osmosis-labs/osmosis/v16/x/gamm/types/migration" io "io" math "math" math_bits "math/bits" @@ -237,44 +238,45 @@ func init() { } var fileDescriptor_e6d167276ceeedc2 = []byte{ - // 584 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0x4e, 0x6c, 0xb7, 0xe2, 0xb4, 0x2b, 0x1a, 0x2b, 0x5b, 0x77, 0x25, 0x29, 0x01, 0xa5, 0x1e, - 0x9a, 0x18, 0x05, 0x0f, 0x3d, 0x69, 0x77, 0x59, 0x58, 0x10, 0x2d, 0x71, 0x4f, 0x22, 0x84, 0x74, - 0x32, 0xd6, 0xa1, 0xe9, 0x4c, 0x36, 0x33, 0xdb, 0xdd, 0x1e, 0xbd, 0x09, 0x5e, 0xbc, 0x08, 0x1e, - 0xfb, 0x73, 0xf6, 0xb8, 0x47, 0xf1, 0x10, 0xa4, 0xbd, 0x78, 0xb5, 0xbf, 0x40, 0x32, 0x93, 0xb6, - 0xe9, 0x6a, 0xc1, 0x65, 0x4f, 0xc9, 0x7b, 0xf3, 0xbd, 0xf7, 0x7d, 0xdf, 0x7b, 0xc3, 0x80, 0x06, - 0x65, 0x03, 0xca, 0x30, 0xb3, 0x21, 0x25, 0x10, 0x11, 0x1e, 0xfb, 0x1c, 0x05, 0xcd, 0x10, 0x1f, - 0x1d, 0xe3, 0x00, 0xf3, 0x91, 0xdd, 0xa3, 0x43, 0x2b, 0x8a, 0x29, 0xa7, 0xda, 0x83, 0x0c, 0x69, - 0xe5, 0x91, 0x0b, 0xa0, 0x35, 0x74, 0xba, 0x88, 0xfb, 0xce, 0x76, 0xb5, 0x47, 0x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0xce, 0x12, 0xa3, 0x2a, 0xa9, 0x57, 0x9a, - 0x99, 0x6e, 0x45, 0xc6, 0xfb, 0x22, 0x94, 0x7b, 0x69, 0xbf, 0x3b, 0x9b, 0xe8, 0xea, 0xf9, 0x44, - 0x57, 0x7f, 0x4e, 0x74, 0xf5, 0xcb, 0x54, 0x57, 0xce, 0xa7, 0xba, 0xf2, 0x7d, 0xaa, 0x2b, 0x6f, - 0xdb, 0x39, 0xb6, 0xec, 0x4e, 0x36, 0x43, 0xbf, 0xcb, 0xe6, 0x81, 0x3d, 0x74, 0x9e, 0xd9, 0xa7, - 0xeb, 0x9e, 0x1d, 0xa1, 0xa6, 0x5b, 0x12, 0x8f, 0xc7, 0xd3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x35, 0x64, 0x88, 0x0b, 0xa5, 0x04, 0x00, 0x00, + // 600 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6b, 0xd4, 0x4e, + 0x18, 0x4f, 0xfe, 0xbb, 0xed, 0x1f, 0x67, 0xb7, 0xa2, 0xb1, 0xd2, 0xb5, 0x95, 0xa4, 0x06, 0x94, + 0xf5, 0xd0, 0xc4, 0x28, 0x78, 0xd8, 0x93, 0x6e, 0x4b, 0xa1, 0x20, 0x5a, 0x62, 0x4f, 0x22, 0x84, + 0xd9, 0xc9, 0x98, 0x0e, 0x9b, 0xcc, 0xa4, 0x33, 0xd3, 0xb7, 0xa3, 0x37, 0xc1, 0x8b, 0x17, 0xc1, + 0x63, 0x3f, 0x4e, 0x8f, 0x3d, 0x8a, 0x87, 0x20, 0xdd, 0x8b, 0x57, 0xf7, 0x13, 0x48, 0x66, 0xb2, + 0x6d, 0x5a, 0x5d, 0xb0, 0x78, 0x4a, 0x9e, 0x67, 0x7e, 0xf3, 0x7b, 0x99, 0x67, 0x18, 0xd0, 0x65, + 0x22, 0x63, 0x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69, 0x8b, 0xa0, 0xe1, 0xeb, 0x1c, 0x22, + 0x42, 0x93, 0x35, 0x8c, 0x38, 0x86, 0x02, 0xff, 0x73, 0xb0, 0x8f, 0x26, 0x70, 0x94, 0x09, 0x12, + 0x47, 0x92, 0x45, 0x92, 0xa0, 0x61, 0x24, 0xb4, 0xc6, 0xa5, 0xb0, 0xcf, 0xae, 0x10, 0x76, 0x23, + 0xde, 0x62, 0x35, 0xb7, 0x55, 0xf6, 0x66, 0x99, 0x3d, 0x5c, 0xcc, 0xa7, 0x01, 0x2e, 0x67, 0x8e, + 0xc1, 0x9d, 0xa9, 0x64, 0xd6, 0x02, 0xf8, 0xbf, 0xf2, 0xad, 0x22, 0x37, 0xc3, 0x59, 0xcd, 0x6b, + 0x75, 0xc1, 0x0d, 0x8a, 0xf7, 0x2f, 0x24, 0x51, 0xc1, 0x9b, 0xe1, 0x75, 0x8a, 0xf7, 0x6b, 0x44, + 0xbd, 0xa6, 0x52, 0xf9, 0xdc, 0x00, 0xe0, 0x7c, 0x40, 0xd6, 0x43, 0x30, 0x1b, 0x63, 0xca, 0xb2, + 0x47, 0xfa, 0x24, 0xfb, 0x37, 0xc7, 0x85, 0x33, 0xa7, 0x87, 0xa5, 0xfb, 0x6e, 0x58, 0x01, 0xce, + 0xa0, 0x81, 0x3e, 0xd8, 0xdf, 0xa0, 0xc1, 0x04, 0x1a, 0x58, 0x3d, 0xd0, 0xbe, 0x60, 0xa8, 0x51, + 0x1a, 0xea, 0x2f, 0x9c, 0x5f, 0x84, 0xfa, 0xaa, 0x1b, 0xb6, 0xe4, 0xb9, 0x4d, 0xeb, 0xbd, 0x09, + 0x6e, 0xe3, 0x83, 0x9c, 0x51, 0x4c, 0x65, 0x04, 0x65, 0x94, 0x73, 0x82, 0x70, 0xc4, 0x28, 0xee, + 0x34, 0x95, 0xec, 0xcb, 0xf2, 0x58, 0xbf, 0x15, 0xce, 0x83, 0x84, 0xc8, 0xed, 0xdd, 0x81, 0x87, + 0x58, 0xe6, 0x23, 0x35, 0xab, 0xea, 0xb3, 0x22, 0xe2, 0xa1, 0x2f, 0x0f, 0x73, 0x2c, 0xbc, 0x0d, + 0x2a, 0xc7, 0x85, 0x73, 0x57, 0x6b, 0xfe, 0x91, 0xd4, 0x0d, 0xad, 0x49, 0xff, 0xb9, 0xdc, 0x2c, + 0xbb, 0xaf, 0x28, 0xb6, 0x86, 0x60, 0x4e, 0xe4, 0x1c, 0xc3, 0x38, 0x7a, 0x07, 0x91, 0x64, 0xbc, + 0x33, 0xa3, 0xa4, 0xd7, 0xaf, 0x20, 0xbd, 0x86, 0xd1, 0xb8, 0x70, 0xe6, 0xb5, 0xf4, 0x05, 0x32, + 0x37, 0x6c, 0xeb, 0x7a, 0x5d, 0x95, 0x7a, 0x2e, 0xfd, 0xb7, 0xc7, 0xa7, 0xb6, 0x79, 0x72, 0x6a, + 0x9b, 0xdf, 0x4f, 0x6d, 0xf3, 0xd3, 0xc8, 0x36, 0x4e, 0x46, 0xb6, 0xf1, 0x75, 0x64, 0x1b, 0x6f, + 0xfa, 0x35, 0xb5, 0xea, 0x4e, 0xae, 0xa4, 0x70, 0x20, 0x26, 0x85, 0xbf, 0x17, 0x3c, 0xf5, 0x0f, + 0xa6, 0xbd, 0x4c, 0xca, 0xcd, 0x60, 0x56, 0x3d, 0x1e, 0x4f, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, + 0xf5, 0x20, 0x8a, 0x36, 0xc8, 0x04, 0x00, 0x00, } func (this *CreateConcentratedLiquidityPoolsProposal) Equal(that interface{}) bool { diff --git a/x/gamm/client/cli/flags.go b/x/gamm/client/cli/flags.go index 29d6d610758..1b0b84536ab 100644 --- a/x/gamm/client/cli/flags.go +++ b/x/gamm/client/cli/flags.go @@ -42,6 +42,8 @@ const ( FlagScalingFactors = "scaling-factors" FlagMigrationRecords = "migration-records" + + FlagPoolRecords = "pool-records" ) type createBalancerPoolInputs struct { diff --git a/x/gamm/client/cli/tx.go b/x/gamm/client/cli/tx.go index e5d08bbc63c..7fe1fb3361d 100644 --- a/x/gamm/client/cli/tx.go +++ b/x/gamm/client/cli/tx.go @@ -295,6 +295,59 @@ Ex) 2,4,1,5 -> [(Balancer 2, CL 4), (Balancer 1, CL 5)] return cmd } +// NewCmdSubmitUpdateMigrationRecordsProposal implements a command handler for update migration records proposal +func NewCmdSubmitCreateCLPoolAndLinkToCFMMProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-cl-pool-and-cfmm-link [flags]", + Args: cobra.ExactArgs(0), + Short: "Submit a create clpool and link to cfmm proposal", + Long: strings.TrimSpace(`Submit a update migration record proposal. + + `), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + content, err := parseCreateConcentratedLiquidityPoolArgsToContent(cmd) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + cmd.Flags().Bool(govcli.FlagIsExpedited, false, "If true, makes the proposal an expedited one") + cmd.Flags().String(govcli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") + cmd.Flags().String(FlagPoolRecords, "", "The pool records array") + + return cmd +} + func BuildCreatePoolCmd(clientCtx client.Context, args []string, fs *flag.FlagSet) (sdk.Msg, error) { poolType, err := fs.GetString(FlagPoolType) if err != nil { @@ -714,3 +767,84 @@ func parseUpdateMigrationRecordsArgsToContent(cmd *cobra.Command) (govtypes.Cont } return content, nil } + +func parseCreateConcentratedLiquidityPoolArgsToContent(cmd *cobra.Command) (govtypes.Content, error) { + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return nil, err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return nil, err + } + + poolRecordsWithCFMMLink, err := parsePoolRecordsWithCFMMLink(cmd) + if err != nil { + return nil, err + } + + content := &types.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{ + Title: title, + Description: description, + PoolRecordsWithCfmmLink: poolRecordsWithCFMMLink, + } + + return content, nil +} + +func parsePoolRecordsWithCFMMLink(cmd *cobra.Command) ([]types.PoolRecordWithCFMMLink, error) { + poolRecordsStr, err := cmd.Flags().GetString(FlagPoolRecords) + if err != nil { + return nil, err + } + + poolRecordsWithCFMMLink := strings.Split(poolRecordsStr, ",") + + if len(poolRecordsWithCFMMLink)%6 != 0 { + return nil, fmt.Errorf("poolRecordswithCFMMLink must be a list of denom0, denom1, tickSpacing, exponentAtPriceOne, spreadFactor and balancerPoolId") + } + + finalPoolRecords := []types.PoolRecordWithCFMMLink{} + i := 0 + for i < len(poolRecordsWithCFMMLink) { + denom0 := poolRecordsWithCFMMLink[i] + denom1 := poolRecordsWithCFMMLink[i+1] + + tickSpacing, err := strconv.Atoi(poolRecordsWithCFMMLink[i+2]) + if err != nil { + return nil, err + } + + exponentAtPriceOneStr := poolRecordsWithCFMMLink[i+3] + exponentAtPriceOne, ok := sdk.NewIntFromString(exponentAtPriceOneStr) + if !ok { + return nil, fmt.Errorf("invalid exponentAtPriceOne: %s", exponentAtPriceOneStr) + } + + spreadFactorStr := poolRecordsWithCFMMLink[i+4] + spreadFactor, err := sdk.NewDecFromStr(spreadFactorStr) + if err != nil { + return nil, err + } + + balancerPoolId, err := strconv.Atoi(poolRecordsWithCFMMLink[i+5]) + if err != nil { + return nil, err + } + + finalPoolRecords = append(finalPoolRecords, types.PoolRecordWithCFMMLink{ + Denom0: denom0, + Denom1: denom1, + TickSpacing: uint64(tickSpacing), + ExponentAtPriceOne: exponentAtPriceOne, + SpreadFactor: spreadFactor, + BalancerPoolId: uint64(balancerPoolId), + }) + + // increase counter by the next 6 + i = i + 6 + } + + return finalPoolRecords, nil +} diff --git a/x/gamm/client/proposal_handler.go b/x/gamm/client/proposal_handler.go index 9abee4b4999..5dbffee7dbd 100644 --- a/x/gamm/client/proposal_handler.go +++ b/x/gamm/client/proposal_handler.go @@ -8,6 +8,7 @@ import ( ) var ( - ReplaceMigrationRecordsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitReplaceMigrationRecordsProposal, rest.ProposalReplaceMigrationRecordsRESTHandler) - UpdateMigrationRecordsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdateMigrationRecordsProposal, rest.ProposalUpdateMigrationRecordsRESTHandler) + ReplaceMigrationRecordsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitReplaceMigrationRecordsProposal, rest.ProposalReplaceMigrationRecordsRESTHandler) + UpdateMigrationRecordsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdateMigrationRecordsProposal, rest.ProposalUpdateMigrationRecordsRESTHandler) + CreateCLPoolAndLinkToCFMMProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitCreateCLPoolAndLinkToCFMMProposal, rest.ProposalCreateConcentratedLiquidityPoolAndLinkToCFMMHandler) ) diff --git a/x/gamm/client/rest/tx.go b/x/gamm/client/rest/tx.go index 29d089b48a3..a8691710a3e 100644 --- a/x/gamm/client/rest/tx.go +++ b/x/gamm/client/rest/tx.go @@ -21,6 +21,13 @@ func ProposalUpdateMigrationRecordsRESTHandler(clientCtx client.Context) govrest } } +func ProposalCreateConcentratedLiquidityPoolAndLinkToCFMMHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "create-cl-pool-and-cfmm-link", + Handler: emptyHandler(clientCtx), + } +} + func emptyHandler(clientCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { } diff --git a/x/gamm/handler.go b/x/gamm/handler.go index f8e663eec32..0df7663ad93 100644 --- a/x/gamm/handler.go +++ b/x/gamm/handler.go @@ -19,6 +19,8 @@ func NewMigrationRecordHandler(k keeper.Keeper) govtypes.Handler { return handleUpdateMigrationRecordsProposal(ctx, k, c) case *types.ReplaceMigrationRecordsProposal: return handleReplaceMigrationRecordsProposal(ctx, k, c) + case *types.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal: + return handleCreatingCLPoolAndLinkToCFMMProposal(ctx, k, c) default: return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized migration record proposal content type: %T", c) @@ -35,3 +37,7 @@ func handleReplaceMigrationRecordsProposal(ctx sdk.Context, k keeper.Keeper, p * func handleUpdateMigrationRecordsProposal(ctx sdk.Context, k keeper.Keeper, p *types.UpdateMigrationRecordsProposal) error { return k.HandleUpdateMigrationRecordsProposal(ctx, p) } + +func handleCreatingCLPoolAndLinkToCFMMProposal(ctx sdk.Context, k keeper.Keeper, p *types.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) error { + return k.HandleCreatingCLPoolAndLinkToCFMMProposal(ctx, p) +} diff --git a/x/gamm/keeper/gov.go b/x/gamm/keeper/gov.go index 7e8cf68d73d..d83cf844b07 100644 --- a/x/gamm/keeper/gov.go +++ b/x/gamm/keeper/gov.go @@ -1,9 +1,14 @@ package keeper import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + clmodel "github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v16/x/gamm/types" + gammmigration "github.com/osmosis-labs/osmosis/v16/x/gamm/types/migration" + poolmanagertypes "github.com/osmosis-labs/osmosis/v16/x/poolmanager/types" ) func (k Keeper) HandleReplaceMigrationRecordsProposal(ctx sdk.Context, p *types.ReplaceMigrationRecordsProposal) error { @@ -13,3 +18,57 @@ func (k Keeper) HandleReplaceMigrationRecordsProposal(ctx sdk.Context, p *types. func (k Keeper) HandleUpdateMigrationRecordsProposal(ctx sdk.Context, p *types.UpdateMigrationRecordsProposal) error { return k.UpdateMigrationRecords(ctx, p.Records) } + +func (k Keeper) HandleCreatingCLPoolAndLinkToCFMMProposal(ctx sdk.Context, p *types.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) error { + poolmanagerModuleAcc := k.accountKeeper.GetModuleAccount(ctx, poolmanagertypes.ModuleName) + poolCreatorAddress := poolmanagerModuleAcc.GetAddress() + + for _, record := range p.PoolRecordsWithCfmmLink { + cfmmPool, err := k.GetCFMMPool(ctx, record.BalancerPoolId) + if err != nil { + return err + } + + poolLiquidity := cfmmPool.GetTotalPoolLiquidity(ctx) + if len(poolLiquidity) != 2 { + return fmt.Errorf("can only have 2 denoms in CL pool") + } + + foundDenom0 := false + denom1 := "" + for _, coin := range poolLiquidity { + if coin.Denom == record.Denom0 { + foundDenom0 = true + } else { + denom1 = coin.Denom + } + } + + if !foundDenom0 { + return fmt.Errorf("desired denom (%s) was not found in the pool", record.Denom0) + } + + createPoolMsg := clmodel.NewMsgCreateConcentratedPool(poolCreatorAddress, record.Denom0, denom1, record.TickSpacing, record.SpreadFactor) + concentratedPool, err := k.poolManager.CreateConcentratedPoolAsPoolManager(ctx, createPoolMsg) + if err != nil { + return err + } + + // link the created cl pool with existing balancer pool + // Set the migration link in x/gamm. + // This will also migrate the CFMM distribution records to point to the new CL pool. + err = k.OverwriteMigrationRecordsAndRedirectDistrRecords(ctx, gammmigration.MigrationRecords{ + BalancerToConcentratedPoolLinks: []gammmigration.BalancerToConcentratedPoolLink{ + { + BalancerPoolId: record.BalancerPoolId, + ClPoolId: concentratedPool.GetId(), + }, + }, + }) + if err != nil { + return err + } + } + + return nil +} diff --git a/x/gamm/types/codec.go b/x/gamm/types/codec.go index b842641502f..45ad44fbfe9 100644 --- a/x/gamm/types/codec.go +++ b/x/gamm/types/codec.go @@ -23,6 +23,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgExitSwapShareAmountIn{}, "osmosis/gamm/exit-swap-share-amount-in", nil) cdc.RegisterConcrete(&UpdateMigrationRecordsProposal{}, "osmosis/gamm/update-migration-records-proposal", nil) cdc.RegisterConcrete(&ReplaceMigrationRecordsProposal{}, "osmosis/gamm/replace-migration-records-proposal", nil) + cdc.RegisterConcrete(&CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{}, "osmosis/gamm/create-cl-pool-and-cfmm-link", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -47,6 +48,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*govtypes.Content)(nil), &UpdateMigrationRecordsProposal{}, &ReplaceMigrationRecordsProposal{}, + &CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gamm/types/expected_keepers.go b/x/gamm/types/expected_keepers.go index cd7351ed9ae..b135fa4768e 100644 --- a/x/gamm/types/expected_keepers.go +++ b/x/gamm/types/expected_keepers.go @@ -23,6 +23,7 @@ type AccountKeeper interface { SetAccount(ctx sdk.Context, acc authtypes.AccountI) GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string) + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI } // BankKeeper defines the banking contract that must be fulfilled when @@ -91,6 +92,8 @@ type PoolManager interface { GetPoolModule(ctx sdk.Context, poolId uint64) (poolmanagertypes.PoolModuleI, error) GetPool(ctx sdk.Context, poolId uint64) (poolmanagertypes.PoolI, error) + + CreateConcentratedPoolAsPoolManager(ctx sdk.Context, msg poolmanagertypes.CreatePoolMsg) (poolmanagertypes.PoolI, error) } type PoolIncentivesKeeper interface { diff --git a/x/gamm/types/gov.go b/x/gamm/types/gov.go index c33204bf593..efdbb793f43 100644 --- a/x/gamm/types/gov.go +++ b/x/gamm/types/gov.go @@ -4,13 +4,16 @@ import ( "fmt" "strings" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + gammmigration "github.com/osmosis-labs/osmosis/v16/x/gamm/types/migration" ) const ( - ProposalTypeUpdateMigrationRecords = "UpdateMigrationRecords" - ProposalTypeReplaceMigrationRecords = "ReplaceMigrationRecords" + ProposalTypeUpdateMigrationRecords = "UpdateMigrationRecords" + ProposalTypeReplaceMigrationRecords = "ReplaceMigrationRecords" + ProposalTypeCreateConcentratedLiquidityPoolAndLinktoCFMM = "CreateConcentratedLiquidityPoolAndLinktoCFMM" ) // Init registers proposals to update and replace migration records. @@ -19,11 +22,14 @@ func init() { govtypes.RegisterProposalTypeCodec(&UpdateMigrationRecordsProposal{}, "osmosis/UpdateMigrationRecordsProposal") govtypes.RegisterProposalType(ProposalTypeReplaceMigrationRecords) govtypes.RegisterProposalTypeCodec(&ReplaceMigrationRecordsProposal{}, "osmosis/ReplaceMigrationRecordsProposal") + govtypes.RegisterProposalType(ProposalTypeCreateConcentratedLiquidityPoolAndLinktoCFMM) + govtypes.RegisterProposalTypeCodec(&CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{}, "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal") } var ( _ govtypes.Content = &UpdateMigrationRecordsProposal{} _ govtypes.Content = &ReplaceMigrationRecordsProposal{} + _ govtypes.Content = &CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{} ) // NewReplacePoolIncentivesProposal returns a new instance of a replace migration record's proposal struct. @@ -130,3 +136,81 @@ func (p UpdateMigrationRecordsProposal) String() string { `, p.Title, p.Description, recordsStr)) return b.String() } + +func NewCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(title, description string, records []PoolRecordWithCFMMLink) govtypes.Content { + return &CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{ + Title: title, + Description: description, + PoolRecordsWithCfmmLink: records, + } +} + +// GetTitle gets the title of the proposal +func (p *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) GetTitle() string { return p.Title } + +// GetDescription gets the description of the proposal +func (p *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns the router key for the proposal +func (p *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) ProposalRoute() string { + return RouterKey +} + +// ProposalType returns the type of the proposal +func (p *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) ProposalType() string { + return ProposalTypeCreateConcentratedLiquidityPoolAndLinktoCFMM +} + +// ValidateBasic validates a governance proposal's abstract and basic contents. +func (p *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(p) + if err != nil { + return err + } + + for _, record := range p.PoolRecordsWithCfmmLink { + if record.TickSpacing <= 0 { + return fmt.Errorf("tick spacing must be positive") + } + + if record.Denom0 == record.Denom1 { + return fmt.Errorf("denom0 and denom1 must be different") + } + + if sdk.ValidateDenom(record.Denom0) != nil { + return fmt.Errorf("denom0 is invalid: %s", sdk.ValidateDenom(record.Denom0)) + } + + if sdk.ValidateDenom(record.Denom1) != nil { + return fmt.Errorf("denom1 is invalid: %s", sdk.ValidateDenom(record.Denom1)) + } + + spreadFactor := record.SpreadFactor + if spreadFactor.IsNegative() || spreadFactor.GTE(sdk.OneDec()) { + return fmt.Errorf("Invalid Spread factor") + } + + if record.BalancerPoolId <= 0 { + return fmt.Errorf("Invalid Balancer Pool Id") + } + } + return nil +} + +// String returns a string containing the decrease tick spacing proposal. +func (p CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) String() string { + recordsStr := "" + for _, record := range p.PoolRecordsWithCfmmLink { + recordsStr = recordsStr + fmt.Sprintf("(Denom0: %s, Denom1: %s, TickSpacing: %d, ExponentAtPriceOne: %d, SpreadFactor: %d, BalancerPoolId: %d) ", record.Denom0, record.Denom1, record.TickSpacing, record.ExponentAtPriceOne, record.SpreadFactor, record.BalancerPoolId) + } + + var b strings.Builder + b.WriteString(fmt.Sprintf(`Create Concentrated Liquidity Pool Proposal: +Title: %s +Description: %s +Records: %s +`, p.Title, p.Description, recordsStr)) + return b.String() +} diff --git a/x/gamm/types/gov.pb.go b/x/gamm/types/gov.pb.go index c62efb26c7a..0a6b81293a6 100644 --- a/x/gamm/types/gov.pb.go +++ b/x/gamm/types/gov.pb.go @@ -6,6 +6,7 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -115,40 +116,175 @@ func (m *UpdateMigrationRecordsProposal) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateMigrationRecordsProposal proto.InternalMessageInfo +type PoolRecordWithCFMMLink struct { + Denom0 string `protobuf:"bytes,1,opt,name=denom0,proto3" json:"denom0,omitempty" yaml:"denom0"` + Denom1 string `protobuf:"bytes,2,opt,name=denom1,proto3" json:"denom1,omitempty" yaml:"denom1"` + TickSpacing uint64 `protobuf:"varint,3,opt,name=tick_spacing,json=tickSpacing,proto3" json:"tick_spacing,omitempty" yaml:"tick_spacing"` + ExponentAtPriceOne github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=exponent_at_price_one,json=exponentAtPriceOne,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"exponent_at_price_one" yaml:"exponent_at_price_one"` + SpreadFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=spread_factor,json=spreadFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"spread_factor" yaml:"spread_factor"` + BalancerPoolId uint64 `protobuf:"varint,6,opt,name=balancer_pool_id,json=balancerPoolId,proto3" json:"balancer_pool_id,omitempty" yaml:"balancer_pool_id"` +} + +func (m *PoolRecordWithCFMMLink) Reset() { *m = PoolRecordWithCFMMLink{} } +func (m *PoolRecordWithCFMMLink) String() string { return proto.CompactTextString(m) } +func (*PoolRecordWithCFMMLink) ProtoMessage() {} +func (*PoolRecordWithCFMMLink) Descriptor() ([]byte, []int) { + return fileDescriptor_f31b9a6c0dbbdfa3, []int{2} +} +func (m *PoolRecordWithCFMMLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolRecordWithCFMMLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolRecordWithCFMMLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PoolRecordWithCFMMLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolRecordWithCFMMLink.Merge(m, src) +} +func (m *PoolRecordWithCFMMLink) XXX_Size() int { + return m.Size() +} +func (m *PoolRecordWithCFMMLink) XXX_DiscardUnknown() { + xxx_messageInfo_PoolRecordWithCFMMLink.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolRecordWithCFMMLink proto.InternalMessageInfo + +func (m *PoolRecordWithCFMMLink) GetDenom0() string { + if m != nil { + return m.Denom0 + } + return "" +} + +func (m *PoolRecordWithCFMMLink) GetDenom1() string { + if m != nil { + return m.Denom1 + } + return "" +} + +func (m *PoolRecordWithCFMMLink) GetTickSpacing() uint64 { + if m != nil { + return m.TickSpacing + } + return 0 +} + +func (m *PoolRecordWithCFMMLink) GetBalancerPoolId() uint64 { + if m != nil { + return m.BalancerPoolId + } + return 0 +} + +// CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type +// for creating concentrated liquidity pools and linking it to a CFMM pool. +type CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + PoolRecordsWithCfmmLink []PoolRecordWithCFMMLink `protobuf:"bytes,3,rep,name=pool_records_with_cfmm_link,json=poolRecordsWithCfmmLink,proto3" json:"pool_records_with_cfmm_link" yaml:"create_cl_pool_and_link_to_cfmm"` +} + +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Reset() { + *m = CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal{} +} +func (*CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) ProtoMessage() {} +func (*CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_f31b9a6c0dbbdfa3, []int{3} +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.Merge(m, src) +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) XXX_Size() int { + return m.Size() +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal proto.InternalMessageInfo + func init() { proto.RegisterType((*ReplaceMigrationRecordsProposal)(nil), "osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal") proto.RegisterType((*UpdateMigrationRecordsProposal)(nil), "osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal") + proto.RegisterType((*PoolRecordWithCFMMLink)(nil), "osmosis.gamm.v1beta1.PoolRecordWithCFMMLink") + proto.RegisterType((*CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal)(nil), "osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal") } func init() { proto.RegisterFile("osmosis/gamm/v1beta1/gov.proto", fileDescriptor_f31b9a6c0dbbdfa3) } var fileDescriptor_f31b9a6c0dbbdfa3 = []byte{ - // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x2f, 0xce, 0xcd, - 0x2f, 0xce, 0x2c, 0xd6, 0x4f, 0x4f, 0xcc, 0xcd, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, - 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xca, 0xeb, 0x81, - 0xe4, 0xf5, 0xa0, 0xf2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x05, 0xfa, 0x20, 0x16, 0x44, - 0xad, 0x94, 0x12, 0x76, 0xb3, 0x52, 0xf3, 0x52, 0x41, 0x06, 0x40, 0xd4, 0x28, 0x62, 0x55, 0x53, - 0x9c, 0x91, 0x58, 0x94, 0x9a, 0x02, 0x55, 0x22, 0x99, 0x0c, 0x56, 0x13, 0x0f, 0x31, 0x1f, 0xc2, - 0x81, 0x4a, 0x09, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0x90, 0x52, 0x3b, 0x13, - 0x97, 0x7c, 0x50, 0x6a, 0x41, 0x4e, 0x62, 0x72, 0xaa, 0x6f, 0x66, 0x7a, 0x51, 0x62, 0x49, 0x66, - 0x7e, 0x5e, 0x50, 0x6a, 0x72, 0x7e, 0x51, 0x4a, 0x71, 0x40, 0x51, 0x7e, 0x41, 0x7e, 0x71, 0x62, - 0x8e, 0x90, 0x08, 0x17, 0x6b, 0x49, 0x66, 0x49, 0x4e, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, - 0x10, 0x84, 0x23, 0xa4, 0xc0, 0xc5, 0x9d, 0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x00, 0xd2, 0x23, - 0xc1, 0x04, 0x96, 0x43, 0x16, 0x12, 0x0a, 0xe1, 0x62, 0x2f, 0x82, 0x18, 0x25, 0xc1, 0xac, 0xc0, - 0xac, 0xc1, 0x6d, 0x64, 0xa2, 0x87, 0x2d, 0x38, 0xf4, 0x9c, 0x12, 0x73, 0x12, 0xf3, 0x92, 0x53, - 0x8b, 0x42, 0xf2, 0x9d, 0xf3, 0xf3, 0x92, 0x53, 0xf3, 0x4a, 0x8a, 0x12, 0x4b, 0x52, 0x53, 0x02, - 0xf2, 0xf3, 0x73, 0x7c, 0x32, 0xf3, 0xb2, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x19, - 0x65, 0x15, 0xd6, 0xb1, 0x40, 0x9e, 0x61, 0xc6, 0x02, 0x79, 0x86, 0x17, 0x0b, 0xe4, 0x19, 0x4f, - 0x6d, 0xd1, 0x95, 0x82, 0x7a, 0x11, 0x14, 0xe8, 0x30, 0x13, 0x9d, 0xf3, 0xf3, 0x4a, 0x52, 0xf3, - 0x4a, 0xba, 0x9e, 0x6f, 0xd0, 0x52, 0x87, 0x85, 0x18, 0x01, 0x5f, 0x2a, 0xb5, 0x32, 0x71, 0xc9, - 0x85, 0x16, 0xa4, 0x24, 0x96, 0x0c, 0x95, 0x80, 0x08, 0x25, 0x2d, 0x20, 0xd4, 0x60, 0x01, 0x81, - 0xdf, 0x93, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, - 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, - 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x35, 0x4c, 0x37, 0x27, 0x31, - 0xa9, 0x18, 0xc6, 0xd1, 0x2f, 0x33, 0x34, 0xd3, 0xaf, 0x80, 0x24, 0xcd, 0x92, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0x70, 0x22, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x81, 0x15, 0x14, - 0x27, 0x03, 0x00, 0x00, + // 730 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0x8e, 0x93, 0xb4, 0x08, 0xb7, 0x45, 0xd4, 0x04, 0x1a, 0x5a, 0x64, 0x07, 0x0f, 0xa5, 0x20, + 0x6a, 0x37, 0xfc, 0x1a, 0x22, 0x31, 0x34, 0x81, 0x4a, 0x45, 0x2d, 0x54, 0xa6, 0x05, 0x89, 0xc5, + 0xba, 0x9c, 0xaf, 0xce, 0x29, 0xf6, 0x9d, 0xb1, 0xaf, 0xa5, 0x1d, 0x19, 0x10, 0x88, 0x89, 0x11, + 0x31, 0xf5, 0x4f, 0x60, 0xe0, 0x8f, 0xa8, 0x98, 0x3a, 0x22, 0x06, 0x0b, 0xb5, 0x03, 0x9d, 0x33, + 0x32, 0xa1, 0xbb, 0xb3, 0xab, 0x00, 0x11, 0xa8, 0x30, 0xb1, 0x24, 0x79, 0xef, 0x7d, 0xfe, 0xde, + 0xbd, 0xef, 0xbe, 0x17, 0xab, 0x3a, 0x4d, 0x42, 0x9a, 0xe0, 0xc4, 0xf6, 0x41, 0x18, 0xda, 0x9b, + 0xf5, 0x36, 0x62, 0xa0, 0x6e, 0xfb, 0x74, 0xd3, 0x8a, 0x62, 0xca, 0xa8, 0x56, 0xc9, 0xea, 0x16, + 0xaf, 0x5b, 0x59, 0x7d, 0xb2, 0xe2, 0x53, 0x9f, 0x0a, 0x80, 0xcd, 0x7f, 0x49, 0xec, 0xa4, 0x39, + 0x98, 0x0b, 0x11, 0xc4, 0x09, 0x24, 0xe6, 0xe2, 0x40, 0x4c, 0xd2, 0x01, 0x31, 0xf2, 0x32, 0xc8, + 0x79, 0x28, 0x30, 0xae, 0xe4, 0x97, 0x41, 0x56, 0x1a, 0x07, 0x21, 0x26, 0xd4, 0x16, 0x9f, 0x32, + 0x65, 0xbe, 0x2c, 0xaa, 0x86, 0x83, 0xa2, 0x00, 0x40, 0xb4, 0x8c, 0xfd, 0x18, 0x30, 0x4c, 0x89, + 0x83, 0x20, 0x8d, 0xbd, 0x64, 0x25, 0xa6, 0x11, 0x4d, 0x40, 0xa0, 0x55, 0xd4, 0x21, 0x86, 0x59, + 0x80, 0xaa, 0x4a, 0x4d, 0x99, 0x39, 0xe9, 0xc8, 0x40, 0xab, 0xa9, 0x23, 0x1e, 0x4a, 0x60, 0x8c, + 0x23, 0xfe, 0x4c, 0xb5, 0x28, 0x6a, 0xfd, 0x29, 0x6d, 0x55, 0x3d, 0x11, 0x4b, 0xaa, 0x6a, 0xa9, + 0x56, 0x9a, 0x19, 0xb9, 0x76, 0xc3, 0x1a, 0x24, 0x87, 0xd5, 0x04, 0x01, 0x20, 0x10, 0xc5, 0xab, + 0xb4, 0x45, 0x09, 0x44, 0x84, 0xc5, 0x80, 0x21, 0x6f, 0x85, 0xd2, 0x60, 0x09, 0x93, 0x6e, 0xb3, + 0xbc, 0x9b, 0x1a, 0x05, 0x27, 0xa7, 0x6a, 0x3c, 0x7a, 0xb5, 0x63, 0x14, 0xde, 0xee, 0x18, 0x85, + 0xc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0xa8, 0x11, + 0x1c, 0x6f, 0xa1, 0x6e, 0xe7, 0x0b, 0xf5, 0x57, 0x12, 0x36, 0xef, 0xed, 0xee, 0xeb, 0xca, 0xde, + 0xbe, 0xae, 0x7c, 0xd9, 0xd7, 0x95, 0x37, 0x07, 0x7a, 0x61, 0xef, 0x40, 0x2f, 0x7c, 0x3a, 0xd0, + 0x0b, 0x4f, 0xe6, 0xfa, 0x1c, 0x93, 0xf5, 0x98, 0x0d, 0x40, 0x3b, 0xc9, 0x03, 0x7b, 0xb3, 0x7e, + 0xcb, 0xde, 0x92, 0xaf, 0x00, 0xe1, 0x9f, 0xf6, 0xb0, 0xf8, 0x33, 0xbf, 0xfe, 0x3d, 0x00, 0x00, + 0xff, 0xff, 0x60, 0x2b, 0xd7, 0x21, 0x8f, 0x06, 0x00, 0x00, } func (this *ReplaceMigrationRecordsProposal) Equal(that interface{}) bool { @@ -221,6 +357,80 @@ func (this *UpdateMigrationRecordsProposal) Equal(that interface{}) bool { } return true } +func (this *PoolRecordWithCFMMLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PoolRecordWithCFMMLink) + if !ok { + that2, ok := that.(PoolRecordWithCFMMLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Denom0 != that1.Denom0 { + return false + } + if this.Denom1 != that1.Denom1 { + return false + } + if this.TickSpacing != that1.TickSpacing { + return false + } + if !this.ExponentAtPriceOne.Equal(that1.ExponentAtPriceOne) { + return false + } + if !this.SpreadFactor.Equal(that1.SpreadFactor) { + return false + } + if this.BalancerPoolId != that1.BalancerPoolId { + return false + } + return true +} +func (this *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) + if !ok { + that2, ok := that.(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if len(this.PoolRecordsWithCfmmLink) != len(that1.PoolRecordsWithCfmmLink) { + return false + } + for i := range this.PoolRecordsWithCfmmLink { + if !this.PoolRecordsWithCfmmLink[i].Equal(&that1.PoolRecordsWithCfmmLink[i]) { + return false + } + } + return true +} func (m *ReplaceMigrationRecordsProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -323,6 +533,124 @@ func (m *UpdateMigrationRecordsProposal) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *PoolRecordWithCFMMLink) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PoolRecordWithCFMMLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolRecordWithCFMMLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BalancerPoolId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.BalancerPoolId)) + i-- + dAtA[i] = 0x30 + } + { + size := m.SpreadFactor.Size() + i -= size + if _, err := m.SpreadFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.ExponentAtPriceOne.Size() + i -= size + if _, err := m.ExponentAtPriceOne.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.TickSpacing != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.TickSpacing)) + i-- + dAtA[i] = 0x18 + } + if len(m.Denom1) > 0 { + i -= len(m.Denom1) + copy(dAtA[i:], m.Denom1) + i = encodeVarintGov(dAtA, i, uint64(len(m.Denom1))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom0) > 0 { + i -= len(m.Denom0) + copy(dAtA[i:], m.Denom0) + i = encodeVarintGov(dAtA, i, uint64(len(m.Denom0))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PoolRecordsWithCfmmLink) > 0 { + for iNdEx := len(m.PoolRecordsWithCfmmLink) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolRecordsWithCfmmLink[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -380,6 +708,56 @@ func (m *UpdateMigrationRecordsProposal) Size() (n int) { return n } +func (m *PoolRecordWithCFMMLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom0) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Denom1) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if m.TickSpacing != 0 { + n += 1 + sovGov(uint64(m.TickSpacing)) + } + l = m.ExponentAtPriceOne.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.SpreadFactor.Size() + n += 1 + l + sovGov(uint64(l)) + if m.BalancerPoolId != 0 { + n += 1 + sovGov(uint64(m.BalancerPoolId)) + } + return n +} + +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.PoolRecordsWithCfmmLink) > 0 { + for _, e := range m.PoolRecordsWithCfmmLink { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + func sovGov(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -682,6 +1060,374 @@ func (m *UpdateMigrationRecordsProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *PoolRecordWithCFMMLink) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolRecordWithCFMMLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolRecordWithCFMMLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom0", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom0 = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom1", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom1 = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TickSpacing", wireType) + } + m.TickSpacing = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TickSpacing |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExponentAtPriceOne", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExponentAtPriceOne.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpreadFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SpreadFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BalancerPoolId", wireType) + } + m.BalancerPoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BalancerPoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolRecordsWithCfmmLink", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolRecordsWithCfmmLink = append(m.PoolRecordsWithCfmmLink, PoolRecordWithCFMMLink{}) + if err := m.PoolRecordsWithCfmmLink[len(m.PoolRecordsWithCfmmLink)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0