From 805fce55ae21be782356cef98457366be138372d Mon Sep 17 00:00:00 2001 From: Alexgao001 Date: Mon, 30 Oct 2023 17:47:07 +0800 Subject: [PATCH 1/2] distinguish inturn relayers --- api/cosmos/oracle/v1/query.pulsar.go | 242 +++++++++++++++++------ proto/cosmos/oracle/v1/query.proto | 16 +- snapshots/types/snapshot.pb.go | 1 + tests/e2e/bank/grpc.go | 10 +- tests/e2e/bank/suite.go | 2 +- tests/e2e/staking/grpc.go | 5 +- testutil/testdata/unknonwnproto.pb.go | 9 + types/query/pagination.pb.go | 16 +- types/tx/signing/signing.pb.go | 1 + types/tx/tx.pb.go | 1 + x/distribution/types/distribution.pb.go | 11 +- x/gashub/types/gashub.pb.go | 1 + x/gov/testutil/expected_keepers.go | 2 + x/gov/testutil/expected_keepers_mocks.go | 14 ++ x/gov/types/v1/gov.pb.go | 12 +- x/group/types.pb.go | 16 +- x/oracle/keeper/grpc_query.go | 2 +- x/oracle/keeper/keeper.go | 22 ++- x/oracle/keeper/keeper_test.go | 2 +- x/oracle/types/expected_keeper_mocks.go | 28 +++ x/oracle/types/expected_keepers.go | 2 + x/oracle/types/query.pb.go | 128 +++++++++--- x/oracle/types/query.pb.gw.go | 18 ++ 23 files changed, 430 insertions(+), 131 deletions(-) diff --git a/api/cosmos/oracle/v1/query.pulsar.go b/api/cosmos/oracle/v1/query.pulsar.go index 99b00ba5f4..be7db37a19 100644 --- a/api/cosmos/oracle/v1/query.pulsar.go +++ b/api/cosmos/oracle/v1/query.pulsar.go @@ -806,12 +806,14 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryInturnRelayerRequest protoreflect.MessageDescriptor + md_QueryInturnRelayerRequest protoreflect.MessageDescriptor + fd_QueryInturnRelayerRequest_claim_src_chain protoreflect.FieldDescriptor ) func init() { file_cosmos_oracle_v1_query_proto_init() md_QueryInturnRelayerRequest = File_cosmos_oracle_v1_query_proto.Messages().ByName("QueryInturnRelayerRequest") + fd_QueryInturnRelayerRequest_claim_src_chain = md_QueryInturnRelayerRequest.Fields().ByName("claim_src_chain") } var _ protoreflect.Message = (*fastReflection_QueryInturnRelayerRequest)(nil) @@ -879,6 +881,12 @@ func (x *fastReflection_QueryInturnRelayerRequest) Interface() protoreflect.Prot // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryInturnRelayerRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClaimSrcChain != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ClaimSrcChain)) + if !f(fd_QueryInturnRelayerRequest_claim_src_chain, value) { + return + } + } } // Has reports whether a field is populated. @@ -894,6 +902,8 @@ func (x *fastReflection_QueryInturnRelayerRequest) Range(f func(protoreflect.Fie // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryInturnRelayerRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + return x.ClaimSrcChain != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -910,6 +920,8 @@ func (x *fastReflection_QueryInturnRelayerRequest) Has(fd protoreflect.FieldDesc // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryInturnRelayerRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + x.ClaimSrcChain = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -926,6 +938,9 @@ func (x *fastReflection_QueryInturnRelayerRequest) Clear(fd protoreflect.FieldDe // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryInturnRelayerRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + value := x.ClaimSrcChain + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -946,6 +961,8 @@ func (x *fastReflection_QueryInturnRelayerRequest) Get(descriptor protoreflect.F // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryInturnRelayerRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + x.ClaimSrcChain = (ClaimSrcChain)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -966,6 +983,8 @@ func (x *fastReflection_QueryInturnRelayerRequest) Set(fd protoreflect.FieldDesc // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryInturnRelayerRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + panic(fmt.Errorf("field claim_src_chain of message cosmos.oracle.v1.QueryInturnRelayerRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -979,6 +998,8 @@ func (x *fastReflection_QueryInturnRelayerRequest) Mutable(fd protoreflect.Field // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryInturnRelayerRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain": + return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.oracle.v1.QueryInturnRelayerRequest")) @@ -1048,6 +1069,9 @@ func (x *fastReflection_QueryInturnRelayerRequest) ProtoMethods() *protoiface.Me var n int var l int _ = l + if x.ClaimSrcChain != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimSrcChain)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1077,6 +1101,11 @@ func (x *fastReflection_QueryInturnRelayerRequest) ProtoMethods() *protoiface.Me i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ClaimSrcChain != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimSrcChain)) + i-- + dAtA[i] = 0x8 + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1126,6 +1155,25 @@ func (x *fastReflection_QueryInturnRelayerRequest) ProtoMethods() *protoiface.Me return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryInturnRelayerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimSrcChain", wireType) + } + x.ClaimSrcChain = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ClaimSrcChain |= ClaimSrcChain(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1673,6 +1721,59 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// ClaimSrcChain defines the src chain of a claim +type ClaimSrcChain int32 + +const ( + // CLAIM_SRC_CHAIN_UNSPECIFIED + ClaimSrcChain_CLAIM_SRC_CHAIN_UNSPECIFIED ClaimSrcChain = 0 + // CLAIM_SRC_CHAIN_BSC defines BSC source chain + ClaimSrcChain_CLAIM_SRC_CHAIN_BSC ClaimSrcChain = 1 + // CLAIM_SRC_CHAIN_OP_BNB defines OPBNB source chain + ClaimSrcChain_CLAIM_SRC_CHAIN_OP_BNB ClaimSrcChain = 2 +) + +// Enum value maps for ClaimSrcChain. +var ( + ClaimSrcChain_name = map[int32]string{ + 0: "CLAIM_SRC_CHAIN_UNSPECIFIED", + 1: "CLAIM_SRC_CHAIN_BSC", + 2: "CLAIM_SRC_CHAIN_OP_BNB", + } + ClaimSrcChain_value = map[string]int32{ + "CLAIM_SRC_CHAIN_UNSPECIFIED": 0, + "CLAIM_SRC_CHAIN_BSC": 1, + "CLAIM_SRC_CHAIN_OP_BNB": 2, + } +) + +func (x ClaimSrcChain) Enum() *ClaimSrcChain { + p := new(ClaimSrcChain) + *p = x + return p +} + +func (x ClaimSrcChain) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClaimSrcChain) Descriptor() protoreflect.EnumDescriptor { + return file_cosmos_oracle_v1_query_proto_enumTypes[0].Descriptor() +} + +func (ClaimSrcChain) Type() protoreflect.EnumType { + return &file_cosmos_oracle_v1_query_proto_enumTypes[0] +} + +func (x ClaimSrcChain) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClaimSrcChain.Descriptor instead. +func (ClaimSrcChain) EnumDescriptor() ([]byte, []int) { + return file_cosmos_oracle_v1_query_proto_rawDescGZIP(), []int{0} +} + // QueryParamsRequest is the request type for the Query/Params RPC method. type QueryParamsRequest struct { state protoimpl.MessageState @@ -1742,6 +1843,9 @@ type QueryInturnRelayerRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // ClaimSrcChain defines the src chain of a claim + ClaimSrcChain ClaimSrcChain `protobuf:"varint,1,opt,name=claim_src_chain,json=claimSrcChain,proto3,enum=cosmos.oracle.v1.ClaimSrcChain" json:"claim_src_chain,omitempty"` } func (x *QueryInturnRelayerRequest) Reset() { @@ -1764,6 +1868,13 @@ func (*QueryInturnRelayerRequest) Descriptor() ([]byte, []int) { return file_cosmos_oracle_v1_query_proto_rawDescGZIP(), []int{2} } +func (x *QueryInturnRelayerRequest) GetClaimSrcChain() ClaimSrcChain { + if x != nil { + return x.ClaimSrcChain + } + return ClaimSrcChain_CLAIM_SRC_CHAIN_UNSPECIFIED +} + // QueryInturnRelayerResponse is the response type for the Query In-turn relayer RPC method. type QueryInturnRelayerResponse struct { state protoimpl.MessageState @@ -1825,47 +1936,58 @@ var file_cosmos_oracle_v1_query_proto_rawDesc = []byte{ 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x64, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, - 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x62, 0x6c, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x73, 0x50, 0x75, - 0x62, 0x4b, 0x65, 0x79, 0x12, 0x46, 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x0d, 0x72, - 0x65, 0x6c, 0x61, 0x79, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x32, 0x97, 0x02, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x77, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, - 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x94, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, - 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, + 0x72, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, - 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x72, - 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0xb0, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, - 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, - 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4f, - 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x72, 0x63, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, + 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x72, 0x63, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x22, 0x84, + 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, + 0x0b, 0x62, 0x6c, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x73, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x46, 0x0a, + 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2a, 0x6b, 0x0a, 0x0d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x72, + 0x63, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, + 0x53, 0x52, 0x43, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4c, 0x41, 0x49, 0x4d, + 0x5f, 0x53, 0x52, 0x43, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x42, 0x53, 0x43, 0x10, 0x01, + 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x52, 0x43, 0x5f, 0x43, 0x48, + 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x50, 0x5f, 0x42, 0x4e, 0x42, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, + 0x1e, 0x00, 0x32, 0x97, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x77, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x6e, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x74, + 0x75, 0x72, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, + 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0xb0, 0x01, 0x0a, + 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1880,27 +2002,30 @@ func file_cosmos_oracle_v1_query_proto_rawDescGZIP() []byte { return file_cosmos_oracle_v1_query_proto_rawDescData } +var file_cosmos_oracle_v1_query_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_cosmos_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cosmos_oracle_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: cosmos.oracle.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: cosmos.oracle.v1.QueryParamsResponse - (*QueryInturnRelayerRequest)(nil), // 2: cosmos.oracle.v1.QueryInturnRelayerRequest - (*QueryInturnRelayerResponse)(nil), // 3: cosmos.oracle.v1.QueryInturnRelayerResponse - (*Params)(nil), // 4: cosmos.oracle.v1.Params - (*RelayInterval)(nil), // 5: cosmos.oracle.v1.RelayInterval + (ClaimSrcChain)(0), // 0: cosmos.oracle.v1.ClaimSrcChain + (*QueryParamsRequest)(nil), // 1: cosmos.oracle.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 2: cosmos.oracle.v1.QueryParamsResponse + (*QueryInturnRelayerRequest)(nil), // 3: cosmos.oracle.v1.QueryInturnRelayerRequest + (*QueryInturnRelayerResponse)(nil), // 4: cosmos.oracle.v1.QueryInturnRelayerResponse + (*Params)(nil), // 5: cosmos.oracle.v1.Params + (*RelayInterval)(nil), // 6: cosmos.oracle.v1.RelayInterval } var file_cosmos_oracle_v1_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.oracle.v1.QueryParamsResponse.params:type_name -> cosmos.oracle.v1.Params - 5, // 1: cosmos.oracle.v1.QueryInturnRelayerResponse.relay_interval:type_name -> cosmos.oracle.v1.RelayInterval - 0, // 2: cosmos.oracle.v1.Query.Params:input_type -> cosmos.oracle.v1.QueryParamsRequest - 2, // 3: cosmos.oracle.v1.Query.InturnRelayer:input_type -> cosmos.oracle.v1.QueryInturnRelayerRequest - 1, // 4: cosmos.oracle.v1.Query.Params:output_type -> cosmos.oracle.v1.QueryParamsResponse - 3, // 5: cosmos.oracle.v1.Query.InturnRelayer:output_type -> cosmos.oracle.v1.QueryInturnRelayerResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 5, // 0: cosmos.oracle.v1.QueryParamsResponse.params:type_name -> cosmos.oracle.v1.Params + 0, // 1: cosmos.oracle.v1.QueryInturnRelayerRequest.claim_src_chain:type_name -> cosmos.oracle.v1.ClaimSrcChain + 6, // 2: cosmos.oracle.v1.QueryInturnRelayerResponse.relay_interval:type_name -> cosmos.oracle.v1.RelayInterval + 1, // 3: cosmos.oracle.v1.Query.Params:input_type -> cosmos.oracle.v1.QueryParamsRequest + 3, // 4: cosmos.oracle.v1.Query.InturnRelayer:input_type -> cosmos.oracle.v1.QueryInturnRelayerRequest + 2, // 5: cosmos.oracle.v1.Query.Params:output_type -> cosmos.oracle.v1.QueryParamsResponse + 4, // 6: cosmos.oracle.v1.Query.InturnRelayer:output_type -> cosmos.oracle.v1.QueryInturnRelayerResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cosmos_oracle_v1_query_proto_init() } @@ -1964,13 +2089,14 @@ func file_cosmos_oracle_v1_query_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_oracle_v1_query_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 4, NumExtensions: 0, NumServices: 1, }, GoTypes: file_cosmos_oracle_v1_query_proto_goTypes, DependencyIndexes: file_cosmos_oracle_v1_query_proto_depIdxs, + EnumInfos: file_cosmos_oracle_v1_query_proto_enumTypes, MessageInfos: file_cosmos_oracle_v1_query_proto_msgTypes, }.Build() File_cosmos_oracle_v1_query_proto = out.File diff --git a/proto/cosmos/oracle/v1/query.proto b/proto/cosmos/oracle/v1/query.proto index 65d4b6a5ac..0a0b202262 100644 --- a/proto/cosmos/oracle/v1/query.proto +++ b/proto/cosmos/oracle/v1/query.proto @@ -29,8 +29,22 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +// ClaimSrcChain defines the src chain of a claim +enum ClaimSrcChain { + option (gogoproto.goproto_enum_prefix) = false; + // CLAIM_SRC_CHAIN_UNSPECIFIED + CLAIM_SRC_CHAIN_UNSPECIFIED = 0; + // CLAIM_SRC_CHAIN_BSC defines BSC source chain + CLAIM_SRC_CHAIN_BSC = 1; + // CLAIM_SRC_CHAIN_OP_BNB defines OPBNB source chain + CLAIM_SRC_CHAIN_OP_BNB = 2; +} + // QueryInturnRelayerRequest is the request type for the Query In-turn relayer RPC method. -message QueryInturnRelayerRequest {} +message QueryInturnRelayerRequest { + // ClaimSrcChain defines the src chain of a claim + ClaimSrcChain claim_src_chain = 1; +} // QueryInturnRelayerResponse is the response type for the Query In-turn relayer RPC method. message QueryInturnRelayerResponse { diff --git a/snapshots/types/snapshot.pb.go b/snapshots/types/snapshot.pb.go index 811e2b78c4..5821c91614 100644 --- a/snapshots/types/snapshot.pb.go +++ b/snapshots/types/snapshot.pb.go @@ -152,6 +152,7 @@ type SnapshotItem struct { // item is the specific type of snapshot item. // // Types that are valid to be assigned to Item: + // // *SnapshotItem_Store // *SnapshotItem_IAVL // *SnapshotItem_Extension diff --git a/tests/e2e/bank/grpc.go b/tests/e2e/bank/grpc.go index 8bc393d306..7101b3987c 100644 --- a/tests/e2e/bank/grpc.go +++ b/tests/e2e/bank/grpc.go @@ -37,9 +37,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() { sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens), sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))), ), - Pagination: &query.PageResponse{ - Total: 2, - }, + Pagination: &query.PageResponse{}, }, }, { @@ -160,7 +158,7 @@ func (s *E2ETestSuite) TestDenomMetadataGRPCHandler() { Display: "eth", }, }, - Pagination: &query.PageResponse{Total: 2}, + Pagination: &query.PageResponse{}, }, }, { @@ -244,9 +242,7 @@ func (s *E2ETestSuite) TestBalancesGRPCHandler() { sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens), sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Sub(s.cfg.BondedTokens)), ), - Pagination: &query.PageResponse{ - Total: 2, - }, + Pagination: &query.PageResponse{}, }, }, { diff --git a/tests/e2e/bank/suite.go b/tests/e2e/bank/suite.go index 399c82d85e..79b21ee88f 100644 --- a/tests/e2e/bank/suite.go +++ b/tests/e2e/bank/suite.go @@ -296,7 +296,7 @@ func (s *E2ETestSuite) TestGetCmdQueryDenomsMetadata() { Display: "eth", }, }, - Pagination: &query.PageResponse{Total: 2}, + Pagination: &query.PageResponse{}, }, }, { diff --git a/tests/e2e/staking/grpc.go b/tests/e2e/staking/grpc.go index ef625af91d..45b52257bb 100644 --- a/tests/e2e/staking/grpc.go +++ b/tests/e2e/staking/grpc.go @@ -400,7 +400,7 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorDelegations() { DelegationResponses: types.DelegationResponses{ types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, - Pagination: &query.PageResponse{Total: 1}, + Pagination: &query.PageResponse{}, }, }, { @@ -413,7 +413,7 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorDelegations() { &types.QueryDelegatorDelegationsResponse{}, &types.QueryDelegatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{}, - Pagination: &query.PageResponse{Total: 0}, + Pagination: &query.PageResponse{}, }, }, } @@ -592,7 +592,6 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorValidators() { } else { s.Require().NoError(err) s.Require().Len(validators.Validators, len(s.network.Validators)) - s.Require().Equal(int(validators.Pagination.Total), len(s.network.Validators)) } }) } diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index fcffd26d8e..3522a72535 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -715,6 +715,7 @@ type Customer3 struct { Surcharge float32 `protobuf:"fixed32,4,opt,name=surcharge,proto3" json:"surcharge,omitempty"` Destination string `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"` // Types that are valid to be assigned to Payment: + // // *Customer3_CreditCardNo // *Customer3_ChequeNo Payment isCustomer3_Payment `protobuf_oneof:"payment"` @@ -848,6 +849,7 @@ type TestVersion1 struct { C []*TestVersion1 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []TestVersion1 `protobuf:"bytes,5,rep,name=d,proto3" json:"d"` // Types that are valid to be assigned to Sum: + // // *TestVersion1_E // *TestVersion1_F Sum isTestVersion1_Sum `protobuf_oneof:"sum"` @@ -992,6 +994,7 @@ type TestVersion2 struct { C []*TestVersion2 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion2 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion2_E // *TestVersion2_F Sum isTestVersion2_Sum `protobuf_oneof:"sum"` @@ -1144,6 +1147,7 @@ type TestVersion3 struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3_E // *TestVersion3_F Sum isTestVersion3_Sum `protobuf_oneof:"sum"` @@ -1296,6 +1300,7 @@ type TestVersion3LoneOneOfValue struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3LoneOneOfValue_E Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -1435,6 +1440,7 @@ type TestVersion3LoneNesting struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3LoneNesting_F Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -1822,6 +1828,7 @@ type TestVersion4LoneNesting struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion4LoneNesting_F Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -2206,6 +2213,7 @@ type TestVersionFD1 struct { X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersionFD1_E // *TestVersionFD1_F Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"` @@ -2323,6 +2331,7 @@ type TestVersionFD1WithExtraAny struct { X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersionFD1WithExtraAny_E // *TestVersionFD1WithExtraAny_F Sum isTestVersionFD1WithExtraAny_Sum `protobuf_oneof:"sum"` diff --git a/types/query/pagination.pb.go b/types/query/pagination.pb.go index 9680f298f4..cc37a25172 100644 --- a/types/query/pagination.pb.go +++ b/types/query/pagination.pb.go @@ -25,10 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PageRequest is to be embedded in gRPC request messages for efficient // pagination. Ex: // -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } type PageRequest struct { // key is a value returned in PageResponse.next_key to begin // querying the next page most efficiently. Only one of offset or key @@ -123,10 +123,10 @@ func (m *PageRequest) GetReverse() bool { // PageResponse is to be embedded in gRPC response messages where the // corresponding request message has used PageRequest. // -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } type PageResponse struct { // next_key is the key to be passed to PageRequest.key to // query the next page most efficiently. It will be empty if diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 0be41d2029..885983f286 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -218,6 +218,7 @@ type SignatureDescriptor_Data struct { // sum is the one of that specifies whether this represents single or multi-signature data // // Types that are valid to be assigned to Sum: + // // *SignatureDescriptor_Data_Single_ // *SignatureDescriptor_Data_Multi_ Sum isSignatureDescriptor_Data_Sum `protobuf_oneof:"sum"` diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index cf1f47d451..4bc546be93 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -715,6 +715,7 @@ type ModeInfo struct { // multisig signer // // Types that are valid to be assigned to Sum: + // // *ModeInfo_Single_ // *ModeInfo_Multi_ Sum isModeInfo_Sum `protobuf_oneof:"sum"` diff --git a/x/distribution/types/distribution.pb.go b/x/distribution/types/distribution.pb.go index 5a8295d590..03ce9ef5f4 100644 --- a/x/distribution/types/distribution.pb.go +++ b/x/distribution/types/distribution.pb.go @@ -85,11 +85,12 @@ func (m *Params) GetWithdrawAddrEnabled() bool { // The reference count indicates the number of objects // which might need to reference this historical entry at any point. // ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization +// +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization type ValidatorHistoricalRewards struct { CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio"` ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty"` diff --git a/x/gashub/types/gashub.pb.go b/x/gashub/types/gashub.pb.go index ae6b6d354c..ac8079f797 100644 --- a/x/gashub/types/gashub.pb.go +++ b/x/gashub/types/gashub.pb.go @@ -85,6 +85,7 @@ type MsgGasParams struct { // gas_params is the oneof that represents either fixed_gas_params or dynamic_gas_params // // Types that are valid to be assigned to GasParams: + // // *MsgGasParams_FixedType // *MsgGasParams_GrantType // *MsgGasParams_MultiSendType diff --git a/x/gov/testutil/expected_keepers.go b/x/gov/testutil/expected_keepers.go index 9adda8969b..d51c3bdb77 100644 --- a/x/gov/testutil/expected_keepers.go +++ b/x/gov/testutil/expected_keepers.go @@ -50,4 +50,6 @@ type CrossChainKeeper interface { GetReceiveSequence(ctx sdk.Context, destChainId sdk.ChainID, channelID sdk.ChannelID) uint64 IsDestChainSupported(chainID sdk.ChainID) bool + + GetDestOpChainID() sdk.ChainID } diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 9bb5fbfb85..f769be7df3 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -1089,6 +1089,20 @@ func (mr *MockCrossChainKeeperMockRecorder) GetDestBscChainID() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestBscChainID", reflect.TypeOf((*MockCrossChainKeeper)(nil).GetDestBscChainID)) } +// GetDestOpChainID mocks base method. +func (m *MockCrossChainKeeper) GetDestOpChainID() types.ChainID { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDestOpChainID") + ret0, _ := ret[0].(types.ChainID) + return ret0 +} + +// GetDestOpChainID indicates an expected call of GetDestOpChainID. +func (mr *MockCrossChainKeeperMockRecorder) GetDestOpChainID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestOpChainID", reflect.TypeOf((*MockCrossChainKeeper)(nil).GetDestOpChainID)) +} + // GetReceiveSequence mocks base method. func (m *MockCrossChainKeeper) GetReceiveSequence(ctx types.Context, destChainId types.ChainID, channelID types.ChannelID) uint64 { m.ctrl.T.Helper() diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 3dec8ec332..4a2b5d6e26 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -738,15 +738,15 @@ type Params struct { MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` // Duration of the voting period. VotingPeriod *time.Duration `protobuf:"bytes,3,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // burn deposits if a proposal does not meet quorum BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` diff --git a/x/group/types.pb.go b/x/group/types.pb.go index 16cb87020e..f375179d8d 100644 --- a/x/group/types.pb.go +++ b/x/group/types.pb.go @@ -298,10 +298,10 @@ func (m *MemberRequest) GetMetadata() string { // ThresholdDecisionPolicy is a decision policy where a proposal passes when it // satisfies the two following conditions: -// 1. The sum of all `YES` voter's weights is greater or equal than the defined -// `threshold`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The sum of all `YES` voter's weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type ThresholdDecisionPolicy struct { // threshold is the minimum weighted sum of `YES` votes that must be met or // exceeded for a proposal to succeed. @@ -359,10 +359,10 @@ func (m *ThresholdDecisionPolicy) GetWindows() *DecisionPolicyWindows { // PercentageDecisionPolicy is a decision policy where a proposal passes when // it satisfies the two following conditions: -// 1. The percentage of all `YES` voters' weights out of the total group weight -// is greater or equal than the given `percentage`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type PercentageDecisionPolicy struct { // percentage is the minimum percentage of the weighted sum of `YES` votes must // meet for a proposal to succeed. diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 357b7c4658..b7e010fe89 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -18,5 +18,5 @@ func (k Keeper) InturnRelayer(c context.Context, req *types.QueryInturnRelayerRe } ctx := sdk.UnwrapSDKContext(c) _, relayerInterval := k.GetRelayerParams(ctx) - return k.GetInturnRelayer(ctx, relayerInterval) + return k.GetInturnRelayer(ctx, relayerInterval, req.ClaimSrcChain) } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 8fad41b000..e6938093eb 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -4,6 +4,8 @@ import ( "bytes" "encoding/hex" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + sdkerrors "cosmossdk.io/errors" "github.com/cometbft/cometbft/libs/log" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -80,7 +82,7 @@ func (k Keeper) GetRelayerRewardShare(ctx sdk.Context) uint32 { } // IsRelayerValid returns true if the relayer is valid and allowed to send the claim message -func (k Keeper) IsRelayerValid(ctx sdk.Context, relayer sdk.AccAddress, validators []stakingtypes.Validator, claimTimestamp uint64) (bool, error) { +func (k Keeper) IsRelayerValid(ctx sdk.Context, relayer sdk.AccAddress, validators []stakingtypes.Validator, claimTimestamp uint64, claimSrcChain types.ClaimSrcChain) (bool, error) { var validatorIndex int64 = -1 var vldr stakingtypes.Validator for index, validator := range validators { @@ -98,7 +100,7 @@ func (k Keeper) IsRelayerValid(ctx sdk.Context, relayer sdk.AccAddress, validato inturnRelayerTimeout, relayerInterval := k.GetRelayerParams(ctx) // check whether submitter of msgClaim is an in-turn relayer - inturnRelayerBlsKey, _, err := k.getInturnRelayer(ctx, relayerInterval) + inturnRelayerBlsKey, _, err := k.getInturnRelayer(ctx, relayerInterval, claimSrcChain) if err != nil { return false, err } @@ -130,7 +132,12 @@ func (k Keeper) CheckClaim(ctx sdk.Context, claim *types.MsgClaim) (sdk.AccAddre } validators := historicalInfo.Valset - isValid, err := k.IsRelayerValid(ctx, relayer, validators, claim.Timestamp) + claimSrcChain := types.CLAIM_SRC_CHAIN_BSC + if ctx.IsUpgraded(upgradetypes.Pampas) && sdk.ChainID(claim.SrcChainId) == k.CrossChainKeeper.GetDestOpChainID() { + claimSrcChain = types.CLAIM_SRC_CHAIN_OP_BNB + } + + isValid, err := k.IsRelayerValid(ctx, relayer, validators, claim.Timestamp, claimSrcChain) if err != nil { return sdk.AccAddress{}, nil, err } @@ -190,7 +197,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { return params } -func (k Keeper) getInturnRelayer(ctx sdk.Context, relayerInterval uint64) ([]byte, *types.RelayInterval, error) { +func (k Keeper) getInturnRelayer(ctx sdk.Context, relayerInterval uint64, claimSrcChain types.ClaimSrcChain) ([]byte, *types.RelayInterval, error) { historicalInfo, ok := k.StakingKeeper.GetHistoricalInfo(ctx, ctx.BlockHeight()) if !ok { return nil, nil, sdkerrors.Wrapf(types.ErrValidatorSet, "get historical validators failed") @@ -211,6 +218,9 @@ func (k Keeper) getInturnRelayer(ctx sdk.Context, relayerInterval uint64) ([]byt start := curTimeStamp - (remainder - inTurnRelayerIndex*relayerInterval) end := start + relayerInterval + if claimSrcChain == types.CLAIM_SRC_CHAIN_OP_BNB { + inTurnRelayerIndex = (inTurnRelayerIndex + uint64(validatorsSize/2)) % uint64(validatorsSize) + } inturnRelayer := validators[inTurnRelayerIndex] return inturnRelayer.BlsKey, &types.RelayInterval{ @@ -219,8 +229,8 @@ func (k Keeper) getInturnRelayer(ctx sdk.Context, relayerInterval uint64) ([]byt }, nil } -func (k Keeper) GetInturnRelayer(ctx sdk.Context, relayerInterval uint64) (*types.QueryInturnRelayerResponse, error) { - blsKey, interval, err := k.getInturnRelayer(ctx, relayerInterval) +func (k Keeper) GetInturnRelayer(ctx sdk.Context, relayerInterval uint64, claimSrcChain types.ClaimSrcChain) (*types.QueryInturnRelayerResponse, error) { + blsKey, interval, err := k.getInturnRelayer(ctx, relayerInterval, claimSrcChain) if err != nil { return nil, err } diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go index 98d948dff5..1918739abe 100644 --- a/x/oracle/keeper/keeper_test.go +++ b/x/oracle/keeper/keeper_test.go @@ -256,7 +256,7 @@ func (s *TestSuite) TestKeeper_IsRelayerValid() { for idx, test := range tests { s.ctx = s.ctx.WithBlockTime(time.Unix(test.blockTime, 0)) relayer := sdk.MustAccAddressFromHex(test.claimMsg.FromAddress) - isValid, err := s.oracleKeeper.IsRelayerValid(s.ctx, relayer, vals, test.claimMsg.Timestamp) + isValid, err := s.oracleKeeper.IsRelayerValid(s.ctx, relayer, vals, test.claimMsg.Timestamp, types.CLAIM_SRC_CHAIN_BSC) if test.expectedPass { s.Require().Nil(err) diff --git a/x/oracle/types/expected_keeper_mocks.go b/x/oracle/types/expected_keeper_mocks.go index d63d1ffe3d..008f103001 100644 --- a/x/oracle/types/expected_keeper_mocks.go +++ b/x/oracle/types/expected_keeper_mocks.go @@ -131,6 +131,34 @@ func (mr *MockCrossChainKeeperMockRecorder) GetCrossChainApp(channelID interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCrossChainApp", reflect.TypeOf((*MockCrossChainKeeper)(nil).GetCrossChainApp), channelID) } +// GetDestBscChainID mocks base method. +func (m *MockCrossChainKeeper) GetDestBscChainID() types.ChainID { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDestBscChainID") + ret0, _ := ret[0].(types.ChainID) + return ret0 +} + +// GetDestBscChainID indicates an expected call of GetDestBscChainID. +func (mr *MockCrossChainKeeperMockRecorder) GetDestBscChainID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestBscChainID", reflect.TypeOf((*MockCrossChainKeeper)(nil).GetDestBscChainID)) +} + +// GetDestOpChainID mocks base method. +func (m *MockCrossChainKeeper) GetDestOpChainID() types.ChainID { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDestOpChainID") + ret0, _ := ret[0].(types.ChainID) + return ret0 +} + +// GetDestOpChainID indicates an expected call of GetDestOpChainID. +func (mr *MockCrossChainKeeperMockRecorder) GetDestOpChainID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestOpChainID", reflect.TypeOf((*MockCrossChainKeeper)(nil).GetDestOpChainID)) +} + // GetReceiveSequence mocks base method. func (m *MockCrossChainKeeper) GetReceiveSequence(ctx types.Context, chainId types.ChainID, channelID types.ChannelID) uint64 { m.ctrl.T.Helper() diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go index 6d751db32e..00142ef448 100644 --- a/x/oracle/types/expected_keepers.go +++ b/x/oracle/types/expected_keepers.go @@ -22,6 +22,8 @@ type CrossChainKeeper interface { IsDestChainSupported(chainID sdk.ChainID) bool GetReceiveSequence(ctx sdk.Context, chainId sdk.ChainID, channelID sdk.ChannelID) uint64 IncrReceiveSequence(ctx sdk.Context, chainId sdk.ChainID, channelID sdk.ChannelID) + GetDestBscChainID() sdk.ChainID + GetDestOpChainID() sdk.ChainID } type BankKeeper interface { diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index f68671491b..7f8d31658e 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -29,6 +29,38 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// ClaimSrcChain defines the src chain of a claim +type ClaimSrcChain int32 + +const ( + // CLAIM_SRC_CHAIN_UNSPECIFIED + CLAIM_SRC_CHAIN_UNSPECIFIED ClaimSrcChain = 0 + // CLAIM_SRC_CHAIN_BSC defines BSC source chain + CLAIM_SRC_CHAIN_BSC ClaimSrcChain = 1 + // CLAIM_SRC_CHAIN_OP_BNB defines OPBNB source chain + CLAIM_SRC_CHAIN_OP_BNB ClaimSrcChain = 2 +) + +var ClaimSrcChain_name = map[int32]string{ + 0: "CLAIM_SRC_CHAIN_UNSPECIFIED", + 1: "CLAIM_SRC_CHAIN_BSC", + 2: "CLAIM_SRC_CHAIN_OP_BNB", +} + +var ClaimSrcChain_value = map[string]int32{ + "CLAIM_SRC_CHAIN_UNSPECIFIED": 0, + "CLAIM_SRC_CHAIN_BSC": 1, + "CLAIM_SRC_CHAIN_OP_BNB": 2, +} + +func (x ClaimSrcChain) String() string { + return proto.EnumName(ClaimSrcChain_name, int32(x)) +} + +func (ClaimSrcChain) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_9f804c4644f3aaef, []int{0} +} + // QueryParamsRequest is the request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -114,6 +146,8 @@ func (m *QueryParamsResponse) GetParams() Params { // QueryInturnRelayerRequest is the request type for the Query In-turn relayer RPC method. type QueryInturnRelayerRequest struct { + // ClaimSrcChain defines the src chain of a claim + ClaimSrcChain ClaimSrcChain `protobuf:"varint,1,opt,name=claim_src_chain,json=claimSrcChain,proto3,enum=cosmos.oracle.v1.ClaimSrcChain" json:"claim_src_chain,omitempty"` } func (m *QueryInturnRelayerRequest) Reset() { *m = QueryInturnRelayerRequest{} } @@ -149,6 +183,13 @@ func (m *QueryInturnRelayerRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryInturnRelayerRequest proto.InternalMessageInfo +func (m *QueryInturnRelayerRequest) GetClaimSrcChain() ClaimSrcChain { + if m != nil { + return m.ClaimSrcChain + } + return CLAIM_SRC_CHAIN_UNSPECIFIED +} + // QueryInturnRelayerResponse is the response type for the Query In-turn relayer RPC method. type QueryInturnRelayerResponse struct { BlsPubKey string `protobuf:"bytes,1,opt,name=bls_pub_key,json=blsPubKey,proto3" json:"bls_pub_key,omitempty"` @@ -203,6 +244,7 @@ func (m *QueryInturnRelayerResponse) GetRelayInterval() *RelayInterval { } func init() { + proto.RegisterEnum("cosmos.oracle.v1.ClaimSrcChain", ClaimSrcChain_name, ClaimSrcChain_value) proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.oracle.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.oracle.v1.QueryParamsResponse") proto.RegisterType((*QueryInturnRelayerRequest)(nil), "cosmos.oracle.v1.QueryInturnRelayerRequest") @@ -212,32 +254,39 @@ func init() { func init() { proto.RegisterFile("cosmos/oracle/v1/query.proto", fileDescriptor_9f804c4644f3aaef) } var fileDescriptor_9f804c4644f3aaef = []byte{ - // 400 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6b, 0xe2, 0x40, - 0x18, 0x4d, 0x64, 0x57, 0x70, 0xc4, 0x65, 0x99, 0xf5, 0x90, 0xcd, 0xba, 0x51, 0xc2, 0x2e, 0x08, - 0xee, 0x66, 0xd0, 0x85, 0xfd, 0x01, 0x42, 0x0b, 0x52, 0x0a, 0x36, 0xc7, 0x5e, 0xc2, 0xc4, 0x0e, - 0x69, 0x30, 0x66, 0xe2, 0xcc, 0xc4, 0x36, 0xd7, 0xd2, 0x1f, 0x50, 0x68, 0xa1, 0x7f, 0xc9, 0xa3, - 0xd0, 0x4b, 0x4f, 0xa5, 0x68, 0x7f, 0x48, 0x71, 0x26, 0x42, 0x6d, 0x2c, 0xed, 0x29, 0xc9, 0xbc, - 0xf7, 0xbd, 0xf7, 0xbe, 0x97, 0x01, 0x8d, 0x11, 0xe5, 0x13, 0xca, 0x11, 0x65, 0x78, 0x14, 0x11, - 0x34, 0xeb, 0xa2, 0x69, 0x4a, 0x58, 0xe6, 0x24, 0x8c, 0x0a, 0x0a, 0xbf, 0x2a, 0xd4, 0x51, 0xa8, - 0x33, 0xeb, 0x9a, 0xf5, 0x80, 0x06, 0x54, 0x82, 0x68, 0xfd, 0xa6, 0x78, 0x66, 0x23, 0xa0, 0x34, - 0x88, 0x08, 0xc2, 0x49, 0x88, 0x70, 0x1c, 0x53, 0x81, 0x45, 0x48, 0x63, 0x9e, 0xa3, 0x3f, 0x0b, - 0x1e, 0xb9, 0x9e, 0x84, 0xed, 0x3a, 0x80, 0x47, 0x6b, 0xcf, 0x21, 0x66, 0x78, 0xc2, 0x5d, 0x32, - 0x4d, 0x09, 0x17, 0xf6, 0x21, 0xf8, 0xb6, 0x75, 0xca, 0x13, 0x1a, 0x73, 0x02, 0xff, 0x83, 0x72, - 0x22, 0x4f, 0x0c, 0xbd, 0xa5, 0xb7, 0xab, 0x3d, 0xc3, 0x79, 0x1d, 0xd1, 0x51, 0x13, 0xfd, 0x4f, - 0xf3, 0x87, 0xa6, 0xe6, 0xe6, 0x6c, 0xfb, 0x07, 0xf8, 0x2e, 0xe5, 0x06, 0xb1, 0x48, 0x59, 0xec, - 0x92, 0x08, 0x67, 0x84, 0x6d, 0xbc, 0x2e, 0x75, 0x60, 0xee, 0x42, 0x73, 0x4f, 0x0b, 0x54, 0xfd, - 0x88, 0x7b, 0x49, 0xea, 0x7b, 0x63, 0x92, 0x49, 0xe3, 0x8a, 0x5b, 0xf1, 0x23, 0x3e, 0x4c, 0xfd, - 0x03, 0x92, 0xc1, 0x7d, 0xf0, 0x85, 0xad, 0x47, 0xbc, 0x30, 0x16, 0x84, 0xcd, 0x70, 0x64, 0x94, - 0x64, 0xb6, 0x66, 0x31, 0x9b, 0x94, 0x1e, 0xe4, 0x34, 0xb7, 0xc6, 0x5e, 0x7e, 0xf6, 0x6e, 0x4b, - 0xe0, 0xb3, 0x8c, 0x01, 0xcf, 0x40, 0x59, 0x6d, 0x01, 0x7f, 0x15, 0x35, 0x8a, 0x65, 0x99, 0xbf, - 0xdf, 0x61, 0xa9, 0x45, 0xec, 0xd6, 0xc5, 0xdd, 0xd3, 0x75, 0xc9, 0x84, 0x06, 0x2a, 0xfc, 0x11, - 0x55, 0x13, 0xbc, 0xd1, 0x41, 0x6d, 0xab, 0x04, 0xd8, 0x79, 0x43, 0x7a, 0x57, 0x91, 0xe6, 0x9f, - 0x8f, 0x91, 0xf3, 0x38, 0x6d, 0x19, 0xc7, 0x86, 0xad, 0x62, 0x9c, 0x50, 0x0e, 0x78, 0x4c, 0x4d, - 0xf4, 0xf7, 0xe6, 0x4b, 0x4b, 0x5f, 0x2c, 0x2d, 0xfd, 0x71, 0x69, 0xe9, 0x57, 0x2b, 0x4b, 0x5b, - 0xac, 0x2c, 0xed, 0x7e, 0x65, 0x69, 0xc7, 0x9d, 0x20, 0x14, 0xa7, 0xa9, 0xef, 0x8c, 0xe8, 0x64, - 0xa3, 0xa2, 0x1e, 0x7f, 0xf9, 0xc9, 0x18, 0x9d, 0x6f, 0x24, 0x45, 0x96, 0x10, 0xee, 0x97, 0xe5, - 0x85, 0xfb, 0xf7, 0x1c, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x7d, 0x7d, 0x85, 0xf5, 0x02, 0x00, 0x00, + // 504 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6b, 0xd4, 0x40, + 0x18, 0x4d, 0x96, 0x5a, 0xe8, 0x94, 0xad, 0xcb, 0xb4, 0xe8, 0x1a, 0x6b, 0x76, 0x09, 0x0a, 0xc5, + 0x6a, 0x42, 0x57, 0xf0, 0xde, 0xc4, 0xad, 0x06, 0xed, 0xba, 0x66, 0xf1, 0xe2, 0x65, 0x98, 0xa4, + 0x43, 0x1a, 0x36, 0x9b, 0x49, 0x67, 0x92, 0xd5, 0x5c, 0xc5, 0x83, 0x47, 0x41, 0xc1, 0x1f, 0xe0, + 0x9f, 0xe9, 0xb1, 0xe0, 0xc5, 0x93, 0xc8, 0xae, 0x3f, 0x44, 0x32, 0x93, 0x42, 0x77, 0xb3, 0xa2, + 0xa7, 0x64, 0xe6, 0xbd, 0xef, 0xbd, 0xf7, 0x7d, 0x5f, 0x02, 0x76, 0x03, 0xca, 0x27, 0x94, 0x5b, + 0x94, 0xe1, 0x20, 0x26, 0xd6, 0xf4, 0xc0, 0x3a, 0xcb, 0x09, 0x2b, 0xcc, 0x94, 0xd1, 0x8c, 0xc2, + 0x96, 0x44, 0x4d, 0x89, 0x9a, 0xd3, 0x03, 0x6d, 0x27, 0xa4, 0x21, 0x15, 0xa0, 0x55, 0xbe, 0x49, + 0x9e, 0xb6, 0x1b, 0x52, 0x1a, 0xc6, 0xc4, 0xc2, 0x69, 0x64, 0xe1, 0x24, 0xa1, 0x19, 0xce, 0x22, + 0x9a, 0xf0, 0x0a, 0xbd, 0x53, 0xf3, 0xa8, 0xf4, 0x04, 0x6c, 0xec, 0x00, 0xf8, 0xaa, 0xf4, 0x1c, + 0x62, 0x86, 0x27, 0xdc, 0x23, 0x67, 0x39, 0xe1, 0x99, 0x71, 0x0c, 0xb6, 0x17, 0x6e, 0x79, 0x4a, + 0x13, 0x4e, 0xe0, 0x63, 0xb0, 0x9e, 0x8a, 0x9b, 0xb6, 0xda, 0x55, 0xf7, 0x36, 0x7b, 0x6d, 0x73, + 0x39, 0xa2, 0x29, 0x2b, 0xec, 0xb5, 0xf3, 0x9f, 0x1d, 0xc5, 0xab, 0xd8, 0xc6, 0x09, 0xb8, 0x25, + 0xe4, 0xdc, 0x24, 0xcb, 0x59, 0xe2, 0x91, 0x18, 0x17, 0x84, 0x55, 0x5e, 0xf0, 0x29, 0xb8, 0x1e, + 0xc4, 0x38, 0x9a, 0x20, 0xce, 0x02, 0x14, 0x9c, 0xe2, 0x28, 0x11, 0xea, 0x5b, 0xbd, 0x4e, 0x5d, + 0xdd, 0x29, 0x89, 0x23, 0x16, 0x38, 0x25, 0xcd, 0x6b, 0x06, 0x57, 0x8f, 0xc6, 0x07, 0x15, 0x68, + 0xab, 0x6c, 0xaa, 0xf0, 0x3a, 0xd8, 0xf4, 0x63, 0x8e, 0xd2, 0xdc, 0x47, 0x63, 0x52, 0x08, 0x8f, + 0x0d, 0x6f, 0xc3, 0x8f, 0xf9, 0x30, 0xf7, 0x9f, 0x93, 0x02, 0x1e, 0x81, 0x2d, 0x56, 0x96, 0xa0, + 0x28, 0xc9, 0x08, 0x9b, 0xe2, 0xb8, 0xdd, 0x10, 0x4d, 0xae, 0x88, 0x21, 0xa4, 0xdd, 0x8a, 0xe6, + 0x35, 0xd9, 0xd5, 0xe3, 0xfd, 0x31, 0x68, 0x2e, 0xc4, 0x84, 0x1d, 0x70, 0xdb, 0x79, 0x71, 0xe8, + 0x1e, 0xa3, 0x91, 0xe7, 0x20, 0xe7, 0xd9, 0xa1, 0x3b, 0x40, 0xaf, 0x07, 0xa3, 0x61, 0xdf, 0x71, + 0x8f, 0xdc, 0xfe, 0x93, 0x96, 0x02, 0x6f, 0x82, 0xed, 0x65, 0x82, 0x3d, 0x72, 0x5a, 0x2a, 0xd4, + 0xc0, 0x8d, 0x65, 0xe0, 0xe5, 0x10, 0xd9, 0x03, 0xbb, 0xd5, 0xd0, 0xd6, 0x3e, 0x7e, 0xd3, 0x95, + 0xde, 0xd7, 0x06, 0xb8, 0x26, 0x7a, 0x86, 0x6f, 0xc1, 0xba, 0x9c, 0x3d, 0xbc, 0x5b, 0x0f, 0x5c, + 0x5f, 0xb1, 0x76, 0xef, 0x1f, 0x2c, 0x39, 0x35, 0xa3, 0xfb, 0xfe, 0xfb, 0xef, 0xcf, 0x0d, 0x0d, + 0xb6, 0xad, 0xda, 0x77, 0x24, 0x97, 0x0b, 0xbf, 0xa8, 0xa0, 0xb9, 0x30, 0x71, 0xb8, 0xff, 0x17, + 0xe9, 0x55, 0xeb, 0xd7, 0x1e, 0xfc, 0x1f, 0xb9, 0x8a, 0xb3, 0x27, 0xe2, 0x18, 0xb0, 0x5b, 0x8f, + 0x13, 0x89, 0x02, 0xc4, 0x64, 0x85, 0xdd, 0x3f, 0x9f, 0xe9, 0xea, 0xc5, 0x4c, 0x57, 0x7f, 0xcd, + 0x74, 0xf5, 0xd3, 0x5c, 0x57, 0x2e, 0xe6, 0xba, 0xf2, 0x63, 0xae, 0x2b, 0x6f, 0xf6, 0xc3, 0x28, + 0x3b, 0xcd, 0x7d, 0x33, 0xa0, 0x93, 0x4b, 0x15, 0xf9, 0x78, 0xc8, 0x4f, 0xc6, 0xd6, 0xbb, 0x4b, + 0xc9, 0xac, 0x48, 0x09, 0xf7, 0xd7, 0xc5, 0x6f, 0xf2, 0xe8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x3f, 0x98, 0x40, 0xe8, 0xab, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -436,6 +485,11 @@ func (m *QueryInturnRelayerRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if m.ClaimSrcChain != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ClaimSrcChain)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -518,6 +572,9 @@ func (m *QueryInturnRelayerRequest) Size() (n int) { } var l int _ = l + if m.ClaimSrcChain != 0 { + n += 1 + sovQuery(uint64(m.ClaimSrcChain)) + } return n } @@ -706,6 +763,25 @@ func (m *QueryInturnRelayerRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryInturnRelayerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimSrcChain", wireType) + } + m.ClaimSrcChain = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimSrcChain |= ClaimSrcChain(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index a882e7a39f..18ce835a69 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -51,10 +51,21 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +var ( + filter_Query_InturnRelayer_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_InturnRelayer_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryInturnRelayerRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InturnRelayer_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.InturnRelayer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -64,6 +75,13 @@ func local_request_Query_InturnRelayer_0(ctx context.Context, marshaler runtime. var protoReq QueryInturnRelayerRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InturnRelayer_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.InturnRelayer(ctx, &protoReq) return msg, metadata, err From 41c3e631f780b2106648f75b9b09eede65d30850 Mon Sep 17 00:00:00 2001 From: Alexgao001 Date: Mon, 30 Oct 2023 18:19:57 +0800 Subject: [PATCH 2/2] fix test --- tests/e2e/slashing/grpc.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/e2e/slashing/grpc.go b/tests/e2e/slashing/grpc.go index efea63187d..58d41b77f7 100644 --- a/tests/e2e/slashing/grpc.go +++ b/tests/e2e/slashing/grpc.go @@ -42,9 +42,7 @@ func (s *E2ETestSuite) TestGRPCQueries() { JailedUntil: time.Unix(0, 0), }, }, - Pagination: &query.PageResponse{ - Total: uint64(1), - }, + Pagination: &query.PageResponse{}, }, }, {