diff --git a/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto new file mode 100644 index 00000000000..dc8f4cbd5b8 --- /dev/null +++ b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package osmosis.gamm.stableswap.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/stableswap"; + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + string swapFee = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + string exitFee = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; +} + +// Pool is the stableswap Pool struct +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams poolParams = 3 [ + (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"", + (gogoproto.nullable) = false + ]; + + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP shares + cosmos.base.v1beta1.Coin totalShares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // assets in the pool + repeated cosmos.base.v1beta1.Coin poolLiquidity = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/proto/osmosis/gamm/pool-models/stableswap/tx.proto b/proto/osmosis/gamm/pool-models/stableswap/tx.proto new file mode 100644 index 00000000000..a6a5b26953e --- /dev/null +++ b/proto/osmosis/gamm/pool-models/stableswap/tx.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package osmosis.gamm.stableswap.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/stableswap"; + +service Msg { + rpc CreateStableswapPool(MsgCreateStableswapPool) + returns (MsgCreateStableswapPoolResponse); +} + +message MsgCreateStableswapPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + PoolParams poolParams = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + + repeated cosmos.base.v1beta1.Coin initial_pool_liquidity = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; +} + +message MsgCreateStableswapPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} diff --git a/proto/osmosis/txfees/v1beta1/query.proto b/proto/osmosis/txfees/v1beta1/query.proto index 3224b9ee7bd..abb36616184 100644 --- a/proto/osmosis/txfees/v1beta1/query.proto +++ b/proto/osmosis/txfees/v1beta1/query.proto @@ -19,7 +19,8 @@ service Query { rpc DenomSpotPrice(QueryDenomSpotPriceRequest) returns (QueryDenomSpotPriceResponse) { - option (google.api.http).get = "/osmosis/txfees/v1beta1/spot_price_by_denom"; + option (google.api.http).get = + "/osmosis/txfees/v1beta1/spot_price_by_denom"; } rpc DenomPoolId(QueryDenomPoolIdRequest) returns (QueryDenomPoolIdResponse) { diff --git a/x/gamm/pool-models/balancer/balancer_pool.go b/x/gamm/pool-models/balancer/balancer_pool.go index 1c674f10809..6d916c044a4 100644 --- a/x/gamm/pool-models/balancer/balancer_pool.go +++ b/x/gamm/pool-models/balancer/balancer_pool.go @@ -517,47 +517,6 @@ func (params PoolParams) GetPoolExitFee() sdk.Dec { return params.ExitFee } -func ValidateFutureGovernor(governor string) error { - // allow empty governor - if governor == "" { - return nil - } - - // validation for future owner - // "osmo1fqlr98d45v5ysqgp6h56kpujcj4cvsjnjq9nck" - _, err := sdk.AccAddressFromBech32(governor) - if err == nil { - return nil - } - - lockTimeStr := "" - splits := strings.Split(governor, ",") - if len(splits) > 2 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, fmt.Sprintf("invalid future governor: %s", governor)) - } - - // token,100h - if len(splits) == 2 { - lpTokenStr := splits[0] - if sdk.ValidateDenom(lpTokenStr) != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, fmt.Sprintf("invalid future governor: %s", governor)) - } - lockTimeStr = splits[1] - } - - // 100h - if len(splits) == 1 { - lockTimeStr = splits[0] - } - - // Note that a duration of 0 is allowed - _, err = time.ParseDuration(lockTimeStr) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, fmt.Sprintf("invalid future governor: %s", governor)) - } - return nil -} - // subPoolAssetWeights subtracts the weights of two different pool asset slices. // It assumes that both pool assets have the same token denominations, // with the denominations in the same order. diff --git a/x/gamm/pool-models/balancer/msgs.go b/x/gamm/pool-models/balancer/msgs.go index cb9fd5edf16..c4db7cfa640 100644 --- a/x/gamm/pool-models/balancer/msgs.go +++ b/x/gamm/pool-models/balancer/msgs.go @@ -46,7 +46,7 @@ func (msg MsgCreateBalancerPool) ValidateBasic() error { } // validation for future owner - if err = ValidateFutureGovernor(msg.FuturePoolGovernor); err != nil { + if err = types.ValidateFutureGovernor(msg.FuturePoolGovernor); err != nil { return err } diff --git a/x/gamm/pool-models/stableswap/codec.go b/x/gamm/pool-models/stableswap/codec.go new file mode 100644 index 00000000000..840d89b4d10 --- /dev/null +++ b/x/gamm/pool-models/stableswap/codec.go @@ -0,0 +1,48 @@ +package stableswap + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + + types "github.com/osmosis-labs/osmosis/v7/x/gamm/types" +) + +// RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&Pool{}, "osmosis/gamm/StableswapPool", nil) + cdc.RegisterConcrete(&MsgCreateStableswapPool{}, "osmosis/gamm/create-stableswap-pool", nil) + cdc.RegisterConcrete(&PoolParams{}, "osmosis/gamm/StableswapPoolParams", nil) +} + +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterInterface( + "osmosis.gamm.v1beta1.PoolI", + (*types.PoolI)(nil), + &Pool{}, + ) + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgCreateStableswapPool{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/bank module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} diff --git a/x/gamm/pool-models/stableswap/msgs.go b/x/gamm/pool-models/stableswap/msgs.go new file mode 100644 index 00000000000..8a87a893851 --- /dev/null +++ b/x/gamm/pool-models/stableswap/msgs.go @@ -0,0 +1,84 @@ +package stableswap + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" +) + +const ( + TypeMsgCreateStableswapPool = "create_stableswap_pool" +) + +var _ sdk.Msg = &MsgCreateStableswapPool{} +var _ types.CreatePoolMsg = &MsgCreateStableswapPool{} + +func NewMsgCreateStableswapPool( + sender sdk.AccAddress, + poolParams PoolParams, + initialLiquidity sdk.Coins, + futurePoolGovernor string) MsgCreateStableswapPool { + return MsgCreateStableswapPool{ + Sender: sender.String(), + PoolParams: &poolParams, + InitialPoolLiquidity: initialLiquidity, + FuturePoolGovernor: futurePoolGovernor, + } +} + +func (msg MsgCreateStableswapPool) Route() string { return types.RouterKey } +func (msg MsgCreateStableswapPool) Type() string { return TypeMsgCreateStableswapPool } +func (msg MsgCreateStableswapPool) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + err = msg.PoolParams.Validate() + if err != nil { + return err + } + + // TODO: Add validation for pool initial liquidity + + // validation for future owner + if err = types.ValidateFutureGovernor(msg.FuturePoolGovernor); err != nil { + return err + } + + return nil +} + +func (msg MsgCreateStableswapPool) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg MsgCreateStableswapPool) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +/// Implement the CreatePoolMsg interface + +func (msg MsgCreateStableswapPool) PoolCreator() sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return sender +} +func (msg MsgCreateStableswapPool) Validate(ctx sdk.Context) error { + return msg.ValidateBasic() +} + +func (msg MsgCreateStableswapPool) InitialLiquidity() sdk.Coins { + return msg.InitialPoolLiquidity +} + +func (msg MsgCreateStableswapPool) CreatePool(ctx sdk.Context, poolID uint64) (types.PoolI, error) { + return &Pool{}, types.ErrNotImplemented +} diff --git a/x/gamm/pool-models/stableswap/params.go b/x/gamm/pool-models/stableswap/params.go new file mode 100644 index 00000000000..7927e6604f8 --- /dev/null +++ b/x/gamm/pool-models/stableswap/params.go @@ -0,0 +1,26 @@ +package stableswap + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" +) + +func (params PoolParams) Validate() error { + if params.ExitFee.IsNegative() { + return types.ErrNegativeExitFee + } + + if params.ExitFee.GTE(sdk.OneDec()) { + return types.ErrTooMuchExitFee + } + + if params.SwapFee.IsNegative() { + return types.ErrNegativeSwapFee + } + + if params.SwapFee.GTE(sdk.OneDec()) { + return types.ErrTooMuchSwapFee + } + return nil +} diff --git a/x/gamm/pool-models/stableswap/pool.go b/x/gamm/pool-models/stableswap/pool.go new file mode 100644 index 00000000000..8f941d15a50 --- /dev/null +++ b/x/gamm/pool-models/stableswap/pool.go @@ -0,0 +1,86 @@ +package stableswap + +import ( + "encoding/json" + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" +) + +var _ types.PoolI = &Pool{} + +func (pa Pool) GetAddress() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(pa.Address) + if err != nil { + panic(fmt.Sprintf("could not bech32 decode address of pool with id: %d", pa.GetId())) + } + return addr +} + +func (pa Pool) String() string { + out, err := json.Marshal(pa) + if err != nil { + panic(err) + } + return string(out) +} + +func (pa Pool) GetId() uint64 { + return pa.Id +} + +func (pa Pool) GetSwapFee(ctx sdk.Context) sdk.Dec { + return pa.PoolParams.SwapFee +} +func (pa Pool) GetExitFee(ctx sdk.Context) sdk.Dec { + return pa.PoolParams.ExitFee +} + +func (pa Pool) IsActive(ctx sdk.Context) bool { + return true +} + +// Returns the coins in the pool owned by all LP shareholders +func (pa Pool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins { + return pa.PoolLiquidity +} + +func (pa Pool) GetTotalShares() sdk.Int { + return pa.TotalShares.Amount +} + +// These should all get moved to amm.go +func (pa Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.DecCoin, err error) { + return sdk.DecCoin{}, types.ErrNotImplemented +} +func (pa *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { + return sdk.Coin{}, types.ErrNotImplemented +} + +func (pa Pool) CalcInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.DecCoin, err error) { + return sdk.DecCoin{}, types.ErrNotImplemented +} +func (pa *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { + return sdk.Coin{}, types.ErrNotImplemented +} + +func (pa Pool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (sdk.Dec, error) { + return sdk.Dec{}, types.ErrNotImplemented +} + +func (pa Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { + return sdk.Int{}, sdk.Coins{}, types.ErrNotImplemented +} +func (pa *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, err error) { + return sdk.Int{}, types.ErrNotImplemented +} + +func (pa *Pool) ExitPool(ctx sdk.Context, numShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { + return sdk.Coins{}, types.ErrNotImplemented +} + +func (pa Pool) CalcExitPoolShares(ctx sdk.Context, numShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { + return sdk.Coins{}, types.ErrNotImplemented +} diff --git a/x/gamm/pool-models/stableswap/stableswap_pool.pb.go b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go new file mode 100644 index 00000000000..3022b0d95c5 --- /dev/null +++ b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go @@ -0,0 +1,787 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/stableswap/stableswap_pool.proto + +package stableswap + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +type PoolParams struct { + SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swapFee" yaml:"swap_fee"` + ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exitFee" yaml:"exit_fee"` +} + +func (m *PoolParams) Reset() { *m = PoolParams{} } +func (m *PoolParams) String() string { return proto.CompactTextString(m) } +func (*PoolParams) ProtoMessage() {} +func (*PoolParams) Descriptor() ([]byte, []int) { + return fileDescriptor_ae0f054436f9999a, []int{0} +} +func (m *PoolParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolParams.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 *PoolParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolParams.Merge(m, src) +} +func (m *PoolParams) XXX_Size() int { + return m.Size() +} +func (m *PoolParams) XXX_DiscardUnknown() { + xxx_messageInfo_PoolParams.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolParams proto.InternalMessageInfo + +// Pool is the stableswap Pool struct +type Pool struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + PoolParams PoolParams `protobuf:"bytes,3,opt,name=poolParams,proto3" json:"poolParams" yaml:"stableswap_pool_params"` + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` + // sum of all LP shares + TotalShares types.Coin `protobuf:"bytes,5,opt,name=totalShares,proto3" json:"totalShares" yaml:"total_shares"` + // assets in the pool + PoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=poolLiquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"poolLiquidity"` +} + +func (m *Pool) Reset() { *m = Pool{} } +func (*Pool) ProtoMessage() {} +func (*Pool) Descriptor() ([]byte, []int) { + return fileDescriptor_ae0f054436f9999a, []int{1} +} +func (m *Pool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pool.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 *Pool) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pool.Merge(m, src) +} +func (m *Pool) XXX_Size() int { + return m.Size() +} +func (m *Pool) XXX_DiscardUnknown() { + xxx_messageInfo_Pool.DiscardUnknown(m) +} + +var xxx_messageInfo_Pool proto.InternalMessageInfo + +func init() { + proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.stableswap.v1beta1.PoolParams") + proto.RegisterType((*Pool)(nil), "osmosis.gamm.stableswap.v1beta1.Pool") +} + +func init() { + proto.RegisterFile("osmosis/gamm/pool-models/stableswap/stableswap_pool.proto", fileDescriptor_ae0f054436f9999a) +} + +var fileDescriptor_ae0f054436f9999a = []byte{ + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xb6, 0x9b, 0xb4, 0x15, 0x57, 0x51, 0xc4, 0xd1, 0xc1, 0x6d, 0x85, 0x2f, 0xb2, 0x04, 0x8a, + 0x04, 0xf1, 0x51, 0x18, 0x10, 0x9d, 0x20, 0x20, 0x10, 0x12, 0x43, 0x31, 0x0b, 0x2a, 0x43, 0x74, + 0x8e, 0x2f, 0xce, 0x09, 0x3b, 0xe7, 0xfa, 0xce, 0xa1, 0xf9, 0x07, 0x8c, 0x8c, 0x8c, 0x9d, 0x99, + 0xf9, 0x0d, 0xa8, 0x63, 0xc5, 0x84, 0x18, 0x0c, 0x4a, 0x46, 0xb6, 0xfc, 0x02, 0x74, 0xe7, 0x4b, + 0x9a, 0x56, 0xa8, 0x20, 0x31, 0xd9, 0xef, 0xbd, 0xef, 0x7d, 0xdf, 0xfb, 0xde, 0xdd, 0x81, 0x07, + 0x5c, 0xa4, 0x5c, 0x30, 0x81, 0x63, 0x92, 0xa6, 0x38, 0xe3, 0x3c, 0x69, 0xa5, 0x3c, 0xa2, 0x89, + 0xc0, 0x42, 0x92, 0x30, 0xa1, 0xe2, 0x1d, 0xc9, 0x16, 0x7e, 0x3b, 0x0a, 0xe1, 0x67, 0x39, 0x97, + 0x1c, 0x22, 0xd3, 0xea, 0xab, 0x56, 0xff, 0x14, 0xe3, 0x0f, 0x77, 0x42, 0x2a, 0xc9, 0xce, 0xd6, + 0x66, 0x57, 0x23, 0x3a, 0x1a, 0x8e, 0xab, 0xa0, 0xea, 0xdd, 0xda, 0x88, 0x79, 0xcc, 0xab, 0xbc, + 0xfa, 0x33, 0x59, 0x37, 0xe6, 0x3c, 0x4e, 0x28, 0xd6, 0x51, 0x58, 0xf4, 0x70, 0x54, 0xe4, 0x44, + 0x32, 0x3e, 0x30, 0x75, 0x74, 0xbe, 0x2e, 0x59, 0x4a, 0x85, 0x24, 0x69, 0x36, 0x23, 0xa8, 0x44, + 0x30, 0x29, 0x64, 0x1f, 0x9b, 0x31, 0x74, 0x70, 0xae, 0x1e, 0x12, 0x41, 0xe7, 0xf5, 0x2e, 0x67, + 0x46, 0xc0, 0xfb, 0x62, 0x03, 0xb0, 0xc7, 0x79, 0xb2, 0x47, 0x72, 0x92, 0x0a, 0xf8, 0x06, 0xac, + 0x2a, 0x43, 0x4f, 0x29, 0x75, 0xec, 0x86, 0xdd, 0xbc, 0xd4, 0x7e, 0x74, 0x5c, 0x22, 0xeb, 0x7b, + 0x89, 0x6e, 0xc6, 0x4c, 0xf6, 0x8b, 0xd0, 0xef, 0xf2, 0xd4, 0xf8, 0x32, 0x9f, 0x96, 0x88, 0xde, + 0x62, 0x39, 0xca, 0xa8, 0xf0, 0x9f, 0xd0, 0xee, 0xb4, 0x44, 0x57, 0x46, 0x24, 0x4d, 0x76, 0x3d, + 0xbd, 0xbb, 0x1e, 0xa5, 0x5e, 0x30, 0x63, 0x54, 0xe4, 0xf4, 0x90, 0x49, 0x45, 0xbe, 0xf4, 0x7f, + 0xe4, 0x8a, 0xc6, 0x90, 0x1b, 0x46, 0xef, 0x57, 0x0d, 0xd4, 0x95, 0x11, 0x78, 0x1b, 0xac, 0x92, + 0x28, 0xca, 0xa9, 0x10, 0xc6, 0x02, 0x9c, 0x96, 0x68, 0xbd, 0xea, 0x33, 0x05, 0x2f, 0x98, 0x41, + 0xe0, 0x3a, 0x58, 0x62, 0x91, 0x1e, 0xa7, 0x1e, 0x2c, 0xb1, 0x08, 0xe6, 0x00, 0x64, 0xf3, 0x75, + 0x38, 0xb5, 0x86, 0xdd, 0x5c, 0xbb, 0x7b, 0xcb, 0xff, 0xcb, 0xb9, 0xfb, 0xa7, 0x1b, 0x6c, 0xdf, + 0x50, 0x9e, 0xa6, 0x25, 0xba, 0x6e, 0xd6, 0x70, 0xf6, 0x22, 0x75, 0x32, 0x8d, 0xf2, 0x82, 0x05, + 0x15, 0xf8, 0x12, 0x6c, 0xf4, 0x0a, 0x59, 0xe4, 0xb4, 0x82, 0xc4, 0x7c, 0x48, 0xf3, 0x01, 0xcf, + 0x9d, 0xba, 0x1e, 0x1f, 0x4d, 0x4b, 0xb4, 0x5d, 0x91, 0xfd, 0x09, 0xe5, 0x05, 0xb0, 0x4a, 0xab, + 0x19, 0x9e, 0x99, 0x24, 0x7c, 0x0d, 0xd6, 0x24, 0x97, 0x24, 0x79, 0xd5, 0x27, 0x39, 0x15, 0xce, + 0xb2, 0xf6, 0xb1, 0xe9, 0x9b, 0x1b, 0xa9, 0x2e, 0xc3, 0x7c, 0xf6, 0xc7, 0x9c, 0x0d, 0xda, 0xdb, + 0x66, 0xea, 0x6b, 0x95, 0x90, 0xee, 0xed, 0x08, 0xdd, 0xec, 0x05, 0x8b, 0x54, 0xf0, 0x00, 0x5c, + 0x56, 0xfa, 0x2f, 0xd8, 0x41, 0xc1, 0x22, 0x26, 0x47, 0xce, 0x4a, 0xa3, 0x76, 0x31, 0xf7, 0x1d, + 0xc5, 0xfd, 0xe9, 0x07, 0x6a, 0xfe, 0xc3, 0x29, 0xab, 0x06, 0x11, 0x9c, 0x55, 0xd8, 0xbd, 0xfa, + 0xfe, 0x08, 0x59, 0x1f, 0x8f, 0x90, 0xf5, 0xf5, 0x73, 0x6b, 0x59, 0xd9, 0x7c, 0xde, 0xde, 0x3f, + 0x1e, 0xbb, 0xf6, 0xc9, 0xd8, 0xb5, 0x7f, 0x8e, 0x5d, 0xfb, 0xc3, 0xc4, 0xb5, 0x4e, 0x26, 0xae, + 0xf5, 0x6d, 0xe2, 0x5a, 0xfb, 0x0f, 0x17, 0x54, 0xcc, 0xb1, 0xb5, 0x12, 0x12, 0x8a, 0x59, 0x80, + 0x87, 0xf7, 0xf1, 0xe1, 0x45, 0x6f, 0x3f, 0x5c, 0xd1, 0x2f, 0xe3, 0xde, 0xef, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x90, 0xbd, 0xb4, 0x70, 0x29, 0x04, 0x00, 0x00, +} + +func (m *PoolParams) 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 *PoolParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ExitFee.Size() + i -= size + if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SwapFee.Size() + i -= size + if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Pool) 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 *Pool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PoolLiquidity) > 0 { + for iNdEx := len(m.PoolLiquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + { + size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.FuturePoolGovernor) > 0 { + i -= len(m.FuturePoolGovernor) + copy(dAtA[i:], m.FuturePoolGovernor) + i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Id != 0 { + i = encodeVarintStableswapPool(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintStableswapPool(dAtA []byte, offset int, v uint64) int { + offset -= sovStableswapPool(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PoolParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SwapFee.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + l = m.ExitFee.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + return n +} + +func (m *Pool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovStableswapPool(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovStableswapPool(uint64(m.Id)) + } + l = m.PoolParams.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + l = len(m.FuturePoolGovernor) + if l > 0 { + n += 1 + l + sovStableswapPool(uint64(l)) + } + l = m.TotalShares.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + if len(m.PoolLiquidity) > 0 { + for _, e := range m.PoolLiquidity { + l = e.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + } + } + return n +} + +func sovStableswapPool(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStableswapPool(x uint64) (n int) { + return sovStableswapPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PoolParams) 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 ErrIntOverflowStableswapPool + } + 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: PoolParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + 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 ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + 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 ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStableswapPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStableswapPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pool) 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 ErrIntOverflowStableswapPool + } + 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: Pool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + 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 ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + 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 ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolLiquidity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolLiquidity = append(m.PoolLiquidity, types.Coin{}) + if err := m.PoolLiquidity[len(m.PoolLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStableswapPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStableswapPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStableswapPool(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStableswapPool + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStableswapPool + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStableswapPool + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStableswapPool = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStableswapPool = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStableswapPool = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gamm/pool-models/stableswap/tx.pb.go b/x/gamm/pool-models/stableswap/tx.pb.go new file mode 100644 index 00000000000..131e5e48e9d --- /dev/null +++ b/x/gamm/pool-models/stableswap/tx.pb.go @@ -0,0 +1,751 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/stableswap/tx.proto + +package stableswap + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateStableswapPool struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + PoolParams *PoolParams `protobuf:"bytes,2,opt,name=poolParams,proto3" json:"poolParams,omitempty" yaml:"pool_params"` + InitialPoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=initial_pool_liquidity,json=initialPoolLiquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_pool_liquidity"` + FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` +} + +func (m *MsgCreateStableswapPool) Reset() { *m = MsgCreateStableswapPool{} } +func (m *MsgCreateStableswapPool) String() string { return proto.CompactTextString(m) } +func (*MsgCreateStableswapPool) ProtoMessage() {} +func (*MsgCreateStableswapPool) Descriptor() ([]byte, []int) { + return fileDescriptor_46b7c8a0f24de97c, []int{0} +} +func (m *MsgCreateStableswapPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateStableswapPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateStableswapPool.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 *MsgCreateStableswapPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateStableswapPool.Merge(m, src) +} +func (m *MsgCreateStableswapPool) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateStableswapPool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateStableswapPool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateStableswapPool proto.InternalMessageInfo + +func (m *MsgCreateStableswapPool) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgCreateStableswapPool) GetPoolParams() *PoolParams { + if m != nil { + return m.PoolParams + } + return nil +} + +func (m *MsgCreateStableswapPool) GetInitialPoolLiquidity() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.InitialPoolLiquidity + } + return nil +} + +func (m *MsgCreateStableswapPool) GetFuturePoolGovernor() string { + if m != nil { + return m.FuturePoolGovernor + } + return "" +} + +type MsgCreateStableswapPoolResponse struct { + PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` +} + +func (m *MsgCreateStableswapPoolResponse) Reset() { *m = MsgCreateStableswapPoolResponse{} } +func (m *MsgCreateStableswapPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateStableswapPoolResponse) ProtoMessage() {} +func (*MsgCreateStableswapPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46b7c8a0f24de97c, []int{1} +} +func (m *MsgCreateStableswapPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateStableswapPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateStableswapPoolResponse.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 *MsgCreateStableswapPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateStableswapPoolResponse.Merge(m, src) +} +func (m *MsgCreateStableswapPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateStableswapPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateStableswapPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateStableswapPoolResponse proto.InternalMessageInfo + +func (m *MsgCreateStableswapPoolResponse) GetPoolID() uint64 { + if m != nil { + return m.PoolID + } + return 0 +} + +func init() { + proto.RegisterType((*MsgCreateStableswapPool)(nil), "osmosis.gamm.stableswap.v1beta1.MsgCreateStableswapPool") + proto.RegisterType((*MsgCreateStableswapPoolResponse)(nil), "osmosis.gamm.stableswap.v1beta1.MsgCreateStableswapPoolResponse") +} + +func init() { + proto.RegisterFile("osmosis/gamm/pool-models/stableswap/tx.proto", fileDescriptor_46b7c8a0f24de97c) +} + +var fileDescriptor_46b7c8a0f24de97c = []byte{ + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xae, 0xe9, 0x54, 0x84, 0x27, 0x0e, 0x58, 0xd5, 0x28, 0x45, 0x8a, 0xab, 0x70, 0x29, 0x82, + 0xda, 0xac, 0x1c, 0xf8, 0x38, 0x4d, 0x19, 0x02, 0x4d, 0x62, 0x52, 0x09, 0xb7, 0x5d, 0x2a, 0xa7, + 0x31, 0xc1, 0x22, 0x89, 0x43, 0xec, 0x96, 0xf5, 0x06, 0xff, 0x00, 0x71, 0xe4, 0x27, 0xf0, 0x4b, + 0x76, 0xdc, 0x91, 0x53, 0x40, 0xed, 0x3f, 0xe8, 0x2f, 0x40, 0xb6, 0xd3, 0x6e, 0x87, 0x8d, 0x21, + 0x4e, 0x79, 0xf3, 0xf8, 0x79, 0x9f, 0xf7, 0xe3, 0x79, 0xe1, 0x43, 0xa9, 0x32, 0xa9, 0x84, 0xa2, + 0x09, 0xcb, 0x32, 0x5a, 0x48, 0x99, 0x0e, 0x32, 0x19, 0xf3, 0x54, 0x51, 0xa5, 0x59, 0x94, 0x72, + 0xf5, 0x89, 0x15, 0x54, 0x1f, 0x93, 0xa2, 0x94, 0x5a, 0x22, 0x5c, 0xb3, 0x89, 0x61, 0x93, 0x33, + 0x06, 0x99, 0xed, 0x46, 0x5c, 0xb3, 0xdd, 0xae, 0x37, 0xb1, 0x0c, 0x1a, 0x31, 0xc5, 0x69, 0x0d, + 0xd2, 0x89, 0x14, 0xb9, 0x13, 0xe8, 0xb6, 0x13, 0x99, 0x48, 0x1b, 0x52, 0x13, 0xd5, 0xe8, 0xb3, + 0x7f, 0x69, 0xe2, 0x2c, 0x1c, 0x1b, 0x86, 0x4b, 0xf5, 0x3f, 0x37, 0xe1, 0xed, 0x43, 0x95, 0xec, + 0x97, 0x9c, 0x69, 0xfe, 0x76, 0x43, 0x19, 0x49, 0x99, 0xa2, 0xfb, 0xb0, 0xa5, 0x78, 0x1e, 0xf3, + 0xb2, 0x03, 0x7a, 0xa0, 0x7f, 0x23, 0xb8, 0xb5, 0xaa, 0xf0, 0xcd, 0x39, 0xcb, 0xd2, 0xe7, 0xbe, + 0xc3, 0xfd, 0xb0, 0x26, 0xa0, 0x09, 0x84, 0x46, 0x74, 0xc4, 0x4a, 0x96, 0xa9, 0xce, 0xb5, 0x1e, + 0xe8, 0x6f, 0x0f, 0x1f, 0x90, 0x2b, 0xa6, 0x25, 0xa3, 0x4d, 0x4a, 0xb0, 0xb3, 0xaa, 0x30, 0x72, + 0xda, 0x46, 0x68, 0x5c, 0x58, 0xd8, 0x0f, 0xcf, 0xc9, 0xa2, 0x2f, 0x00, 0xee, 0x88, 0x5c, 0x68, + 0xc1, 0x52, 0x3b, 0xc2, 0x38, 0x15, 0x1f, 0xa7, 0x22, 0x16, 0x7a, 0xde, 0x69, 0xf6, 0x9a, 0xfd, + 0xed, 0xe1, 0x1d, 0xe2, 0xd6, 0x47, 0xcc, 0xfa, 0x36, 0x55, 0xf6, 0xa5, 0xc8, 0x83, 0x47, 0x27, + 0x15, 0x6e, 0xfc, 0xf8, 0x85, 0xfb, 0x89, 0xd0, 0xef, 0xa7, 0x11, 0x99, 0xc8, 0x8c, 0xd6, 0xbb, + 0x76, 0x9f, 0x81, 0x8a, 0x3f, 0x50, 0x3d, 0x2f, 0xb8, 0xb2, 0x09, 0x2a, 0x6c, 0xd7, 0xa5, 0x4c, + 0x93, 0xaf, 0xd7, 0x85, 0xd0, 0x1b, 0xd8, 0x7e, 0x37, 0xd5, 0xd3, 0x92, 0xbb, 0x0e, 0x12, 0x39, + 0xe3, 0x65, 0x2e, 0xcb, 0xce, 0x96, 0xdd, 0x10, 0x5e, 0x55, 0xf8, 0xae, 0x9b, 0xe2, 0x22, 0x96, + 0x1f, 0x22, 0x07, 0x1b, 0xcd, 0x57, 0x6b, 0xf0, 0x25, 0xc4, 0x97, 0x38, 0x10, 0x72, 0x55, 0xc8, + 0x5c, 0x71, 0x74, 0x0f, 0x5e, 0xb7, 0x42, 0x22, 0xb6, 0x56, 0x6c, 0x05, 0x70, 0x51, 0xe1, 0x96, + 0xa1, 0x1c, 0xbc, 0x08, 0x5b, 0xe6, 0xe9, 0x20, 0x1e, 0x7e, 0x07, 0xb0, 0x79, 0xa8, 0x12, 0xf4, + 0x0d, 0xc0, 0xf6, 0x85, 0x7e, 0x3e, 0xbd, 0xd2, 0x90, 0x4b, 0xfa, 0xe8, 0xee, 0xfd, 0x6f, 0xe6, + 0x7a, 0x82, 0xe0, 0xe8, 0x64, 0xe1, 0x81, 0xd3, 0x85, 0x07, 0x7e, 0x2f, 0x3c, 0xf0, 0x75, 0xe9, + 0x35, 0x4e, 0x97, 0x5e, 0xe3, 0xe7, 0xd2, 0x6b, 0x1c, 0xed, 0x9d, 0x73, 0xa4, 0xae, 0x32, 0x48, + 0x59, 0xa4, 0xd6, 0x3f, 0x74, 0xf6, 0x84, 0x1e, 0xff, 0xed, 0xb2, 0xa3, 0x96, 0x3d, 0xe5, 0xc7, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x2a, 0xeb, 0xc5, 0x8c, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + CreateStableswapPool(ctx context.Context, in *MsgCreateStableswapPool, opts ...grpc.CallOption) (*MsgCreateStableswapPoolResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateStableswapPool(ctx context.Context, in *MsgCreateStableswapPool, opts ...grpc.CallOption) (*MsgCreateStableswapPoolResponse, error) { + out := new(MsgCreateStableswapPoolResponse) + err := c.cc.Invoke(ctx, "/osmosis.gamm.stableswap.v1beta1.Msg/CreateStableswapPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateStableswapPool(context.Context, *MsgCreateStableswapPool) (*MsgCreateStableswapPoolResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateStableswapPool(ctx context.Context, req *MsgCreateStableswapPool) (*MsgCreateStableswapPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateStableswapPool not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateStableswapPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateStableswapPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateStableswapPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.gamm.stableswap.v1beta1.Msg/CreateStableswapPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateStableswapPool(ctx, req.(*MsgCreateStableswapPool)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "osmosis.gamm.stableswap.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateStableswapPool", + Handler: _Msg_CreateStableswapPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "osmosis/gamm/pool-models/stableswap/tx.proto", +} + +func (m *MsgCreateStableswapPool) 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 *MsgCreateStableswapPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateStableswapPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FuturePoolGovernor) > 0 { + i -= len(m.FuturePoolGovernor) + copy(dAtA[i:], m.FuturePoolGovernor) + i = encodeVarintTx(dAtA, i, uint64(len(m.FuturePoolGovernor))) + i-- + dAtA[i] = 0x22 + } + if len(m.InitialPoolLiquidity) > 0 { + for iNdEx := len(m.InitialPoolLiquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialPoolLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.PoolParams != nil { + { + size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateStableswapPoolResponse) 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 *MsgCreateStableswapPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateStableswapPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PoolID != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.PoolID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateStableswapPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PoolParams != nil { + l = m.PoolParams.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.InitialPoolLiquidity) > 0 { + for _, e := range m.InitialPoolLiquidity { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.FuturePoolGovernor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateStableswapPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolID != 0 { + n += 1 + sovTx(uint64(m.PoolID)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateStableswapPool) 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 ErrIntOverflowTx + } + 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: MsgCreateStableswapPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateStableswapPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PoolParams == nil { + m.PoolParams = &PoolParams{} + } + if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialPoolLiquidity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialPoolLiquidity = append(m.InitialPoolLiquidity, types.Coin{}) + if err := m.InitialPoolLiquidity[len(m.InitialPoolLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateStableswapPoolResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateStableswapPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateStableswapPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolID", wireType) + } + m.PoolID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gamm/types/errors.go b/x/gamm/types/errors.go index 78d935b5ae0..43c1b2a91dc 100644 --- a/x/gamm/types/errors.go +++ b/x/gamm/types/errors.go @@ -29,4 +29,6 @@ var ( ErrPoolParamsInvalidDenom = sdkerrors.Register(ModuleName, 50, "pool params' LBP params has an invalid denomination") ErrPoolParamsInvalidNumDenoms = sdkerrors.Register(ModuleName, 51, "pool params' LBP doesn't have same number of params as underlying pool") + + ErrNotImplemented = sdkerrors.Register(ModuleName, 60, "function not implemented") ) diff --git a/x/gamm/types/tx.pb.go b/x/gamm/types/tx.pb.go index 79ba0b422b3..053a8092199 100644 --- a/x/gamm/types/tx.pb.go +++ b/x/gamm/types/tx.pb.go @@ -532,11 +532,9 @@ var xxx_messageInfo_MsgSwapExactAmountOutResponse proto.InternalMessageInfo // ===================== MsgJoinSwapExternAmountIn // TODO: Rename to MsgJoinSwapExactAmountIn type MsgJoinSwapExternAmountIn struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=poolId,proto3" json:"poolId,omitempty" yaml:"pool_id"` - TokenIn types.Coin `protobuf:"bytes,3,opt,name=tokenIn,proto3" json:"tokenIn" yaml:"token_in"` - // reserved 3; - // reserved "token_in"; + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + PoolId uint64 `protobuf:"varint,2,opt,name=poolId,proto3" json:"poolId,omitempty" yaml:"pool_id"` + TokenIn types.Coin `protobuf:"bytes,3,opt,name=tokenIn,proto3" json:"tokenIn" yaml:"token_in"` ShareOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=shareOutMinAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shareOutMinAmount" yaml:"share_out_min_amount"` }