From 93dca875c1d427c989578b597b2db0d300807a50 Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Tue, 30 Mar 2021 20:03:02 +0700 Subject: [PATCH 01/14] Meow *pop pop pop* --- go.sum | 4 - proto/oracle/v1/oracle.proto | 20 + proto/oracle/v1/query.proto | 37 ++ x/oracle/client/cli/query.go | 51 +- x/oracle/keeper/grpc_query.go | 106 ++++ x/oracle/types/oracle.pb.go | 528 ++++++++++++++---- x/oracle/types/query.pb.go | 921 ++++++++++++++++++++++++++++--- x/oracle/types/query.pb.gw.go | 120 +++- x/oracle/types/verify_request.go | 21 + 9 files changed, 1635 insertions(+), 173 deletions(-) create mode 100644 x/oracle/types/verify_request.go diff --git a/go.sum b/go.sum index 586fd9f1b..8b8b98860 100644 --- a/go.sum +++ b/go.sum @@ -77,7 +77,6 @@ github.com/blevesearch/zap/v14 v14.0.0/go.mod h1:sUc/gPGJlFbSQ2ZUh/wGRYwkKx+Dg/5 github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= @@ -123,7 +122,6 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/cosmos-sdk v0.42.2 h1:t2jIxV5DGN1ynOwuSIvQUUHr7tAePN1AG5ArM7o8qos= github.com/cosmos/cosmos-sdk v0.42.2/go.mod h1:xiLp1G8mumj82S5KLJGCAyeAlD+7VNomg/aRSJV12yk= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -740,7 +738,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -830,7 +827,6 @@ github.com/tendermint/tendermint v0.34.8 h1:PMWgUx47FrNTsfhxCWzoiIlVAC1SE9+WBlns github.com/tendermint/tendermint v0.34.8/go.mod h1:JVuu3V1ZexOaZG8VJMRl8lnfrGw6hEB2TVnoUwKRbss= github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= diff --git a/proto/oracle/v1/oracle.proto b/proto/oracle/v1/oracle.proto index 459be0897..f3d133f94 100644 --- a/proto/oracle/v1/oracle.proto +++ b/proto/oracle/v1/oracle.proto @@ -276,3 +276,23 @@ message IBCSource { // SourcePort string source_port = 2; } + +// RequestVerification is a message that is constructed and signed by a reporter +// to be used as a part of verification of oracle request. +message RequestVerification { + option (gogoproto.equal) = true; + // ChainID is the ID of targeted chain + string chain_id = 1 [ (gogoproto.customname) = "ChainID" ]; + // Validator is an validator address + string validator = 2; + // RequestID is the targeted request ID + int64 request_id = 3 [ + (gogoproto.customname) = "RequestID", + (gogoproto.casttype) = "RequestID" + ]; + // ExternalID is the oracle's external ID of data source + int64 external_id = 4 [ + (gogoproto.customname) = "ExternalID", + (gogoproto.casttype) = "ExternalID" + ]; +} diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index 70a6e61ad..ea9100daa 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -69,6 +69,13 @@ service Query { returns (QueryRequestPriceResponse) { option (google.api.http).post = "/oracle/request_prices"; } + + // RequestVerification verifies a request to make sure that + // the request requires data from given reporter + rpc RequestVerification(QueryRequestVerificationRequest) + returns (QueryRequestVerificationResponse) { + option (google.api.http).post = "/oracle/verify_request"; + } } // QueryCountsRequest is request type for the Query/Count RPC method. @@ -170,3 +177,33 @@ message QueryRequestPriceResponse { int64 ask_count = 3; int64 min_count = 4; } + +// QueryRequestVerificationRequest is request type for the Query/RequestVerification RPC +message QueryRequestVerificationRequest { + // ChainID is the chain ID to identify which chain ID is used for the verification + string chain_id = 1; + // Validator is a validator address + string validator = 2; + // RequestID is oracle request ID + int64 request_id = 3; + // ExternalID is an oracle's external ID + int64 external_id = 4; + // Reporter is an account address which is a reporter authorized by the validator + string reporter = 5; + // Signature is a signature signed by the reporter using reporter's private key + bytes signature = 6; +} + +// QueryRequestVerificationResponse is response type for the Query/RequestVerification RPC +message QueryRequestVerificationResponse { + // ChainID is the targeted chain ID + string chain_id = 1; + // Validator is the targeted validator address + string validator = 2; + // RequestID is the ID of targeted request + int64 request_id = 3; + // ExternalID is the ID of targeted oracle's external data source + int64 external_id = 4; + // DataSourceID is the ID of a data source that relates to the targeted external ID + int64 data_source_id = 5; +} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index fd11fe560..61185d1b1 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -6,6 +6,8 @@ import ( // "net/http" "context" + "encoding/hex" + "fmt" "strconv" "github.com/cosmos/cosmos-sdk/client" @@ -37,7 +39,8 @@ func GetQueryCmd() *cobra.Command { // GetQueryCmdValidatorStatus(), GetQueryCmdReporters(), GetQueryActiveValidators(), - // GetQueryPendingRequests(storeKey, cdc), + // GetQueryPendingRequests(storeKey, cdc), + GetQueryRequestVerification(), ) return oracleCmd } @@ -223,7 +226,7 @@ func GetQueryCmdReporters() *cobra.Command { return err } queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Reporters(context.Background(), &types.QueryReportersRequest{ValidatorAddress: args[1]}) + r, err := queryClient.Reporters(context.Background(), &types.QueryReportersRequest{ValidatorAddress: args[0]}) if err != nil { return err } @@ -282,3 +285,47 @@ func GetQueryActiveValidators() *cobra.Command { // }, // } // } + +func GetQueryRequestVerification() *cobra.Command { + cmd := &cobra.Command{ + Use: "verify-request [chain-id] [validator-addr] [request-id] [data-source-external-id] [reporter-addr] [reporter-signature-hex]", + Args: cobra.ExactArgs(6), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + requestID, err := strconv.ParseInt(args[2], 10, 64) + if err != nil { + return fmt.Errorf("unable to parse request ID: %w", err) + } + externalID, err := strconv.ParseInt(args[3], 10, 64) + if err != nil { + return fmt.Errorf("unable to parse external ID: %w", err) + } + + signature, err := hex.DecodeString(args[5]) + if err != nil { + return fmt.Errorf("unable to parse signature: %w", err) + } + + r, err := queryClient.RequestVerification(context.Background(), &types.QueryRequestVerificationRequest{ + ChainId: args[0], + Validator: args[1], + RequestId: requestID, + ExternalId: externalID, + Reporter: args[4], + Signature: signature, + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(r) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index bbb04f7f3..9c2f61093 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "github.com/bandprotocol/chain/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -155,3 +156,108 @@ func (k Querier) RequestSearch(c context.Context, req *types.QueryRequestSearchR func (k Querier) RequestPrice(c context.Context, req *types.QueryRequestPriceRequest) (*types.QueryRequestPriceResponse, error) { return &types.QueryRequestPriceResponse{}, nil } + +func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestVerificationRequest) (*types.QueryRequestVerificationResponse, error) { + // Request should not be empty + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + + // Provided chain ID should match validator's chain ID + if ctx.ChainID() != req.ChainId { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) + } + + // Provided validator's address should be valid + validator, err := sdk.ValAddressFromBech32(req.Validator) + if err != nil { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unable to parse validator address: %s", err.Error())) + } + + // Provided signature should be valid, which means this query request should be signed by the provided reporter + reporterPubKey, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeAccPub, req.Reporter) + if err != nil { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unable to get reporter's public key: %s", err.Error())) + } + requestVerificationContent := types.NewRequestVerification(req.ChainId, validator, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signByte := requestVerificationContent.GetSignBytes() + // TODO: panicked when signature array is less than 64 bytes + if !reporterPubKey.VerifySignature(signByte, req.Signature) { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Invalid signature: %s", err.Error())) + } + + // Provided reporter should be authorized by the provided validator + reporters := k.GetReporters(ctx, validator) + reporter := sdk.AccAddress(reporterPubKey.Address().Bytes()) + isReporterAuthorizedByValidator := false + for _, existingReporter := range reporters { + if reporter.Equals(existingReporter) { + isReporterAuthorizedByValidator = true + break + } + } + if !isReporterAuthorizedByValidator { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not an authorized report of %s", reporter, req.Validator)) + } + + // Provided request should exist on chain + request, err := k.GetRequest(ctx, types.RequestID(req.RequestId)) + if err != nil { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unable to get request from chain: %s", err.Error())) + } + + // Provided validator should be assigned to response to the request + isValidatorAssigned := false + for _, requestedValidator := range request.RequestedValidators { + v, _ := sdk.ValAddressFromBech32(requestedValidator) + if validator.Equals(v) { + isValidatorAssigned = true + break + } + } + if !isValidatorAssigned { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not assigned for request ID %d", validator, req.RequestId)) + } + + // Provided external ID should be required by the request determined by oracle script + var dataSourceID *types.DataSourceID + for _, rawRequest := range request.RawRequests { + if rawRequest.ExternalID == types.ExternalID(req.ExternalId) { + dataSourceID = &rawRequest.DataSourceID + break + } + } + if dataSourceID == nil { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("The external data source with ID %d is not required by the request with ID %d", req.ExternalId, req.RequestId)) + } + + // Provided validator should not have reported data for the request + reports := k.GetReports(ctx, types.RequestID(req.RequestId)) + isValidatorReported := false + for _, report := range reports { + reportVal, _ := sdk.ValAddressFromBech32(report.Validator) + if reportVal.Equals(validator) { + isValidatorReported = true + break + } + } + if isValidatorReported { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Validator %s already submitted data report for this request", validator)) + } + + // The request should not be expired + params := k.GetParams(ctx) + if request.RequestHeight+int64(params.ExpirationBlockCount) < ctx.BlockHeader().Height { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Request with ID %d is already expired", req.RequestId)) + } + + return &types.QueryRequestVerificationResponse{ + ChainId: req.ChainId, + Validator: req.Validator, + RequestId: req.RequestId, + ExternalId: req.ExternalId, + DataSourceId: int64(*dataSourceID), + }, nil +} diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index 545389359..73f6fa332 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -1226,6 +1226,80 @@ func (m *IBCSource) GetSourcePort() string { return "" } +// RequestVerification is a message that is constructed and signed by a reporter +// to be used as a part of verification of oracle request. +type RequestVerification struct { + // ChainID is the ID of targeted chain + ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is an validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is the targeted request ID + RequestID RequestID `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"` + // ExternalID is the oracle's external ID of data source + ExternalID ExternalID `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"` +} + +func (m *RequestVerification) Reset() { *m = RequestVerification{} } +func (m *RequestVerification) String() string { return proto.CompactTextString(m) } +func (*RequestVerification) ProtoMessage() {} +func (*RequestVerification) Descriptor() ([]byte, []int) { + return fileDescriptor_652b57db11528d07, []int{14} +} +func (m *RequestVerification) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestVerification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestVerification.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 *RequestVerification) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestVerification.Merge(m, src) +} +func (m *RequestVerification) XXX_Size() int { + return m.Size() +} +func (m *RequestVerification) XXX_DiscardUnknown() { + xxx_messageInfo_RequestVerification.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestVerification proto.InternalMessageInfo + +func (m *RequestVerification) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *RequestVerification) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *RequestVerification) GetRequestID() RequestID { + if m != nil { + return m.RequestID + } + return 0 +} + +func (m *RequestVerification) GetExternalID() ExternalID { + if m != nil { + return m.ExternalID + } + return 0 +} + func init() { proto.RegisterEnum("oracle.v1.ResolveStatus", ResolveStatus_name, ResolveStatus_value) proto.RegisterType((*DataSource)(nil), "oracle.v1.DataSource") @@ -1242,108 +1316,113 @@ func init() { proto.RegisterType((*Params)(nil), "oracle.v1.Params") proto.RegisterType((*PendingResolveList)(nil), "oracle.v1.PendingResolveList") proto.RegisterType((*IBCSource)(nil), "oracle.v1.IBCSource") + proto.RegisterType((*RequestVerification)(nil), "oracle.v1.RequestVerification") } func init() { proto.RegisterFile("oracle/v1/oracle.proto", fileDescriptor_652b57db11528d07) } var fileDescriptor_652b57db11528d07 = []byte{ - // 1530 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcb, 0x6f, 0x1b, 0x55, - 0x17, 0xcf, 0x64, 0x9c, 0xd4, 0x73, 0xec, 0xa4, 0xe9, 0x34, 0x4d, 0x1d, 0xb7, 0xb2, 0xfd, 0x45, - 0xfd, 0xa4, 0x7c, 0x55, 0x3f, 0x9b, 0x04, 0x84, 0x68, 0xca, 0x43, 0xb1, 0xe3, 0x14, 0x8b, 0xa8, - 0xb1, 0xc6, 0x49, 0x05, 0x48, 0x68, 0x74, 0x3d, 0x73, 0xe3, 0x5c, 0x65, 0x5e, 0xdc, 0x3b, 0xce, - 0x63, 0xc9, 0x0e, 0x75, 0xd5, 0x0d, 0x12, 0x9b, 0x4a, 0x95, 0x60, 0xc5, 0x9e, 0x25, 0x1b, 0x56, - 0xdd, 0xd1, 0x15, 0x82, 0x4d, 0x8a, 0x5c, 0x21, 0xf1, 0x37, 0xc0, 0x06, 0xdd, 0xc7, 0xf8, 0x11, - 0xb9, 0x14, 0xca, 0x63, 0xc1, 0xca, 0x3e, 0xbf, 0x73, 0xce, 0xcc, 0xb9, 0xe7, 0xf7, 0xbb, 0xe7, - 0xde, 0x81, 0x85, 0x90, 0x22, 0xc7, 0xc3, 0x95, 0xc3, 0x95, 0x8a, 0xfc, 0x57, 0x8e, 0x68, 0x18, - 0x87, 0xa6, 0xa1, 0xac, 0xc3, 0x95, 0xfc, 0x7c, 0x27, 0xec, 0x84, 0x02, 0xad, 0xf0, 0x7f, 0x32, - 0x20, 0x5f, 0xec, 0x84, 0x61, 0xc7, 0xc3, 0x15, 0x61, 0xb5, 0xbb, 0x7b, 0x95, 0x98, 0xf8, 0x98, - 0xc5, 0xc8, 0x8f, 0x54, 0xc0, 0xe2, 0xd9, 0x00, 0x14, 0x9c, 0x28, 0x57, 0xc1, 0x09, 0x99, 0x1f, - 0xb2, 0x4a, 0x1b, 0x31, 0xfe, 0xe6, 0x36, 0x8e, 0xd1, 0x4a, 0xc5, 0x09, 0x49, 0x20, 0xfd, 0x4b, - 0xdf, 0x6b, 0x00, 0x1b, 0x28, 0x46, 0xad, 0xb0, 0x4b, 0x1d, 0x6c, 0xce, 0xc3, 0x54, 0x78, 0x14, - 0x60, 0x9a, 0xd3, 0x4a, 0xda, 0xb2, 0x61, 0x49, 0xc3, 0x34, 0x21, 0x15, 0x20, 0x1f, 0xe7, 0x26, - 0x05, 0x28, 0xfe, 0x9b, 0x25, 0xc8, 0xb8, 0x98, 0x39, 0x94, 0x44, 0x31, 0x09, 0x83, 0x9c, 0x2e, - 0x5c, 0xc3, 0x90, 0x99, 0x87, 0xf4, 0x1e, 0xf1, 0xb0, 0xc8, 0x4c, 0x09, 0x77, 0xdf, 0x36, 0x3f, - 0x00, 0x7d, 0x0f, 0xe3, 0xdc, 0x74, 0x49, 0x5f, 0xce, 0xac, 0x2e, 0x96, 0x65, 0x91, 0x65, 0x5e, - 0x64, 0x59, 0x15, 0x59, 0xae, 0x85, 0x24, 0xa8, 0xbe, 0xf4, 0xe8, 0xb4, 0x38, 0xf1, 0xc5, 0x93, - 0xe2, 0x72, 0x87, 0xc4, 0xfb, 0xdd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f4, 0x1e, 0xc6, 0x5b, 0xfc, 0xe1, - 0x5c, 0x15, 0x89, 0xce, 0x0f, 0xf0, 0x89, 0x94, 0xb1, 0x05, 0x0a, 0x7a, 0x07, 0x9f, 0xf0, 0x80, - 0x88, 0xe2, 0x08, 0x51, 0x29, 0x9b, 0xb4, 0x94, 0x8d, 0x82, 0x6e, 0x23, 0x76, 0x56, 0x57, 0xc6, - 0x33, 0x74, 0x85, 0x61, 0x69, 0x0c, 0x7d, 0xeb, 0xce, 0x41, 0x10, 0x1e, 0x79, 0xd8, 0xed, 0x60, - 0x1f, 0x07, 0xb1, 0x79, 0x13, 0x92, 0x77, 0x0f, 0x66, 0x4a, 0x9e, 0x4b, 0x5a, 0x65, 0x09, 0x4e, - 0x06, 0x86, 0x65, 0xa8, 0xe8, 0x86, 0xab, 0x5e, 0xf3, 0xf5, 0x24, 0xe4, 0x92, 0xf7, 0xb0, 0x28, - 0x0c, 0x18, 0x7e, 0x31, 0x9d, 0x8c, 0x16, 0x32, 0xf9, 0x07, 0x0a, 0x11, 0xb4, 0x07, 0x4c, 0x31, - 0xab, 0x2b, 0xda, 0x03, 0x26, 0x99, 0x3d, 0x3b, 0x57, 0x52, 0x62, 0xf8, 0x8c, 0xcc, 0x15, 0x11, - 0x22, 0xf6, 0x8d, 0x0c, 0x99, 0x4a, 0x42, 0x04, 0x26, 0x42, 0xde, 0xe2, 0x43, 0x4c, 0x86, 0xb0, - 0x18, 0xc5, 0x5d, 0x26, 0xe6, 0xd3, 0xec, 0x6a, 0x6e, 0x78, 0x4b, 0xc9, 0x80, 0x96, 0xf0, 0xf3, - 0xf1, 0x36, 0x64, 0xf2, 0x23, 0x96, 0x62, 0xd6, 0xf5, 0x62, 0xc1, 0x78, 0xd6, 0x52, 0x96, 0x6a, - 0xe2, 0xb7, 0x3a, 0x9f, 0x01, 0x1c, 0xf8, 0xf7, 0x6d, 0xad, 0x51, 0x62, 0xa7, 0x5f, 0x98, 0xd8, - 0x73, 0xcf, 0x21, 0x36, 0xfd, 0x7c, 0x62, 0x8d, 0xdf, 0x43, 0x2c, 0xbc, 0x28, 0xb1, 0x99, 0x31, - 0xc4, 0x46, 0x70, 0xbe, 0x7f, 0x4e, 0xaa, 0x84, 0x2b, 0x60, 0x10, 0x66, 0x23, 0x27, 0x26, 0x87, - 0x58, 0x10, 0x9c, 0xb6, 0xd2, 0x84, 0xad, 0x0b, 0xdb, 0x5c, 0x83, 0x29, 0x46, 0x02, 0x47, 0xce, - 0xf5, 0xcc, 0x6a, 0xbe, 0x2c, 0x6f, 0xca, 0xe5, 0xe4, 0xa6, 0x5c, 0xde, 0x49, 0xae, 0xd2, 0xd5, - 0x34, 0x1f, 0x42, 0xf7, 0x9f, 0x14, 0x35, 0x4b, 0xa6, 0xa8, 0x37, 0x7e, 0xae, 0xc3, 0x74, 0x13, - 0x51, 0xe4, 0x33, 0x73, 0x05, 0x2e, 0xf9, 0xe8, 0xd8, 0x1e, 0x3a, 0x08, 0x55, 0x2b, 0x35, 0xd1, - 0x4a, 0xd3, 0x47, 0xc7, 0x83, 0x53, 0x50, 0x36, 0x75, 0x09, 0x66, 0x78, 0xca, 0x80, 0xea, 0x49, - 0x79, 0x0c, 0xfb, 0xe8, 0x78, 0x3d, 0x61, 0xfb, 0x15, 0x58, 0xc0, 0xc7, 0x11, 0xa1, 0x88, 0xdf, - 0x2b, 0xed, 0xb6, 0x17, 0x3a, 0x07, 0x23, 0x7b, 0x6f, 0x7e, 0xe0, 0xad, 0x72, 0xa7, 0xcc, 0xba, - 0x06, 0xb3, 0x7c, 0x90, 0xda, 0xe1, 0x11, 0x62, 0xbe, 0x18, 0x5c, 0x52, 0x45, 0x59, 0x8e, 0x6e, - 0x73, 0x90, 0xcf, 0xb6, 0x9b, 0xb0, 0x18, 0x61, 0x3a, 0xb8, 0x76, 0xf4, 0x0b, 0xe7, 0x09, 0x52, - 0x59, 0x0b, 0x11, 0xa6, 0xfd, 0x9e, 0xaa, 0xe2, 0x79, 0xea, 0x0d,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4, 0x3c, 0xe9, 0x9d, 0x90, + 0x57, 0x7f, 0xa7, 0xd9, 0xd0, 0xeb, 0x5b, 0x0b, 0xea, 0xc4, 0x3c, 0xe9, 0xcd, 0x27, 0x3f, 0xfa, + 0xb4, 0x30, 0x55, 0xdd, 0x7e, 0xd8, 0x2f, 0x28, 0x8f, 0xfa, 0x05, 0xe5, 0x87, 0x7e, 0x41, 0xb9, + 0xf7, 0xa4, 0x30, 0xf5, 0xe8, 0x49, 0x61, 0xea, 0xdb, 0x27, 0x85, 0xa9, 0xf7, 0xae, 0x8f, 0x2c, + 0x32, 0x6d, 0xe4, 0x5a, 0x7c, 0xdc, 0x98, 0x9e, 0x5d, 0xe1, 0xb4, 0x56, 0x4e, 0xe5, 0x7f, 0x00, + 0x88, 0x95, 0xa6, 0x3d, 0xc3, 0xdd, 0x2f, 0xfd, 0x1a, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xe3, 0xe2, + 0xf2, 0x21, 0x10, 0x00, 0x00, } func (this *DataSource) Equal(that interface{}) bool { @@ -1883,6 +1962,39 @@ func (this *IBCSource) Equal(that interface{}) bool { } return true } +func (this *RequestVerification) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RequestVerification) + if !ok { + that2, ok := that.(RequestVerification) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ChainID != that1.ChainID { + return false + } + if this.Validator != that1.Validator { + return false + } + if this.RequestID != that1.RequestID { + return false + } + if this.ExternalID != that1.ExternalID { + return false + } + return true +} func (m *DataSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2684,6 +2796,53 @@ func (m *IBCSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *RequestVerification) 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 *RequestVerification) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestVerification) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExternalID != 0 { + i = encodeVarintOracle(dAtA, i, uint64(m.ExternalID)) + i-- + dAtA[i] = 0x20 + } + if m.RequestID != 0 { + i = encodeVarintOracle(dAtA, i, uint64(m.RequestID)) + i-- + dAtA[i] = 0x18 + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintOracle(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintOracle(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintOracle(dAtA []byte, offset int, v uint64) int { offset -= sovOracle(v) base := offset @@ -3078,6 +3237,29 @@ func (m *IBCSource) Size() (n int) { return n } +func (m *RequestVerification) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + if m.RequestID != 0 { + n += 1 + sovOracle(uint64(m.RequestID)) + } + if m.ExternalID != 0 { + n += 1 + sovOracle(uint64(m.ExternalID)) + } + return n +} + func sovOracle(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5635,6 +5817,158 @@ func (m *IBCSource) Unmarshal(dAtA []byte) error { } return nil } +func (m *RequestVerification) 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 ErrIntOverflowOracle + } + 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: RequestVerification: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestVerification: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestID", wireType) + } + m.RequestID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestID |= RequestID(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalID", wireType) + } + m.ExternalID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExternalID |= ExternalID(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipOracle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOracle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipOracle(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 65fd42061..e5d73bf62 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1084,6 +1084,179 @@ func (m *QueryRequestPriceResponse) GetMinCount() int64 { return 0 } +// QueryRequestVerificationRequest is request type for the Query/RequestVerification RPC +type QueryRequestVerificationRequest struct { + // ChainID is the chain ID to identify which chain ID is used for the verification + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is a validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is oracle request ID + RequestId int64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ExternalID is an oracle's external ID + ExternalId int64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // Reporter is an account address which is a reporter authorized by the validator + Reporter string `protobuf:"bytes,5,opt,name=reporter,proto3" json:"reporter,omitempty"` + // Signature is a signature signed by the reporter using reporter's private key + Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *QueryRequestVerificationRequest) Reset() { *m = QueryRequestVerificationRequest{} } +func (m *QueryRequestVerificationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequestVerificationRequest) ProtoMessage() {} +func (*QueryRequestVerificationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_34238c8dfdfcd7ec, []int{22} +} +func (m *QueryRequestVerificationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequestVerificationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequestVerificationRequest.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 *QueryRequestVerificationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequestVerificationRequest.Merge(m, src) +} +func (m *QueryRequestVerificationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequestVerificationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequestVerificationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequestVerificationRequest proto.InternalMessageInfo + +func (m *QueryRequestVerificationRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *QueryRequestVerificationRequest) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *QueryRequestVerificationRequest) GetRequestId() int64 { + if m != nil { + return m.RequestId + } + return 0 +} + +func (m *QueryRequestVerificationRequest) GetExternalId() int64 { + if m != nil { + return m.ExternalId + } + return 0 +} + +func (m *QueryRequestVerificationRequest) GetReporter() string { + if m != nil { + return m.Reporter + } + return "" +} + +func (m *QueryRequestVerificationRequest) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// QueryRequestVerificationResponse is response type for the Query/RequestVerification RPC +type QueryRequestVerificationResponse struct { + // ChainID is the targeted chain ID + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is the targeted validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is the ID of targeted request + RequestId int64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ExternalID is the ID of targeted oracle's external data source + ExternalId int64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // DataSourceID is the ID of a data source that relates to the targeted external ID + DataSourceId int64 `protobuf:"varint,5,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` +} + +func (m *QueryRequestVerificationResponse) Reset() { *m = QueryRequestVerificationResponse{} } +func (m *QueryRequestVerificationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRequestVerificationResponse) ProtoMessage() {} +func (*QueryRequestVerificationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_34238c8dfdfcd7ec, []int{23} +} +func (m *QueryRequestVerificationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequestVerificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequestVerificationResponse.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 *QueryRequestVerificationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequestVerificationResponse.Merge(m, src) +} +func (m *QueryRequestVerificationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRequestVerificationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequestVerificationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequestVerificationResponse proto.InternalMessageInfo + +func (m *QueryRequestVerificationResponse) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *QueryRequestVerificationResponse) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *QueryRequestVerificationResponse) GetRequestId() int64 { + if m != nil { + return m.RequestId + } + return 0 +} + +func (m *QueryRequestVerificationResponse) GetExternalId() int64 { + if m != nil { + return m.ExternalId + } + return 0 +} + +func (m *QueryRequestVerificationResponse) GetDataSourceId() int64 { + if m != nil { + return m.DataSourceId + } + return 0 +} + func init() { proto.RegisterType((*QueryCountsRequest)(nil), "oracle.v1.QueryCountsRequest") proto.RegisterType((*QueryCountsResponse)(nil), "oracle.v1.QueryCountsResponse") @@ -1107,80 +1280,91 @@ func init() { proto.RegisterType((*QueryRequestSearchResponse)(nil), "oracle.v1.QueryRequestSearchResponse") proto.RegisterType((*QueryRequestPriceRequest)(nil), "oracle.v1.QueryRequestPriceRequest") proto.RegisterType((*QueryRequestPriceResponse)(nil), "oracle.v1.QueryRequestPriceResponse") + proto.RegisterType((*QueryRequestVerificationRequest)(nil), "oracle.v1.QueryRequestVerificationRequest") + proto.RegisterType((*QueryRequestVerificationResponse)(nil), "oracle.v1.QueryRequestVerificationResponse") } func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 1087 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0x26, 0x69, 0xbe, 0xf1, 0x8b, 0x93, 0x6f, 0x3c, 0x71, 0x5c, 0x77, 0xe3, 0x6c, 0x93, - 0x8d, 0x4b, 0xac, 0x02, 0x5e, 0x1a, 0x0a, 0x27, 0x84, 0xd4, 0x12, 0x55, 0x44, 0x42, 0xa2, 0x75, - 0x04, 0x12, 0x5c, 0xac, 0xc9, 0x7a, 0x65, 0xaf, 0x62, 0x7b, 0xb7, 0x3b, 0xe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 0x4a, 0x4d, 0x09, 0xf3, 0xde, - 0x6b, 0x50, 0xa8, 0x6a, 0x71, 0xd5, 0x2a, 0xa9, 0x64, 0xde, 0x5c, 0x9b, 0x09, 0xb1, 0x4b, 0x28, - 0xea, 0xad, 0x35, 0x5f, 0x6c, 0x53, 0xfa, 0xbc, 0x59, 0x9f, 0x0f, 0x4a, 0x4b, 0xdb, 0x39, 0xe9, - 0x30, 0x81, 0xb1, 0xc7, 0x4f, 0x5e, 0x5e, 0x5b, 0xc6, 0xab, 0x6b, 0xcb, 0xf8, 0xf3, 0xda, 0x32, - 0x7e, 0xb8, 0xb1, 0x16, 0x5e, 0xdd, 0x58, 0x0b, 0xbf, 0xdf, 0x58, 0x0b, 0x5f, 0xbe, 0xd5, 0xf5, - 0xe3, 0xde, 0xe8, 0xac, 0xe9, 0x06, 0x03, 0xe7, 0x8c, 0x0e, 0x3b, 0xfc, 0x1f, 0x83, 0x1b, 0xf4, - 0x1d, 0xb7, 0x47, 0xfd, 0xa1, 0xf3, 0x95, 0x24, 0x8c, 0x2f, 0x43, 0x8f, 0x9d, 0xad, 0xf0, 0xf4, - 0xbb, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x79, 0x61, 0x59, 0x0d, 0xc0, 0x0c, 0x00, 0x00, + // 1218 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xe6, 0xc3, 0x8d, 0x5f, 0xdc, 0x10, 0x4f, 0x3e, 0xea, 0x6c, 0x1c, 0x27, 0xd9, 0xa4, + 0x24, 0x4a, 0xc1, 0x4b, 0x43, 0xe1, 0x84, 0x90, 0x5a, 0xa2, 0x8a, 0x48, 0x48, 0xb4, 0x1b, 0x51, + 0x09, 0x2e, 0xd6, 0x64, 0xbd, 0xd8, 0xab, 0x38, 0xbb, 0xee, 0xce, 0x3a, 0x6a, 0x14, 0x22, 0x50, + 0x4f, 0x48, 0x48, 0x08, 0x09, 0x89, 0x0b, 0x7f, 0x0d, 0xb7, 0x1e, 0x38, 0x54, 0x82, 0x03, 0x27, + 0x84, 0x12, 0xfe, 0x10, 0xb4, 0x33, 0x6f, 0xc6, 0xb3, 0x1f, 0x4e, 0x81, 0x4b, 0x6f, 0xde, 0xf7, + 0x7e, 0xf3, 0x7b, 0xbf, 0x79, 0x33, 0xef, 0xbd, 0x31, 0x2c, 0x86, 0x11, 0x75, 0x7b, 0x9e, 0x7d, + 0x7a, 0xd7, 0x7e, 0x3a, 0xf0, 0xa2, 0xb3, 0x66, 0x3f, 0x0a, 0xe3, 0x90, 0x94, 0x85, 0xb9, 0x79, + 0x7a, 0xd7, 0x5c, 0xe8, 0x84, 0x9d, 0x90, 0x5b, 0xed, 0xe4, 0x97, 0x00, 0x98, 0xf5, 0x4e, 0x18, + 0x76, 0x7a, 0x9e, 0x4d, 0xfb, 0xbe, 0x4d, 0x83, 0x20, 0x8c, 0x69, 0xec, 0x87, 0x01, 0x43, 0xef, + 0xd2, 0x90, 0x15, 0x89, 0xb8, 0xdd, 0x5a, 0x00, 0xf2, 0x38, 0x89, 0xf2, 0x51, 0x38, 0x08, 0x62, + 0xe6, 0x78, 0x4f, 0x07, 0x1e, 0x8b, 0xad, 0x9f, 0x0c, 0x98, 0x4f, 0x99, 0x59, 0x3f, 0x0c, 0x98, + 0x47, 0x76, 0xa1, 0xda, 0xa6, 0x31, 0x6d, 0xb1, 0x70, 0x10, 0xb9, 0x5e, 0xcb, 0x4d, 0xbc, 0x35, + 0x63, 0xdd, 0xd8, 0x99, 0x70, 0xde, 0x48, 0x1c, 0x87, 0xdc, 0xce, 0x17, 0x91, 0x26, 0xcc, 0x8b, + 0x48, 0x2d, 0xe6, 0x46, 0x7e, 0x3f, 0x46, 0xf4, 0x38, 0x47, 0x57, 0x85, 0xeb, 0x90, 0x7b, 0x04, + 0x7e, 0x13, 0x6e, 0x46, 0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xc6, 0x5f, 0x97, 0x0d, 0xe3, 0x87, 0xab, 0xc6, 0xd8, 0xcb, 0xab, 0xc6, 0xd8, 0x1f, 0x57, 0x8d, + 0xb1, 0x2f, 0xde, 0xea, 0xf8, 0x71, 0x77, 0x70, 0xd4, 0x74, 0xc3, 0x13, 0xfb, 0x88, 0x06, 0x6d, + 0xfe, 0xef, 0xd2, 0x0d, 0x7b, 0x36, 0x9f, 0x46, 0xf6, 0x33, 0x49, 0x18, 0x9f, 0xf5, 0x3d, 0x76, + 0x54, 0xe2, 0xee, 0x77, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x04, 0xf5, 0xd8, 0xec, 0x0e, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1219,6 +1403,9 @@ type QueryClient interface { // RequestPrice queries the latest price on standard price reference oracle // script. RequestPrice(ctx context.Context, in *QueryRequestPriceRequest, opts ...grpc.CallOption) (*QueryRequestPriceResponse, error) + // RequestVerification verifies a request to make sure that + // the request requires data from given reporter + RequestVerification(ctx context.Context, in *QueryRequestVerificationRequest, opts ...grpc.CallOption) (*QueryRequestVerificationResponse, error) } type queryClient struct { @@ -1328,6 +1515,15 @@ func (c *queryClient) RequestPrice(ctx context.Context, in *QueryRequestPriceReq return out, nil } +func (c *queryClient) RequestVerification(ctx context.Context, in *QueryRequestVerificationRequest, opts ...grpc.CallOption) (*QueryRequestVerificationResponse, error) { + out := new(QueryRequestVerificationResponse) + err := c.cc.Invoke(ctx, "/oracle.v1.Query/RequestVerification", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Counts queries the number of data sources, oracle scripts, and requests. @@ -1354,6 +1550,9 @@ type QueryServer interface { // RequestPrice queries the latest price on standard price reference oracle // script. RequestPrice(context.Context, *QueryRequestPriceRequest) (*QueryRequestPriceResponse, error) + // RequestVerification verifies a request to make sure that + // the request requires data from given reporter + RequestVerification(context.Context, *QueryRequestVerificationRequest) (*QueryRequestVerificationResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1393,6 +1592,9 @@ func (*UnimplementedQueryServer) RequestSearch(ctx context.Context, req *QueryRe func (*UnimplementedQueryServer) RequestPrice(ctx context.Context, req *QueryRequestPriceRequest) (*QueryRequestPriceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RequestPrice not implemented") } +func (*UnimplementedQueryServer) RequestVerification(ctx context.Context, req *QueryRequestVerificationRequest) (*QueryRequestVerificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestVerification not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1596,6 +1798,24 @@ func _Query_RequestPrice_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Query_RequestVerification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequestVerificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RequestVerification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/oracle.v1.Query/RequestVerification", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RequestVerification(ctx, req.(*QueryRequestVerificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "oracle.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1644,6 +1864,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "RequestPrice", Handler: _Query_RequestPrice_Handler, }, + { + MethodName: "RequestVerification", + Handler: _Query_RequestVerification_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "oracle/v1/query.proto", @@ -2358,6 +2582,119 @@ func (m *QueryRequestPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *QueryRequestVerificationRequest) 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 *QueryRequestVerificationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequestVerificationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x32 + } + if len(m.Reporter) > 0 { + i -= len(m.Reporter) + copy(dAtA[i:], m.Reporter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Reporter))) + i-- + dAtA[i] = 0x2a + } + if m.ExternalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ExternalId)) + i-- + dAtA[i] = 0x20 + } + if m.RequestId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RequestId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRequestVerificationResponse) 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 *QueryRequestVerificationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequestVerificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DataSourceId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DataSourceId)) + i-- + dAtA[i] = 0x28 + } + if m.ExternalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ExternalId)) + i-- + dAtA[i] = 0x20 + } + if m.RequestId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RequestId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2668,6 +3005,63 @@ func (m *QueryRequestPriceResponse) Size() (n int) { return n } +func (m *QueryRequestVerificationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.RequestId != 0 { + n += 1 + sovQuery(uint64(m.RequestId)) + } + if m.ExternalId != 0 { + n += 1 + sovQuery(uint64(m.ExternalId)) + } + l = len(m.Reporter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRequestVerificationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.RequestId != 0 { + n += 1 + sovQuery(uint64(m.RequestId)) + } + if m.ExternalId != 0 { + n += 1 + sovQuery(uint64(m.ExternalId)) + } + if m.DataSourceId != 0 { + n += 1 + sovQuery(uint64(m.DataSourceId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4534,6 +4928,395 @@ func (m *QueryRequestPriceResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryRequestVerificationRequest) 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: QueryRequestVerificationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequestVerificationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + m.RequestId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + m.ExternalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExternalId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reporter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reporter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + 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 (m *QueryRequestVerificationResponse) 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: QueryRequestVerificationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequestVerificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + m.RequestId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + m.ExternalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExternalId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + m.DataSourceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataSourceId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index a8a6c95aa..0d06eca41 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_Counts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryCountsRequest @@ -481,15 +483,53 @@ func local_request_Query_RequestPrice_0(ctx context.Context, marshaler runtime.M } +var ( + filter_Query_RequestVerification_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RequestVerification_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequestVerificationRequest + 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_RequestVerification_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RequestVerification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RequestVerification_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequestVerificationRequest + 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_RequestVerification_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RequestVerification(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Counts_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 { @@ -497,6 +537,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Counts_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) @@ -510,6 +551,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Data_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 { @@ -517,6 +560,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Data_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) @@ -530,6 +574,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DataSource_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 { @@ -537,6 +583,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DataSource_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) @@ -550,6 +597,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_OracleScript_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 { @@ -557,6 +606,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_OracleScript_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) @@ -570,6 +620,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Request_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 { @@ -577,6 +629,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Request_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) @@ -590,6 +643,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Validator_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 { @@ -597,6 +652,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Validator_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) @@ -610,6 +666,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Reporters_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 { @@ -617,6 +675,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Reporters_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) @@ -630,6 +689,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ActiveValidators_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 { @@ -637,6 +698,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ActiveValidators_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) @@ -650,6 +712,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + 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 { @@ -657,6 +721,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_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) @@ -670,6 +735,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_RequestSearch_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 { @@ -677,6 +744,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_RequestSearch_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) @@ -690,6 +758,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Query_RequestPrice_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 { @@ -697,6 +767,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_RequestPrice_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) @@ -707,6 +778,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("POST", pattern_Query_RequestVerification_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 { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RequestVerification_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) + return + } + + forward_Query_RequestVerification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -968,6 +1062,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("POST", pattern_Query_RequestVerification_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_RequestVerification_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_RequestVerification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -993,6 +1107,8 @@ var ( pattern_Query_RequestSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"oracle", "request_search"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_RequestPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"oracle", "request_prices"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RequestVerification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"oracle", "verify_request"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -1017,4 +1133,6 @@ var ( forward_Query_RequestSearch_0 = runtime.ForwardResponseMessage forward_Query_RequestPrice_0 = runtime.ForwardResponseMessage + + forward_Query_RequestVerification_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/verify_request.go b/x/oracle/types/verify_request.go new file mode 100644 index 000000000..198992ef3 --- /dev/null +++ b/x/oracle/types/verify_request.go @@ -0,0 +1,21 @@ +package types + +import ( + "encoding/json" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewRequestVerification(chainID string, validator sdk.ValAddress, requestID RequestID, externalID ExternalID) RequestVerification { + return RequestVerification{ + ChainID: chainID, + Validator: validator.String(), + RequestID: requestID, + ExternalID: externalID, + } +} + +func (msg RequestVerification) GetSignBytes() []byte { + bz, _ := json.Marshal(msg) + return sdk.MustSortJSON(bz) +} From 0d494c1830d3b24813a1f717b13917c3662f651d Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Tue, 30 Mar 2021 23:43:38 +0700 Subject: [PATCH 02/14] Fix nil pointer exception --- x/oracle/keeper/grpc_query.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 9c2f61093..63d204e0e 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -183,9 +183,8 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } requestVerificationContent := types.NewRequestVerification(req.ChainId, validator, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) signByte := requestVerificationContent.GetSignBytes() - // TODO: panicked when signature array is less than 64 bytes if !reporterPubKey.VerifySignature(signByte, req.Signature) { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Invalid signature: %s", err.Error())) + return nil, status.Error(codes.InvalidArgument, "Invalid reporter's signature") } // Provided reporter should be authorized by the provided validator From 505086072901dfaabe0df09c9c49449e290a64cd Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Wed, 31 Mar 2021 15:30:16 +0700 Subject: [PATCH 03/14] Add supa tests --- proto/oracle/v1/query.proto | 2 +- x/oracle/keeper/grpc_query.go | 10 +- x/oracle/keeper/grpc_query_test.go | 292 +++++++++++++++++++++++++++++ 3 files changed, 298 insertions(+), 6 deletions(-) create mode 100644 x/oracle/keeper/grpc_query_test.go diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index ea9100daa..a4536c7c6 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -188,7 +188,7 @@ message QueryRequestVerificationRequest { int64 request_id = 3; // ExternalID is an oracle's external ID int64 external_id = 4; - // Reporter is an account address which is a reporter authorized by the validator + // Reporter is an bech32-encoded public key of the reporter authorized by the validator string reporter = 5; // Signature is a signature signed by the reporter using reporter's private key bytes signature = 6; diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 63d204e0e..df09fd474 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -167,7 +167,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV // Provided chain ID should match validator's chain ID if ctx.ChainID() != req.ChainId { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) } // Provided validator's address should be valid @@ -184,7 +184,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV requestVerificationContent := types.NewRequestVerification(req.ChainId, validator, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) signByte := requestVerificationContent.GetSignBytes() if !reporterPubKey.VerifySignature(signByte, req.Signature) { - return nil, status.Error(codes.InvalidArgument, "Invalid reporter's signature") + return nil, status.Error(codes.InvalidArgument, "invalid reporter's signature") } // Provided reporter should be authorized by the provided validator @@ -198,7 +198,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if !isReporterAuthorizedByValidator { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not an authorized report of %s", reporter, req.Validator)) + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not an authorized reporter of %s", reporter, req.Validator)) } // Provided request should exist on chain @@ -229,7 +229,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if dataSourceID == nil { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("The external data source with ID %d is not required by the request with ID %d", req.ExternalId, req.RequestId)) + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("no data source required by the request %d found which relates to the external data source with ID %d.", req.RequestId, req.ExternalId)) } // Provided validator should not have reported data for the request @@ -243,7 +243,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if isValidatorReported { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Validator %s already submitted data report for this request", validator)) + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("validator %s already submitted data report for this request", validator)) } // The request should not be expired diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go new file mode 100644 index 000000000..038b30c4b --- /dev/null +++ b/x/oracle/keeper/grpc_query_test.go @@ -0,0 +1,292 @@ +package keeper_test + +import ( + "testing" + + "github.com/bandprotocol/chain/x/oracle/keeper" + "github.com/bandprotocol/chain/x/oracle/testapp" + "github.com/bandprotocol/chain/x/oracle/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" +) + +type RequestVerificationTestSuite struct { + suite.Suite + + assert *require.Assertions + querier keeper.Querier + request types.Request + + reporterPrivKey cryptotypes.PrivKey + reporterAddr sdk.AccAddress + + ctx sdk.Context +} + +func (suite *RequestVerificationTestSuite) SetupTest() { + suite.assert = require.New(suite.T()) + _, ctx, k := testapp.CreateTestInput(true) + + suite.querier = keeper.Querier{ + Keeper: k, + } + suite.ctx = ctx + + suite.request = types.NewRequest( + 1, + BasicCalldata, + []sdk.ValAddress{testapp.Validators[0].ValAddress}, + 1, + 1, + testapp.ParseTime(0), + "", + []types.RawRequest{ + types.NewRawRequest(1, 1, []byte("testdata")), + types.NewRawRequest(2, 2, []byte("testdata")), + types.NewRawRequest(3, 3, []byte("testdata")), + }, + nil, + 0, + ) + suite.reporterPrivKey = secp256k1.GenPrivKey() + suite.reporterAddr = sdk.AccAddress(suite.reporterPrivKey.PubKey().Address()) + + k.SetRequest(ctx, types.RequestID(1), suite.request) + if err := k.AddReporter(ctx, testapp.Validators[0].ValAddress, suite.reporterAddr); err != nil { + panic(err) + } +} + +func (suite *RequestVerificationTestSuite) TestSuccess() { + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + expectedResult := &types.QueryRequestVerificationResponse{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + DataSourceId: 1, + } + suite.assert.NoError(err, "RequestVerification should success") + suite.assert.Equal(expectedResult, res, "Expected result should be matched") +} + +func (suite *RequestVerificationTestSuite) TestFailedEmptyRequest() { + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), nil) + + suite.assert.Contains(err.Error(), "empty request", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedChainIDNotMatch() { + req := &types.QueryRequestVerificationRequest{ + ChainId: "other-chain-id", + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "provided chain ID does not match the validator's chain ID", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedInvalidValidatorAddr() { + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: "someRandomString", + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "unable to parse validator address", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedInvalidReporterPubKey() { + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: "someRandomString", + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "unable to get reporter's public key", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedEmptySignature() { + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "invalid reporter's signature", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedReporterUnauthorized() { + err := suite.querier.Keeper.RemoveReporter(suite.ctx, testapp.Validators[0].ValAddress, suite.reporterAddr) + suite.assert.NoError(err) + + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "is not an authorized reporter of", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedUnselectedValidator() { + suite.request.RequestedValidators = []string{testapp.Validators[1].ValAddress.String()} + suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(1), suite.request) + + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "is not assigned for request ID", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedNoDataSourceFound() { + suite.request.RawRequests = []types.RawRequest{} + suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(1), suite.request) + + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "no data source required by the request", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedValidatorAlreadyReported() { + err := suite.querier.Keeper.AddReport(suite.ctx, types.RequestID(1), types.NewReport(testapp.Validators[0].ValAddress, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("testdata")), + types.NewRawReport(2, 0, []byte("testdata")), + types.NewRawReport(3, 0, []byte("testdata")), + })) + suite.assert.NoError(err) + + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "already submitted data report", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func (suite *RequestVerificationTestSuite) TestFailedRequestAlreadyExpired() { + req := &types.QueryRequestVerificationRequest{ + ChainId: suite.ctx.ChainID(), + Validator: testapp.Validators[0].ValAddress.String(), + RequestId: 1, + ExternalId: 1, + Reporter: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, suite.reporterPrivKey.PubKey()), + } + + suite.ctx = suite.ctx.WithBlockHeight(1000) + + requestVerification := types.NewRequestVerification(req.ChainId, testapp.Validators[0].ValAddress, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) + signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) + suite.assert.NoError(err) + req.Signature = signature + + res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + + suite.assert.Contains(err.Error(), "Request with ID 1 is already expired", "RequestVerification should failed") + suite.assert.Nil(res, "response should be nil") +} + +func TestRequestVerification(t *testing.T) { + suite.Run(t, new(RequestVerificationTestSuite)) +} From 9861404b32c3121fc9f48ddf392ec0120977ceea Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Wed, 31 Mar 2021 15:34:39 +0700 Subject: [PATCH 04/14] Fix comments pop pop --- proto/oracle/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index a4536c7c6..190fb4363 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -71,7 +71,7 @@ service Query { } // RequestVerification verifies a request to make sure that - // the request requires data from given reporter + // all information that will be used to report the data is valid rpc RequestVerification(QueryRequestVerificationRequest) returns (QueryRequestVerificationResponse) { option (google.api.http).post = "/oracle/verify_request"; From 9a9672a6f55d25b3a8bc0e6cea303d5d0dede1df Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Wed, 31 Mar 2021 15:55:39 +0700 Subject: [PATCH 05/14] Edit a bit comment --- x/oracle/types/query.pb.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index e5d73bf62..b8192a2b7 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1094,7 +1094,7 @@ type QueryRequestVerificationRequest struct { RequestId int64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // ExternalID is an oracle's external ID ExternalId int64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - // Reporter is an account address which is a reporter authorized by the validator + // Reporter is an bech32-encoded public key of the reporter authorized by the validator Reporter string `protobuf:"bytes,5,opt,name=reporter,proto3" json:"reporter,omitempty"` // Signature is a signature signed by the reporter using reporter's private key Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` @@ -1404,7 +1404,7 @@ type QueryClient interface { // script. RequestPrice(ctx context.Context, in *QueryRequestPriceRequest, opts ...grpc.CallOption) (*QueryRequestPriceResponse, error) // RequestVerification verifies a request to make sure that - // the request requires data from given reporter + // all information that will be used to report the data is valid RequestVerification(ctx context.Context, in *QueryRequestVerificationRequest, opts ...grpc.CallOption) (*QueryRequestVerificationResponse, error) } @@ -1551,7 +1551,7 @@ type QueryServer interface { // script. RequestPrice(context.Context, *QueryRequestPriceRequest) (*QueryRequestPriceResponse, error) // RequestVerification verifies a request to make sure that - // the request requires data from given reporter + // all information that will be used to report the data is valid RequestVerification(context.Context, *QueryRequestVerificationRequest) (*QueryRequestVerificationResponse, error) } From 783f8acf53dd4601ba2f9b3730c518a2a59cbeca Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Thu, 1 Apr 2021 15:03:47 +0700 Subject: [PATCH 06/14] Change status code --- x/oracle/keeper/grpc_query.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index df09fd474..e2c9fda92 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -165,9 +165,9 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV ctx := sdk.UnwrapSDKContext(c) - // Provided chain ID should match validator's chain ID + // Provided chain ID should match current chain ID if ctx.ChainID() != req.ChainId { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) + return nil, status.Error(codes.Internal, fmt.Sprintf("provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) } // Provided validator's address should be valid @@ -198,13 +198,13 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if !isReporterAuthorizedByValidator { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not an authorized reporter of %s", reporter, req.Validator)) + return nil, status.Error(codes.Unauthenticated, fmt.Sprintf("%s is not an authorized reporter of %s", reporter, req.Validator)) } // Provided request should exist on chain request, err := k.GetRequest(ctx, types.RequestID(req.RequestId)) if err != nil { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unable to get request from chain: %s", err.Error())) + return nil, status.Error(codes.NotFound, fmt.Sprintf("unable to get request from chain: %s", err.Error())) } // Provided validator should be assigned to response to the request @@ -217,7 +217,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if !isValidatorAssigned { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("%s is not assigned for request ID %d", validator, req.RequestId)) + return nil, status.Error(codes.Unauthenticated, fmt.Sprintf("%s is not assigned for request ID %d", validator, req.RequestId)) } // Provided external ID should be required by the request determined by oracle script @@ -243,13 +243,13 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if isValidatorReported { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("validator %s already submitted data report for this request", validator)) + return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("validator %s already submitted data report for this request", validator)) } // The request should not be expired params := k.GetParams(ctx) if request.RequestHeight+int64(params.ExpirationBlockCount) < ctx.BlockHeader().Height { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Request with ID %d is already expired", req.RequestId)) + return nil, status.Error(codes.DeadlineExceeded, fmt.Sprintf("Request with ID %d is already expired", req.RequestId)) } return &types.QueryRequestVerificationResponse{ From be8a2b934076ff20ee9101eab30c302d306351bd Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Fri, 2 Apr 2021 14:05:49 +0700 Subject: [PATCH 07/14] Change URL --- proto/oracle/v1/query.proto | 2 +- x/oracle/types/query.pb.go | 156 +++++++++++++++++----------------- x/oracle/types/query.pb.gw.go | 2 +- 3 files changed, 80 insertions(+), 80 deletions(-) diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index 190fb4363..ec0f4e1a4 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -74,7 +74,7 @@ service Query { // all information that will be used to report the data is valid rpc RequestVerification(QueryRequestVerificationRequest) returns (QueryRequestVerificationResponse) { - option (google.api.http).post = "/oracle/verify_request"; + option (google.api.http).post = "/oracle/v1/verify_request"; } } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index b8192a2b7..8d89eb8fa 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1287,84 +1287,84 @@ func init() { func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 1218 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xe6, 0xc3, 0x8d, 0x5f, 0xdc, 0x10, 0x4f, 0x3e, 0xea, 0x6c, 0x1c, 0x27, 0xd9, 0xa4, - 0x24, 0x4a, 0xc1, 0x4b, 0x43, 0xe1, 0x84, 0x90, 0x5a, 0xa2, 0x8a, 0x48, 0x48, 0xb4, 0x1b, 0x51, - 0x09, 0x2e, 0xd6, 0x64, 0xbd, 0xd8, 0xab, 0x38, 0xbb, 0xee, 0xce, 0x3a, 0x6a, 0x14, 0x22, 0x50, - 0x4f, 0x48, 0x48, 0x08, 0x09, 0x89, 0x0b, 0x7f, 0x0d, 0xb7, 0x1e, 0x38, 0x54, 0x82, 0x03, 0x27, - 0x84, 0x12, 0xfe, 0x10, 0xb4, 0x33, 0x6f, 0xc6, 0xb3, 0x1f, 0x4e, 0x81, 0x4b, 0x6f, 0xde, 0xf7, - 0x7e, 0xf3, 0x7b, 0xbf, 0x79, 0x33, 0xef, 0xbd, 0x31, 0x2c, 0x86, 0x11, 0x75, 0x7b, 0x9e, 0x7d, - 0x7a, 0xd7, 0x7e, 0x3a, 0xf0, 0xa2, 0xb3, 0x66, 0x3f, 0x0a, 0xe3, 0x90, 0x94, 0x85, 0xb9, 0x79, - 0x7a, 0xd7, 0x5c, 0xe8, 0x84, 0x9d, 0x90, 0x5b, 0xed, 0xe4, 0x97, 0x00, 0x98, 0xf5, 0x4e, 0x18, - 0x76, 0x7a, 0x9e, 0x4d, 0xfb, 0xbe, 0x4d, 0x83, 0x20, 0x8c, 0x69, 0xec, 0x87, 0x01, 0x43, 0xef, - 0xd2, 0x90, 0x15, 0x89, 0xb8, 0xdd, 0x5a, 0x00, 0xf2, 0x38, 0x89, 0xf2, 0x51, 0x38, 0x08, 0x62, - 0xe6, 0x78, 0x4f, 0x07, 0x1e, 0x8b, 0xad, 0x9f, 0x0c, 0x98, 0x4f, 0x99, 0x59, 0x3f, 0x0c, 0x98, - 0x47, 0x76, 0xa1, 0xda, 0xa6, 0x31, 0x6d, 0xb1, 0x70, 0x10, 0xb9, 0x5e, 0xcb, 0x4d, 0xbc, 0x35, - 0x63, 0xdd, 0xd8, 0x99, 0x70, 0xde, 0x48, 0x1c, 0x87, 0xdc, 0xce, 0x17, 0x91, 0x26, 0xcc, 0x8b, - 0x48, 0x2d, 0xe6, 0x46, 0x7e, 0x3f, 0x46, 0xf4, 0x38, 0x47, 0x57, 0x85, 0xeb, 0x90, 0x7b, 0x04, - 0x7e, 0x13, 0x6e, 0x46, 0x22, 0x3c, 0x22, 0x27, 0x38, 0xb2, 0x82, 0x46, 0x0e, 0xb2, 0x6c, 0x98, - 0xe3, 0xba, 0xf6, 0x69, 0x4c, 0x51, 0x2c, 0x59, 0x81, 0x32, 0x17, 0xd5, 0xa5, 0xac, 0xcb, 0xc5, - 0x94, 0x9d, 0xe9, 0xc4, 0xf0, 0x31, 0x65, 0x5d, 0x6b, 0x1b, 0xaa, 0xda, 0x02, 0xdc, 0x06, 0x81, - 0xc9, 0x04, 0xc0, 0xc1, 0x15, 0x87, 0xff, 0xb6, 0x3e, 0x84, 0x25, 0x05, 0x14, 0xdb, 0x90,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, 0x04, 0xf5, 0xd8, 0xec, 0x0e, - 0x00, 0x00, + // 1223 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xe6, 0x87, 0x1b, 0xbf, 0x38, 0x21, 0x9e, 0xfc, 0xa8, 0xb3, 0x71, 0x9c, 0x64, 0x93, + 0x92, 0x28, 0x05, 0x2f, 0x09, 0x85, 0x13, 0x42, 0x6a, 0x89, 0x2a, 0x22, 0x21, 0xd1, 0x6e, 0x44, + 0x25, 0xb8, 0x58, 0x93, 0xf5, 0x62, 0xaf, 0xe2, 0xec, 0xba, 0x3b, 0x6b, 0xab, 0x51, 0x88, 0x40, + 0x3d, 0x21, 0x71, 0x01, 0x21, 0x71, 0xe1, 0xaf, 0xe1, 0xd6, 0x1b, 0x95, 0xe0, 0xc0, 0x09, 0xa1, + 0x84, 0x3f, 0x04, 0xed, 0xcc, 0x9b, 0xf1, 0xec, 0xae, 0x9d, 0x02, 0x97, 0xde, 0xbc, 0xef, 0x7d, + 0xf3, 0xbd, 0x6f, 0xde, 0xcc, 0x7b, 0x6f, 0x0c, 0x4b, 0x61, 0x44, 0xdd, 0x8e, 0x67, 0xf7, 0xf7, + 0xed, 0xa7, 0x3d, 0x2f, 0x3a, 0xaf, 0x77, 0xa3, 0x30, 0x0e, 0x49, 0x51, 0x98, 0xeb, 0xfd, 0x7d, + 0x73, 0xb1, 0x15, 0xb6, 0x42, 0x6e, 0xb5, 0x93, 0x5f, 0x02, 0x60, 0x56, 0x5b, 0x61, 0xd8, 0xea, + 0x78, 0x36, 0xed, 0xfa, 0x36, 0x0d, 0x82, 0x30, 0xa6, 0xb1, 0x1f, 0x06, 0x0c, 0xbd, 0xcb, 0x03, + 0x56, 0x24, 0xe2, 0x76, 0x6b, 0x11, 0xc8, 0xe3, 0x24, 0xca, 0x47, 0x61, 0x2f, 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0x59, + 0xce, 0xdc, 0xb9, 0x06, 0x13, 0xc1, 0xce, 0xa1, 0xa4, 0x4f, 0xbd, 0x7c, 0xb1, 0x0d, 0x19, 0xc1, + 0xe6, 0xf6, 0xcd, 0xa0, 0x74, 0x68, 0x2b, 0x17, 0xba, 0x9b, 0xc0, 0x18, 0xf9, 0xc1, 0x80, 0x85, + 0x21, 0xcd, 0x9f, 0xec, 0x8d, 0x60, 0x1f, 0x32, 0xf8, 0xcc, 0xbb, 0xff, 0x0a, 0x9b, 0x3e, 0x6d, + 0x4b, 0x9d, 0x76, 0x7f, 0xdf, 0xee, 0x27, 0xc0, 0xf3, 0x06, 0x4a, 0x7b, 0xf0, 0xf0, 0xc5, 0x55, + 0xcd, 0x78, 0x79, 0x55, 0x33, 0xfe, 0xba, 0xaa, 0x19, 0xdf, 0x5f, 0xd7, 0xc6, 0x5e, 0x5e, 0xd7, + 0xc6, 0xfe, 0xb8, 0xae, 0x8d, 0x7d, 0xf1, 0x56, 0xcb, 0x8f, 0xdb, 0xbd, 0x93, 0xba, 0x1b, 0x9e, + 0xd9, 0x27, 0x34, 0x68, 0xf2, 0x3f, 0x98, 0x6e, 0xd8, 0xb1, 0xf9, 0x40, 0xb2, 0x9f, 0x49, 0xce, + 0xf8, 0xbc, 0xeb, 0xb1, 0x93, 0x02, 0x77, 0xbf, 0xfb, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, + 0x95, 0x80, 0x6e, 0xef, 0x0e, 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 0d06eca41..d757af063 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -1108,7 +1108,7 @@ var ( pattern_Query_RequestPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"oracle", "request_prices"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_RequestVerification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"oracle", "verify_request"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_RequestVerification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"oracle", "v1", "verify_request"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( From ea039447cc9ecb4dbd8d077a99f367f8da9155b6 Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Mon, 5 Apr 2021 10:23:51 +0700 Subject: [PATCH 08/14] Fix error codes --- x/oracle/keeper/grpc_query.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index e2c9fda92..d071d0a0f 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -184,7 +184,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV requestVerificationContent := types.NewRequestVerification(req.ChainId, validator, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId)) signByte := requestVerificationContent.GetSignBytes() if !reporterPubKey.VerifySignature(signByte, req.Signature) { - return nil, status.Error(codes.InvalidArgument, "invalid reporter's signature") + return nil, status.Error(codes.Unauthenticated, "invalid reporter's signature") } // Provided reporter should be authorized by the provided validator @@ -198,7 +198,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if !isReporterAuthorizedByValidator { - return nil, status.Error(codes.Unauthenticated, fmt.Sprintf("%s is not an authorized reporter of %s", reporter, req.Validator)) + return nil, status.Error(codes.PermissionDenied, fmt.Sprintf("%s is not an authorized reporter of %s", reporter, req.Validator)) } // Provided request should exist on chain @@ -217,7 +217,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } } if !isValidatorAssigned { - return nil, status.Error(codes.Unauthenticated, fmt.Sprintf("%s is not assigned for request ID %d", validator, req.RequestId)) + return nil, status.Error(codes.PermissionDenied, fmt.Sprintf("%s is not assigned for request ID %d", validator, req.RequestId)) } // Provided external ID should be required by the request determined by oracle script From b720ee11ec0bdd7626a240ce4f23b76fe3492a4f Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Mon, 5 Apr 2021 11:32:43 +0700 Subject: [PATCH 09/14] Fix error codes --- x/oracle/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index d071d0a0f..bb6ee3dc5 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -167,7 +167,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV // Provided chain ID should match current chain ID if ctx.ChainID() != req.ChainId { - return nil, status.Error(codes.Internal, fmt.Sprintf("provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) + return nil, status.Error(codes.FailedPrecondition, fmt.Sprintf("provided chain ID does not match the validator's chain ID; expected %s, got %s", ctx.ChainID(), req.ChainId)) } // Provided validator's address should be valid From 99425454798c3e77569e8083d83a454432452b3d Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Thu, 8 Apr 2021 11:31:16 +0700 Subject: [PATCH 10/14] Format proto files --- go.mod | 1 - proto/oracle/v1/genesis.proto | 3 ++- proto/oracle/v1/oracle.proto | 44 +++++++++++++++++++++-------------- proto/oracle/v1/query.proto | 36 +++++++++++++++++----------- proto/oracle/v1/tx.proto | 44 +++++++++++++++++++++-------------- x/oracle/types/genesis.pb.go | 3 ++- x/oracle/types/oracle.pb.go | 40 +++++++++++++++++++------------ x/oracle/types/query.pb.go | 38 +++++++++++++++++++----------- x/oracle/types/query.pb.gw.go | 40 +------------------------------ x/oracle/types/tx.pb.go | 44 +++++++++++++++++++++-------------- 10 files changed, 157 insertions(+), 136 deletions(-) diff --git a/go.mod b/go.mod index 4209762e2..f56d53342 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/poy/onpar v1.1.2 // indirect github.com/prometheus/client_golang v1.8.0 github.com/rakyll/statik v0.1.7 - github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/segmentio/kafka-go v0.4.9 github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.1 diff --git a/proto/oracle/v1/genesis.proto b/proto/oracle/v1/genesis.proto index 67aa45561..bb2f7b0c3 100644 --- a/proto/oracle/v1/genesis.proto +++ b/proto/oracle/v1/genesis.proto @@ -12,6 +12,7 @@ message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; // DataSources are data sources to be installed during genesis phase repeated DataSource data_sources = 2 [ (gogoproto.nullable) = false ]; - // OracleScripts are list of oracle scripts to be installed during genesis phase + // OracleScripts are list of oracle scripts to be installed during genesis + // phase repeated OracleScript oracle_scripts = 3 [ (gogoproto.nullable) = false ]; } diff --git a/proto/oracle/v1/oracle.proto b/proto/oracle/v1/oracle.proto index ba27a9669..03b69b97b 100644 --- a/proto/oracle/v1/oracle.proto +++ b/proto/oracle/v1/oracle.proto @@ -23,7 +23,7 @@ message DataSource { // Treasury is the account address who recive data source fee from requester. string treasury = 5; // Fee is the data source fee per ask_count that data provider will receive - // from requester. + // from requester. repeated cosmos.base.v1beta1.Coin fee = 6 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" @@ -43,10 +43,12 @@ message OracleScript { // compiled oracle script WASM file stored in bandchain nodes string filename = 4; // Schema is the schema of the oracle script input/output - // which is formatted in OBI format e.g. "{symbol:string,multiplier:u64}/{px:u64}" + // which is formatted in OBI format e.g. + // "{symbol:string,multiplier:u64}/{px:u64}" string schema = 5; // SourceCodeURL is the URL of oracle script's source code. - // It is recommendded to store source code on IPFS and get its URL to preserve decentralization. + // It is recommendded to store source code on IPFS and get its URL to preserve + // decentralization. string source_code_url = 6 [ (gogoproto.customname) = "SourceCodeURL" ]; } @@ -63,7 +65,8 @@ message RawRequest { (gogoproto.customname) = "DataSourceID", (gogoproto.casttype) = "DataSourceID" ]; - // Calldata is the data used as argument params for executing data source script + // Calldata is the data used as argument params for executing data source + // script bytes calldata = 3; } @@ -76,11 +79,12 @@ message RawReport { (gogoproto.casttype) = "ExternalID" ]; // ExitCode is status code provided by validators to specify error, if any. - // Exit code is usually filled by the exit code returned from execution of specified data source script. - // With code 0 means there is no error. + // Exit code is usually filled by the exit code returned from execution of + // specified data source script. With code 0 means there is no error. uint32 exit_code = 2; // Data is raw result provided by validators. - // It is usually filled by the result from execution of specified data source script. + // It is usually filled by the result from execution of specified data source + // script. bytes data = 3; } @@ -94,9 +98,11 @@ message Request { ]; // Calldata is the data used as argument params for the oracle script bytes calldata = 2; - // RequestedValidators is a list of validator addresses that are assigned for fulfilling the request + // RequestedValidators is a list of validator addresses that are assigned for + // fulfilling the request repeated string requested_validators = 3; - // MinCount is minimum number of validators required for fulfilling the request + // MinCount is minimum number of validators required for fulfilling the + // request uint64 min_count = 4; // RequestHeight is block height that the request has been created int64 request_height = 5; @@ -105,11 +111,12 @@ message Request { // ClientID is arbitrary id provided by requester. // It is used by client-side for referencing the request string client_id = 7 [ (gogoproto.customname) = "ClientID" ]; - // RawRequests is a list of raw requests specified by execution of oracle script + // RawRequests is a list of raw requests specified by execution of oracle + // script repeated RawRequest raw_requests = 8 [ (gogoproto.nullable) = false ]; - // IBCSource is an IBC connection info of the other chain, which contains a channel and a port - // to allow bandchain connect to that chain. This field allows other chain be able to request data - // from bandchain via IBC. + // IBCSource is an IBC connection info of the other chain, which contains a + // channel and a port to allow bandchain connect to that chain. This field + // allows other chain be able to request data from bandchain via IBC. IBCSource ibc_source = 9 [ (gogoproto.customname) = "IBCSource" ]; // ExecuteGas is amount of gas to reserve for executing uint64 execute_gas = 10; @@ -120,7 +127,8 @@ message Report { option (gogoproto.equal) = true; // Validator is a validator address who submit the report string validator = 1; - // InBeforeResolve indicates whether the report is submitted before the request resolved + // InBeforeResolve indicates whether the report is submitted before the + // request resolved bool in_before_resolve = 2; // RawReports is list of raw reports provided by the validator. // Each raw report has different external ID @@ -160,7 +168,8 @@ message OracleRequestPacketData { (gogoproto.customname) = "OracleScriptID", (gogoproto.casttype) = "OracleScriptID" ]; - // Calldata is the OBI-encoded calldata bytes available for oracle executor to read. + // Calldata is the OBI-encoded calldata bytes available for oracle executor to + // read. bytes calldata = 3; // AskCount is the number of validators that are requested to respond to this // oracle request. Higher value means more security, at a higher gas cost. @@ -317,7 +326,8 @@ message PendingResolveList { repeated int64 request_ids = 1; } -// IBCSource is information of IBC protocol to allow communicating with other chain +// IBCSource is information of IBC protocol to allow communicating with other +// chain message IBCSource { option (gogoproto.equal) = true; @@ -341,7 +351,7 @@ message RequestVerification { (gogoproto.casttype) = "RequestID" ]; // ExternalID is the oracle's external ID of data source - int64 external_id = 4 [ + int64 external_id = 4 [ (gogoproto.customname) = "ExternalID", (gogoproto.casttype) = "ExternalID" ]; diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index cbf6bef07..0394ac601 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -9,12 +9,14 @@ import "oracle/v1/oracle.proto"; // Query defines the gRPC querier service. service Query { - // Counts queries the number of existing data sources, oracle scripts, and requests. + // Counts queries the number of existing data sources, oracle scripts, and + // requests. rpc Counts(QueryCountsRequest) returns (QueryCountsResponse) { option (google.api.http).get = "/oracle/counts"; } - // Data queries content of the data source or oracle script for given SHA256 file hash. + // Data queries content of the data source or oracle script for given SHA256 + // file hash. rpc Data(QueryDataRequest) returns (QueryDataResponse) { option (google.api.http).get = "/oracle/data/{data_hash}"; } @@ -72,8 +74,8 @@ service Query { // RequestVerification verifies a request to make sure that // all information that will be used to report the data is valid rpc RequestVerification(QueryRequestVerificationRequest) - returns (QueryRequestVerificationResponse) { - option (google.api.http).post = "/oracle/v1/verify_request"; + returns (QueryRequestVerificationResponse) { + option (google.api.http).post = "/oracle/v1/verify_request"; } } @@ -92,7 +94,8 @@ message QueryCountsResponse { // QueryDataRequest is request type for the Query/Data RPC method. message QueryDataRequest { - // DataHash is SHA256 hash of the file's content, which can be data source or oracle script + // DataHash is SHA256 hash of the file's content, which can be data source or + // oracle script string data_hash = 1; } @@ -138,8 +141,9 @@ message QueryRequestRequest { message QueryRequestResponse { // RequestPacketData is information of oracle request submitted by a client OracleRequestPacketData request_packet_data = 1; - // ResponsePacketData is information of oracle result that fulfilled the oracle request. - // The result can be empty if the request has not been fulfilled yet. + // ResponsePacketData is information of oracle result that fulfilled the + // oracle request. The result can be empty if the request has not been + // fulfilled yet. OracleResponsePacketData response_packet_data = 2; } @@ -230,9 +234,11 @@ message QueryRequestPriceResponse { int64 min_count = 4; } -// QueryRequestVerificationRequest is request type for the Query/RequestVerification RPC +// QueryRequestVerificationRequest is request type for the +// Query/RequestVerification RPC message QueryRequestVerificationRequest { - // ChainID is the chain ID to identify which chain ID is used for the verification + // ChainID is the chain ID to identify which chain ID is used for the + // verification string chain_id = 1; // Validator is a validator address string validator = 2; @@ -240,13 +246,16 @@ message QueryRequestVerificationRequest { int64 request_id = 3; // ExternalID is an oracle's external ID int64 external_id = 4; - // Reporter is an bech32-encoded public key of the reporter authorized by the validator + // Reporter is an bech32-encoded public key of the reporter authorized by the + // validator string reporter = 5; - // Signature is a signature signed by the reporter using reporter's private key + // Signature is a signature signed by the reporter using reporter's private + // key bytes signature = 6; } -// QueryRequestVerificationResponse is response type for the Query/RequestVerification RPC +// QueryRequestVerificationResponse is response type for the +// Query/RequestVerification RPC message QueryRequestVerificationResponse { // ChainID is the targeted chain ID string chain_id = 1; @@ -256,6 +265,7 @@ message QueryRequestVerificationResponse { int64 request_id = 3; // ExternalID is the ID of targeted oracle's external data source int64 external_id = 4; - // DataSourceID is the ID of a data source that relates to the targeted external ID + // DataSourceID is the ID of a data source that relates to the targeted + // external ID int64 data_source_id = 5; } diff --git a/proto/oracle/v1/tx.proto b/proto/oracle/v1/tx.proto index 5dad93823..fbb3bffd4 100644 --- a/proto/oracle/v1/tx.proto +++ b/proto/oracle/v1/tx.proto @@ -84,7 +84,8 @@ message MsgReportData { (gogoproto.customname) = "RequestID", (gogoproto.casttype) = "RequestID" ]; - // RawReports is the list of report information provided by data sources identified by external ID + // RawReports is the list of report information provided by data sources + // identified by external ID repeated RawReport raw_reports = 2 [ (gogoproto.nullable) = false ]; // Validator is the address of the validator that owns this report. string validator = 3; @@ -101,10 +102,11 @@ message MsgCreateDataSource { option (gogoproto.equal) = true; // Name is the name of this data source used for display (optional). string name = 1; - // Description is the description of this data source used for display (optional). + // Description is the description of this data source used for display + // (optional). string description = 2; - // Executable is the content of executable script or binary file to be run by validators upon - // execution. + // Executable is the content of executable script or binary file to be run by + // validators upon execution. bytes executable = 3; // Fee is the data source fee per ask_count that data provider will receive // from requester. @@ -114,8 +116,8 @@ message MsgCreateDataSource { ]; // Treasury is the account address who recive data source fee from requester. string treasury = 5; - // Owner is the account address who is allowed to make further changes to the data - // source. + // Owner is the account address who is allowed to make further changes to the + // data source. string owner = 6; // Sender is the signer of this message. string sender = 7; @@ -134,7 +136,8 @@ message MsgEditDataSource { ]; // Name is the name of this data source used for display (optional). string name = 2; - // Description is the description of this data source used for display (optional). + // Description is the description of this data source used for display + // (optional). string description = 3; // Executable is the executable script or binary to be run by validators upon // execution. @@ -163,7 +166,8 @@ message MsgCreateOracleScript { option (gogoproto.equal) = true; // Name is the name of this oracle script used for display (optional). string name = 1; - // Description is the description of this oracle script used for display (optional). + // Description is the description of this oracle script used for display + // (optional). string description = 2; // Schema is the OBI schema of this oracle script (optional). string schema = 3; @@ -178,7 +182,8 @@ message MsgCreateOracleScript { string sender = 7; } -// MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript message +// MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript +// message message MsgCreateOracleScriptResponse {} // MsgEditOracleScript is a message for editing an existing oracle script. @@ -191,7 +196,8 @@ message MsgEditOracleScript { ]; // Name is the name of this oracle script used for display (optional). string name = 2; - // Description is the description of this oracle script used for display (optional). + // Description is the description of this oracle script used for display + // (optional). string description = 3; // Schema is the OBI schema of this oracle script (optional). string schema = 4; @@ -202,8 +208,8 @@ message MsgEditOracleScript { // Owner is an account address who is allowed to make further changes to the // oracle script. string owner = 7; - // Sender is an account address who sign this message. Must be the current oracle script's - // owner. + // Sender is an account address who sign this message. Must be the current + // oracle script's owner. string sender = 8; } @@ -215,7 +221,8 @@ message MsgEditOracleScriptResponse {} // is unable to provide data to fulfill requests message MsgActivate { option (gogoproto.equal) = true; - // Validator is the validator address who sign this message and request to be activated. + // Validator is the validator address who sign this message and request to be + // activated. string validator = 1; } @@ -225,8 +232,8 @@ message MsgActivateResponse {} // MsgAddReporter is a message for adding a new reporter for a validator. message MsgAddReporter { option (gogoproto.equal) = true; - // Validator is the validator address who requested to add a new reporter. Note that this is the - // signer. + // Validator is the validator address who requested to add a new reporter. + // Note that this is the signer. string validator = 1; // Reporter is the account address to be added as a reporter to the validator. string reporter = 2; @@ -239,10 +246,11 @@ message MsgAddReporterResponse {} // validator. message MsgRemoveReporter { option (gogoproto.equal) = true; - // Validator is the validator address who requested to remove an existing reporter. Note that this - // is the signer. + // Validator is the validator address who requested to remove an existing + // reporter. Note that this is the signer. string validator = 1; - // Reporter is the account address to be removed from being the validator's reporter. + // Reporter is the account address to be removed from being the validator's + // reporter. string reporter = 2; } diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 0a99c465b..b5971b4d0 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -29,7 +29,8 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // DataSources are data sources to be installed during genesis phase DataSources []DataSource `protobuf:"bytes,2,rep,name=data_sources,json=dataSources,proto3" json:"data_sources"` - // OracleScripts are list of oracle scripts to be installed during genesis phase + // OracleScripts are list of oracle scripts to be installed during genesis + // phase OracleScripts []OracleScript `protobuf:"bytes,3,rep,name=oracle_scripts,json=oracleScripts,proto3" json:"oracle_scripts"` } diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index ece469eef..40ff02b09 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -173,10 +173,12 @@ type OracleScript struct { // compiled oracle script WASM file stored in bandchain nodes Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` // Schema is the schema of the oracle script input/output - // which is formatted in OBI format e.g. "{symbol:string,multiplier:u64}/{px:u64}" + // which is formatted in OBI format e.g. + // "{symbol:string,multiplier:u64}/{px:u64}" Schema string `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` // SourceCodeURL is the URL of oracle script's source code. - // It is recommendded to store source code on IPFS and get its URL to preserve decentralization. + // It is recommendded to store source code on IPFS and get its URL to preserve + // decentralization. SourceCodeURL string `protobuf:"bytes,6,opt,name=source_code_url,json=sourceCodeUrl,proto3" json:"source_code_url,omitempty"` } @@ -261,7 +263,8 @@ type RawRequest struct { ExternalID ExternalID `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"` // DataSourceID is an ID of data source script that relates to the raw request DataSourceID DataSourceID `protobuf:"varint,2,opt,name=data_source_id,json=dataSourceId,proto3,casttype=DataSourceID" json:"data_source_id,omitempty"` - // Calldata is the data used as argument params for executing data source script + // Calldata is the data used as argument params for executing data source + // script Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"` } @@ -324,11 +327,12 @@ type RawReport struct { // ExternalID is an ID of the raw request ExternalID ExternalID `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"` // ExitCode is status code provided by validators to specify error, if any. - // Exit code is usually filled by the exit code returned from execution of specified data source script. - // With code 0 means there is no error. + // Exit code is usually filled by the exit code returned from execution of + // specified data source script. With code 0 means there is no error. ExitCode uint32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // Data is raw result provided by validators. - // It is usually filled by the result from execution of specified data source script. + // It is usually filled by the result from execution of specified data source + // script. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` } @@ -392,9 +396,11 @@ type Request struct { OracleScriptID OracleScriptID `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3,casttype=OracleScriptID" json:"oracle_script_id,omitempty"` // Calldata is the data used as argument params for the oracle script Calldata []byte `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"` - // RequestedValidators is a list of validator addresses that are assigned for fulfilling the request + // RequestedValidators is a list of validator addresses that are assigned for + // fulfilling the request RequestedValidators []string `protobuf:"bytes,3,rep,name=requested_validators,json=requestedValidators,proto3" json:"requested_validators,omitempty"` - // MinCount is minimum number of validators required for fulfilling the request + // MinCount is minimum number of validators required for fulfilling the + // request MinCount uint64 `protobuf:"varint,4,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` // RequestHeight is block height that the request has been created RequestHeight int64 `protobuf:"varint,5,opt,name=request_height,json=requestHeight,proto3" json:"request_height,omitempty"` @@ -403,11 +409,12 @@ type Request struct { // ClientID is arbitrary id provided by requester. // It is used by client-side for referencing the request ClientID string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // RawRequests is a list of raw requests specified by execution of oracle script + // RawRequests is a list of raw requests specified by execution of oracle + // script RawRequests []RawRequest `protobuf:"bytes,8,rep,name=raw_requests,json=rawRequests,proto3" json:"raw_requests"` - // IBCSource is an IBC connection info of the other chain, which contains a channel and a port - // to allow bandchain connect to that chain. This field allows other chain be able to request data - // from bandchain via IBC. + // IBCSource is an IBC connection info of the other chain, which contains a + // channel and a port to allow bandchain connect to that chain. This field + // allows other chain be able to request data from bandchain via IBC. IBCSource *IBCSource `protobuf:"bytes,9,opt,name=ibc_source,json=ibcSource,proto3" json:"ibc_source,omitempty"` // ExecuteGas is amount of gas to reserve for executing ExecuteGas uint64 `protobuf:"varint,10,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"` @@ -520,7 +527,8 @@ func (m *Request) GetExecuteGas() uint64 { type Report struct { // Validator is a validator address who submit the report Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` - // InBeforeResolve indicates whether the report is submitted before the request resolved + // InBeforeResolve indicates whether the report is submitted before the + // request resolved InBeforeResolve bool `protobuf:"varint,2,opt,name=in_before_resolve,json=inBeforeResolve,proto3" json:"in_before_resolve,omitempty"` // RawReports is list of raw reports provided by the validator. // Each raw report has different external ID @@ -591,7 +599,8 @@ type OracleRequestPacketData struct { // OracleScriptID is the unique identifier of the oracle script to be // executed. OracleScriptID OracleScriptID `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3,casttype=OracleScriptID" json:"oracle_script_id,omitempty"` - // Calldata is the OBI-encoded calldata bytes available for oracle executor to read. + // Calldata is the OBI-encoded calldata bytes available for oracle executor to + // read. Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"` // AskCount is the number of validators that are requested to respond to this // oracle request. Higher value means more security, at a higher gas cost. @@ -1228,7 +1237,8 @@ func (m *PendingResolveList) GetRequestIds() []int64 { return nil } -// IBCSource is information of IBC protocol to allow communicating with other chain +// IBCSource is information of IBC protocol to allow communicating with other +// chain type IBCSource struct { // SourceChannel is channel ID used for communicating with other chains SourceChannel string `protobuf:"bytes,1,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 2578c7aac..6b209f431 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -132,7 +132,8 @@ func (m *QueryCountsResponse) GetRequestCount() int64 { // QueryDataRequest is request type for the Query/Data RPC method. type QueryDataRequest struct { - // DataHash is SHA256 hash of the file's content, which can be data source or oracle script + // DataHash is SHA256 hash of the file's content, which can be data source or + // oracle script DataHash string `protobuf:"bytes,1,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` } @@ -458,8 +459,9 @@ func (m *QueryRequestRequest) GetRequestId() int64 { type QueryRequestResponse struct { // RequestPacketData is information of oracle request submitted by a client RequestPacketData *OracleRequestPacketData `protobuf:"bytes,1,opt,name=request_packet_data,json=requestPacketData,proto3" json:"request_packet_data,omitempty"` - // ResponsePacketData is information of oracle result that fulfilled the oracle request. - // The result can be empty if the request has not been fulfilled yet. + // ResponsePacketData is information of oracle result that fulfilled the + // oracle request. The result can be empty if the request has not been + // fulfilled yet. ResponsePacketData *OracleResponsePacketData `protobuf:"bytes,2,opt,name=response_packet_data,json=responsePacketData,proto3" json:"response_packet_data,omitempty"` } @@ -1113,9 +1115,11 @@ func (m *QueryRequestPriceResponse) GetMinCount() int64 { return 0 } -// QueryRequestVerificationRequest is request type for the Query/RequestVerification RPC +// QueryRequestVerificationRequest is request type for the +// Query/RequestVerification RPC type QueryRequestVerificationRequest struct { - // ChainID is the chain ID to identify which chain ID is used for the verification + // ChainID is the chain ID to identify which chain ID is used for the + // verification ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Validator is a validator address Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` @@ -1123,9 +1127,11 @@ type QueryRequestVerificationRequest struct { RequestId int64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // ExternalID is an oracle's external ID ExternalId int64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - // Reporter is an bech32-encoded public key of the reporter authorized by the validator + // Reporter is an bech32-encoded public key of the reporter authorized by the + // validator Reporter string `protobuf:"bytes,5,opt,name=reporter,proto3" json:"reporter,omitempty"` - // Signature is a signature signed by the reporter using reporter's private key + // Signature is a signature signed by the reporter using reporter's private + // key Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` } @@ -1204,7 +1210,8 @@ func (m *QueryRequestVerificationRequest) GetSignature() []byte { return nil } -// QueryRequestVerificationResponse is response type for the Query/RequestVerification RPC +// QueryRequestVerificationResponse is response type for the +// Query/RequestVerification RPC type QueryRequestVerificationResponse struct { // ChainID is the targeted chain ID ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` @@ -1214,7 +1221,8 @@ type QueryRequestVerificationResponse struct { RequestId int64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // ExternalID is the ID of targeted oracle's external data source ExternalId int64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - // DataSourceID is the ID of a data source that relates to the targeted external ID + // DataSourceID is the ID of a data source that relates to the targeted + // external ID DataSourceId int64 `protobuf:"varint,5,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` } @@ -1408,9 +1416,11 @@ const _ = grpc.SupportPackageIsVersion4 // // 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 { - // Counts queries the number of existing data sources, oracle scripts, and requests. + // Counts queries the number of existing data sources, oracle scripts, and + // requests. Counts(ctx context.Context, in *QueryCountsRequest, opts ...grpc.CallOption) (*QueryCountsResponse, error) - // Data queries content of the data source or oracle script for given SHA256 file hash. + // Data queries content of the data source or oracle script for given SHA256 + // file hash. Data(ctx context.Context, in *QueryDataRequest, opts ...grpc.CallOption) (*QueryDataResponse, error) // DataSource queries data source summary info for given data source id. DataSource(ctx context.Context, in *QueryDataSourceRequest, opts ...grpc.CallOption) (*QueryDataSourceResponse, error) @@ -1554,9 +1564,11 @@ func (c *queryClient) RequestVerification(ctx context.Context, in *QueryRequestV // QueryServer is the server API for Query service. type QueryServer interface { - // Counts queries the number of existing data sources, oracle scripts, and requests. + // Counts queries the number of existing data sources, oracle scripts, and + // requests. Counts(context.Context, *QueryCountsRequest) (*QueryCountsResponse, error) - // Data queries content of the data source or oracle script for given SHA256 file hash. + // Data queries content of the data source or oracle script for given SHA256 + // file hash. Data(context.Context, *QueryDataRequest) (*QueryDataResponse, error) // DataSource queries data source summary info for given data source id. DataSource(context.Context, *QueryDataSourceRequest) (*QueryDataSourceResponse, error) diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index d757af063..0896a82ed 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Counts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryCountsRequest @@ -522,14 +520,12 @@ func local_request_Query_RequestVerification_0(ctx context.Context, marshaler ru // 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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_Counts_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 { @@ -537,7 +533,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Counts_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) @@ -551,8 +546,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Data_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 { @@ -560,7 +553,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Data_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) @@ -574,8 +566,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DataSource_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 { @@ -583,7 +573,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DataSource_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) @@ -597,8 +586,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_OracleScript_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 { @@ -606,7 +593,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_OracleScript_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) @@ -620,8 +606,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Request_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 { @@ -629,7 +613,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Request_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) @@ -643,8 +626,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Validator_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 { @@ -652,7 +633,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Validator_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) @@ -666,8 +646,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Reporters_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 { @@ -675,7 +653,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Reporters_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) @@ -689,8 +666,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ActiveValidators_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 { @@ -698,7 +673,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ActiveValidators_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) @@ -712,8 +686,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - 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 { @@ -721,7 +693,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_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) @@ -735,8 +706,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_RequestSearch_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 { @@ -744,7 +713,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_RequestSearch_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) @@ -758,8 +726,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Query_RequestPrice_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 { @@ -767,7 +733,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_RequestPrice_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) @@ -781,8 +746,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Query_RequestVerification_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 { @@ -790,7 +753,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_RequestVerification_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/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 925bf64a7..86423899a 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -194,7 +194,8 @@ var xxx_messageInfo_MsgRequestDataResponse proto.InternalMessageInfo type MsgReportData struct { // RequestID is the identifier of the request to be reported to. RequestID RequestID `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"` - // RawReports is the list of report information provided by data sources identified by external ID + // RawReports is the list of report information provided by data sources + // identified by external ID RawReports []RawReport `protobuf:"bytes,2,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports"` // Validator is the address of the validator that owns this report. Validator string `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` @@ -305,18 +306,19 @@ var xxx_messageInfo_MsgReportDataResponse proto.InternalMessageInfo type MsgCreateDataSource struct { // Name is the name of this data source used for display (optional). Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Description is the description of this data source used for display (optional). + // Description is the description of this data source used for display + // (optional). Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // Executable is the content of executable script or binary file to be run by validators upon - // execution. + // Executable is the content of executable script or binary file to be run by + // validators upon execution. Executable []byte `protobuf:"bytes,3,opt,name=executable,proto3" json:"executable,omitempty"` // Fee is the data source fee per ask_count that data provider will receive // from requester. Fee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=fee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee"` // Treasury is the account address who recive data source fee from requester. Treasury string `protobuf:"bytes,5,opt,name=treasury,proto3" json:"treasury,omitempty"` - // Owner is the account address who is allowed to make further changes to the data - // source. + // Owner is the account address who is allowed to make further changes to the + // data source. Owner string `protobuf:"bytes,6,opt,name=owner,proto3" json:"owner,omitempty"` // Sender is the signer of this message. Sender string `protobuf:"bytes,7,opt,name=sender,proto3" json:"sender,omitempty"` @@ -447,7 +449,8 @@ type MsgEditDataSource struct { DataSourceID DataSourceID `protobuf:"varint,1,opt,name=data_source_id,json=dataSourceId,proto3,casttype=DataSourceID" json:"data_source_id,omitempty"` // Name is the name of this data source used for display (optional). Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Description is the description of this data source used for display (optional). + // Description is the description of this data source used for display + // (optional). Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Executable is the executable script or binary to be run by validators upon // execution. @@ -595,7 +598,8 @@ var xxx_messageInfo_MsgEditDataSourceResponse proto.InternalMessageInfo type MsgCreateOracleScript struct { // Name is the name of this oracle script used for display (optional). Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Description is the description of this oracle script used for display (optional). + // Description is the description of this oracle script used for display + // (optional). Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // Schema is the OBI schema of this oracle script (optional). Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` @@ -692,7 +696,8 @@ func (m *MsgCreateOracleScript) GetSender() string { return "" } -// MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript message +// MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript +// message type MsgCreateOracleScriptResponse struct { } @@ -735,7 +740,8 @@ type MsgEditOracleScript struct { OracleScriptID OracleScriptID `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3,casttype=OracleScriptID" json:"oracle_script_id,omitempty"` // Name is the name of this oracle script used for display (optional). Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Description is the description of this oracle script used for display (optional). + // Description is the description of this oracle script used for display + // (optional). Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Schema is the OBI schema of this oracle script (optional). Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` @@ -746,8 +752,8 @@ type MsgEditOracleScript struct { // Owner is an account address who is allowed to make further changes to the // oracle script. Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` - // Sender is an account address who sign this message. Must be the current oracle script's - // owner. + // Sender is an account address who sign this message. Must be the current + // oracle script's owner. Sender string `protobuf:"bytes,8,opt,name=sender,proto3" json:"sender,omitempty"` } @@ -881,7 +887,8 @@ var xxx_messageInfo_MsgEditOracleScriptResponse proto.InternalMessageInfo // oracle provider. However, the activation can be revoked once the validator // is unable to provide data to fulfill requests type MsgActivate struct { - // Validator is the validator address who sign this message and request to be activated. + // Validator is the validator address who sign this message and request to be + // activated. Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` } @@ -964,8 +971,8 @@ var xxx_messageInfo_MsgActivateResponse proto.InternalMessageInfo // MsgAddReporter is a message for adding a new reporter for a validator. type MsgAddReporter struct { - // Validator is the validator address who requested to add a new reporter. Note that this is the - // signer. + // Validator is the validator address who requested to add a new reporter. + // Note that this is the signer. Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` // Reporter is the account address to be added as a reporter to the validator. Reporter string `protobuf:"bytes,2,opt,name=reporter,proto3" json:"reporter,omitempty"` @@ -1058,10 +1065,11 @@ var xxx_messageInfo_MsgAddReporterResponse proto.InternalMessageInfo // MsgAddReporter is a message for removing an existing reporter from a // validator. type MsgRemoveReporter struct { - // Validator is the validator address who requested to remove an existing reporter. Note that this - // is the signer. + // Validator is the validator address who requested to remove an existing + // reporter. Note that this is the signer. Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` - // Reporter is the account address to be removed from being the validator's reporter. + // Reporter is the account address to be removed from being the validator's + // reporter. Reporter string `protobuf:"bytes,2,opt,name=reporter,proto3" json:"reporter,omitempty"` } From b99f1607fff5704ce221dec4b3a8c77d26a6ceb8 Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Wed, 5 May 2021 10:29:40 +0700 Subject: [PATCH 11/14] format code --- x/oracle/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index b62d511c1..41669c269 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -39,7 +39,7 @@ func GetQueryCmd() *cobra.Command { // GetQueryCmdValidatorStatus(), GetQueryCmdReporters(), GetQueryActiveValidators(), - // GetQueryPendingRequests(storeKey, cdc), + // GetQueryPendingRequests(storeKey, cdc), GetQueryRequestVerification(), GetQueryRequestPool(), ) From 4371e7841b776d4505aedc3917c72fdc5fe643dc Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Wed, 5 May 2021 12:32:16 +0700 Subject: [PATCH 12/14] Use Expiration block count & fix usage --- x/oracle/client/cli/query.go | 2 +- x/oracle/keeper/grpc_query.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 41669c269..ba4b86cbb 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -290,7 +290,7 @@ func GetQueryActiveValidators() *cobra.Command { // GetQueryRequestVerification implements the query request verification command. func GetQueryRequestVerification() *cobra.Command { cmd := &cobra.Command{ - Use: "verify-request [chain-id] [validator-addr] [request-id] [data-source-external-id] [reporter-addr] [reporter-signature-hex]", + Use: "verify-request [chain-id] [validator-addr] [request-id] [data-source-external-id] [reporter-pubkey] [reporter-signature-hex]", Args: cobra.ExactArgs(6), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 351a436ca..db7a7e82c 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -248,8 +248,7 @@ func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestV } // The request should not be expired - params := k.GetParams(ctx) - if request.RequestHeight+int64(params.ExpirationBlockCount) < ctx.BlockHeader().Height { + if request.RequestHeight+int64(k.ExpirationBlockCount(ctx)) < ctx.BlockHeader().Height { return nil, status.Error(codes.DeadlineExceeded, fmt.Sprintf("Request with ID %d is already expired", req.RequestId)) } From 5d686d623bf4dd47d4499ca75b0ac0e8b511ed4c Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Thu, 6 May 2021 10:48:01 +0700 Subject: [PATCH 13/14] Use get instead of post --- proto/oracle/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index 5128f6166..2152a4eb8 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -76,7 +76,7 @@ service Query { // all information that will be used to report the data is valid rpc RequestVerification(QueryRequestVerificationRequest) returns (QueryRequestVerificationResponse) { - option (google.api.http).post = "/oracle/v1/verify_request"; + option (google.api.http).get = "/oracle/v1/verify_request"; } // RequestPool queries the request pool information corresponding to the given From f8f4b6e67c592ff52ebeddc0e6ff9e33899c10fb Mon Sep 17 00:00:00 2001 From: Nathachai Jaiboon Date: Thu, 6 May 2021 11:52:13 +0700 Subject: [PATCH 14/14] generate proto --- x/oracle/types/query.pb.go | 19 +++++++++---------- x/oracle/types/query.pb.gw.go | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index d0b6970a3..804018929 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1447,7 +1447,7 @@ func init() { func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 1426 bytes of a gzipped FileDescriptorProto + // 1424 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6f, 0x1b, 0x45, 0x14, 0xcf, 0xe6, 0x8f, 0x13, 0x3f, 0xbb, 0x25, 0x99, 0xa4, 0xa9, 0xb3, 0x49, 0x9d, 0x74, 0x93, 0x52, 0xab, 0xa5, 0xde, 0x26, 0x14, 0x4e, 0x55, 0xa5, 0xb6, 0x51, 0x45, 0x04, 0x12, 0xad, 0x23, @@ -1529,15 +1529,14 @@ var fileDescriptor_34238c8dfdfcd7ec = []byte{ 0x14, 0x66, 0xad, 0x8b, 0xac, 0x35, 0xb2, 0x9c, 0xbb, 0x73, 0x6d, 0x2e, 0x93, 0x0d, 0xa0, 0x9a, 0xd6, 0x07, 0xc5, 0xc7, 0x36, 0x42, 0xac, 0xe8, 0x5b, 0x67, 0x07, 0x65, 0x53, 0x1b, 0x85, 0xd4, 0xbd, 0x28, 0x8c, 0x93, 0x6f, 0x34, 0x58, 0x1c, 0x31, 0x26, 0xc9, 0xb5, 0x31, 0xe8, 0x23, 0x24, - 0x82, 0x7e, 0xfd, 0x5f, 0xc5, 0x66, 0x4f, 0xdb, 0x88, 0x4f, 0xfb, 0x78, 0xdb, 0x3c, 0x8e, 0x02, - 0x07, 0x6d, 0xa4, 0x46, 0x7e, 0xd0, 0xa0, 0x92, 0x1a, 0x41, 0xc4, 0x18, 0xb7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0x2f, + 0x4e, 0xeb, 0x13, 0xbf, 0x9d, 0xd6, 0x27, 0x3e, 0x79, 0x2b, 0x35, 0xbd, 0x3a, 0xd4, 0xb7, 0xc5, + 0x7f, 0x0a, 0x2c, 0xe6, 0x99, 0x42, 0x59, 0x98, 0x4f, 0x55, 0x5a, 0x31, 0xc7, 0x3a, 0x25, 0xe1, + 0x7e, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, 0x72, 0xdc, 0x44, 0xd8, 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 d932d4146..d556532e0 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -841,7 +841,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("POST", pattern_Query_RequestVerification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_RequestVerification_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) @@ -1142,7 +1142,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("POST", pattern_Query_RequestVerification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_RequestVerification_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)