github.com/InjectiveLabs/sdk-go@v1.53.0/chain/insurance/types/genesis.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: injective/insurance/v1beta1/genesis.proto
     3  
     4  package types
     5  
     6  import (
     7  	fmt "fmt"
     8  	_ "github.com/cosmos/gogoproto/gogoproto"
     9  	proto "github.com/cosmos/gogoproto/proto"
    10  	io "io"
    11  	math "math"
    12  	math_bits "math/bits"
    13  )
    14  
    15  // Reference imports to suppress errors if they are not otherwise used.
    16  var _ = proto.Marshal
    17  var _ = fmt.Errorf
    18  var _ = math.Inf
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the proto package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // proto package needs to be updated.
    24  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    25  
    26  // GenesisState defines the insurance module's genesis state.
    27  type GenesisState struct {
    28  	// params defines all the parameters of related to insurance.
    29  	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
    30  	// insurance_funds describes the insurance funds available for derivative
    31  	// markets
    32  	InsuranceFunds []InsuranceFund `protobuf:"bytes,2,rep,name=insurance_funds,json=insuranceFunds,proto3" json:"insurance_funds"`
    33  	// redemption_schedule describes the redemption requests pending
    34  	RedemptionSchedule []RedemptionSchedule `protobuf:"bytes,3,rep,name=redemption_schedule,json=redemptionSchedule,proto3" json:"redemption_schedule"`
    35  	// next_share_denom_id describes the next share denom id to be used for newly
    36  	// creating insurance fund incremented by 1 per insurance fund creation
    37  	NextShareDenomId uint64 `protobuf:"varint,4,opt,name=next_share_denom_id,json=nextShareDenomId,proto3" json:"next_share_denom_id,omitempty"`
    38  	// next_redemption_schedule_id describes next redemption schedule id to be
    39  	// used for next schedule incremented by 1 per redemption request
    40  	NextRedemptionScheduleId uint64 `protobuf:"varint,5,opt,name=next_redemption_schedule_id,json=nextRedemptionScheduleId,proto3" json:"next_redemption_schedule_id,omitempty"`
    41  }
    42  
    43  func (m *GenesisState) Reset()         { *m = GenesisState{} }
    44  func (m *GenesisState) String() string { return proto.CompactTextString(m) }
    45  func (*GenesisState) ProtoMessage()    {}
    46  func (*GenesisState) Descriptor() ([]byte, []int) {
    47  	return fileDescriptor_293324fee7d3f3b1, []int{0}
    48  }
    49  func (m *GenesisState) XXX_Unmarshal(b []byte) error {
    50  	return m.Unmarshal(b)
    51  }
    52  func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    53  	if deterministic {
    54  		return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
    55  	} else {
    56  		b = b[:cap(b)]
    57  		n, err := m.MarshalToSizedBuffer(b)
    58  		if err != nil {
    59  			return nil, err
    60  		}
    61  		return b[:n], nil
    62  	}
    63  }
    64  func (m *GenesisState) XXX_Merge(src proto.Message) {
    65  	xxx_messageInfo_GenesisState.Merge(m, src)
    66  }
    67  func (m *GenesisState) XXX_Size() int {
    68  	return m.Size()
    69  }
    70  func (m *GenesisState) XXX_DiscardUnknown() {
    71  	xxx_messageInfo_GenesisState.DiscardUnknown(m)
    72  }
    73  
    74  var xxx_messageInfo_GenesisState proto.InternalMessageInfo
    75  
    76  func (m *GenesisState) GetParams() Params {
    77  	if m != nil {
    78  		return m.Params
    79  	}
    80  	return Params{}
    81  }
    82  
    83  func (m *GenesisState) GetInsuranceFunds() []InsuranceFund {
    84  	if m != nil {
    85  		return m.InsuranceFunds
    86  	}
    87  	return nil
    88  }
    89  
    90  func (m *GenesisState) GetRedemptionSchedule() []RedemptionSchedule {
    91  	if m != nil {
    92  		return m.RedemptionSchedule
    93  	}
    94  	return nil
    95  }
    96  
    97  func (m *GenesisState) GetNextShareDenomId() uint64 {
    98  	if m != nil {
    99  		return m.NextShareDenomId
   100  	}
   101  	return 0
   102  }
   103  
   104  func (m *GenesisState) GetNextRedemptionScheduleId() uint64 {
   105  	if m != nil {
   106  		return m.NextRedemptionScheduleId
   107  	}
   108  	return 0
   109  }
   110  
   111  func init() {
   112  	proto.RegisterType((*GenesisState)(nil), "injective.insurance.v1beta1.GenesisState")
   113  }
   114  
   115  func init() {
   116  	proto.RegisterFile("injective/insurance/v1beta1/genesis.proto", fileDescriptor_293324fee7d3f3b1)
   117  }
   118  
   119  var fileDescriptor_293324fee7d3f3b1 = []byte{
   120  	// 360 bytes of a gzipped FileDescriptorProto
   121  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x4a, 0xeb, 0x40,
   122  	0x14, 0x86, 0x93, 0xdb, 0xde, 0x2e, 0xd2, 0xcb, 0x55, 0x52, 0x17, 0xa1, 0x85, 0x58, 0x74, 0x53,
   123  	0x95, 0x66, 0x68, 0x5d, 0xbb, 0xb0, 0x88, 0x12, 0x10, 0x94, 0x76, 0xa5, 0x9b, 0x30, 0xc9, 0x9c,
   124  	0x26, 0x23, 0x66, 0x26, 0x64, 0x26, 0x45, 0xb7, 0x3e, 0x81, 0x8f, 0xd5, 0x65, 0x97, 0xae, 0x44,
   125  	0xda, 0x17, 0x91, 0x4c, 0xd3, 0x58, 0xa8, 0x64, 0x77, 0x72, 0xfe, 0xef, 0xff, 0xcf, 0x39, 0x64,
   126  	0x8c, 0x13, 0xca, 0x9e, 0x20, 0x90, 0x74, 0x06, 0x88, 0x32, 0x91, 0xa5, 0x98, 0x05, 0x80, 0x66,
   127  	0x03, 0x1f, 0x24, 0x1e, 0xa0, 0x10, 0x18, 0x08, 0x2a, 0x9c, 0x24, 0xe5, 0x92, 0x9b, 0x9d, 0x12,
   128  	0x75, 0x4a, 0xd4, 0x29, 0xd0, 0xf6, 0x59, 0x55, 0xce, 0x0f, 0xae, 0x92, 0xda, 0x07, 0x21, 0x0f,
   129  	0xb9, 0x2a, 0x51, 0x5e, 0xad, 0xbb, 0x47, 0x6f, 0x35, 0xe3, 0xdf, 0xcd, 0x7a, 0xe2, 0x44, 0x62,
   130  	0x09, 0xe6, 0xa5, 0xd1, 0x48, 0x70, 0x8a, 0x63, 0x61, 0xe9, 0x5d, 0xbd, 0xd7, 0x1c, 0x1e, 0x3b,
   131  	0x15, 0x1b, 0x38, 0xf7, 0x0a, 0x1d, 0xd5, 0xe7, 0x9f, 0x87, 0xda, 0xb8, 0x30, 0x9a, 0x0f, 0xc6,
   132  	0x5e, 0x49, 0x7a, 0xd3, 0x8c, 0x11, 0x61, 0xfd, 0xe9, 0xd6, 0x7a, 0xcd, 0xe1, 0x69, 0x65, 0x96,
   133  	0xbb, 0xe9, 0x5c, 0x67, 0x8c, 0x14, 0x91, 0xff, 0xe9, 0x76, 0x53, 0x98, 0x53, 0xa3, 0x95, 0x02,
   134  	0x81, 0x38, 0x91, 0x94, 0x33, 0x4f, 0x04, 0x11, 0x90, 0xec, 0x19, 0xac, 0x9a, 0x8a, 0x47, 0x95,
   135  	0xf1, 0xe3, 0xd2, 0x37, 0x29, 0x6c, 0xc5, 0x0c, 0x33, 0xdd, 0x51, 0xcc, 0xbe, 0xd1, 0x62, 0xf0,
   136  	0x22, 0x3d, 0x11, 0xe1, 0x14, 0x3c, 0x02, 0x8c, 0xc7, 0x1e, 0x25, 0x56, 0xbd, 0xab, 0xf7, 0xea,
   137  	0xe3, 0xfd, 0x5c, 0x9a, 0xe4, 0xca, 0x55, 0x2e, 0xb8, 0xc4, 0xbc, 0x30, 0x3a, 0x0a, 0xff, 0x65,
   138  	0xb7, 0xdc, 0xf6, 0x57, 0xd9, 0xac, 0x1c, 0xd9, 0xdd, 0xc2, 0x25, 0x23, 0x3a, 0x5f, 0xda, 0xfa,
   139  	0x62, 0x69, 0xeb, 0x5f, 0x4b, 0x5b, 0x7f, 0x5f, 0xd9, 0xda, 0x62, 0x65, 0x6b, 0x1f, 0x2b, 0x5b,
   140  	0x7b, 0xbc, 0x0b, 0xa9, 0x8c, 0x32, 0xdf, 0x09, 0x78, 0x8c, 0xdc, 0xcd, 0x71, 0xb7, 0xd8, 0x17,
   141  	0xa8, 0x3c, 0xb5, 0x1f, 0xf0, 0x14, 0xb6, 0x3f, 0x23, 0x4c, 0x19, 0x8a, 0x79, 0x9e, 0x2d, 0xb6,
   142  	0xde, 0x85, 0x7c, 0x4d, 0x40, 0xf8, 0x0d, 0xf5, 0xdb, 0xcf, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff,
   143  	0x41, 0xfa, 0xec, 0x9b, 0x83, 0x02, 0x00, 0x00,
   144  }
   145  
   146  func (m *GenesisState) Marshal() (dAtA []byte, err error) {
   147  	size := m.Size()
   148  	dAtA = make([]byte, size)
   149  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   150  	if err != nil {
   151  		return nil, err
   152  	}
   153  	return dAtA[:n], nil
   154  }
   155  
   156  func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
   157  	size := m.Size()
   158  	return m.MarshalToSizedBuffer(dAtA[:size])
   159  }
   160  
   161  func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   162  	i := len(dAtA)
   163  	_ = i
   164  	var l int
   165  	_ = l
   166  	if m.NextRedemptionScheduleId != 0 {
   167  		i = encodeVarintGenesis(dAtA, i, uint64(m.NextRedemptionScheduleId))
   168  		i--
   169  		dAtA[i] = 0x28
   170  	}
   171  	if m.NextShareDenomId != 0 {
   172  		i = encodeVarintGenesis(dAtA, i, uint64(m.NextShareDenomId))
   173  		i--
   174  		dAtA[i] = 0x20
   175  	}
   176  	if len(m.RedemptionSchedule) > 0 {
   177  		for iNdEx := len(m.RedemptionSchedule) - 1; iNdEx >= 0; iNdEx-- {
   178  			{
   179  				size, err := m.RedemptionSchedule[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   180  				if err != nil {
   181  					return 0, err
   182  				}
   183  				i -= size
   184  				i = encodeVarintGenesis(dAtA, i, uint64(size))
   185  			}
   186  			i--
   187  			dAtA[i] = 0x1a
   188  		}
   189  	}
   190  	if len(m.InsuranceFunds) > 0 {
   191  		for iNdEx := len(m.InsuranceFunds) - 1; iNdEx >= 0; iNdEx-- {
   192  			{
   193  				size, err := m.InsuranceFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   194  				if err != nil {
   195  					return 0, err
   196  				}
   197  				i -= size
   198  				i = encodeVarintGenesis(dAtA, i, uint64(size))
   199  			}
   200  			i--
   201  			dAtA[i] = 0x12
   202  		}
   203  	}
   204  	{
   205  		size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
   206  		if err != nil {
   207  			return 0, err
   208  		}
   209  		i -= size
   210  		i = encodeVarintGenesis(dAtA, i, uint64(size))
   211  	}
   212  	i--
   213  	dAtA[i] = 0xa
   214  	return len(dAtA) - i, nil
   215  }
   216  
   217  func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
   218  	offset -= sovGenesis(v)
   219  	base := offset
   220  	for v >= 1<<7 {
   221  		dAtA[offset] = uint8(v&0x7f | 0x80)
   222  		v >>= 7
   223  		offset++
   224  	}
   225  	dAtA[offset] = uint8(v)
   226  	return base
   227  }
   228  func (m *GenesisState) Size() (n int) {
   229  	if m == nil {
   230  		return 0
   231  	}
   232  	var l int
   233  	_ = l
   234  	l = m.Params.Size()
   235  	n += 1 + l + sovGenesis(uint64(l))
   236  	if len(m.InsuranceFunds) > 0 {
   237  		for _, e := range m.InsuranceFunds {
   238  			l = e.Size()
   239  			n += 1 + l + sovGenesis(uint64(l))
   240  		}
   241  	}
   242  	if len(m.RedemptionSchedule) > 0 {
   243  		for _, e := range m.RedemptionSchedule {
   244  			l = e.Size()
   245  			n += 1 + l + sovGenesis(uint64(l))
   246  		}
   247  	}
   248  	if m.NextShareDenomId != 0 {
   249  		n += 1 + sovGenesis(uint64(m.NextShareDenomId))
   250  	}
   251  	if m.NextRedemptionScheduleId != 0 {
   252  		n += 1 + sovGenesis(uint64(m.NextRedemptionScheduleId))
   253  	}
   254  	return n
   255  }
   256  
   257  func sovGenesis(x uint64) (n int) {
   258  	return (math_bits.Len64(x|1) + 6) / 7
   259  }
   260  func sozGenesis(x uint64) (n int) {
   261  	return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   262  }
   263  func (m *GenesisState) Unmarshal(dAtA []byte) error {
   264  	l := len(dAtA)
   265  	iNdEx := 0
   266  	for iNdEx < l {
   267  		preIndex := iNdEx
   268  		var wire uint64
   269  		for shift := uint(0); ; shift += 7 {
   270  			if shift >= 64 {
   271  				return ErrIntOverflowGenesis
   272  			}
   273  			if iNdEx >= l {
   274  				return io.ErrUnexpectedEOF
   275  			}
   276  			b := dAtA[iNdEx]
   277  			iNdEx++
   278  			wire |= uint64(b&0x7F) << shift
   279  			if b < 0x80 {
   280  				break
   281  			}
   282  		}
   283  		fieldNum := int32(wire >> 3)
   284  		wireType := int(wire & 0x7)
   285  		if wireType == 4 {
   286  			return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
   287  		}
   288  		if fieldNum <= 0 {
   289  			return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
   290  		}
   291  		switch fieldNum {
   292  		case 1:
   293  			if wireType != 2 {
   294  				return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
   295  			}
   296  			var msglen int
   297  			for shift := uint(0); ; shift += 7 {
   298  				if shift >= 64 {
   299  					return ErrIntOverflowGenesis
   300  				}
   301  				if iNdEx >= l {
   302  					return io.ErrUnexpectedEOF
   303  				}
   304  				b := dAtA[iNdEx]
   305  				iNdEx++
   306  				msglen |= int(b&0x7F) << shift
   307  				if b < 0x80 {
   308  					break
   309  				}
   310  			}
   311  			if msglen < 0 {
   312  				return ErrInvalidLengthGenesis
   313  			}
   314  			postIndex := iNdEx + msglen
   315  			if postIndex < 0 {
   316  				return ErrInvalidLengthGenesis
   317  			}
   318  			if postIndex > l {
   319  				return io.ErrUnexpectedEOF
   320  			}
   321  			if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   322  				return err
   323  			}
   324  			iNdEx = postIndex
   325  		case 2:
   326  			if wireType != 2 {
   327  				return fmt.Errorf("proto: wrong wireType = %d for field InsuranceFunds", wireType)
   328  			}
   329  			var msglen int
   330  			for shift := uint(0); ; shift += 7 {
   331  				if shift >= 64 {
   332  					return ErrIntOverflowGenesis
   333  				}
   334  				if iNdEx >= l {
   335  					return io.ErrUnexpectedEOF
   336  				}
   337  				b := dAtA[iNdEx]
   338  				iNdEx++
   339  				msglen |= int(b&0x7F) << shift
   340  				if b < 0x80 {
   341  					break
   342  				}
   343  			}
   344  			if msglen < 0 {
   345  				return ErrInvalidLengthGenesis
   346  			}
   347  			postIndex := iNdEx + msglen
   348  			if postIndex < 0 {
   349  				return ErrInvalidLengthGenesis
   350  			}
   351  			if postIndex > l {
   352  				return io.ErrUnexpectedEOF
   353  			}
   354  			m.InsuranceFunds = append(m.InsuranceFunds, InsuranceFund{})
   355  			if err := m.InsuranceFunds[len(m.InsuranceFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   356  				return err
   357  			}
   358  			iNdEx = postIndex
   359  		case 3:
   360  			if wireType != 2 {
   361  				return fmt.Errorf("proto: wrong wireType = %d for field RedemptionSchedule", wireType)
   362  			}
   363  			var msglen int
   364  			for shift := uint(0); ; shift += 7 {
   365  				if shift >= 64 {
   366  					return ErrIntOverflowGenesis
   367  				}
   368  				if iNdEx >= l {
   369  					return io.ErrUnexpectedEOF
   370  				}
   371  				b := dAtA[iNdEx]
   372  				iNdEx++
   373  				msglen |= int(b&0x7F) << shift
   374  				if b < 0x80 {
   375  					break
   376  				}
   377  			}
   378  			if msglen < 0 {
   379  				return ErrInvalidLengthGenesis
   380  			}
   381  			postIndex := iNdEx + msglen
   382  			if postIndex < 0 {
   383  				return ErrInvalidLengthGenesis
   384  			}
   385  			if postIndex > l {
   386  				return io.ErrUnexpectedEOF
   387  			}
   388  			m.RedemptionSchedule = append(m.RedemptionSchedule, RedemptionSchedule{})
   389  			if err := m.RedemptionSchedule[len(m.RedemptionSchedule)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   390  				return err
   391  			}
   392  			iNdEx = postIndex
   393  		case 4:
   394  			if wireType != 0 {
   395  				return fmt.Errorf("proto: wrong wireType = %d for field NextShareDenomId", wireType)
   396  			}
   397  			m.NextShareDenomId = 0
   398  			for shift := uint(0); ; shift += 7 {
   399  				if shift >= 64 {
   400  					return ErrIntOverflowGenesis
   401  				}
   402  				if iNdEx >= l {
   403  					return io.ErrUnexpectedEOF
   404  				}
   405  				b := dAtA[iNdEx]
   406  				iNdEx++
   407  				m.NextShareDenomId |= uint64(b&0x7F) << shift
   408  				if b < 0x80 {
   409  					break
   410  				}
   411  			}
   412  		case 5:
   413  			if wireType != 0 {
   414  				return fmt.Errorf("proto: wrong wireType = %d for field NextRedemptionScheduleId", wireType)
   415  			}
   416  			m.NextRedemptionScheduleId = 0
   417  			for shift := uint(0); ; shift += 7 {
   418  				if shift >= 64 {
   419  					return ErrIntOverflowGenesis
   420  				}
   421  				if iNdEx >= l {
   422  					return io.ErrUnexpectedEOF
   423  				}
   424  				b := dAtA[iNdEx]
   425  				iNdEx++
   426  				m.NextRedemptionScheduleId |= uint64(b&0x7F) << shift
   427  				if b < 0x80 {
   428  					break
   429  				}
   430  			}
   431  		default:
   432  			iNdEx = preIndex
   433  			skippy, err := skipGenesis(dAtA[iNdEx:])
   434  			if err != nil {
   435  				return err
   436  			}
   437  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   438  				return ErrInvalidLengthGenesis
   439  			}
   440  			if (iNdEx + skippy) > l {
   441  				return io.ErrUnexpectedEOF
   442  			}
   443  			iNdEx += skippy
   444  		}
   445  	}
   446  
   447  	if iNdEx > l {
   448  		return io.ErrUnexpectedEOF
   449  	}
   450  	return nil
   451  }
   452  func skipGenesis(dAtA []byte) (n int, err error) {
   453  	l := len(dAtA)
   454  	iNdEx := 0
   455  	depth := 0
   456  	for iNdEx < l {
   457  		var wire uint64
   458  		for shift := uint(0); ; shift += 7 {
   459  			if shift >= 64 {
   460  				return 0, ErrIntOverflowGenesis
   461  			}
   462  			if iNdEx >= l {
   463  				return 0, io.ErrUnexpectedEOF
   464  			}
   465  			b := dAtA[iNdEx]
   466  			iNdEx++
   467  			wire |= (uint64(b) & 0x7F) << shift
   468  			if b < 0x80 {
   469  				break
   470  			}
   471  		}
   472  		wireType := int(wire & 0x7)
   473  		switch wireType {
   474  		case 0:
   475  			for shift := uint(0); ; shift += 7 {
   476  				if shift >= 64 {
   477  					return 0, ErrIntOverflowGenesis
   478  				}
   479  				if iNdEx >= l {
   480  					return 0, io.ErrUnexpectedEOF
   481  				}
   482  				iNdEx++
   483  				if dAtA[iNdEx-1] < 0x80 {
   484  					break
   485  				}
   486  			}
   487  		case 1:
   488  			iNdEx += 8
   489  		case 2:
   490  			var length int
   491  			for shift := uint(0); ; shift += 7 {
   492  				if shift >= 64 {
   493  					return 0, ErrIntOverflowGenesis
   494  				}
   495  				if iNdEx >= l {
   496  					return 0, io.ErrUnexpectedEOF
   497  				}
   498  				b := dAtA[iNdEx]
   499  				iNdEx++
   500  				length |= (int(b) & 0x7F) << shift
   501  				if b < 0x80 {
   502  					break
   503  				}
   504  			}
   505  			if length < 0 {
   506  				return 0, ErrInvalidLengthGenesis
   507  			}
   508  			iNdEx += length
   509  		case 3:
   510  			depth++
   511  		case 4:
   512  			if depth == 0 {
   513  				return 0, ErrUnexpectedEndOfGroupGenesis
   514  			}
   515  			depth--
   516  		case 5:
   517  			iNdEx += 4
   518  		default:
   519  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   520  		}
   521  		if iNdEx < 0 {
   522  			return 0, ErrInvalidLengthGenesis
   523  		}
   524  		if depth == 0 {
   525  			return iNdEx, nil
   526  		}
   527  	}
   528  	return 0, io.ErrUnexpectedEOF
   529  }
   530  
   531  var (
   532  	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
   533  	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
   534  	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
   535  )