From 23413f87191edf56017b3f64a0e5f6ec11bd4db4 Mon Sep 17 00:00:00 2001 From: Tian Qin Date: Wed, 31 Jul 2024 11:53:48 -0400 Subject: [PATCH] add/modify proto to have individual vault quoting parameters --- proto/dydxprotocol/vault/genesis.proto | 5 +- proto/dydxprotocol/vault/params.proto | 10 +- proto/dydxprotocol/vault/query.proto | 3 +- proto/dydxprotocol/vault/share.proto | 23 + proto/dydxprotocol/vault/tx.proto | 16 +- proto/dydxprotocol/vault/vault.proto | 26 - protocol/x/vault/types/genesis.pb.go | 69 +-- protocol/x/vault/types/params.pb.go | 291 +++++++++--- protocol/x/vault/types/query.pb.go | 116 ++--- protocol/x/vault/types/share.pb.go | 553 ++++++++++++++++++++++ protocol/x/vault/types/tx.pb.go | 212 ++++----- protocol/x/vault/types/vault.pb.go | 627 +------------------------ 12 files changed, 1047 insertions(+), 904 deletions(-) create mode 100644 proto/dydxprotocol/vault/share.proto create mode 100644 protocol/x/vault/types/share.pb.go diff --git a/proto/dydxprotocol/vault/genesis.proto b/proto/dydxprotocol/vault/genesis.proto index e0346312b7..44f621303f 100644 --- a/proto/dydxprotocol/vault/genesis.proto +++ b/proto/dydxprotocol/vault/genesis.proto @@ -3,14 +3,15 @@ package dydxprotocol.vault; import "gogoproto/gogo.proto"; import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; import "dydxprotocol/vault/vault.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; // GenesisState defines `x/vault`'s genesis state. message GenesisState { - // The parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + // The default quoting parameters for all vaults. + QuotingParams default_quoting_params = 1 [ (gogoproto.nullable) = false ]; // The vaults. repeated Vault vaults = 2; } diff --git a/proto/dydxprotocol/vault/params.proto b/proto/dydxprotocol/vault/params.proto index baf96d7fc2..258f9d911e 100644 --- a/proto/dydxprotocol/vault/params.proto +++ b/proto/dydxprotocol/vault/params.proto @@ -5,8 +5,8 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; -// Params stores `x/vault` parameters. -message Params { +// QuotingParams stores vault quoting parameters. +message QuotingParams { // The number of layers of orders a vault places. For example if // `layers=2`, a vault places 2 asks and 2 bids. uint32 layers = 1; @@ -38,3 +38,9 @@ message Params { (gogoproto.nullable) = false ]; } + +// VaultParams stores individual parameters of a vault. +message VaultParams { + // The quoting parameters specific to this vault. + QuotingParams quoting_params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/dydxprotocol/vault/query.proto b/proto/dydxprotocol/vault/query.proto index babc5112b5..b00d6c35f5 100644 --- a/proto/dydxprotocol/vault/query.proto +++ b/proto/dydxprotocol/vault/query.proto @@ -6,6 +6,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "dydxprotocol/subaccounts/subaccount.proto"; import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; import "dydxprotocol/vault/vault.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; @@ -36,7 +37,7 @@ message QueryParamsRequest {} // QueryParamsResponse is a response type for the Params RPC method. message QueryParamsResponse { - Params params = 1 [ (gogoproto.nullable) = false ]; + QuotingParams default_quoting_params = 1 [ (gogoproto.nullable) = false ]; } // QueryVaultRequest is a request type for the Vault RPC method. diff --git a/proto/dydxprotocol/vault/share.proto b/proto/dydxprotocol/vault/share.proto new file mode 100644 index 0000000000..20dac51bb4 --- /dev/null +++ b/proto/dydxprotocol/vault/share.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// NumShares represents the number of shares in a vault. +message NumShares { + // Number of shares. + bytes num_shares = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// OwnerShare is a type for owner shares in a vault. +message OwnerShare { + string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + NumShares shares = 2; +} diff --git a/proto/dydxprotocol/vault/tx.proto b/proto/dydxprotocol/vault/tx.proto index e8d15fc9ca..6f17fd0bdb 100644 --- a/proto/dydxprotocol/vault/tx.proto +++ b/proto/dydxprotocol/vault/tx.proto @@ -15,8 +15,8 @@ service Msg { // DepositToVault deposits funds into a vault. rpc DepositToVault(MsgDepositToVault) returns (MsgDepositToVaultResponse); - // UpdateParams updates the Params in state. - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // UpdateDefaultQuotingParams updates the default quoting params in state. + rpc UpdateDefaultQuotingParams(MsgUpdateDefaultQuotingParams) returns (MsgUpdateDefaultQuotingParamsResponse); } // MsgDepositToVault deposits the specified asset from the subaccount to the @@ -44,15 +44,15 @@ message MsgDepositToVault { // MsgDepositToVaultResponse is the Msg/DepositToVault response type. message MsgDepositToVaultResponse {} -// MsgUpdateParams is the Msg/UpdateParams request type. -message MsgUpdateParams { +// MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request type. +message MsgUpdateDefaultQuotingParams { // Authority is the address that controls the module. option (cosmos.msg.v1.signer) = "authority"; string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // The parameters to update. Each field must be set. - Params params = 2 [ (gogoproto.nullable) = false ]; + // The quoting parameters to update to. Every field must be set. + QuotingParams default_quoting_params = 2 [ (gogoproto.nullable) = false ]; } -// MsgUpdateParamsResponse is the Msg/UpdateParams response type. -message MsgUpdateParamsResponse {} +// MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams response type. +message MsgUpdateDefaultQuotingParamsResponse {} diff --git a/proto/dydxprotocol/vault/vault.proto b/proto/dydxprotocol/vault/vault.proto index 547ffcb95a..527c4c4938 100644 --- a/proto/dydxprotocol/vault/vault.proto +++ b/proto/dydxprotocol/vault/vault.proto @@ -1,10 +1,6 @@ syntax = "proto3"; package dydxprotocol.vault; -import "dydxprotocol/prices/market_price.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; // VaultType represents different types of vaults. @@ -24,25 +20,3 @@ message VaultId { // Unique ID of the vault within above type. uint32 number = 2; } - -// NumShares represents the number of shares in a vault. -message NumShares { - // Number of shares. - bytes num_shares = 2 [ - (gogoproto.customtype) = - "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", - (gogoproto.nullable) = false - ]; -} - -// OwnerShare is a type for owner shares in a vault. -message OwnerShare { - string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - NumShares shares = 2; -} - -// VaultParams is the individual parameters of a vault. -message VaultParams { - // Lagged price that the vault quotes at. - dydxprotocol.prices.MarketPrice lagged_price = 1; -} diff --git a/protocol/x/vault/types/genesis.pb.go b/protocol/x/vault/types/genesis.pb.go index 66a8a9ec1c..2e5fdbf32e 100644 --- a/protocol/x/vault/types/genesis.pb.go +++ b/protocol/x/vault/types/genesis.pb.go @@ -25,8 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines `x/vault`'s genesis state. type GenesisState struct { - // The parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // The default quoting parameters for all vaults. + DefaultQuotingParams QuotingParams `protobuf:"bytes,1,opt,name=default_quoting_params,json=defaultQuotingParams,proto3" json:"default_quoting_params"` // The vaults. Vaults []*Vault `protobuf:"bytes,2,rep,name=vaults,proto3" json:"vaults,omitempty"` } @@ -64,11 +64,11 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { +func (m *GenesisState) GetDefaultQuotingParams() QuotingParams { if m != nil { - return m.Params + return m.DefaultQuotingParams } - return Params{} + return QuotingParams{} } func (m *GenesisState) GetVaults() []*Vault { @@ -168,31 +168,32 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/genesis.proto", fileDescriptor_4be4a747b209e41c) } var fileDescriptor_4be4a747b209e41c = []byte{ - // 379 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xbd, 0x6e, 0xdb, 0x30, - 0x14, 0x85, 0x25, 0xff, 0xb5, 0xa0, 0xd4, 0x85, 0x2d, 0x0a, 0x57, 0x45, 0x69, 0xc1, 0x93, 0x97, - 0x4a, 0xa8, 0x5d, 0xb4, 0x1d, 0x1b, 0x67, 0x08, 0xbc, 0xe4, 0x87, 0x06, 0x32, 0x64, 0x11, 0x64, - 0x89, 0x90, 0x05, 0x48, 0xa2, 0x21, 0xd2, 0x8e, 0x8d, 0xbc, 0x44, 0x5e, 0x28, 0xbb, 0x47, 0x8f, - 0x99, 0x82, 0xc0, 0x7e, 0x91, 0x40, 0x97, 0x8a, 0x93, 0x20, 0xf2, 0x42, 0x91, 0xe7, 0x7c, 0xe7, - 0xde, 0x2b, 0x82, 0xc8, 0x0e, 0x57, 0xe1, 0x72, 0x96, 0x73, 0xc9, 0x03, 0x9e, 0xb8, 0x0b, 0x7f, - 0x9e, 0x48, 0x37, 0x62, 0x19, 0x13, 0xb1, 0x70, 0x40, 0xc6, 0xf8, 0x35, 0xe1, 0x00, 0x61, 0x7d, - 0x89, 0x78, 0xc4, 0x41, 0x73, 0x8b, 0x9d, 0x22, 0xad, 0x4e, 0x45, 0xad, 0x99, 0x9f, 0xfb, 0x69, - 0x59, 0xca, 0x22, 0x15, 0x00, 0xac, 0xca, 0xef, 0xde, 0x20, 0xf3, 0x44, 0xf5, 0x1e, 0x4b, 0x5f, - 0x32, 0xfc, 0x0f, 0xb5, 0x54, 0xbe, 0xad, 0xdb, 0x7a, 0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0x46, - 0xb1, 0x9c, 0xce, 0x27, 0x4e, 0xc0, 0x53, 0xf7, 0xed, 0x0b, 0xf8, 0xfd, 0x33, 0x98, 0xfa, 0x71, - 0xe6, 0xee, 0x95, 0x65, 0xf9, 0x2a, 0xe4, 0x6a, 0xc6, 0xc4, 0xa4, 0x05, 0xfa, 0xe0, 0x29, 0x00, - 0x00, 0xff, 0xff, 0x85, 0x9d, 0xbd, 0xf3, 0xa5, 0x02, 0x00, 0x00, + // 397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcf, 0xee, 0xd2, 0x30, + 0x1c, 0xdf, 0x7e, 0xfc, 0xd1, 0x74, 0xf3, 0x52, 0x09, 0x41, 0x8c, 0x65, 0x72, 0xe2, 0xe2, 0x16, + 0xc1, 0xe8, 0x55, 0xf1, 0x60, 0xb8, 0xa8, 0x94, 0xc4, 0x83, 0x89, 0x59, 0xc6, 0x56, 0xc7, 0x92, + 0x6d, 0xc5, 0xb5, 0x43, 0x78, 0x0b, 0x1f, 0xc1, 0x17, 0xf1, 0xce, 0x91, 0xa3, 0x27, 0x63, 0xe0, + 0x45, 0x4c, 0xbf, 0x9d, 0x28, 0x71, 0x78, 0xe9, 0xda, 0xcf, 0xbf, 0x7e, 0xf6, 0x4d, 0x91, 0x13, + 0xed, 0xa2, 0xed, 0xba, 0xe0, 0x92, 0x87, 0x3c, 0xf5, 0x36, 0x41, 0x99, 0x4a, 0x2f, 0x66, 0x39, + 0x13, 0x89, 0x70, 0x01, 0xc6, 0xf8, 0x6f, 0x85, 0x0b, 0x8a, 0x7e, 0x27, 0xe6, 0x31, 0x07, 0xcc, + 0x53, 0x3b, 0xad, 0xec, 0x0f, 0x6a, 0xb2, 0xd6, 0x41, 0x11, 0x64, 0x55, 0x54, 0x9f, 0xd4, 0x08, + 0xc4, 0x2a, 0x28, 0xd8, 0x7f, 0x78, 0x58, 0x35, 0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0x8c, 0xee, + 0xd0, 0xbb, 0x8a, 0xa5, 0x40, 0xbe, 0x04, 0x6e, 0x16, 0x89, 0xe9, 0x7c, 0x7f, 0x24, 0xe6, 0xe1, + 0x48, 0xcc, 0x9f, 0x47, 0x62, 0x7e, 0x39, 0x11, 0xe3, 0x70, 0x22, 0xc6, 0xf7, 0x13, 0x31, 0xde, + 0x3f, 0x8b, 0x13, 0xb9, 0x2a, 0x97, 0x6e, 0xc8, 0x33, 0xef, 0xf2, 0x9d, 0x3c, 0x79, 0x14, 0xae, + 0x82, 0x24, 0xf7, 0xce, 0xc8, 0xb6, 0x7a, 0x3b, 0x72, 0xb7, 0x66, 0x62, 0xd9, 0x06, 0x7c, 0xf2, + 0x2b, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x97, 0xc5, 0x76, 0xeb, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -230,7 +231,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DefaultQuotingParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -350,7 +351,7 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Params.Size() + l = m.DefaultQuotingParams.Size() n += 1 + l + sovGenesis(uint64(l)) if len(m.Vaults) > 0 { for _, e := range m.Vaults { @@ -432,7 +433,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultQuotingParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -459,7 +460,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DefaultQuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/protocol/x/vault/types/params.pb.go b/protocol/x/vault/types/params.pb.go index af75318148..c0cb987a96 100644 --- a/protocol/x/vault/types/params.pb.go +++ b/protocol/x/vault/types/params.pb.go @@ -24,8 +24,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params stores `x/vault` parameters. -type Params struct { +// QuotingParams stores vault quoting parameters. +type QuotingParams struct { // The number of layers of orders a vault places. For example if // `layers=2`, a vault places 2 asks and 2 bids. Layers uint32 `protobuf:"varint,1,opt,name=layers,proto3" json:"layers,omitempty"` @@ -48,18 +48,18 @@ type Params struct { ActivationThresholdQuoteQuantums github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,7,opt,name=activation_threshold_quote_quantums,json=activationThresholdQuoteQuantums,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"activation_threshold_quote_quantums"` } -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { +func (m *QuotingParams) Reset() { *m = QuotingParams{} } +func (m *QuotingParams) String() string { return proto.CompactTextString(m) } +func (*QuotingParams) ProtoMessage() {} +func (*QuotingParams) Descriptor() ([]byte, []int) { return fileDescriptor_6043e0b8bfdbca9f, []int{0} } -func (m *Params) XXX_Unmarshal(b []byte) error { +func (m *QuotingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) + return xxx_messageInfo_QuotingParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -69,96 +69,146 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) +func (m *QuotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuotingParams.Merge(m, src) } -func (m *Params) XXX_Size() int { +func (m *QuotingParams) XXX_Size() int { return m.Size() } -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) +func (m *QuotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_QuotingParams.DiscardUnknown(m) } -var xxx_messageInfo_Params proto.InternalMessageInfo +var xxx_messageInfo_QuotingParams proto.InternalMessageInfo -func (m *Params) GetLayers() uint32 { +func (m *QuotingParams) GetLayers() uint32 { if m != nil { return m.Layers } return 0 } -func (m *Params) GetSpreadMinPpm() uint32 { +func (m *QuotingParams) GetSpreadMinPpm() uint32 { if m != nil { return m.SpreadMinPpm } return 0 } -func (m *Params) GetSpreadBufferPpm() uint32 { +func (m *QuotingParams) GetSpreadBufferPpm() uint32 { if m != nil { return m.SpreadBufferPpm } return 0 } -func (m *Params) GetSkewFactorPpm() uint32 { +func (m *QuotingParams) GetSkewFactorPpm() uint32 { if m != nil { return m.SkewFactorPpm } return 0 } -func (m *Params) GetOrderSizePctPpm() uint32 { +func (m *QuotingParams) GetOrderSizePctPpm() uint32 { if m != nil { return m.OrderSizePctPpm } return 0 } -func (m *Params) GetOrderExpirationSeconds() uint32 { +func (m *QuotingParams) GetOrderExpirationSeconds() uint32 { if m != nil { return m.OrderExpirationSeconds } return 0 } +// VaultParams stores individual parameters of a vault. +type VaultParams struct { + // The quoting parameters specific to this vault. + QuotingParams QuotingParams `protobuf:"bytes,1,opt,name=quoting_params,json=quotingParams,proto3" json:"quoting_params"` +} + +func (m *VaultParams) Reset() { *m = VaultParams{} } +func (m *VaultParams) String() string { return proto.CompactTextString(m) } +func (*VaultParams) ProtoMessage() {} +func (*VaultParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6043e0b8bfdbca9f, []int{1} +} +func (m *VaultParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VaultParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VaultParams.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 *VaultParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VaultParams.Merge(m, src) +} +func (m *VaultParams) XXX_Size() int { + return m.Size() +} +func (m *VaultParams) XXX_DiscardUnknown() { + xxx_messageInfo_VaultParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VaultParams proto.InternalMessageInfo + +func (m *VaultParams) GetQuotingParams() QuotingParams { + if m != nil { + return m.QuotingParams + } + return QuotingParams{} +} + func init() { - proto.RegisterType((*Params)(nil), "dydxprotocol.vault.Params") + proto.RegisterType((*QuotingParams)(nil), "dydxprotocol.vault.QuotingParams") + proto.RegisterType((*VaultParams)(nil), "dydxprotocol.vault.VaultParams") } func init() { proto.RegisterFile("dydxprotocol/vault/params.proto", fileDescriptor_6043e0b8bfdbca9f) } var fileDescriptor_6043e0b8bfdbca9f = []byte{ - // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x8f, 0xd3, 0x30, - 0x18, 0xc6, 0x13, 0x0a, 0x41, 0xb2, 0x5a, 0x2a, 0x22, 0x54, 0x45, 0x0c, 0x69, 0x05, 0x08, 0x55, - 0x20, 0x92, 0x01, 0x24, 0x18, 0x51, 0x25, 0x10, 0x0c, 0x48, 0xfd, 0xc3, 0xc4, 0x62, 0x39, 0x8e, - 0xdb, 0x58, 0x24, 0xb1, 0x6b, 0x3b, 0xa5, 0xed, 0xa7, 0x60, 0x63, 0xe0, 0x0b, 0x75, 0xec, 0x88, - 0x18, 0xa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, 0xce, 0xf1, 0xcc, 0xa6, 0xfe, 0x1f, 0x17, 0x3d, - 0x27, 0xd4, 0xf0, 0x95, 0x1d, 0x32, 0x99, 0x62, 0x3a, 0x13, 0x79, 0x8a, 0x97, 0x95, 0x30, 0x0c, - 0x2f, 0x2b, 0x52, 0x9a, 0xaa, 0xd0, 0xc1, 0xc3, 0x81, 0x3b, 0x6c, 0x8f, 0xbe, 0xec, 0x0e, 0x7d, - 0xe7, 0xff, 0xa1, 0xff, 0x71, 0xc1, 0x4d, 0x56, 0x25, 0x11, 0x15, 0x45, 0x7c, 0xfb, 0x3d, 0xde, - 0xbd, 0xa1, 0x19, 0xe1, 0x65, 0x7c, 0x26, 0xa9, 0xd9, 0x48, 0xa6, 0xa3, 0x19, 0x53, 0x9c, 0xe4, - 0x7c, 0x4b, 0x92, 0x9c, 0x7d, 0x2d, 0xcd, 0x74, 0x70, 0x5d, 0xfa, 0xfd, 0xaa, 0x73, 0x52, 0x57, - 0x4e, 0x9a, 0xc6, 0xd1, 0x64, 0x77, 0x0c, 0xdd, 0xfd, 0x31, 0x74, 0x2f, 0x8e, 0xa1, 0xfb, 0xfb, - 0x14, 0x3a, 0xfb, 0x53, 0xe8, 0xfc, 0x3b, 0x85, 0xce, 0x8f, 0xf7, 0x77, 0x6f, 0x5f, 0x37, 0x3f, - 0x04, 0x2e, 0x91, 0x78, 0xc0, 0xdf, 0x5e, 0x06, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x00, 0xa7, 0x50, - 0x44, 0x02, 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { + // 433 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x8b, 0xd4, 0x30, + 0x18, 0xc6, 0xa7, 0xee, 0x3a, 0x42, 0x76, 0x67, 0x17, 0x8b, 0x2c, 0xc5, 0x43, 0x67, 0x5c, 0x45, + 0x16, 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, 0xce, 0x37, + 0x71, 0xe7, 0xc7, 0x26, 0xee, 0x7c, 0x7c, 0x76, 0xf5, 0xe5, 0x16, 0xed, 0x7f, 0x08, 0x3b, 0xce, + 0xba, 0x90, 0x3f, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xd1, 0x51, 0x65, 0xaa, 0x02, 0x00, + 0x00, +} + +func (m *QuotingParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -168,12 +218,12 @@ func (m *Params) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Params) MarshalTo(dAtA []byte) (int, error) { +func (m *QuotingParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -221,6 +271,39 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VaultParams) 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 *VaultParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VaultParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.QuotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -232,7 +315,7 @@ func encodeVarintParams(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Params) Size() (n int) { +func (m *QuotingParams) Size() (n int) { if m == nil { return 0 } @@ -261,13 +344,24 @@ func (m *Params) Size() (n int) { return n } +func (m *VaultParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.QuotingParams.Size() + n += 1 + l + sovParams(uint64(l)) + return n +} + func sovParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozParams(x uint64) (n int) { return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Params) Unmarshal(dAtA []byte) error { +func (m *QuotingParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -290,10 +384,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") + return fmt.Errorf("proto: QuotingParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuotingParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -464,6 +558,89 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *VaultParams) 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 ErrIntOverflowParams + } + 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: VaultParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VaultParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuotingParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.QuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/vault/types/query.pb.go b/protocol/x/vault/types/query.pb.go index b6beacb3ee..34a087164b 100644 --- a/protocol/x/vault/types/query.pb.go +++ b/protocol/x/vault/types/query.pb.go @@ -71,7 +71,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse is a response type for the Params RPC method. type QueryParamsResponse struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + DefaultQuotingParams QuotingParams `protobuf:"bytes,1,opt,name=default_quoting_params,json=defaultQuotingParams,proto3" json:"default_quoting_params"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -107,11 +107,11 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() Params { +func (m *QueryParamsResponse) GetDefaultQuotingParams() QuotingParams { if m != nil { - return m.Params + return m.DefaultQuotingParams } - return Params{} + return QuotingParams{} } // QueryVaultRequest is a request type for the Vault RPC method. @@ -456,55 +456,57 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/query.proto", fileDescriptor_478fb8dc0ff21ea6) } var fileDescriptor_478fb8dc0ff21ea6 = []byte{ - // 765 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4b, 0x6f, 0xd3, 0x4a, - 0x18, 0x8d, 0x9b, 0x34, 0xf7, 0x76, 0x92, 0x5e, 0xe9, 0xce, 0xed, 0x2d, 0xc1, 0x2d, 0x6e, 0xb1, - 0x44, 0x9f, 0xe0, 0x21, 0x01, 0x89, 0x2e, 0x10, 0xa2, 0x5d, 0x14, 0xba, 0xa1, 0xad, 0x8b, 0x58, - 0xb0, 0xa0, 0x8c, 0x93, 0xc1, 0xb5, 0xe4, 0x78, 0x5c, 0x7b, 0x1c, 0x1a, 0xaa, 0x6e, 0x90, 0x58, - 0xb0, 0x43, 0xe2, 0x17, 0xc0, 0x82, 0x15, 0x7b, 0x96, 0x6c, 0xbb, 0xac, 0xc4, 0x06, 0xb1, 0xa8, - 0x50, 0xcb, 0x0f, 0x41, 0x9e, 0x99, 0x26, 0xce, 0xc3, 0x6a, 0x84, 0xba, 0x89, 0x26, 0xdf, 0x9c, - 0xef, 0x9c, 0xe3, 0xef, 0x31, 0x40, 0xab, 0x35, 0x6b, 0x7b, 0x7e, 0x40, 0x19, 0xad, 0x52, 0x17, - 0x35, 0x70, 0xe4, 0x32, 0xb4, 0x1b, 0x91, 0xa0, 0x69, 0xf0, 0x20, 0x84, 0xc9, 0x7b, 0x83, 0xdf, - 0xab, 0x63, 0x36, 0xb5, 0x29, 0x8f, 0xa1, 0xf8, 0x24, 0x90, 0xea, 0xa4, 0x4d, 0xa9, 0xed, 0x12, - 0x84, 0x7d, 0x07, 0x61, 0xcf, 0xa3, 0x0c, 0x33, 0x87, 0x7a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0c, 0x2c, 0xdd, 0x2c, 0x71, 0x37, 0x15, - 0x78, 0xb3, 0x9f, 0x9b, 0xe4, 0xb4, 0x76, 0x17, 0x6b, 0x65, 0xf3, 0xf0, 0x44, 0x53, 0x8e, 0x4e, - 0x34, 0xe5, 0xe7, 0x89, 0xa6, 0xbc, 0x3b, 0xd5, 0x32, 0x47, 0xa7, 0x5a, 0xe6, 0xfb, 0xa9, 0x96, - 0x79, 0x7a, 0x67, 0xf0, 0xd7, 0x74, 0x4f, 0x2a, 0xf1, 0x47, 0xd5, 0xca, 0xf3, 0xf8, 0xad, 0xdf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x91, 0x1e, 0x58, 0x7b, 0x08, 0x00, 0x00, + // 788 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x4f, 0x13, 0x4f, + 0x14, 0xef, 0xd2, 0xd2, 0xef, 0x97, 0x69, 0x31, 0x71, 0x44, 0xac, 0x05, 0x17, 0xd8, 0x44, 0x7e, + 0xea, 0x8e, 0xad, 0x26, 0x7a, 0x30, 0x46, 0x38, 0xa0, 0x5c, 0x94, 0x2e, 0xc6, 0x83, 0x89, 0xd6, + 0x69, 0x3b, 0x2c, 0x9b, 0x6c, 0x77, 0xda, 0xdd, 0xd9, 0x4a, 0x25, 0x5c, 0x4c, 0x3c, 0x78, 0x33, + 0xf1, 0x2f, 0xd0, 0x83, 0x27, 0xef, 0x1e, 0xbd, 0x72, 0x24, 0xf1, 0x62, 0x3c, 0x10, 0x03, 0xfe, + 0x21, 0x66, 0x67, 0xa6, 0xed, 0xf6, 0xc7, 0x4a, 0x63, 0xb8, 0x90, 0xed, 0x7b, 0x6f, 0x3e, 0x9f, + 0xcf, 0xbc, 0xf7, 0x79, 0x03, 0x50, 0x2b, 0xcd, 0xca, 0x6e, 0xcd, 0xa5, 0x8c, 0x96, 0xa9, 0x8d, +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, 0x39, 0x4e, 0xbe, 0x02, 0x97, 0x50, 0xd4, 0x7f, 0x03, 0xb4, 0x17, + 0x78, 0x62, 0x1f, 0xed, 0x09, 0x13, 0xec, 0xc3, 0xb7, 0x0a, 0x18, 0x6b, 0xef, 0x02, 0x5c, 0x8a, + 0x24, 0xea, 0xdd, 0xc8, 0xec, 0xf2, 0x30, 0xa5, 0x52, 0xd7, 0x1c, 0xd7, 0x35, 0x05, 0x2f, 0x47, + 0xea, 0x82, 0x9f, 0x14, 0x90, 0x0a, 0x19, 0x08, 0xae, 0x44, 0xc2, 0xf7, 0x6f, 0x45, 0xf6, 0xda, + 0x70, 0xc5, 0x52, 0xcd, 0x1d, 0xae, 0x26, 0x0f, 0x6f, 0x0c, 0x52, 0x13, 0x76, 0x6b, 0x6f, 0xb3, + 0xd6, 0x0a, 0x07, 0xc7, 0xaa, 0x72, 0x78, 0xac, 0x2a, 0xbf, 0x8e, 0x55, 0xe5, 0xfd, 0x89, 0x1a, + 0x3b, 0x3c, 0x51, 0x63, 0x3f, 0x4e, 0xd4, 0xd8, 0xb3, 0xdb, 0xc3, 0xbf, 0xa6, 0xbb, 0x92, 0x89, + 0x3f, 0xaa, 0xa5, 0x24, 0x8f, 0xdf, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x73, 0x54, 0x73, 0x3c, + 0xc0, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -747,7 +749,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DefaultQuotingParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1069,7 +1071,7 @@ func (m *QueryParamsResponse) Size() (n int) { } var l int _ = l - l = m.Params.Size() + l = m.DefaultQuotingParams.Size() n += 1 + l + sovQuery(uint64(l)) return n } @@ -1265,7 +1267,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultQuotingParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1292,7 +1294,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DefaultQuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/protocol/x/vault/types/share.pb.go b/protocol/x/vault/types/share.pb.go new file mode 100644 index 0000000000..0dee7e8a42 --- /dev/null +++ b/protocol/x/vault/types/share.pb.go @@ -0,0 +1,553 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dydxprotocol/vault/share.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_dydxprotocol_v4_chain_protocol_dtypes "github.com/dydxprotocol/v4-chain/protocol/dtypes" + 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 + +// NumShares represents the number of shares in a vault. +type NumShares struct { + // Number of shares. + NumShares github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,2,opt,name=num_shares,json=numShares,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"num_shares"` +} + +func (m *NumShares) Reset() { *m = NumShares{} } +func (m *NumShares) String() string { return proto.CompactTextString(m) } +func (*NumShares) ProtoMessage() {} +func (*NumShares) Descriptor() ([]byte, []int) { + return fileDescriptor_b65bab3182bbf56c, []int{0} +} +func (m *NumShares) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NumShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NumShares.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 *NumShares) XXX_Merge(src proto.Message) { + xxx_messageInfo_NumShares.Merge(m, src) +} +func (m *NumShares) XXX_Size() int { + return m.Size() +} +func (m *NumShares) XXX_DiscardUnknown() { + xxx_messageInfo_NumShares.DiscardUnknown(m) +} + +var xxx_messageInfo_NumShares proto.InternalMessageInfo + +// OwnerShare is a type for owner shares in a vault. +type OwnerShare struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Shares *NumShares `protobuf:"bytes,2,opt,name=shares,proto3" json:"shares,omitempty"` +} + +func (m *OwnerShare) Reset() { *m = OwnerShare{} } +func (m *OwnerShare) String() string { return proto.CompactTextString(m) } +func (*OwnerShare) ProtoMessage() {} +func (*OwnerShare) Descriptor() ([]byte, []int) { + return fileDescriptor_b65bab3182bbf56c, []int{1} +} +func (m *OwnerShare) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OwnerShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OwnerShare.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 *OwnerShare) XXX_Merge(src proto.Message) { + xxx_messageInfo_OwnerShare.Merge(m, src) +} +func (m *OwnerShare) XXX_Size() int { + return m.Size() +} +func (m *OwnerShare) XXX_DiscardUnknown() { + xxx_messageInfo_OwnerShare.DiscardUnknown(m) +} + +var xxx_messageInfo_OwnerShare proto.InternalMessageInfo + +func (m *OwnerShare) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *OwnerShare) GetShares() *NumShares { + if m != nil { + return m.Shares + } + return nil +} + +func init() { + proto.RegisterType((*NumShares)(nil), "dydxprotocol.vault.NumShares") + proto.RegisterType((*OwnerShare)(nil), "dydxprotocol.vault.OwnerShare") +} + +func init() { proto.RegisterFile("dydxprotocol/vault/share.proto", fileDescriptor_b65bab3182bbf56c) } + +var fileDescriptor_b65bab3182bbf56c = []byte{ + // 286 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x2f, 0x4b, 0x2c, 0xcd, 0x29, 0xd1, 0x2f, + 0xce, 0x48, 0x2c, 0x4a, 0xd5, 0x03, 0x0b, 0x0a, 0x09, 0x21, 0xcb, 0xeb, 0x81, 0xe5, 0xa5, 0x44, + 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0xa5, 0x94, 0x64, 0x72, 0x7e, 0x71, + 0x6e, 0x7e, 0x71, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x48, 0x29, 0x95, 0x70, 0x71, 0xfa, 0x95, 0xe6, + 0x06, 0x83, 0x8c, 0x2d, 0x16, 0x4a, 0xe7, 0xe2, 0xca, 0x2b, 0xcd, 0x8d, 0x07, 0x5b, 0x52, 0x2c, + 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0xe3, 0xe4, 0x71, 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0x0e, + 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xa8, 0x0e, 0x33, 0xd1, 0x4d, + 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0x8b, 0xa4, 0x94, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x05, 0xa7, + 0x16, 0x65, 0x26, 0xe6, 0x64, 0x56, 0x25, 0x26, 0xe5, 0xa4, 0x7a, 0xe6, 0x95, 0x04, 0x71, 0xe6, + 0xc1, 0x2c, 0x52, 0x2a, 0xe6, 0xe2, 0xf2, 0x2f, 0xcf, 0x4b, 0x2d, 0x02, 0x73, 0x85, 0xf4, 0xb8, + 0x58, 0xf3, 0x41, 0x3c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, + 0xa0, 0x8e, 0x74, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x0e, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, + 0x82, 0x28, 0x13, 0x32, 0xe5, 0x62, 0x43, 0x72, 0x22, 0xb7, 0x91, 0xac, 0x1e, 0x66, 0x48, 0xe8, + 0xc1, 0x7d, 0x15, 0x04, 0x55, 0xec, 0x14, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, + 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, + 0x0c, 0x51, 0xe6, 0xc4, 0xfb, 0xad, 0x02, 0x1a, 0x11, 0x60, 0x2f, 0x26, 0xb1, 0x81, 0xc5, 0x8d, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x11, 0x60, 0xb8, 0x3e, 0xab, 0x01, 0x00, 0x00, +} + +func (m *NumShares) 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 *NumShares) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NumShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.NumShares.Size() + i -= size + if _, err := m.NumShares.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintShare(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} + +func (m *OwnerShare) 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 *OwnerShare) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OwnerShare) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Shares != nil { + { + size, err := m.Shares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintShare(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintShare(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintShare(dAtA []byte, offset int, v uint64) int { + offset -= sovShare(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *NumShares) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.NumShares.Size() + n += 1 + l + sovShare(uint64(l)) + return n +} + +func (m *OwnerShare) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovShare(uint64(l)) + } + if m.Shares != nil { + l = m.Shares.Size() + n += 1 + l + sovShare(uint64(l)) + } + return n +} + +func sovShare(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozShare(x uint64) (n int) { + return sovShare(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *NumShares) 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 ErrIntOverflowShare + } + 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: NumShares: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NumShares: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NumShares", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShare + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthShare + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthShare + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NumShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipShare(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthShare + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OwnerShare) 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 ErrIntOverflowShare + } + 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: OwnerShare: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OwnerShare: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShare + } + 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 ErrInvalidLengthShare + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthShare + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShare + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthShare + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthShare + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Shares == nil { + m.Shares = &NumShares{} + } + if err := m.Shares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipShare(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthShare + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipShare(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, ErrIntOverflowShare + } + 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, ErrIntOverflowShare + } + 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, ErrIntOverflowShare + } + 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, ErrInvalidLengthShare + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupShare + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthShare + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthShare = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowShare = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupShare = fmt.Errorf("proto: unexpected end of group") +) diff --git a/protocol/x/vault/types/tx.pb.go b/protocol/x/vault/types/tx.pb.go index 7b407301fb..7de57c637a 100644 --- a/protocol/x/vault/types/tx.pb.go +++ b/protocol/x/vault/types/tx.pb.go @@ -127,25 +127,25 @@ func (m *MsgDepositToVaultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositToVaultResponse proto.InternalMessageInfo -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { +// MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request type. +type MsgUpdateDefaultQuotingParams struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // The parameters to update. Each field must be set. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` + // The quoting parameters to update to. Every field must be set. + DefaultQuotingParams QuotingParams `protobuf:"bytes,2,opt,name=default_quoting_params,json=defaultQuotingParams,proto3" json:"default_quoting_params"` } -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { +func (m *MsgUpdateDefaultQuotingParams) Reset() { *m = MsgUpdateDefaultQuotingParams{} } +func (m *MsgUpdateDefaultQuotingParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDefaultQuotingParams) ProtoMessage() {} +func (*MsgUpdateDefaultQuotingParams) Descriptor() ([]byte, []int) { return fileDescriptor_ced574c6017ce006, []int{2} } -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateDefaultQuotingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateDefaultQuotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateDefaultQuotingParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -155,48 +155,48 @@ func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) +func (m *MsgUpdateDefaultQuotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDefaultQuotingParams.Merge(m, src) } -func (m *MsgUpdateParams) XXX_Size() int { +func (m *MsgUpdateDefaultQuotingParams) XXX_Size() int { return m.Size() } -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +func (m *MsgUpdateDefaultQuotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDefaultQuotingParams.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateDefaultQuotingParams proto.InternalMessageInfo -func (m *MsgUpdateParams) GetAuthority() string { +func (m *MsgUpdateDefaultQuotingParams) GetAuthority() string { if m != nil { return m.Authority } return "" } -func (m *MsgUpdateParams) GetParams() Params { +func (m *MsgUpdateDefaultQuotingParams) GetDefaultQuotingParams() QuotingParams { if m != nil { - return m.Params + return m.DefaultQuotingParams } - return Params{} + return QuotingParams{} } -// MsgUpdateParamsResponse is the Msg/UpdateParams response type. -type MsgUpdateParamsResponse struct { +// MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams response type. +type MsgUpdateDefaultQuotingParamsResponse struct { } -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateDefaultQuotingParamsResponse) Reset() { *m = MsgUpdateDefaultQuotingParamsResponse{} } +func (m *MsgUpdateDefaultQuotingParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDefaultQuotingParamsResponse) ProtoMessage() {} +func (*MsgUpdateDefaultQuotingParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ced574c6017ce006, []int{3} } -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateDefaultQuotingParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateDefaultQuotingParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateDefaultQuotingParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -206,61 +206,63 @@ func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +func (m *MsgUpdateDefaultQuotingParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDefaultQuotingParamsResponse.Merge(m, src) } -func (m *MsgUpdateParamsResponse) XXX_Size() int { +func (m *MsgUpdateDefaultQuotingParamsResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +func (m *MsgUpdateDefaultQuotingParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDefaultQuotingParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateDefaultQuotingParamsResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgDepositToVault)(nil), "dydxprotocol.vault.MsgDepositToVault") proto.RegisterType((*MsgDepositToVaultResponse)(nil), "dydxprotocol.vault.MsgDepositToVaultResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "dydxprotocol.vault.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dydxprotocol.vault.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateDefaultQuotingParams)(nil), "dydxprotocol.vault.MsgUpdateDefaultQuotingParams") + proto.RegisterType((*MsgUpdateDefaultQuotingParamsResponse)(nil), "dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse") } func init() { proto.RegisterFile("dydxprotocol/vault/tx.proto", fileDescriptor_ced574c6017ce006) } var fileDescriptor_ced574c6017ce006 = []byte{ - // 504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0x5b, 0x54, 0xe8, 0x92, 0x06, 0xb1, 0xaa, 0xd4, 0xc4, 0x91, 0x9c, 0x2a, 0x08, 0x54, - 0x40, 0xb1, 0x45, 0x41, 0x05, 0xf5, 0x04, 0x11, 0x07, 0x22, 0x14, 0x89, 0x3a, 0xc0, 0x81, 0x4b, - 0xd8, 0x78, 0x17, 0xc7, 0x52, 0xec, 0x75, 0x3d, 0xeb, 0x28, 0xe1, 0xc8, 0x17, 0x20, 0x71, 0xe6, - 0x1f, 0x38, 0xf0, 0x11, 0xbd, 0x51, 0x71, 0x42, 0x1c, 0x2a, 0x94, 0x1c, 0xf8, 0x0d, 0xe4, 0xb5, - 0xdd, 0xd8, 0x89, 0x91, 0x72, 0x49, 0x66, 0x67, 0xde, 0xec, 0x7b, 0xf3, 0x76, 0x8c, 0xea, 0x74, - 0x4a, 0x27, 0x7e, 0xc0, 0x05, 0xb7, 0xf8, 0xc8, 0x18, 0x93, 0x70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0x5f, 0x73, 0xad, 0xf4, 0xee, 0xf1, 0xfa, 0xeb, 0x31, - 0x49, 0xbf, 0xef, 0x68, 0x4b, 0x06, 0x5b, 0x32, 0xff, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x67, 0x36, 0x31, 0xb6, 0x02, 0x04, 0x00, 0x00, + // 529 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x5b, 0x04, 0x74, 0x69, 0x23, 0xb1, 0x8a, 0x20, 0x75, 0x84, 0x53, 0x22, 0x15, 0x0a, + 0x52, 0x6c, 0xb5, 0xa0, 0x22, 0x7a, 0x82, 0xa8, 0x07, 0x22, 0x14, 0x89, 0x38, 0xc0, 0x01, 0x09, + 0x59, 0x1b, 0xef, 0xd6, 0xb1, 0x14, 0x7b, 0x1d, 0xef, 0x3a, 0x4a, 0x38, 0x72, 0xe4, 0xc4, 0x0f, + 0xf0, 0x0f, 0x1c, 0xf8, 0x06, 0xd4, 0x63, 0xc5, 0x09, 0x71, 0xa8, 0x50, 0x72, 0xe0, 0x1f, 0x38, + 0x21, 0xef, 0xda, 0x4d, 0x4c, 0xdc, 0x2a, 0xbd, 0x24, 0xb3, 0x33, 0xf3, 0x66, 0xe6, 0xbd, 0x19, + 0x19, 0x54, 0xf0, 0x18, 0x8f, 0x82, 0x90, 0x72, 0x6a, 0xd3, 0xbe, 0x31, 0x44, 0x51, 0x9f, 0x1b, + 0x7c, 0xa4, 0x0b, 0x0f, 0x84, 0xf3, 0x41, 0x5d, 0x04, 0xd5, 0x4d, 0x9b, 0x32, 0x8f, 0x32, 0x4b, + 0xb8, 0x0d, 0xf9, 0x90, 0xe9, 0xea, 0x6d, 0xf9, 0x32, 0x3c, 0xe6, 0x18, 0xc3, 0xdd, 0xf8, 0x2f, + 0x09, 0x3c, 0xc8, 0x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0x76, 0xaf, + 0x0a, 0xff, 0xa3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x66, 0x7c, 0x37, 0x6e, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -277,8 +279,8 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // DepositToVault deposits funds into a vault. DepositToVault(ctx context.Context, in *MsgDepositToVault, opts ...grpc.CallOption) (*MsgDepositToVaultResponse, error) - // UpdateParams updates the Params in state. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // UpdateDefaultQuotingParams updates the default quoting params in state. + UpdateDefaultQuotingParams(ctx context.Context, in *MsgUpdateDefaultQuotingParams, opts ...grpc.CallOption) (*MsgUpdateDefaultQuotingParamsResponse, error) } type msgClient struct { @@ -298,9 +300,9 @@ func (c *msgClient) DepositToVault(ctx context.Context, in *MsgDepositToVault, o return out, nil } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.vault.Msg/UpdateParams", in, out, opts...) +func (c *msgClient) UpdateDefaultQuotingParams(ctx context.Context, in *MsgUpdateDefaultQuotingParams, opts ...grpc.CallOption) (*MsgUpdateDefaultQuotingParamsResponse, error) { + out := new(MsgUpdateDefaultQuotingParamsResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.vault.Msg/UpdateDefaultQuotingParams", in, out, opts...) if err != nil { return nil, err } @@ -311,8 +313,8 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts type MsgServer interface { // DepositToVault deposits funds into a vault. DepositToVault(context.Context, *MsgDepositToVault) (*MsgDepositToVaultResponse, error) - // UpdateParams updates the Params in state. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // UpdateDefaultQuotingParams updates the default quoting params in state. + UpdateDefaultQuotingParams(context.Context, *MsgUpdateDefaultQuotingParams) (*MsgUpdateDefaultQuotingParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -322,8 +324,8 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) DepositToVault(ctx context.Context, req *MsgDepositToVault) (*MsgDepositToVaultResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DepositToVault not implemented") } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +func (*UnimplementedMsgServer) UpdateDefaultQuotingParams(ctx context.Context, req *MsgUpdateDefaultQuotingParams) (*MsgUpdateDefaultQuotingParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDefaultQuotingParams not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -348,20 +350,20 @@ func _Msg_DepositToVault_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) +func _Msg_UpdateDefaultQuotingParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateDefaultQuotingParams) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) + return srv.(MsgServer).UpdateDefaultQuotingParams(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/dydxprotocol.vault.Msg/UpdateParams", + FullMethod: "/dydxprotocol.vault.Msg/UpdateDefaultQuotingParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + return srv.(MsgServer).UpdateDefaultQuotingParams(ctx, req.(*MsgUpdateDefaultQuotingParams)) } return interceptor(ctx, in, info, handler) } @@ -375,8 +377,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_DepositToVault_Handler, }, { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, + MethodName: "UpdateDefaultQuotingParams", + Handler: _Msg_UpdateDefaultQuotingParams_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -463,7 +465,7 @@ func (m *MsgDepositToVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateDefaultQuotingParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -473,18 +475,18 @@ func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateDefaultQuotingParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateDefaultQuotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DefaultQuotingParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -503,7 +505,7 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateDefaultQuotingParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -513,12 +515,12 @@ func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateDefaultQuotingParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateDefaultQuotingParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -565,7 +567,7 @@ func (m *MsgDepositToVaultResponse) Size() (n int) { return n } -func (m *MsgUpdateParams) Size() (n int) { +func (m *MsgUpdateDefaultQuotingParams) Size() (n int) { if m == nil { return 0 } @@ -575,12 +577,12 @@ func (m *MsgUpdateParams) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() + l = m.DefaultQuotingParams.Size() n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgUpdateParamsResponse) Size() (n int) { +func (m *MsgUpdateDefaultQuotingParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -800,7 +802,7 @@ func (m *MsgDepositToVaultResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateDefaultQuotingParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -823,10 +825,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateDefaultQuotingParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateDefaultQuotingParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -863,7 +865,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultQuotingParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -890,7 +892,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DefaultQuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -915,7 +917,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateDefaultQuotingParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -938,10 +940,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateDefaultQuotingParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateDefaultQuotingParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/protocol/x/vault/types/vault.pb.go b/protocol/x/vault/types/vault.pb.go index 12b6c3d190..99577b61fe 100644 --- a/protocol/x/vault/types/vault.pb.go +++ b/protocol/x/vault/types/vault.pb.go @@ -5,11 +5,7 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - github_com_dydxprotocol_v4_chain_protocol_dtypes "github.com/dydxprotocol/v4-chain/protocol/dtypes" - types "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" io "io" math "math" math_bits "math/bits" @@ -109,184 +105,29 @@ func (m *VaultId) GetNumber() uint32 { return 0 } -// NumShares represents the number of shares in a vault. -type NumShares struct { - // Number of shares. - NumShares github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,2,opt,name=num_shares,json=numShares,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"num_shares"` -} - -func (m *NumShares) Reset() { *m = NumShares{} } -func (m *NumShares) String() string { return proto.CompactTextString(m) } -func (*NumShares) ProtoMessage() {} -func (*NumShares) Descriptor() ([]byte, []int) { - return fileDescriptor_32accb5830bb2860, []int{1} -} -func (m *NumShares) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NumShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NumShares.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 *NumShares) XXX_Merge(src proto.Message) { - xxx_messageInfo_NumShares.Merge(m, src) -} -func (m *NumShares) XXX_Size() int { - return m.Size() -} -func (m *NumShares) XXX_DiscardUnknown() { - xxx_messageInfo_NumShares.DiscardUnknown(m) -} - -var xxx_messageInfo_NumShares proto.InternalMessageInfo - -// OwnerShare is a type for owner shares in a vault. -type OwnerShare struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Shares *NumShares `protobuf:"bytes,2,opt,name=shares,proto3" json:"shares,omitempty"` -} - -func (m *OwnerShare) Reset() { *m = OwnerShare{} } -func (m *OwnerShare) String() string { return proto.CompactTextString(m) } -func (*OwnerShare) ProtoMessage() {} -func (*OwnerShare) Descriptor() ([]byte, []int) { - return fileDescriptor_32accb5830bb2860, []int{2} -} -func (m *OwnerShare) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OwnerShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OwnerShare.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 *OwnerShare) XXX_Merge(src proto.Message) { - xxx_messageInfo_OwnerShare.Merge(m, src) -} -func (m *OwnerShare) XXX_Size() int { - return m.Size() -} -func (m *OwnerShare) XXX_DiscardUnknown() { - xxx_messageInfo_OwnerShare.DiscardUnknown(m) -} - -var xxx_messageInfo_OwnerShare proto.InternalMessageInfo - -func (m *OwnerShare) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *OwnerShare) GetShares() *NumShares { - if m != nil { - return m.Shares - } - return nil -} - -// VaultParams is the individual parameters of a vault. -type VaultParams struct { - // Lagged price that the vault quotes at. - LaggedPrice *types.MarketPrice `protobuf:"bytes,1,opt,name=lagged_price,json=laggedPrice,proto3" json:"lagged_price,omitempty"` -} - -func (m *VaultParams) Reset() { *m = VaultParams{} } -func (m *VaultParams) String() string { return proto.CompactTextString(m) } -func (*VaultParams) ProtoMessage() {} -func (*VaultParams) Descriptor() ([]byte, []int) { - return fileDescriptor_32accb5830bb2860, []int{3} -} -func (m *VaultParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VaultParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VaultParams.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 *VaultParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VaultParams.Merge(m, src) -} -func (m *VaultParams) XXX_Size() int { - return m.Size() -} -func (m *VaultParams) XXX_DiscardUnknown() { - xxx_messageInfo_VaultParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VaultParams proto.InternalMessageInfo - -func (m *VaultParams) GetLaggedPrice() *types.MarketPrice { - if m != nil { - return m.LaggedPrice - } - return nil -} - func init() { proto.RegisterEnum("dydxprotocol.vault.VaultType", VaultType_name, VaultType_value) proto.RegisterType((*VaultId)(nil), "dydxprotocol.vault.VaultId") - proto.RegisterType((*NumShares)(nil), "dydxprotocol.vault.NumShares") - proto.RegisterType((*OwnerShare)(nil), "dydxprotocol.vault.OwnerShare") - proto.RegisterType((*VaultParams)(nil), "dydxprotocol.vault.VaultParams") } func init() { proto.RegisterFile("dydxprotocol/vault/vault.proto", fileDescriptor_32accb5830bb2860) } var fileDescriptor_32accb5830bb2860 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0x11, 0x04, 0x65, 0x52, 0xa0, 0x5a, 0xaa, 0x2a, 0x44, 0xc2, 0x8d, 0x72, 0x40, 0x15, - 0x52, 0xd7, 0xa2, 0x80, 0xb8, 0x70, 0xa0, 0x09, 0x41, 0x44, 0x2a, 0x6d, 0x70, 0xd2, 0x4a, 0x70, - 0xb1, 0x36, 0xf6, 0xca, 0xb1, 0xb0, 0xbd, 0xd6, 0xee, 0x1a, 0x1a, 0xbe, 0x82, 0x8f, 0xe1, 0x23, - 0x7a, 0xac, 0x38, 0x21, 0x0e, 0x11, 0x4a, 0x7e, 0x04, 0x79, 0xd6, 0x44, 0x89, 0xe0, 0xd0, 0x8b, - 0xb5, 0x6f, 0xde, 0x1b, 0xbf, 0x9d, 0x37, 0x0b, 0x4e, 0x38, 0x0b, 0x2f, 0x72, 0x29, 0xb4, 0x08, - 0x44, 0xe2, 0x7e, 0x66, 0x45, 0xa2, 0xcd, 0x97, 0x62, 0x91, 0x90, 0x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 0xae, 0xd4, 0x48, 0xcb, 0x38, 0x8b, 0x3c, 0x23, 0x23, 0xcf, 0xa1, 0xb6, 0x76, 0xc5, 0xc6, 0xff, - 0x03, 0x58, 0x4d, 0xe5, 0x55, 0xe2, 0x8e, 0x07, 0x0d, 0x4c, 0x65, 0xc8, 0x24, 0x4b, 0x15, 0xe9, - 0xc1, 0x56, 0xc2, 0xa2, 0x88, 0x87, 0x66, 0x2d, 0x68, 0xde, 0x38, 0x6c, 0x6f, 0xfe, 0xcb, 0xec, - 0x8f, 0xbe, 0xc3, 0xfd, 0x0d, 0x4b, 0xe0, 0x35, 0x4c, 0x17, 0x82, 0xc7, 0x2f, 0xa1, 0xbe, 0x4a, - 0x9a, 0xb4, 0x60, 0xf7, 0xfc, 0xe8, 0xec, 0x78, 0xec, 0x8f, 0x3f, 0x0c, 0xfb, 0xfe, 0xd9, 0xc9, - 0x68, 0xd8, 0xef, 0x0d, 0xde, 0x0c, 0xfa, 0xaf, 0xb7, 0x2d, 0x72, 0x1f, 0xee, 0xad, 0x71, 0xbd, - 0xe3, 0xd3, 0xee, 0xb6, 0xdd, 0x7d, 0x7f, 0xb9, 0x70, 0xec, 0xab, 0x85, 0x63, 0xff, 0x5e, 0x38, - 0xf6, 0xb7, 0xa5, 0x63, 0x5d, 0x2d, 0x1d, 0xeb, 0xe7, 0xd2, 0xb1, 0x3e, 0xbe, 0xb8, 0x7e, 0xda, - 0x17, 0xd5, 0xc3, 0xc4, 0xd0, 0x27, 0x35, 0xac, 0x3f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x5e, - 0x16, 0x11, 0xfd, 0xbb, 0x02, 0x00, 0x00, + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x2f, 0x4b, 0x2c, 0xcd, 0x29, 0x81, 0x90, + 0x7a, 0x60, 0x41, 0x21, 0x21, 0x64, 0x79, 0x3d, 0xb0, 0x8c, 0x52, 0x08, 0x17, 0x7b, 0x18, 0x88, + 0xe1, 0x99, 0x22, 0x64, 0xc8, 0xc5, 0x52, 0x52, 0x59, 0x90, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, + 0x67, 0x24, 0xab, 0x87, 0xa9, 0x5a, 0x0f, 0xac, 0x34, 0xa4, 0xb2, 0x20, 0x35, 0x08, 0xac, 0x54, + 0x48, 0x8c, 0x8b, 0x2d, 0xaf, 0x34, 0x37, 0x29, 0xb5, 0x48, 0x82, 0x49, 0x81, 0x51, 0x83, 0x37, + 0x08, 0xca, 0xd3, 0xb2, 0xe1, 0xe2, 0x84, 0x2b, 0x15, 0x92, 0xe2, 0x12, 0x0b, 0x73, 0x0c, 0xf5, + 0x09, 0x89, 0x0f, 0x89, 0x0c, 0x70, 0x8d, 0x0f, 0xf5, 0x0b, 0x0e, 0x70, 0x75, 0xf6, 0x74, 0xf3, + 0x74, 0x75, 0x11, 0x60, 0x10, 0x12, 0xe6, 0xe2, 0x47, 0x92, 0x73, 0xf6, 0xf1, 0x77, 0x12, 0x60, + 0x74, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, + 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf3, 0xf4, 0xcc, + 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x54, 0xcf, 0x9a, 0xe8, 0x26, 0x67, 0x24, + 0x66, 0xe6, 0xe9, 0xc3, 0x45, 0x2a, 0xa0, 0x01, 0x00, 0x72, 0x67, 0x71, 0x12, 0x1b, 0x58, 0xdc, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x06, 0x99, 0xfd, 0x23, 0x01, 0x00, 0x00, } func (m *VaultId) Marshal() (dAtA []byte, err error) { @@ -322,116 +163,6 @@ func (m *VaultId) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *NumShares) 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 *NumShares) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NumShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.NumShares.Size() - i -= size - if _, err := m.NumShares.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} - -func (m *OwnerShare) 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 *OwnerShare) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OwnerShare) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Shares != nil { - { - size, err := m.Shares.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintVault(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VaultParams) 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 *VaultParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VaultParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LaggedPrice != nil { - { - size, err := m.LaggedPrice.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintVault(dAtA []byte, offset int, v uint64) int { offset -= sovVault(v) base := offset @@ -458,47 +189,6 @@ func (m *VaultId) Size() (n int) { return n } -func (m *NumShares) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.NumShares.Size() - n += 1 + l + sovVault(uint64(l)) - return n -} - -func (m *OwnerShare) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovVault(uint64(l)) - } - if m.Shares != nil { - l = m.Shares.Size() - n += 1 + l + sovVault(uint64(l)) - } - return n -} - -func (m *VaultParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LaggedPrice != nil { - l = m.LaggedPrice.Size() - n += 1 + l + sovVault(uint64(l)) - } - return n -} - func sovVault(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -593,293 +283,6 @@ func (m *VaultId) Unmarshal(dAtA []byte) error { } return nil } -func (m *NumShares) 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 ErrIntOverflowVault - } - 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: NumShares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NumShares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NumShares", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthVault - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NumShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVault(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVault - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OwnerShare) 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 ErrIntOverflowVault - } - 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: OwnerShare: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OwnerShare: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVault - } - 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 ErrInvalidLengthVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVault - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shares == nil { - m.Shares = &NumShares{} - } - if err := m.Shares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVault(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVault - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VaultParams) 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 ErrIntOverflowVault - } - 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: VaultParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VaultParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LaggedPrice", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVault - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LaggedPrice == nil { - m.LaggedPrice = &types.MarketPrice{} - } - if err := m.LaggedPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVault(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthVault - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipVault(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0