From df8aa3afc98d71c0fc5739287f078a7fcae4bb35 Mon Sep 17 00:00:00 2001 From: mike <142298428+mikebraver@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:16:22 +0800 Subject: [PATCH] feat: add the avs reward --- proto/exocore/avs/tx.proto | 4 +- x/avs/types/tx.pb.go | 235 +++++-- x/feedistribution/types/genesis.pb.go | 326 ++++++++++ x/feedistribution/types/params.pb.go | 291 +++++++++ x/feedistribution/types/query.pb.go | 540 ++++++++++++++++ x/feedistribution/types/query.pb.gw.go | 148 +++++ x/feedistribution/types/tx.pb.go | 599 ++++++++++++++++++ x/oracle/types/query.pb.go | 134 ++-- x/oracle/types/query.pb.gw.go | 3 - x/reward/keeper/hooks.go | 37 +- x/reward/keeper/keeper.go | 6 +- .../{reward_pool.go => reward_record.go} | 16 +- 12 files changed, 2214 insertions(+), 125 deletions(-) create mode 100644 x/feedistribution/types/genesis.pb.go create mode 100644 x/feedistribution/types/params.pb.go create mode 100644 x/feedistribution/types/query.pb.go create mode 100644 x/feedistribution/types/query.pb.gw.go create mode 100644 x/feedistribution/types/tx.pb.go rename x/reward/keeper/{reward_pool.go => reward_record.go} (80%) diff --git a/proto/exocore/avs/tx.proto b/proto/exocore/avs/tx.proto index 646fcc4d1..bb7274d54 100644 --- a/proto/exocore/avs/tx.proto +++ b/proto/exocore/avs/tx.proto @@ -28,7 +28,7 @@ message AVSInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - //avs epoch ,Subsequently will be handled by the epochs module. + // avs epoch ,Subsequently will be handled by the epochs module. string epoch_identifier = 8; // registered operator of avs repeated string operator_address = 9; @@ -36,6 +36,8 @@ message AVSInfo { // Effective current epoch, accounting for current_epoch + 1 // and current_epoch is the integer identifier of the epoch module int64 starting_epoch = 10; + // asset_reward_commission_epoch_basis is the avs reward distribution based on asset per eopch end. + map asset_reward_amount_epoch_basis = 11; } // RegisterAVSReq is requst to register avs diff --git a/x/avs/types/tx.pb.go b/x/avs/types/tx.pb.go index fd58da719..fe97ca29d 100644 --- a/x/avs/types/tx.pb.go +++ b/x/avs/types/tx.pb.go @@ -47,13 +47,15 @@ type AVSInfo struct { AvsUnbondingPeriod uint32 `protobuf:"varint,6,opt,name=avs_unbonding_period,json=avsUnbondingPeriod,proto3" json:"avs_unbonding_period,omitempty"` // the operator minimum delegation amount. MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` - //avs epoch ,Subsequently will be handled by the epochs module. + // avs epoch ,Subsequently will be handled by the epochs module. EpochIdentifier string `protobuf:"bytes,8,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` // registered operator of avs OperatorAddress []string `protobuf:"bytes,9,rep,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // Effective current epoch, accounting for current_epoch + 1 // and current_epoch is the integer identifier of the epoch module StartingEpoch int64 `protobuf:"varint,10,opt,name=starting_epoch,json=startingEpoch,proto3" json:"starting_epoch,omitempty"` + // asset_reward_commission_epoch_basis is the avs reward distribution based on asset per eopch end. + AssetRewardAmountEpochBasis map[string]int64 `protobuf:"bytes,11,rep,name=asset_reward_amount_epoch_basis,json=assetRewardAmountEpochBasis,proto3" json:"asset_reward_amount_epoch_basis,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } func (m *AVSInfo) Reset() { *m = AVSInfo{} } @@ -152,6 +154,13 @@ func (m *AVSInfo) GetStartingEpoch() int64 { return 0 } +func (m *AVSInfo) GetAssetRewardAmountEpochBasis() map[string]int64 { + if m != nil { + return m.AssetRewardAmountEpochBasis + } + return nil +} + // RegisterAVSReq is requst to register avs type RegisterAVSReq struct { // from_address is the source @@ -374,6 +383,7 @@ func (m *DeRegisterAVSResponse) GetInfo() *AVSInfo { func init() { proto.RegisterType((*AVSInfo)(nil), "exocore.avs.AVSInfo") + proto.RegisterMapType((map[string]int64)(nil), "exocore.avs.AVSInfo.AssetRewardAmountEpochBasisEntry") proto.RegisterType((*RegisterAVSReq)(nil), "exocore.avs.RegisterAVSReq") proto.RegisterType((*RegisterAVSResponse)(nil), "exocore.avs.RegisterAVSResponse") proto.RegisterType((*DeRegisterAVSReq)(nil), "exocore.avs.DeRegisterAVSReq") @@ -383,46 +393,51 @@ func init() { func init() { proto.RegisterFile("exocore/avs/tx.proto", fileDescriptor_c92b5dfe90086a66) } var fileDescriptor_c92b5dfe90086a66 = []byte{ - // 617 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x4d, 0x4f, 0x13, 0x4f, - 0x1c, 0xee, 0xfc, 0xcb, 0x5b, 0x7f, 0xfd, 0xf3, 0x36, 0xd4, 0xb8, 0xd4, 0x50, 0x9a, 0x26, 0x9a, - 0x4a, 0xd2, 0xae, 0xe2, 0x4d, 0xbd, 0x40, 0x40, 0xd3, 0xc4, 0xb7, 0x6c, 0x23, 0x07, 0x2f, 0x9b, - 0xa1, 0x3b, 0x5d, 0x26, 0x74, 0x67, 0xea, 0xcc, 0xb0, 0xe0, 0xcd, 0x78, 0x33, 0x26, 0x86, 0x4f, - 0x62, 0x38, 0xf0, 0x05, 0xbc, 0x71, 0x24, 0x9c, 0x8c, 0x07, 0x62, 0xe0, 0xc0, 0xd7, 0x30, 0x33, - 0xbb, 0x5b, 0x28, 0x89, 0x5e, 0xf1, 0xb4, 0x3b, 0xcf, 0xf3, 0xcc, 0x33, 0xbf, 0xdf, 0x33, 0x2f, - 0x50, 0xa2, 0x7b, 0xa2, 0x23, 0x24, 0x75, 0x49, 0xac, 0x5c, 0xbd, 0xd7, 0xec, 0x4b, 0xa1, 0x05, - 0x2e, 0xa6, 0x68, 0x93, 0xc4, 0xaa, 0x7c, 0xbb, 0x23, 0x54, 0x24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x5c, 0x41, 0x5f, 0x10, 0xcc, 0xac, 0xd1, 0x7f, 0x25, 0x9e, - 0x7d, 0x04, 0xb7, 0xae, 0x55, 0x73, 0xc3, 0x01, 0x2d, 0x7f, 0x43, 0x90, 0x7f, 0xa9, 0x42, 0xfc, - 0x02, 0x8a, 0x57, 0xea, 0xc2, 0x77, 0x86, 0x4c, 0x86, 0xf3, 0x2b, 0x57, 0xff, 0x4c, 0xa6, 0xed, - 0x78, 0x30, 0x39, 0xd4, 0x27, 0x5e, 0x18, 0x9a, 0x72, 0x7d, 0x47, 0xca, 0xb5, 0xbf, 0xd1, 0x89, - 0x67, 0x79, 0xf4, 0xe3, 0xc5, 0xc1, 0x12, 0x5a, 0x7d, 0x7e, 0x74, 0x56, 0x41, 0xc7, 0x67, 0x15, - 0xf4, 0xeb, 0xac, 0x82, 0xf6, 0xcf, 0x2b, 0xb9, 0xe3, 0xf3, 0x4a, 0xee, 0xc7, 0x79, 0x25, 0xf7, - 0xae, 0x71, 0xe5, 0x3a, 0xaf, 0x27, 0x76, 0xaf, 0xa8, 0xde, 0x15, 0x72, 0xdb, 0xcd, 0xde, 0xd4, - 0xbd, 0xe4, 0x55, 0x35, 0x37, 0x7b, 0x73, 0xcc, 0x3e, 0x81, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, - 0xff, 0x14, 0x11, 0x75, 0xf3, 0x71, 0x05, 0x00, 0x00, + // 703 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xc1, 0x4b, 0x1b, 0x4d, + 0x1c, 0xcd, 0x1a, 0xa3, 0x66, 0xf6, 0x53, 0xe3, 0x98, 0x8f, 0x6f, 0x8d, 0x98, 0x84, 0xc0, 0x57, + 0x52, 0x21, 0x49, 0x6b, 0x29, 0x14, 0xdb, 0x4b, 0x82, 0xb6, 0x04, 0x5a, 0x5b, 0x36, 0xd4, 0x43, + 0x2f, 0x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, 0x80, 0x29, 0x24, 0x04, 0x96, 0x0e, 0x71, + 0xad, 0x94, 0xa6, 0x4c, 0xea, 0x79, 0xd3, 0x85, 0x0f, 0x40, 0x56, 0xd9, 0x0c, 0x68, 0x9b, 0x51, + 0x97, 0x50, 0xcf, 0xe9, 0x63, 0x4e, 0x98, 0x6b, 0x4d, 0x14, 0x8d, 0xf2, 0xb4, 0x0d, 0x51, 0x20, + 0xde, 0xc6, 0xa5, 0x37, 0xba, 0x02, 0x7b, 0x60, 0xde, 0x27, 0xd4, 0x11, 0xb8, 0xd7, 0x75, 0x5c, + 0xdc, 0xc3, 0x1e, 0x92, 0x84, 0x51, 0x6b, 0x52, 0x35, 0xd8, 0x78, 0x76, 0x7c, 0x56, 0x48, 0x7c, + 0x3f, 0x2b, 0xdc, 0xf3, 0x88, 0xdc, 0x1a, 0xb4, 0xab, 0x1d, 0xe6, 0x47, 0x61, 0x45, 0x9f, 0x8a, + 0x70, 0xb7, 0x6b, 0x72, 0xaf, 0x8f, 0x45, 0xb5, 0x49, 0xe5, 0xe9, 0x51, 0x05, 0x44, 0x59, 0x36, + 0xa9, 0xb4, 0xe7, 0x7c, 0x42, 0x5b, 0xb8, 0xd7, 0x5d, 0x1b, 0xda, 0xc2, 0xfb, 0x20, 0x83, 0xfb, + 0xac, 0xb3, 0xe5, 0x10, 0x17, 0x53, 0x49, 0xba, 0x04, 0x73, 0x6b, 0x4a, 0x67, 0x31, 0xab, 0xf1, + 0xe6, 0x10, 0x56, 0x54, 0xd6, 0xc7, 0x1c, 0x49, 0x76, 0x15, 0x48, 0x3a, 0x0c, 0x24, 0xc6, 0xe3, + 0x40, 0xfe, 0x07, 0x33, 0x42, 0x22, 0x2e, 0xd5, 0x82, 0xb5, 0x8d, 0x05, 0x8a, 0x46, 0x39, 0x69, + 0x4f, 0xc7, 0xe8, 0xba, 0x02, 0xe1, 0x07, 0x50, 0x08, 0x73, 0xe3, 0x78, 0x07, 0x71, 0xd7, 0x41, + 0x3e, 0x1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 0xfa, 0x82, 0x8b, 0x23, 0x26, 0xa3, 0xf9, 0xe5, + 0x8a, 0xb7, 0x17, 0xa3, 0xe5, 0xd8, 0x60, 0x7a, 0x64, 0x9d, 0x70, 0x69, 0x44, 0x72, 0x73, 0x47, + 0x72, 0xa5, 0xdf, 0x95, 0x43, 0xcf, 0x5c, 0xea, 0xe3, 0xe5, 0xe1, 0xb2, 0xd1, 0x78, 0x71, 0x7c, + 0x9e, 0x37, 0x4e, 0xce, 0xf3, 0xc6, 0x8f, 0xf3, 0xbc, 0x71, 0x70, 0x91, 0x4f, 0x9c, 0x5c, 0xe4, + 0x13, 0xdf, 0x2e, 0xf2, 0x89, 0x77, 0x95, 0x6b, 0x77, 0xd3, 0x7a, 0x68, 0xb7, 0x81, 0xe5, 0x0e, + 0xe3, 0xdb, 0xb5, 0xf8, 0x81, 0xd8, 0x0d, 0x9f, 0x08, 0x75, 0x4d, 0xb5, 0x27, 0xf4, 0x7d, 0xfe, + 0xe8, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x83, 0x65, 0x73, 0x52, 0x3e, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -565,6 +580,23 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AssetRewardAmountEpochBasis) > 0 { + for k := range m.AssetRewardAmountEpochBasis { + v := m.AssetRewardAmountEpochBasis[k] + baseI := i + i = encodeVarintTx(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTx(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTx(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } if m.StartingEpoch != 0 { i = encodeVarintTx(dAtA, i, uint64(m.StartingEpoch)) i-- @@ -870,6 +902,14 @@ func (m *AVSInfo) Size() (n int) { if m.StartingEpoch != 0 { n += 1 + sovTx(uint64(m.StartingEpoch)) } + if len(m.AssetRewardAmountEpochBasis) > 0 { + for k, v := range m.AssetRewardAmountEpochBasis { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + sovTx(uint64(v)) + n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) + } + } return n } @@ -1272,6 +1312,119 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { break } } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetRewardAmountEpochBasis", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetRewardAmountEpochBasis == nil { + m.AssetRewardAmountEpochBasis = make(map[string]int64) + } + var mapkey string + var mapvalue int64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthTx + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthTx + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AssetRewardAmountEpochBasis[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/feedistribution/types/genesis.pb.go b/x/feedistribution/types/genesis.pb.go new file mode 100644 index 000000000..62b455f25 --- /dev/null +++ b/x/feedistribution/types/genesis.pb.go @@ -0,0 +1,326 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/feedistribute/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// GenesisState defines the feedistribute module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_aee557f1ee09d7b3, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "exocore.feedistribute.GenesisState") +} + +func init() { + proto.RegisterFile("exocore/feedistribute/genesis.proto", fileDescriptor_aee557f1ee09d7b3) +} + +var fileDescriptor_aee557f1ee09d7b3 = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4b, 0x4d, 0x4d, 0xc9, 0x2c, 0x2e, 0x29, 0xca, 0x4c, 0x2a, 0x2d, + 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x2a, 0xd2, 0x43, 0x51, 0x24, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, + 0x21, 0x2a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a, 0xaa, 0x84, + 0xdd, 0x92, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x1d, 0x4a, 0x01, 0x5c, 0x3c, 0xee, 0x10, 0x4b, + 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x1c, 0xb8, 0xd8, 0x20, 0xf2, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, + 0xdc, 0x46, 0xb2, 0x7a, 0x58, 0x1d, 0xa1, 0x17, 0x00, 0x56, 0xe4, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, + 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xa0, 0xfa, 0x9c, 0x82, 0x4f, 0x3c, 0x92, 0x63, 0xbc, + 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, + 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, + 0x57, 0xdf, 0x15, 0x62, 0xaa, 0x5f, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0xa5, 0x15, + 0x28, 0x6e, 0xcd, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xd6, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xf1, 0xcb, 0xd5, 0x38, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feedistribution/types/params.pb.go b/x/feedistribution/types/params.pb.go new file mode 100644 index 000000000..a03412a86 --- /dev/null +++ b/x/feedistribution/types/params.pb.go @@ -0,0 +1,291 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/feedistribute/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_2ff10781d3e27dd7, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "exocore.feedistribute.Params") +} + +func init() { + proto.RegisterFile("exocore/feedistribute/params.proto", fileDescriptor_2ff10781d3e27dd7) +} + +var fileDescriptor_2ff10781d3e27dd7 = []byte{ + // 185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4b, 0x4d, 0x4d, 0xc9, 0x2c, 0x2e, 0x29, 0xca, 0x4c, 0x2a, 0x2d, + 0x49, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xaa, 0xd1, 0x43, 0x51, 0x23, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, + 0x2a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x22, 0xaa, 0x64, 0xcc, + 0xc5, 0x16, 0x00, 0x36, 0xcf, 0x4a, 0xf3, 0xc5, 0x02, 0x79, 0xc6, 0xae, 0xe7, 0x1b, 0xb4, 0x14, + 0x60, 0xd6, 0x56, 0xa0, 0x58, 0x9c, 0x99, 0x9f, 0xa7, 0x0f, 0x51, 0xea, 0x14, 0x7c, 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, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, + 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0x63, 0xfc, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x71, + 0x9b, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x90, 0x31, 0x20, 0x00, 0x00, 0xff, + 0xff, 0xf9, 0xf5, 0x23, 0xb0, 0xf6, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = 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 { + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feedistribution/types/query.pb.go b/x/feedistribution/types/query.pb.go new file mode 100644 index 000000000..b1ca0e4f1 --- /dev/null +++ b/x/feedistribution/types/query.pb.go @@ -0,0 +1,540 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/feedistribute/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b223d71029f365a9, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b223d71029f365a9, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "exocore.feedistribute.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "exocore.feedistribute.QueryParamsResponse") +} + +func init() { proto.RegisterFile("exocore/feedistribute/query.proto", fileDescriptor_b223d71029f365a9) } + +var fileDescriptor_b223d71029f365a9 = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4b, 0x3b, 0x31, + 0x14, 0xc7, 0x2f, 0x3f, 0xf8, 0x15, 0x3c, 0x27, 0xcf, 0x0a, 0x52, 0xf4, 0xd4, 0x9b, 0xb4, 0xc3, + 0xc5, 0x56, 0x10, 0xdc, 0xa4, 0xe0, 0x2a, 0x5a, 0x07, 0xc1, 0x2d, 0x57, 0x9f, 0x67, 0xd0, 0xcb, + 0xbb, 0x26, 0x39, 0x6d, 0x57, 0xff, 0x02, 0xc1, 0xc1, 0xd9, 0xcd, 0xd1, 0x3f, 0xa3, 0x63, 0xc1, + 0xc5, 0x49, 0xa4, 0x15, 0xfc, 0x37, 0xa4, 0x49, 0x96, 0xd2, 0x2b, 0xb8, 0x84, 0xc7, 0xcb, 0xe7, + 0xfb, 0xc9, 0xcb, 0xf3, 0xb7, 0xa0, 0x87, 0x1d, 0x94, 0x40, 0xaf, 0x00, 0x2e, 0xb9, 0xd2, 0x92, + 0x27, 0x85, 0x06, 0xda, 0x2d, 0x40, 0xf6, 0xe3, 0x5c, 0xa2, 0xc6, 0x60, 0xc5, 0x21, 0xf1, 0x14, + 0x52, 0x5b, 0x62, 0x19, 0x17, 0x48, 0xcd, 0x69, 0xc9, 0x5a, 0x35, 0xc5, 0x14, 0x4d, 0x49, 0x27, + 0x95, 0xeb, 0xae, 0xa5, 0x88, 0xe9, 0x2d, 0x50, 0x96, 0x73, 0xca, 0x84, 0x40, 0xcd, 0x34, 0x47, + 0xa1, 0xdc, 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0x41, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.feedistribute.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.feedistribute.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.feedistribute.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/feedistribute/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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 ErrIntOverflowQuery + } + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) 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 ErrIntOverflowQuery + } + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feedistribution/types/query.pb.gw.go b/x/feedistribution/types/query.pb.gw.go new file mode 100644 index 000000000..69ecda040 --- /dev/null +++ b/x/feedistribution/types/query.pb.gw.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: exocore/feedistribute/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "feedistribution", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/feedistribution/types/tx.pb.go b/x/feedistribution/types/tx.pb.go new file mode 100644 index 000000000..5b0e0aac2 --- /dev/null +++ b/x/feedistribution/types/tx.pb.go @@ -0,0 +1,599 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/feedistribute/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_feaa9f6a0e1fb991, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_feaa9f6a0e1fb991, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "exocore.feedistribute.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "exocore.feedistribute.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("exocore/feedistribute/tx.proto", fileDescriptor_feaa9f6a0e1fb991) } + +var fileDescriptor_feaa9f6a0e1fb991 = []byte{ + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4b, 0x4d, 0x4d, 0xc9, 0x2c, 0x2e, 0x29, 0xca, 0x4c, 0x2a, 0x2d, + 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xca, 0xeb, 0xa1, + 0xc8, 0x4b, 0x09, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0x4a, 0x29, 0xf1, 0xe4, + 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xfd, 0xdc, 0xe2, 0x74, 0xfd, 0x32, 0x43, 0x10, 0x05, 0x95, 0x90, + 0x84, 0x48, 0xc4, 0x83, 0x79, 0xfa, 0x10, 0x0e, 0x54, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0x22, + 0x0e, 0x62, 0x41, 0x45, 0x95, 0xb0, 0xbb, 0xa9, 0x20, 0xb1, 0x28, 0x31, 0x17, 0xaa, 0x53, 0xe9, + 0x24, 0x23, 0x17, 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0x6a, 0x00, 0x58, 0x46, + 0xc8, 0x8c, 0x8b, 0x33, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0x52, 0x82, 0x51, 0x81, + 0x51, 0x83, 0xd3, 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x95, 0x8e, 0x29, 0x29, 0x45, 0xa9, + 0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0x04, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xff, 0x0d, 0xd5, 0x72, + 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.feedistribute.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.feedistribute.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.feedistribute.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/feedistribute/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 76ca80401..26fb10c88 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1061,73 +1061,73 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 1051 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xcf, 0x6f, 0x1b, 0x55, - 0x10, 0xc7, 0xf3, 0xda, 0x24, 0xd0, 0x69, 0x08, 0xf4, 0xd5, 0x44, 0xcd, 0x36, 0x38, 0xed, 0x6b, - 0xd3, 0xa6, 0x75, 0xbb, 0x1b, 0x3b, 0xa6, 0x29, 0x15, 0x54, 0x4a, 0x24, 0x88, 0xca, 0x8f, 0x28, - 0x58, 0xfc, 0x10, 0x70, 0x30, 0x6b, 0xfb, 0x69, 0x59, 0x65, 0xbd, 0xcf, 0xdd, 0x5d, 0x87, 0x54, - 0xa5, 0x12, 0xe2, 0xc4, 0x11, 0x84, 0x04, 0x07, 0x6e, 0x08, 0x01, 0x47, 0x0e, 0xfc, 0x01, 0x1c, - 0x7b, 0xac, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x7f, 0x01, 0x7f, 0x01, 0xf2, 0xdb, 0x59, 0xdb, 0xbb, - 0xfb, 0xd6, 0x5e, 0xa3, 0xdc, 0xe2, 0x9d, 0xef, 0xcc, 0x7c, 0x66, 0xde, 0xbc, 0x9d, 0x0d, 0x68, - 0xfc, 0x40, 0x34, 0x85, 0xc7, 0x0d, 0xe1, 0x99, 0x4d, 0x87, 0x1b, 0xf7, 0xbb, 0xdc, 0x7b, 0xa0, - 0x77, 0x3c, 0x11, 0x08, 0x3a, 0x8f, 0x36, 0x3d, 0xb4, 0x69, 0xd7, 0x9b, 0xc2, 0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, + // 1053 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xdf, 0x6f, 0xdb, 0x54, + 0x14, 0xc7, 0xeb, 0xf5, 0x07, 0xec, 0xac, 0x14, 0x76, 0x17, 0xaa, 0xd5, 0x2b, 0xe9, 0x76, 0xb7, + 0x6e, 0xdd, 0xb2, 0xd9, 0x4d, 0x1a, 0xd6, 0x31, 0xc1, 0xa4, 0x56, 0x82, 0x6a, 0xfc, 0xa8, 0x4a, + 0xc4, 0x0f, 0x01, 0x0f, 0xc1, 0x49, 0xae, 0x8c, 0x55, 0xc7, 0xd7, 0xb3, 0x9d, 0xd2, 0x69, 0x4c, + 0x42, 0x3c, 0xf1, 0x08, 0x42, 0x82, 0x07, 0xde, 0x10, 0x02, 0x1e, 0x79, 0xe0, 0x0f, 0xe0, 0x71, + 0x8f, 0x95, 0x78, 0xe1, 0x09, 0xa1, 0x96, 0xbf, 0x80, 0xbf, 0x00, 0xe5, 0xfa, 0x38, 0x89, 0xed, + 0xeb, 0xc4, 0x41, 0x79, 0x8b, 0x7d, 0xbf, 0xe7, 0x9c, 0xcf, 0x39, 0xf7, 0xdc, 0x7b, 0x1c, 0x50, + 0xd9, 0x21, 0x6f, 0x72, 0x8f, 0xe9, 0xdc, 0x33, 0x9a, 0x36, 0xd3, 0x1f, 0x74, 0x98, 0xf7, 0x50, + 0x73, 0x3d, 0x1e, 0x70, 0xb2, 0x80, 0x6b, 0x5a, 0xb8, 0xa6, 0xde, 0x68, 0x72, 0xbf, 0xcd, 0x7d, + 0xbd, 0x61, 0xf8, 0x28, 0xd4, 0x0f, 0xca, 0x0d, 0x16, 0x18, 0x65, 0xdd, 0x35, 0x4c, 0xcb, 0x31, + 0x02, 0x8b, 0x3b, 0xa1, 0xad, 0xba, 0x9a, 0xf0, 0x6b, 0x39, 0x2d, 0x76, 0x58, 0xf7, 0x58, 0x93, + 0x39, 0x41,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0x93, 0x6f, + 0x15, 0x98, 0xef, 0x39, 0xdc, 0xb2, 0xed, 0x0c, 0x40, 0xc9, 0xb8, 0xcd, 0x00, 0x94, 0xcd, 0x4c, + 0x5a, 0x16, 0x80, 0x25, 0x72, 0x3d, 0x37, 0x20, 0xf9, 0xb9, 0x07, 0x86, 0x3d, 0x59, 0x1a, 0x5e, + 0x8f, 0x78, 0x3b, 0xde, 0xcc, 0x27, 0x46, 0xbc, 0x97, 0x05, 0xde, 0x6d, 0x52, 0xcd, 0x87, 0x17, + 0xf6, 0x60, 0xaf, 0x84, 0x3f, 0x28, 0xf0, 0xec, 0xa0, 0xdb, 0x6e, 0x15, 0x4b, 0xc3, 0x6b, 0x93, + 0x07, 0x36, 0x63, 0xa0, 0xd1, 0xaa, 0x80, 0xd5, 0xc8, 0xcd, 0x71, 0x60, 0xb7, 0x5f, 0x7f, 0x72, + 0x5c, 0x54, 0x8e, 0x8e, 0x8b, 0xca, 0xdf, 0xc7, 0x45, 0xe5, 0xab, 0x93, 0xe2, 0xd4, 0xd1, 0x49, + 0x71, 0xea, 0xcf, 0x93, 0xe2, 0xd4, 0x87, 0xeb, 0xa6, 0x15, 0x7c, 0xd2, 0x69, 0x68, 0x4d, 0xde, + 0xce, 0xf2, 0x78, 0x18, 0xf9, 0x0c, 0x1e, 0xba, 0xcc, 0x6f, 0xcc, 0x89, 0xbf, 0x9d, 0x1b, 0xff, + 0x05, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x33, 0x5e, 0x11, 0x1d, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index ef824e828..1c929a312 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -440,8 +440,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_LatestPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -449,7 +447,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_LatestPrice_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/reward/keeper/hooks.go b/x/reward/keeper/hooks.go index 8903f4b3a..82e963bb4 100644 --- a/x/reward/keeper/hooks.go +++ b/x/reward/keeper/hooks.go @@ -34,13 +34,44 @@ func (k Keeper) AfterEpochEnd( pool := k.getPool(ctx, types.ModuleName) // distribute the reward to the avs accordingly ForEach(epochEndAVS, func(p string) { - if err := pool.ReleaseRewards(p); err != nil { + avsInfo, err := pool.k.avsKeeper.GetAVSInfo(ctx, p) + if err != nil { k.Logger(ctx).Error( - "release reward error", - "error message", err, + "get avsInfo error", + "avsInfo err", err, ) return } + assetId := avsInfo.Info.AssetId + operatorAddress := avsInfo.Info.OperatorAddress + + for _, operator := range operatorAddress { + opAddr, err := sdk.AccAddressFromBech32(operator) + if err != nil { + k.Logger(ctx).Error( + "get operatorInfo error", + "operatorInfo err", err, + ) + return + } + for _, asset := range assetId { + assetInfo, err := k.assetsKeeper.GetStakingAssetInfo(ctx, asset) + if err != nil { + k.Logger(ctx).Error( + "get assetInfo error", + "assetInfo err", err, + ) + return + } + if k.assetsKeeper.IsOperatorAssetExist(ctx, opAddr, asset) { + coin := sdk.Coin{ + Denom: assetInfo.AssetBasicInfo.Symbol, + Amount: sdk.NewInt(avsInfo.Info.AssetRewardAmountEpochBasis[asset]), + } + pool.AddReward(p, coin) + } + } + } }) } diff --git a/x/reward/keeper/keeper.go b/x/reward/keeper/keeper.go index 0e57d6ed4..f2eb68b1f 100644 --- a/x/reward/keeper/keeper.go +++ b/x/reward/keeper/keeper.go @@ -74,13 +74,13 @@ func (k Keeper) getPools(ctx sdk.Context) ([]types.Pool, error) { return pools, nil } -func (k Keeper) getPool(ctx sdk.Context, name string) *rewardPool { +func (k Keeper) getPool(ctx sdk.Context, name string) *rewardRecord { var pool types.Pool poolKey := key.FromStr(poolNamePrefix).Append(key.FromStr(name)) store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixRewardInfo) if !store.Has(poolKey.Bytes()) { - return newRewardPool(ctx, k, k.banker, k.distributor, types.NewPool(name)) + return newRewardRecord(ctx, k, k.banker, k.distributor, types.NewPool(name)) } - return newRewardPool(ctx, k, k.banker, k.distributor, pool) + return newRewardRecord(ctx, k, k.banker, k.distributor, pool) } diff --git a/x/reward/keeper/reward_pool.go b/x/reward/keeper/reward_record.go similarity index 80% rename from x/reward/keeper/reward_pool.go rename to x/reward/keeper/reward_record.go index 15f93f407..ffe3f8620 100644 --- a/x/reward/keeper/reward_pool.go +++ b/x/reward/keeper/reward_record.go @@ -7,7 +7,7 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" ) -type rewardPool struct { +type rewardRecord struct { ctx sdk.Context k Keeper banker bankkeeper.Keeper @@ -16,8 +16,8 @@ type rewardPool struct { staker distrtypes.StakingKeeper } -func newRewardPool(ctx sdk.Context, k Keeper, banker bankkeeper.Keeper, distributor types.Distributor, p types.Pool) *rewardPool { - return &rewardPool{ +func newRewardRecord(ctx sdk.Context, k Keeper, banker bankkeeper.Keeper, distributor types.Distributor, p types.Pool) *rewardRecord { + return &rewardRecord{ ctx: ctx, k: k, banker: banker, @@ -25,7 +25,7 @@ func newRewardPool(ctx sdk.Context, k Keeper, banker bankkeeper.Keeper, distribu } } -func (p rewardPool) getRewards(earningAddress string) (sdk.Coins, bool) { +func (p rewardRecord) getRewards(earningAddress string) (sdk.Coins, bool) { for _, reward := range p.Pool.Rewards { if reward.EarningsAddr == earningAddress { return reward.Coins, true @@ -34,7 +34,8 @@ func (p rewardPool) getRewards(earningAddress string) (sdk.Coins, bool) { return sdk.Coins{}, false } -func (p *rewardPool) AddReward(earningAddress string, coin sdk.Coin) { +// Logically recording the rewards +func (p *rewardRecord) AddReward(earningAddress string, coin sdk.Coin) { defer func() { p.k.Logger(p.ctx).Debug("adding rewards in pool", "pool", p.Name, "earningAddress", earningAddress, "coin", coin.String(), "amount", coin.Amount) p.k.setPool(p.ctx, p.Pool) @@ -57,7 +58,8 @@ func (p *rewardPool) AddReward(earningAddress string, coin sdk.Coin) { }) } -func (p *rewardPool) ReleaseRewards(earningAddress string) error { +// Allocate the rewards actually +func (p *rewardRecord) ReleaseRewards(earningAddress string) error { rewards, ok := p.getRewards(earningAddress) if !ok { return nil @@ -94,7 +96,7 @@ func (p *rewardPool) ReleaseRewards(earningAddress string) error { return nil } -func (p *rewardPool) ClearRewards(earningAddress string) { +func (p *rewardRecord) ClearRewards(earningAddress string) { for i, reward := range p.Rewards { if reward.EarningsAddr == earningAddress { p.k.Logger(p.ctx).Info("clearing rewards in pool", "pool", p.Name, "earningAddress", earningAddress)