diff --git a/proto/sedachain/batching/v1/genesis.proto b/proto/sedachain/batching/v1/genesis.proto index 5f5d0912..0318b3be 100644 --- a/proto/sedachain/batching/v1/genesis.proto +++ b/proto/sedachain/batching/v1/genesis.proto @@ -13,7 +13,7 @@ message GenesisState { uint64 current_batch_number = 1; repeated Batch batches = 2 [ (gogoproto.nullable) = false ]; repeated BatchData batch_data = 3 [ (gogoproto.nullable) = false ]; - repeated DataResult data_results = 4 [ (gogoproto.nullable) = false ]; + repeated GenesisDataResult data_results = 4 [ (gogoproto.nullable) = false ]; repeated BatchAssignment batch_assignments = 5 [ (gogoproto.nullable) = false ]; } @@ -23,6 +23,7 @@ message GenesisState { message BatchAssignment { uint64 batch_number = 1; string data_request_id = 2; + uint64 data_request_height = 3; } // BatchData represents a given batch's full data. @@ -35,3 +36,9 @@ message BatchData { repeated BatchSignatures batch_signatures = 4 [ (gogoproto.nullable) = false ]; } + +// GenesisDataResult includes a data result and its batching status. +message GenesisDataResult { + bool batched = 1; + DataResult data_result = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/sedachain/batching/v1/query.proto b/proto/sedachain/batching/v1/query.proto index df6bc15e..6ae3b0c0 100644 --- a/proto/sedachain/batching/v1/query.proto +++ b/proto/sedachain/batching/v1/query.proto @@ -74,7 +74,10 @@ message QueryBatchesResponse { } // The request message for QueryDataResult RPC. -message QueryDataResultRequest { string data_request_id = 1; } +message QueryDataResultRequest { + string data_request_id = 1; + uint64 data_request_height = 2; +} // The response message for QueryDataResult RPC. message QueryDataResultResponse { diff --git a/x/batching/client/cli/query.go b/x/batching/client/cli/query.go index b9b2fa50..95b7e0b2 100644 --- a/x/batching/client/cli/query.go +++ b/x/batching/client/cli/query.go @@ -147,9 +147,9 @@ func GetCmdQueryBatches() *cobra.Command { // associated with a given data request. func GetCmdQueryDataResult() *cobra.Command { cmd := &cobra.Command{ - Use: "data-result ", + Use: "data-result ", Short: "Get the data result associated with a given data request", - Args: cobra.ExactArgs(1), + Args: cobra.MaximumNArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -160,6 +160,12 @@ func GetCmdQueryDataResult() *cobra.Command { req := &types.QueryDataResultRequest{ DataRequestId: args[0], } + if len(args) == 2 { + req.DataRequestHeight, err = strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + } res, err := queryClient.DataResult(cmd.Context(), req) if err != nil { return err diff --git a/x/batching/keeper/data_result.go b/x/batching/keeper/data_result.go index 7a423b3c..c6596adc 100644 --- a/x/batching/keeper/data_result.go +++ b/x/batching/keeper/data_result.go @@ -12,35 +12,32 @@ import ( // SetDataResultForBatching stores a data result so that it is ready // to be batched. func (k Keeper) SetDataResultForBatching(ctx context.Context, result types.DataResult) error { - return k.dataResults.Set(ctx, collections.Join(false, result.DrId), result) + return k.dataResults.Set(ctx, collections.Join3(false, result.DrId, result.DrBlockHeight), result) } // MarkDataResultAsBatched removes the "unbatched" variant of the given // data result and stores a "batched" variant. func (k Keeper) MarkDataResultAsBatched(ctx context.Context, result types.DataResult, batchNum uint64) error { - err := k.SetBatchAssignment(ctx, result.DrId, batchNum) + err := k.SetBatchAssignment(ctx, result.DrId, result.DrBlockHeight, batchNum) if err != nil { return err } - err = k.dataResults.Remove(ctx, collections.Join(false, result.DrId)) + err = k.dataResults.Remove(ctx, collections.Join3(false, result.DrId, result.DrBlockHeight)) if err != nil { return err } - return k.dataResults.Set(ctx, collections.Join(true, result.DrId), result) + return k.dataResults.Set(ctx, collections.Join3(true, result.DrId, result.DrBlockHeight), result) } // GetDataResult returns a data result given the associated data request's -// ID. -func (k Keeper) GetDataResult(ctx context.Context, dataReqID string) (*types.DataResult, error) { - dataResult, err := k.dataResults.Get(ctx, collections.Join(false, dataReqID)) +// ID and height. +func (k Keeper) GetDataResult(ctx context.Context, dataReqID string, dataReqHeight uint64) (*types.DataResult, error) { + dataResult, err := k.dataResults.Get(ctx, collections.Join3(false, dataReqID, dataReqHeight)) if err != nil { if errors.Is(err, collections.ErrNotFound) { // Look among batched data requests. - dataResult, err := k.dataResults.Get(ctx, collections.Join(true, dataReqID)) + dataResult, err := k.dataResults.Get(ctx, collections.Join3(true, dataReqID, dataReqHeight)) if err != nil { - if errors.Is(err, collections.ErrNotFound) { - return nil, nil - } return nil, err } return &dataResult, nil @@ -50,11 +47,54 @@ func (k Keeper) GetDataResult(ctx context.Context, dataReqID string) (*types.Dat return &dataResult, err } +// GetLatestDataResult returns the latest data result given the associated +// data request's ID. +func (k Keeper) GetLatestDataResult(ctx context.Context, dataReqID string) (*types.DataResult, error) { + dataResult, err := k.getLatestDataResult(ctx, false, dataReqID) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + // Look among batched data requests. + dataResult, err := k.getLatestDataResult(ctx, true, dataReqID) + if err != nil { + return nil, err + } + return dataResult, nil + } + return nil, err + } + + return dataResult, nil +} + +func (k Keeper) getLatestDataResult(ctx context.Context, batched bool, dataReqID string) (*types.DataResult, error) { + // The triple pair ranger does not expose the Descending() method, + // so we manually create the range using the same prefix that the + // collections.NewSuperPrefixedTripleRange uses internally. + drRange := &collections.Range[collections.Triple[bool, string, uint64]]{} + drRange.Prefix(collections.TripleSuperPrefix[bool, string, uint64](batched, dataReqID)).Descending() + + itr, err := k.dataResults.Iterate(ctx, drRange) + if err != nil { + return nil, err + } + defer itr.Close() + + if itr.Valid() { + kv, err := itr.KeyValue() + if err != nil { + return nil, err + } + return &kv.Value, nil + } + + return nil, collections.ErrNotFound +} + // GetDataResults returns a list of data results under a given status // (batched or not). func (k Keeper) GetDataResults(ctx context.Context, batched bool) ([]types.DataResult, error) { var results []types.DataResult - err := k.IterateDataResults(ctx, batched, func(_ collections.Pair[bool, string], value types.DataResult) (bool, error) { + err := k.IterateDataResults(ctx, batched, func(_ collections.Triple[bool, string, uint64], value types.DataResult) (bool, error) { results = append(results, value) return false, nil }) @@ -62,48 +102,60 @@ func (k Keeper) GetDataResults(ctx context.Context, batched bool) ([]types.DataR } // getAllDataResults returns all data results from the store regardless -// of their batched status. -func (k Keeper) getAllDataResults(ctx context.Context) ([]types.DataResult, error) { - var dataResults []types.DataResult +// of their batched status. Used for genesis export. +func (k Keeper) getAllGenesisDataResults(ctx context.Context) ([]types.GenesisDataResult, error) { + dataResults := make([]types.GenesisDataResult, 0) unbatched, err := k.GetDataResults(ctx, false) if err != nil { return nil, err } - dataResults = append(dataResults, unbatched...) + for _, result := range unbatched { + dataResults = append(dataResults, types.GenesisDataResult{ + Batched: false, + DataResult: result, + }) + } batched, err := k.GetDataResults(ctx, true) if err != nil { return nil, err } - dataResults = append(dataResults, batched...) + for _, result := range batched { + dataResults = append(dataResults, types.GenesisDataResult{ + Batched: true, + DataResult: result, + }) + } return dataResults, nil } // IterateDataResults iterates over all data results under a given // status (batched or not) and performs a given callback function. -func (k Keeper) IterateDataResults(ctx context.Context, batched bool, cb func(key collections.Pair[bool, string], value types.DataResult) (bool, error)) error { - rng := collections.NewPrefixedPairRange[bool, string](batched) +func (k Keeper) IterateDataResults(ctx context.Context, batched bool, cb func(key collections.Triple[bool, string, uint64], value types.DataResult) (bool, error)) error { + rng := collections.NewPrefixedTripleRange[bool, string, uint64](batched) return k.dataResults.Walk(ctx, rng, cb) } // SetBatchAssignment assigns a given batch number to the given data -// request. -func (k Keeper) SetBatchAssignment(ctx context.Context, dataReqID string, batchNumber uint64) error { - return k.batchAssignments.Set(ctx, dataReqID, batchNumber) +// request ID and data request height. +func (k Keeper) SetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64, batchNumber uint64) error { + return k.batchAssignments.Set(ctx, collections.Join(dataReqID, dataReqHeight), batchNumber) } // GetBatchAssignment returns the given data request's assigned batch -// number. -func (k Keeper) GetBatchAssignment(ctx context.Context, dataReqID string) (uint64, error) { - return k.batchAssignments.Get(ctx, dataReqID) +// number for a given height. +func (k Keeper) GetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64) (uint64, error) { + return k.batchAssignments.Get(ctx, collections.Join(dataReqID, dataReqHeight)) } // getAllBatchAssignments retrieves all batch assignments from the store. +// Used for genesis export. func (k Keeper) getAllBatchAssignments(ctx context.Context) ([]types.BatchAssignment, error) { var batchAssignments []types.BatchAssignment - err := k.batchAssignments.Walk(ctx, nil, func(dataReqID string, batchNum uint64) (stop bool, err error) { + err := k.batchAssignments.Walk(ctx, nil, func(key collections.Pair[string, uint64], value uint64) (stop bool, err error) { batchAssignments = append(batchAssignments, types.BatchAssignment{ - BatchNumber: batchNum, - DataRequestId: dataReqID, + BatchNumber: value, + DataRequestId: key.K1(), + DataRequestHeight: key.K2(), }) return false, nil }) diff --git a/x/batching/keeper/genesis.go b/x/batching/keeper/genesis.go index a4e206ed..033f8a58 100644 --- a/x/batching/keeper/genesis.go +++ b/x/batching/keeper/genesis.go @@ -1,6 +1,8 @@ package keeper import ( + "cosmossdk.io/collections" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sedaprotocol/seda-chain/x/batching/types" @@ -31,11 +33,21 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } } + for _, dataResult := range data.DataResults { + if err := k.dataResults.Set(ctx, collections.Join3(false, dataResult.DataResult.DrId, dataResult.DataResult.DrBlockHeight), dataResult.DataResult); err != nil { + panic(err) + } + } + for _, batchAssignment := range data.BatchAssignments { + if err := k.SetBatchAssignment(ctx, batchAssignment.DataRequestId, batchAssignment.DataRequestHeight, batchAssignment.BatchNumber); err != nil { + panic(err) + } + } } // ExportGenesis extracts all data from store to genesis state. func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState { - dataResults, err := k.getAllDataResults(ctx) + dataResults, err := k.getAllGenesisDataResults(ctx) if err != nil { panic(err) } diff --git a/x/batching/keeper/keeper.go b/x/batching/keeper/keeper.go index c7adf22e..825816c1 100644 --- a/x/batching/keeper/keeper.go +++ b/x/batching/keeper/keeper.go @@ -30,8 +30,8 @@ type Keeper struct { authority string Schema collections.Schema - dataResults collections.Map[collections.Pair[bool, string], types.DataResult] - batchAssignments collections.Map[string, uint64] + dataResults collections.Map[collections.Triple[bool, string, uint64], types.DataResult] + batchAssignments collections.Map[collections.Pair[string, uint64], uint64] currentBatchNumber collections.Sequence batches *collections.IndexedMap[int64, types.Batch, BatchIndexes] validatorTreeEntries collections.Map[collections.Pair[uint64, []byte], types.ValidatorTreeEntry] @@ -60,8 +60,8 @@ func NewKeeper( wasmViewKeeper: wvk, validatorAddressCodec: validatorAddressCodec, authority: authority, - dataResults: collections.NewMap(sb, types.DataResultsPrefix, "data_results", collections.PairKeyCodec(collections.BoolKey, collections.StringKey), codec.CollValue[types.DataResult](cdc)), - batchAssignments: collections.NewMap(sb, types.BatchAssignmentsPrefix, "batch_assignments", collections.StringKey, collections.Uint64Value), + dataResults: collections.NewMap(sb, types.DataResultsPrefix, "data_results", collections.TripleKeyCodec(collections.BoolKey, collections.StringKey, collections.Uint64Key), codec.CollValue[types.DataResult](cdc)), + batchAssignments: collections.NewMap(sb, types.BatchAssignmentsPrefix, "batch_assignments", collections.PairKeyCodec(collections.StringKey, collections.Uint64Key), collections.Uint64Value), currentBatchNumber: collections.NewSequence(sb, types.CurrentBatchNumberKey, "current_batch_number"), batches: collections.NewIndexedMap(sb, types.BatchesKeyPrefix, "batches", collections.Int64Key, codec.CollValue[types.Batch](cdc), NewBatchIndexes(sb)), validatorTreeEntries: collections.NewMap(sb, types.ValidatorTreeEntriesKeyPrefix, "validator_tree_entries", collections.PairKeyCodec(collections.Uint64Key, collections.BytesKey), codec.CollValue[types.ValidatorTreeEntry](cdc)), diff --git a/x/batching/keeper/keeper_test.go b/x/batching/keeper/keeper_test.go index 75bab747..98902ee6 100644 --- a/x/batching/keeper/keeper_test.go +++ b/x/batching/keeper/keeper_test.go @@ -79,6 +79,7 @@ func (s *KeeperTestSuite) TestKeeper_DataResult() { ExitCode: 0, Result: []byte("Ghkvq84TmIuEmU1ClubNxBjVXi8df5QhiNQEC5T8V6w="), BlockHeight: 12345, + DrBlockHeight: 12343, GasUsed: 20, PaybackAddress: "", SedaPayload: "", @@ -104,7 +105,42 @@ func (s *KeeperTestSuite) TestKeeper_DataResult() { s.Require().NoError(err) s.Require().Equal(&mockDataResult, res.DataResult) s.Require().Equal(&batchingtypes.BatchAssignment{ - BatchNumber: batchNum, - DataRequestId: mockDataResult.DrId, + BatchNumber: batchNum, + DataRequestId: mockDataResult.DrId, + DataRequestHeight: mockDataResult.DrBlockHeight, + }, res.BatchAssignment) + + // Resolve and batch another data result for the same data request ID. + mockDataResult2 := mockDataResult + mockDataResult2.Id = "ccf12276c43cc61e0f3c6ace3e66872eda5df5ec753525a7bddab6fa3407e927" + mockDataResult2.DrBlockHeight = 54321 + + err = s.keeper.SetDataResultForBatching(s.ctx, mockDataResult2) + s.Require().NoError(err) + err = s.keeper.MarkDataResultAsBatched(s.ctx, mockDataResult2, batchNum) + s.Require().NoError(err) + + res, err = s.queryClient.DataResult(s.ctx, &batchingtypes.QueryDataResultRequest{ + DataRequestId: mockDataResult2.DrId, + }) + s.Require().NoError(err) + s.Require().Equal(&batchingtypes.BatchAssignment{ + BatchNumber: batchNum, + DataRequestId: mockDataResult2.DrId, + DataRequestHeight: mockDataResult2.DrBlockHeight, + }, res.BatchAssignment) + s.Require().Equal(&mockDataResult2, res.DataResult) + + // We should still be able to query the first data result. + res, err = s.queryClient.DataResult(s.ctx, &batchingtypes.QueryDataResultRequest{ + DataRequestId: mockDataResult.DrId, + DataRequestHeight: mockDataResult.DrBlockHeight, + }) + s.Require().NoError(err) + s.Require().Equal(&mockDataResult, res.DataResult) + s.Require().Equal(&batchingtypes.BatchAssignment{ + BatchNumber: batchNum, + DataRequestId: mockDataResult.DrId, + DataRequestHeight: mockDataResult.DrBlockHeight, }, res.BatchAssignment) } diff --git a/x/batching/keeper/querier.go b/x/batching/keeper/querier.go index d3acd060..534be924 100644 --- a/x/batching/keeper/querier.go +++ b/x/batching/keeper/querier.go @@ -89,8 +89,19 @@ func (q Querier) Batches(c context.Context, req *types.QueryBatchesRequest) (*ty func (q Querier) DataResult(c context.Context, req *types.QueryDataResultRequest) (*types.QueryDataResultResponse, error) { ctx := sdk.UnwrapSDKContext(c) - dataResult, err := q.Keeper.GetDataResult(ctx, req.DataRequestId) + + var dataResult *types.DataResult + var err error + if req.DataRequestHeight == 0 { + dataResult, err = q.Keeper.GetLatestDataResult(ctx, req.DataRequestId) + } else { + dataResult, err = q.Keeper.GetDataResult(ctx, req.DataRequestId, req.DataRequestHeight) + } + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return &types.QueryDataResultResponse{}, nil + } return nil, err } @@ -98,15 +109,16 @@ func (q Querier) DataResult(c context.Context, req *types.QueryDataResultRequest DataResult: dataResult, } - batchNum, err := q.Keeper.GetBatchAssignment(ctx, req.DataRequestId) + batchNum, err := q.Keeper.GetBatchAssignment(ctx, req.DataRequestId, dataResult.DrBlockHeight) if err != nil { if !errors.Is(err, collections.ErrNotFound) { return nil, err } } else { result.BatchAssignment = &types.BatchAssignment{ - BatchNumber: batchNum, - DataRequestId: req.DataRequestId, + BatchNumber: batchNum, + DataRequestId: req.DataRequestId, + DataRequestHeight: dataResult.DrBlockHeight, } } return result, nil diff --git a/x/batching/types/genesis.go b/x/batching/types/genesis.go index fc23f7c1..a5965fa2 100644 --- a/x/batching/types/genesis.go +++ b/x/batching/types/genesis.go @@ -7,7 +7,7 @@ func NewGenesisState( curBatchNum uint64, batches []Batch, batchData []BatchData, - dataResults []DataResult, + dataResults []GenesisDataResult, batchAssignments []BatchAssignment, ) GenesisState { return GenesisState{ diff --git a/x/batching/types/genesis.pb.go b/x/batching/types/genesis.pb.go index f8be3b8e..07a82127 100644 --- a/x/batching/types/genesis.pb.go +++ b/x/batching/types/genesis.pb.go @@ -27,11 +27,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { // current_batch_number is the batch number of the most recently- // created batch. - CurrentBatchNumber uint64 `protobuf:"varint,1,opt,name=current_batch_number,json=currentBatchNumber,proto3" json:"current_batch_number,omitempty"` - Batches []Batch `protobuf:"bytes,2,rep,name=batches,proto3" json:"batches"` - BatchData []BatchData `protobuf:"bytes,3,rep,name=batch_data,json=batchData,proto3" json:"batch_data"` - DataResults []DataResult `protobuf:"bytes,4,rep,name=data_results,json=dataResults,proto3" json:"data_results"` - BatchAssignments []BatchAssignment `protobuf:"bytes,5,rep,name=batch_assignments,json=batchAssignments,proto3" json:"batch_assignments"` + CurrentBatchNumber uint64 `protobuf:"varint,1,opt,name=current_batch_number,json=currentBatchNumber,proto3" json:"current_batch_number,omitempty"` + Batches []Batch `protobuf:"bytes,2,rep,name=batches,proto3" json:"batches"` + BatchData []BatchData `protobuf:"bytes,3,rep,name=batch_data,json=batchData,proto3" json:"batch_data"` + DataResults []GenesisDataResult `protobuf:"bytes,4,rep,name=data_results,json=dataResults,proto3" json:"data_results"` + BatchAssignments []BatchAssignment `protobuf:"bytes,5,rep,name=batch_assignments,json=batchAssignments,proto3" json:"batch_assignments"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -88,7 +88,7 @@ func (m *GenesisState) GetBatchData() []BatchData { return nil } -func (m *GenesisState) GetDataResults() []DataResult { +func (m *GenesisState) GetDataResults() []GenesisDataResult { if m != nil { return m.DataResults } @@ -105,8 +105,9 @@ func (m *GenesisState) GetBatchAssignments() []BatchAssignment { // BatchAssignment represents a batch assignment for genesis export // and import. type BatchAssignment struct { - BatchNumber uint64 `protobuf:"varint,1,opt,name=batch_number,json=batchNumber,proto3" json:"batch_number,omitempty"` - DataRequestId string `protobuf:"bytes,2,opt,name=data_request_id,json=dataRequestId,proto3" json:"data_request_id,omitempty"` + BatchNumber uint64 `protobuf:"varint,1,opt,name=batch_number,json=batchNumber,proto3" json:"batch_number,omitempty"` + DataRequestId string `protobuf:"bytes,2,opt,name=data_request_id,json=dataRequestId,proto3" json:"data_request_id,omitempty"` + DataRequestHeight uint64 `protobuf:"varint,3,opt,name=data_request_height,json=dataRequestHeight,proto3" json:"data_request_height,omitempty"` } func (m *BatchAssignment) Reset() { *m = BatchAssignment{} } @@ -156,6 +157,13 @@ func (m *BatchAssignment) GetDataRequestId() string { return "" } +func (m *BatchAssignment) GetDataRequestHeight() uint64 { + if m != nil { + return m.DataRequestHeight + } + return 0 +} + // BatchData represents a given batch's full data. type BatchData struct { BatchNumber uint64 `protobuf:"varint,1,opt,name=batch_number,json=batchNumber,proto3" json:"batch_number,omitempty"` @@ -225,10 +233,64 @@ func (m *BatchData) GetBatchSignatures() []BatchSignatures { return nil } +// GenesisDataResult includes a data result and its batching status. +type GenesisDataResult struct { + Batched bool `protobuf:"varint,1,opt,name=batched,proto3" json:"batched,omitempty"` + DataResult DataResult `protobuf:"bytes,2,opt,name=data_result,json=dataResult,proto3" json:"data_result"` +} + +func (m *GenesisDataResult) Reset() { *m = GenesisDataResult{} } +func (m *GenesisDataResult) String() string { return proto.CompactTextString(m) } +func (*GenesisDataResult) ProtoMessage() {} +func (*GenesisDataResult) Descriptor() ([]byte, []int) { + return fileDescriptor_eccca5d98d3cb479, []int{3} +} +func (m *GenesisDataResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisDataResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisDataResult.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 *GenesisDataResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisDataResult.Merge(m, src) +} +func (m *GenesisDataResult) XXX_Size() int { + return m.Size() +} +func (m *GenesisDataResult) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisDataResult.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisDataResult proto.InternalMessageInfo + +func (m *GenesisDataResult) GetBatched() bool { + if m != nil { + return m.Batched + } + return false +} + +func (m *GenesisDataResult) GetDataResult() DataResult { + if m != nil { + return m.DataResult + } + return DataResult{} +} + func init() { proto.RegisterType((*GenesisState)(nil), "sedachain.batching.v1.GenesisState") proto.RegisterType((*BatchAssignment)(nil), "sedachain.batching.v1.BatchAssignment") proto.RegisterType((*BatchData)(nil), "sedachain.batching.v1.BatchData") + proto.RegisterType((*GenesisDataResult)(nil), "sedachain.batching.v1.GenesisDataResult") } func init() { @@ -236,37 +298,41 @@ func init() { } var fileDescriptor_eccca5d98d3cb479 = []byte{ - // 470 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x37, 0xdb, 0x55, 0xd9, 0xc9, 0xca, 0xba, 0x63, 0x85, 0x50, 0x24, 0xa6, 0xab, 0x94, - 0x08, 0x9a, 0xd8, 0xf6, 0xea, 0xc5, 0x62, 0x11, 0x05, 0x3d, 0xa4, 0xa2, 0x28, 0x85, 0x30, 0x93, - 0x0c, 0xd9, 0x81, 0xdd, 0x49, 0x9d, 0x99, 0x2c, 0xf6, 0xbf, 0xf0, 0xcf, 0xaa, 0xb7, 0x1e, 0x3d, - 0x89, 0xec, 0x5e, 0xfd, 0x23, 0x24, 0xf3, 0xab, 0xb5, 0x6c, 0x57, 0x6f, 0xc9, 0x7b, 0xdf, 0xf7, - 0x79, 0x6f, 0xbe, 0x8f, 0x07, 0x1e, 0x0a, 0x52, 0xa2, 0x62, 0x82, 0x28, 0x4b, 0x31, 0x92, 0xc5, - 0x84, 0xb2, 0x2a, 0x9d, 0xef, 0xa6, 0x15, 0x61, 0x44, 0x50, 0x91, 0x9c, 0xf0, 0x5a, 0xd6, 0xf0, - 0x9e, 0x13, 0x25, 0x56, 0x94, 0xcc, 0x77, 0xb7, 0x36, 0xab, 0xba, 0xaa, 0x95, 0x22, 0x6d, 0xbf, - 0xb4, 0x78, 0xeb, 0xd1, 0x6a, 0xa2, 0x2b, 0x54, 0xaa, 0xf1, 0xef, 0x2e, 0x18, 0xbc, 0xd2, 0x4d, - 0x8e, 0x24, 0x92, 0x04, 0x3e, 0x03, 0x9b, 0x45, 0xc3, 0x39, 0x61, 0x32, 0x57, 0xd2, 0x9c, 0x35, - 0x33, 0x4c, 0x78, 0xe0, 0x45, 0x5e, 0xdc, 0xcb, 0xa0, 0xc9, 0x1d, 0xb4, 0xa9, 0x77, 0x2a, 0x03, - 0x9f, 0x83, 0x5b, 0x4a, 0x49, 0x44, 0xd0, 0x8d, 0x36, 0x62, 0x7f, 0xef, 0x7e, 0xb2, 0x72, 0xce, - 0x44, 0x15, 0x1d, 0xf4, 0xce, 0x7e, 0x3e, 0xe8, 0x64, 0xb6, 0x04, 0x1e, 0x02, 0xa0, 0xfb, 0x94, - 0x48, 0xa2, 0x60, 0x43, 0x01, 0xa2, 0x75, 0x80, 0x97, 0x48, 0x22, 0x03, 0xe9, 0x63, 0x1b, 0x80, - 0x6f, 0xc0, 0xa0, 0x05, 0xe4, 0x9c, 0x88, 0x66, 0x2a, 0x45, 0xd0, 0x53, 0xa0, 0xed, 0x6b, 0x40, - 0x6d, 0x49, 0xa6, 0x94, 0x86, 0xe4, 0x97, 0x2e, 0x22, 0xe0, 0x27, 0x30, 0xd2, 0x23, 0x21, 0x21, - 0x68, 0xc5, 0x66, 0x84, 0x49, 0x11, 0xdc, 0x50, 0xc0, 0x9d, 0x75, 0x93, 0xbd, 0x70, 0x72, 0x43, - 0xbd, 0x83, 0xff, 0x0e, 0x8b, 0xf1, 0x31, 0x18, 0x5e, 0x91, 0xc2, 0x6d, 0x30, 0x58, 0x61, 0xb4, - 0x8f, 0x2f, 0x39, 0xbc, 0x03, 0x86, 0xe6, 0x71, 0x5f, 0x1a, 0x22, 0x64, 0x4e, 0xcb, 0xa0, 0x1b, - 0x79, 0x71, 0x3f, 0xbb, 0xad, 0xc7, 0x56, 0xd1, 0xd7, 0xe5, 0xf8, 0x7b, 0x17, 0xf4, 0x9d, 0x47, - 0xff, 0x03, 0xc6, 0xe0, 0xee, 0x25, 0xd7, 0x72, 0xc2, 0x24, 0xa7, 0x6a, 0x8d, 0x5e, 0xec, 0xef, - 0x3d, 0xf9, 0xa7, 0x79, 0xef, 0x39, 0x21, 0x87, 0xba, 0xc6, 0xbc, 0x78, 0x74, 0xe1, 0xa3, 0x49, - 0xc0, 0x63, 0x30, 0x9a, 0xa3, 0x29, 0x2d, 0x91, 0xac, 0xb9, 0xeb, 0xa0, 0xf7, 0xfc, 0xf8, 0x9a, - 0x0e, 0x1f, 0xac, 0xde, 0x36, 0x38, 0xb5, 0x86, 0x3a, 0x92, 0xa5, 0x7f, 0x04, 0xda, 0xe4, 0xbc, - 0xf5, 0x13, 0xc9, 0x86, 0x13, 0xbb, 0xfb, 0xb5, 0xab, 0x3a, 0x72, 0x6a, 0x43, 0x1e, 0xe2, 0x2b, - 0xe1, 0xb7, 0x67, 0x8b, 0xd0, 0x3b, 0x5f, 0x84, 0xde, 0xaf, 0x45, 0xe8, 0x7d, 0x5b, 0x86, 0x9d, - 0xf3, 0x65, 0xd8, 0xf9, 0xb1, 0x0c, 0x3b, 0x9f, 0xf7, 0x2b, 0x2a, 0x27, 0x0d, 0x4e, 0x8a, 0x7a, - 0x96, 0xb6, 0x2d, 0xd4, 0x21, 0x15, 0xf5, 0x54, 0xfd, 0x3c, 0xd5, 0x17, 0xf7, 0xf5, 0xe2, 0xe6, - 0xe4, 0xe9, 0x09, 0x11, 0xf8, 0xa6, 0x52, 0xed, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x7a, - 0xd7, 0xd5, 0xe8, 0x03, 0x00, 0x00, + // 531 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0xc7, 0xe3, 0x24, 0xdf, 0x07, 0x19, 0x07, 0x05, 0x2f, 0x45, 0xb2, 0x2a, 0x64, 0xd2, 0x80, + 0x2a, 0x23, 0x81, 0x4d, 0xdb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 0x6a, 0x92, 0xa2, 0xbf, 0x81, 0x6a, 0x2b, 0x5e, 0xe9, 0x3f, 0x15, 0x45, 0xce, + 0xd4, 0xcd, 0x6c, 0xdd, 0xed, 0x69, 0xad, 0x96, 0xe4, 0x9e, 0xbf, 0x1a, 0x1e, 0x7c, 0x04, 0xe3, + 0x8f, 0xeb, 0x22, 0xa6, 0x7a, 0x45, 0x42, 0x74, 0xf3, 0xaa, 0x3a, 0xff, 0x90, 0x9c, 0x80, 0xbe, + 0xe4, 0xa4, 0x74, 0x70, 0xef, 0xaf, 0x0e, 0xca, 0xee, 0xb0, 0xb0, 0x6d, 0xf8, 0xfc, 0x62, 0x66, + 0x69, 0x97, 0x33, 0x4b, 0xfb, 0x31, 0xb3, 0xb4, 0x2f, 0x73, 0xab, 0x71, 0x39, 0xb7, 0x1a, 0xdf, + 0xe6, 0x56, 0xe3, 0xdd, 0x51, 0x94, 0x88, 0xb8, 0xf0, 0x9d, 0x20, 0x9b, 0xb8, 0x25, 0x18, 0xdf, + 0xfc, 0x20, 0x1b, 0xe3, 0x9f, 0x07, 0xd5, 0x27, 0xe2, 0xd3, 0xe2, 0x23, 0x21, 0xce, 0xcf, 0x18, + 0xf7, 0xff, 0x47, 0xd5, 0xd1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x50, 0x30, 0x8a, 0x99, + 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -373,6 +439,11 @@ func (m *BatchAssignment) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DataRequestHeight != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.DataRequestHeight)) + i-- + dAtA[i] = 0x18 + } if len(m.DataRequestId) > 0 { i -= len(m.DataRequestId) copy(dAtA[i:], m.DataRequestId) @@ -454,6 +525,49 @@ func (m *BatchData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GenesisDataResult) 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 *GenesisDataResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisDataResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.DataResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Batched { + i-- + if m.Batched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -514,6 +628,9 @@ func (m *BatchAssignment) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } + if m.DataRequestHeight != 0 { + n += 1 + sovGenesis(uint64(m.DataRequestHeight)) + } return n } @@ -543,6 +660,20 @@ func (m *BatchData) Size() (n int) { return n } +func (m *GenesisDataResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Batched { + n += 2 + } + l = m.DataResult.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -694,7 +825,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DataResults = append(m.DataResults, DataResult{}) + m.DataResults = append(m.DataResults, GenesisDataResult{}) if err := m.DataResults[len(m.DataResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -834,6 +965,25 @@ func (m *BatchAssignment) Unmarshal(dAtA []byte) error { } m.DataRequestId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataRequestHeight", wireType) + } + m.DataRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataRequestHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -1025,6 +1175,109 @@ func (m *BatchData) Unmarshal(dAtA []byte) error { } return nil } +func (m *GenesisDataResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisDataResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisDataResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Batched", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Batched = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DataResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/batching/types/query.pb.go b/x/batching/types/query.pb.go index 59b2ed90..2d05aca8 100644 --- a/x/batching/types/query.pb.go +++ b/x/batching/types/query.pb.go @@ -345,7 +345,8 @@ func (m *QueryBatchesResponse) GetPagination() *query.PageResponse { // The request message for QueryDataResult RPC. type QueryDataResultRequest struct { - DataRequestId string `protobuf:"bytes,1,opt,name=data_request_id,json=dataRequestId,proto3" json:"data_request_id,omitempty"` + DataRequestId string `protobuf:"bytes,1,opt,name=data_request_id,json=dataRequestId,proto3" json:"data_request_id,omitempty"` + DataRequestHeight uint64 `protobuf:"varint,2,opt,name=data_request_height,json=dataRequestHeight,proto3" json:"data_request_height,omitempty"` } func (m *QueryDataResultRequest) Reset() { *m = QueryDataResultRequest{} } @@ -388,6 +389,13 @@ func (m *QueryDataResultRequest) GetDataRequestId() string { return "" } +func (m *QueryDataResultRequest) GetDataRequestHeight() uint64 { + if m != nil { + return m.DataRequestHeight + } + return 0 +} + // The response message for QueryDataResult RPC. type QueryDataResultResponse struct { DataResult *DataResult `protobuf:"bytes,1,opt,name=data_result,json=dataResult,proto3" json:"data_result,omitempty"` @@ -455,57 +463,58 @@ func init() { func init() { proto.RegisterFile("sedachain/batching/v1/query.proto", fileDescriptor_351236f6b51194e8) } var fileDescriptor_351236f6b51194e8 = []byte{ - // 787 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x4f, 0x13, 0x5d, - 0x14, 0xee, 0x00, 0x7d, 0x79, 0xbd, 0x05, 0x81, 0x0b, 0x6a, 0x53, 0x49, 0x85, 0x81, 0x20, 0x1f, - 0x32, 0x93, 0x16, 0x42, 0x8c, 0x21, 0x51, 0x89, 0x22, 0x2e, 0x34, 0x32, 0x7e, 0x90, 0x18, 0x93, - 0xe6, 0x4e, 0x7b, 0x9d, 0x4e, 0x6c, 0xe7, 0x96, 0xb9, 0xb7, 0x55, 0x42, 0xd8, 0xb0, 0x30, 0xee, - 0x34, 0x71, 0xed, 0xda, 0x5f, 0xa0, 0xbf, 0x81, 0x25, 0x89, 0x1b, 0x57, 0xc6, 0x80, 0x1b, 0xff, - 0x85, 0x99, 0x33, 0x77, 0x3e, 0x0a, 0x2d, 0xad, 0x71, 0x37, 0x3d, 0xf7, 0x39, 0xcf, 0x79, 0xce, - 0xb9, 0xcf, 0xb9, 0x45, 0x93, 0x9c, 0x96, 0x48, 0xb1, 0x4c, 0x6c, 0x47, 0x37, 0x89, 0x28, 0x96, - 0x6d, 0xc7, 0xd2, 0x1b, 0x39, 0x7d, 0xbb, 0x4e, 0xdd, 0x1d, 0xad, 0xe6, 0x32, 0xc1, 0xf0, 0x85, - 0x10, 0xa2, 0x05, 0x10, 0xad, 0x91, 0xcb, 0x8c, 0x59, 0xcc, 0x62, 0x80, 0xd0, 0xbd, 0x2f, 0x1f, - 0x9c, 0x19, 0xb7, 0x18, 0xb3, 0x2a, 0x54, 0x27, 0x35, 0x5b, 0x27, 0x8e, 0xc3, 0x04, 0x11, 0x36, - 0x73, 0xb8, 0x3c, 0x9d, 0x2f, 0x32, 0x5e, 0x65, 0x5c, 0x37, 0x09, 0xa7, 0x7e, 0x0d, 0xbd, 0x91, - 0x33, 0xa9, 0x20, 0x39, 0xbd, 0x46, 0x2c, 0xdb, 0x01, 0xb0, 0xc4, 0x4e, 0xb7, 0x56, 0x16, 0x4a, - 0xf0, 0x51, 0x53, 0xad, 0x51, 0x16, 0x75, 0x28, 0xb7, 0x65, 0x59, 0x75, 0x05, 0x8d, 0x6c, 0x7a, - 0xc5, 0xd6, 0x3c, 0x84, 0x41, 0xb7, 0xeb, 0x94, 0x0b, 0x3c, 0x89, 0x06, 0x20, 0xa3, 0xe0, 0xd4, - 0xab, 0x26, 0x75, 0xd3, 0xca, 0x84, 0x32, 0xdb, 0x67, 0xa4, 0x20, 0xf6, 0x10, 0x42, 0xea, 0xef, - 0x1e, 0x84, 0xe3, 0x89, 0xbc, 0xc6, 0x1c, 0x4e, 0xf1, 0x75, 0x94, 0x04, 0x14, 0xa4, 0xa4, 0xf2, - 0xe3, 0x5a, 0xcb, 0x01, 0x69, 0x90, 0xb4, 0xd6, 0x77, 0xf0, 0xe3, 0x4a, 0xc2, 0xf0, 0x13, 0xb0, - 0x89, 0x46, 0x4b, 0x44, 0x90, 0x82, 0x4b, 0x79, 0xbd, 0x22, 0x0a, 0xd4, 0x11, 0xae, 0x4d, 0x79, - 0xba, 0x07, 0x78, 0xae, 0xb5, 0xe1, 0xb9, 0x43, 0x04, 0x31, 0x20, 0xe1, 0x89, 0x4b, 0xe9, 0x5d, - 0x3f, 0x47, 0xf2, 0x8e, 0x94, 0xc2, 0x43, 0x79, 0x80, 0x5f, 0xa0, 0x91, 0x06, 0xa9, 0xd8, 0x25, - 0x22, 0x98, 0x1b, 0x56, 0xe8, 0x9d, 0xe8, 0x9d, 0x4d, 0xe5, 0xe7, 0xda, 0x54, 0x78, 0x16, 0xe0, - 0x83, 0x02, 0x3b, 0x92, 0x7e, 0x38, 0x64, 0x0a, 0xd8, 0xb7, 0xd0, 0xb0, 0x3f, 0x35, 0x6e, 0x5b, - 0x0e, 0x11, 0x75, 0x97, 0xf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0x70, 0x94, 0x55, 0x0e, 0x8f, 0xb2, 0xca, 0xcf, 0xa3, 0xac, 0xf2, 0xe1, 0x38, 0x9b, - 0x38, 0x3c, 0xce, 0x26, 0xbe, 0x1f, 0x67, 0x13, 0xcf, 0x97, 0x2c, 0x5b, 0x94, 0xeb, 0xa6, 0x56, - 0x64, 0x55, 0xe0, 0x85, 0xbf, 0xc5, 0x22, 0xab, 0xc4, 0x8b, 0xbc, 0x89, 0xca, 0x88, 0x9d, 0x1a, - 0xe5, 0xe6, 0x7f, 0x80, 0x5a, 0xfa, 0x13, 0x00, 0x00, 0xff, 0xff, 0x36, 0x0c, 0x2f, 0x4b, 0x23, - 0x08, 0x00, 0x00, + // 805 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4f, 0x13, 0x5b, + 0x14, 0xee, 0x14, 0xfa, 0x78, 0xef, 0x16, 0x1e, 0xf4, 0xc2, 0x7b, 0xaf, 0xe9, 0x23, 0x15, 0x06, + 0x82, 0xfc, 0x90, 0x99, 0xb4, 0x10, 0x62, 0x0c, 0x89, 0x91, 0x28, 0xe2, 0x42, 0x23, 0xe3, 0x0f, + 0x12, 0x63, 0xd2, 0xdc, 0x69, 0xaf, 0xd3, 0x89, 0xed, 0xdc, 0x32, 0xf7, 0xb6, 0x4a, 0x08, 0x1b, + 0x16, 0xc6, 0x9d, 0x26, 0xae, 0x5d, 0xfb, 0x17, 0xe8, 0xdf, 0xc0, 0x92, 0xc4, 0x8d, 0x2b, 0x63, + 0xc0, 0x8d, 0xff, 0x85, 0x99, 0x33, 0x77, 0x7e, 0x14, 0x5a, 0x5a, 0xe3, 0x6e, 0x7a, 0xee, 0x77, + 0xce, 0xf9, 0xee, 0x39, 0xdf, 0x77, 0x8b, 0xa6, 0x39, 0xad, 0x90, 0x72, 0x95, 0xd8, 0x8e, 0x6e, + 0x12, 0x51, 0xae, 0xda, 0x8e, 0xa5, 0xb7, 0x0a, 0xfa, 0x6e, 0x93, 0xba, 0x7b, 0x5a, 0xc3, 0x65, + 0x82, 0xe1, 0x7f, 0x42, 0x88, 0x16, 0x40, 0xb4, 0x56, 0x21, 0x37, 0x61, 0x31, 0x8b, 0x01, 0x42, + 0xf7, 0xbe, 0x7c, 0x70, 0x6e, 0xd2, 0x62, 0xcc, 0xaa, 0x51, 0x9d, 0x34, 0x6c, 0x9d, 0x38, 0x0e, + 0x13, 0x44, 0xd8, 0xcc, 0xe1, 0xf2, 0x74, 0xb1, 0xcc, 0x78, 0x9d, 0x71, 0xdd, 0x24, 0x9c, 0xfa, + 0x3d, 0xf4, 0x56, 0xc1, 0xa4, 0x82, 0x14, 0xf4, 0x06, 0xb1, 0x6c, 0x07, 0xc0, 0x12, 0x3b, 0xdb, + 0x99, 0x59, 0x48, 0xc1, 0x47, 0xcd, 0x74, 0x46, 0x59, 0xd4, 0xa1, 0xdc, 0x96, 0x6d, 0xd5, 0x35, + 0x94, 0xd9, 0xf6, 0x9a, 0x6d, 0x78, 0x08, 0x83, 0xee, 0x36, 0x29, 0x17, 0x78, 0x1a, 0x0d, 0x43, + 0x46, 0xc9, 0x69, 0xd6, 0x4d, 0xea, 0x66, 0x95, 0x29, 0x65, 0x7e, 0xd0, 0x48, 0x43, 0xec, 0x1e, + 0x84, 0xd4, 0x1f, 0x49, 0x84, 0xe3, 0x89, 0xbc, 0xc1, 0x1c, 0x4e, 0xf1, 0x55, 0x94, 0x02, 0x14, + 0xa4, 0xa4, 0x8b, 0x93, 0x5a, 0xc7, 0x01, 0x69, 0x90, 0xb4, 0x31, 0x78, 0xf4, 0xf5, 0x52, 0xc2, + 0xf0, 0x13, 0xb0, 0x89, 0xc6, 0x2b, 0x44, 0x90, 0x92, 0x4b, 0x79, 0xb3, 0x26, 0x4a, 0xd4, 0x11, + 0xae, 0x4d, 0x79, 0x36, 0x09, 0x75, 0xae, 0x74, 0xa9, 0x73, 0x93, 0x08, 0x62, 0x40, 0xc2, 0x43, + 0x97, 0xd2, 0x5b, 0x7e, 0x8e, 0xac, 0x9b, 0xa9, 0x84, 0x87, 0xf2, 0x00, 0x3f, 0x45, 0x99, 0x16, + 0xa9, 0xd9, 0x15, 0x22, 0x98, 0x1b, 0x76, 0x18, 0x98, 0x1a, 0x98, 0x4f, 0x17, 0x17, 0xba, 0x74, + 0x78, 0x1c, 0xe0, 0x83, 0x06, 0x7b, 0xb2, 0xfc, 0x58, 0x58, 0x29, 0xa8, 0xbe, 0x83, 0xc6, 0xfc, + 0xa9, 0x71, 0xdb, 0x72, 0x88, 0x68, 0xba, 0x94, 0x67, 0x07, 0xa1, 0xf8, 0xdc, 0x45, 0x63, 0x78, + 0x10, 0xa2, 0x65, 0xe5, 0x51, 0xb3, 0x3d, 0xac, 0x5e, 0x47, 0xb9, 0x68, 0xd4, 0x9b, 0xcc, 0xdd, + 0xa2, 0xb6, 0x55, 0x15, 0xf1, 0x65, 0xd5, 0x58, 0xf9, 0x79, 0xa9, 0x0a, 0x61, 0x98, 0xfc, 0x80, + 0x91, 0x86, 0x98, 0x8f, 0x54, 0x77, 0xd0, 0xff, 0x1d, 0x0b, 0xfc, 0xee, 0xd2, 0xd4, 0x43, 0x05, + 0x8d, 0x47, 0x95, 0x29, 0x0f, 0x38, 0x6d, 0x22, 0x14, 0x89, 0x56, 0x96, 0x9d, 0xd3, 0x7c, 0x85, + 0x6b, 0x9e, 0xc2, 0x35, 0xdf, 0x45, 0x52, 0xe1, 0xda, 0x7d, 0x62, 0x51, 0x99, 0x6b, 0xc4, 0x32, + 0xf1, 0x0c, 0x1a, 0x79, 0x61, 0x8b, 0x6a, 0xa9, 0xe9, 0x78, 0x33, 0xa5, 0x15, 0x90, 0xc3, 0x9f, + 0xc6, 0xb0, 0x17, 0x7c, 0x24, 0x63, 0xea, 0x7b, 0x05, 0x4d, 0xb4, 0x93, 0x90, 0xf7, 0x5a, 0x47, + 0x43, 0xa6, 0x1f, 0xca, 0x2a, 0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 0xee, 0x64, 0x4b, 0xcf, 0x98, 0x2b, 0x65, + 0xa1, 0xef, 0xc7, 0x9f, 0x83, 0x03, 0xfc, 0x5a, 0x41, 0x43, 0xd2, 0x19, 0x78, 0xb1, 0x67, 0xf7, + 0xd0, 0xc3, 0xb9, 0xa5, 0xbe, 0xb0, 0x92, 0xe2, 0x2c, 0x50, 0xcc, 0xe3, 0xc9, 0xee, 0x14, 0x29, + 0xc7, 0x1f, 0x14, 0x84, 0x22, 0x49, 0xe1, 0xe5, 0x8b, 0x3a, 0x9c, 0x73, 0x4b, 0x4e, 0xeb, 0x17, + 0x2e, 0x39, 0x5d, 0x03, 0x4e, 0xab, 0xb8, 0xd8, 0x91, 0x53, 0xcc, 0x04, 0xfa, 0xfe, 0x19, 0x17, + 0x1e, 0x6c, 0xdc, 0x3d, 0x3a, 0xc9, 0x2b, 0xc7, 0x27, 0x79, 0xe5, 0xdb, 0x49, 0x5e, 0x79, 0x7b, + 0x9a, 0x4f, 0x1c, 0x9f, 0xe6, 0x13, 0x5f, 0x4e, 0xf3, 0x89, 0x27, 0x2b, 0x96, 0x2d, 0xaa, 0x4d, + 0x53, 0x2b, 0xb3, 0x3a, 0xd4, 0x85, 0xbf, 0xd1, 0x32, 0xab, 0xc5, 0x9b, 0xbc, 0x8c, 0xda, 0x88, + 0xbd, 0x06, 0xe5, 0xe6, 0x1f, 0x80, 0x5a, 0xf9, 0x19, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x3a, 0xa7, + 0x42, 0x53, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -981,6 +990,11 @@ func (m *QueryDataResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.DataRequestHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DataRequestHeight)) + i-- + dAtA[i] = 0x10 + } if len(m.DataRequestId) > 0 { i -= len(m.DataRequestId) copy(dAtA[i:], m.DataRequestId) @@ -1154,6 +1168,9 @@ func (m *QueryDataResultRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.DataRequestHeight != 0 { + n += 1 + sovQuery(uint64(m.DataRequestHeight)) + } return n } @@ -1872,6 +1889,25 @@ func (m *QueryDataResultRequest) Unmarshal(dAtA []byte) error { } m.DataRequestId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataRequestHeight", wireType) + } + m.DataRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataRequestHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/batching/types/query.pb.gw.go b/x/batching/types/query.pb.gw.go index c3c09d9c..2ccb4a67 100644 --- a/x/batching/types/query.pb.gw.go +++ b/x/batching/types/query.pb.gw.go @@ -177,6 +177,10 @@ func local_request_Query_Batches_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_DataResult_0 = &utilities.DoubleArray{Encoding: map[string]int{"data_request_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_DataResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDataResultRequest var metadata runtime.ServerMetadata @@ -199,6 +203,13 @@ func request_Query_DataResult_0(ctx context.Context, marshaler runtime.Marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "data_request_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DataResult_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.DataResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -226,6 +237,13 @@ func local_request_Query_DataResult_0(ctx context.Context, marshaler runtime.Mar return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "data_request_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DataResult_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.DataResult(ctx, &protoReq) return msg, metadata, err