feat: include transactions in QueryBlockByHeight (#10880)
## Description Closes: #3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
parent
e66b8ef212
commit
dd65ef8732
|
@ -170,6 +170,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
|||
* (types/errors) [\#10779](https://github.com/cosmos/cosmos-sdk/pull/10779) Move most functionality in `types/errors` to a standalone `errors` go module, except the `RootCodespace` errors and ABCI response helpers. All functions and types that used to live in `types/errors` are now aliased so this is not a breaking change.
|
||||
* (gov) [\#10854](https://github.com/cosmos/cosmos-sdk/pull/10854) v1beta2's vote doesn't include the deprecate `option VoteOption` anymore. Instead, it only uses `WeightedVoteOption`.
|
||||
* (types) [\#11004](https://github.com/cosmos/cosmos-sdk/pull/11004) Added mutable versions of many of the sdk.Dec types operations. This improves performance when used by avoiding reallocating a new bigint for each operation.
|
||||
* (x/auth) [\#10880](https://github.com/cosmos/cosmos-sdk/pull/10880) Added a new query to the tx query service that returns a block with transactions fully decoded.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
|
|
@ -3,10 +3,6 @@ package groupv1beta1
|
|||
|
||||
import (
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
_ "github.com/cosmos/cosmos-proto"
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
|
@ -16,6 +12,9 @@ import (
|
|||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,10 @@ type ServiceClient interface {
|
|||
BroadcastTx(ctx context.Context, in *BroadcastTxRequest, opts ...grpc.CallOption) (*BroadcastTxResponse, error)
|
||||
// GetTxsEvent fetches txs by event.
|
||||
GetTxsEvent(ctx context.Context, in *GetTxsEventRequest, opts ...grpc.CallOption) (*GetTxsEventResponse, error)
|
||||
// GetBlockWithTxs fetches a block with decoded txs.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxsRequest, opts ...grpc.CallOption) (*GetBlockWithTxsResponse, error)
|
||||
}
|
||||
|
||||
type serviceClient struct {
|
||||
|
@ -76,6 +80,15 @@ func (c *serviceClient) GetTxsEvent(ctx context.Context, in *GetTxsEventRequest,
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxsRequest, opts ...grpc.CallOption) (*GetBlockWithTxsResponse, error) {
|
||||
out := new(GetBlockWithTxsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.tx.v1beta1.Service/GetBlockWithTxs", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServer is the server API for Service service.
|
||||
// All implementations must embed UnimplementedServiceServer
|
||||
// for forward compatibility
|
||||
|
@ -88,6 +101,10 @@ type ServiceServer interface {
|
|||
BroadcastTx(context.Context, *BroadcastTxRequest) (*BroadcastTxResponse, error)
|
||||
// GetTxsEvent fetches txs by event.
|
||||
GetTxsEvent(context.Context, *GetTxsEventRequest) (*GetTxsEventResponse, error)
|
||||
// GetBlockWithTxs fetches a block with decoded txs.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
GetBlockWithTxs(context.Context, *GetBlockWithTxsRequest) (*GetBlockWithTxsResponse, error)
|
||||
mustEmbedUnimplementedServiceServer()
|
||||
}
|
||||
|
||||
|
@ -107,6 +124,9 @@ func (UnimplementedServiceServer) BroadcastTx(context.Context, *BroadcastTxReque
|
|||
func (UnimplementedServiceServer) GetTxsEvent(context.Context, *GetTxsEventRequest) (*GetTxsEventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTxsEvent not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) GetBlockWithTxs(context.Context, *GetBlockWithTxsRequest) (*GetBlockWithTxsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBlockWithTxs not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
|
||||
|
||||
// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
|
@ -192,6 +212,24 @@ func _Service_GetTxsEvent_Handler(srv interface{}, ctx context.Context, dec func
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_GetBlockWithTxs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBlockWithTxsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).GetBlockWithTxs(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.tx.v1beta1.Service/GetBlockWithTxs",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).GetBlockWithTxs(ctx, req.(*GetBlockWithTxsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -215,6 +253,10 @@ var Service_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "GetTxsEvent",
|
||||
Handler: _Service_GetTxsEvent_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBlockWithTxs",
|
||||
Handler: _Service_GetBlockWithTxs_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/tx/v1beta1/service.proto",
|
||||
|
|
|
@ -2,8 +2,8 @@ package tmservice
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
"github.com/tendermint/tendermint/rpc/coretypes"
|
||||
)
|
||||
|
||||
|
@ -16,3 +16,17 @@ func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*co
|
|||
|
||||
return node.Block(ctx, height)
|
||||
}
|
||||
|
||||
func GetProtoBlock(ctx context.Context, clientCtx client.Context, height *int64) (tmproto.BlockID, *tmproto.Block, error) {
|
||||
block, err := getBlock(ctx, clientCtx, height)
|
||||
if err != nil {
|
||||
return tmproto.BlockID{}, nil, err
|
||||
}
|
||||
protoBlock, err := block.Block.ToProto()
|
||||
if err != nil {
|
||||
return tmproto.BlockID{}, nil, err
|
||||
}
|
||||
protoBlockId := block.BlockID.ToProto()
|
||||
|
||||
return protoBlockId, protoBlock, nil
|
||||
}
|
||||
|
|
|
@ -74,12 +74,7 @@ func (s queryServer) GetBlockByHeight(ctx context.Context, req *GetBlockByHeight
|
|||
return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length")
|
||||
}
|
||||
|
||||
res, err := getBlock(ctx, s.clientCtx, &req.Height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
protoBlockID := res.BlockID.ToProto()
|
||||
protoBlock, err := res.Block.ToProto()
|
||||
protoBlockID, protoBlock, err := GetProtoBlock(ctx, s.clientCtx, &req.Height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import "google/api/annotations.proto";
|
|||
import "cosmos/base/abci/v1beta1/abci.proto";
|
||||
import "cosmos/tx/v1beta1/tx.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "tendermint/types/block.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/types/tx";
|
||||
|
||||
|
@ -32,6 +34,12 @@ service Service {
|
|||
rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) {
|
||||
option (google.api.http).get = "/cosmos/tx/v1beta1/txs";
|
||||
}
|
||||
// GetBlockWithTxs fetches a block with decoded txs.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) {
|
||||
option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}";
|
||||
}
|
||||
}
|
||||
|
||||
// GetTxsEventRequest is the request type for the Service.TxsByEvents
|
||||
|
@ -39,7 +47,7 @@ service Service {
|
|||
message GetTxsEventRequest {
|
||||
// events is the list of transaction event type.
|
||||
repeated string events = 1;
|
||||
// pagination defines an pagination for the request.
|
||||
// pagination defines a pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
OrderBy order_by = 3;
|
||||
}
|
||||
|
@ -61,7 +69,7 @@ message GetTxsEventResponse {
|
|||
repeated cosmos.tx.v1beta1.Tx txs = 1;
|
||||
// tx_responses is the list of queried TxResponses.
|
||||
repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2;
|
||||
// pagination defines an pagination for the response.
|
||||
// pagination defines a pagination for the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 3;
|
||||
}
|
||||
|
||||
|
@ -129,4 +137,27 @@ message GetTxResponse {
|
|||
cosmos.tx.v1beta1.Tx tx = 1;
|
||||
// tx_response is the queried TxResponses.
|
||||
cosmos.base.abci.v1beta1.TxResponse tx_response = 2;
|
||||
}
|
||||
|
||||
// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs
|
||||
// RPC method.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
message GetBlockWithTxsRequest {
|
||||
// height is the height of the block to query.
|
||||
int64 height = 1;
|
||||
// pagination defines a pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
}
|
||||
|
||||
// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
message GetBlockWithTxsResponse {
|
||||
// txs are the transactions in the block.
|
||||
repeated cosmos.tx.v1beta1.Tx txs = 1;
|
||||
.tendermint.types.BlockID block_id = 2;
|
||||
.tendermint.types.Block block = 3;
|
||||
// pagination defines a pagination for the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 4;
|
||||
}
|
|
@ -3,15 +3,14 @@ package testdata_pulsar
|
|||
|
||||
import (
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -3,16 +3,15 @@ package testdata_pulsar
|
|||
|
||||
import (
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -3,15 +3,14 @@ package testdata_pulsar
|
|||
|
||||
import (
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,20 +4,18 @@ package testdata_pulsar
|
|||
import (
|
||||
binary "encoding/binary"
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
math "math"
|
||||
reflect "reflect"
|
||||
sort "sort"
|
||||
sync "sync"
|
||||
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/tx/v1beta1"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/tx/v1beta1"
|
||||
io "io"
|
||||
math "math"
|
||||
reflect "reflect"
|
||||
sort "sort"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
query "github.com/cosmos/cosmos-sdk/types/query"
|
||||
grpc1 "github.com/gogo/protobuf/grpc"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
types1 "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
|
@ -106,7 +107,7 @@ func (BroadcastMode) EnumDescriptor() ([]byte, []int) {
|
|||
type GetTxsEventRequest struct {
|
||||
// events is the list of transaction event type.
|
||||
Events []string `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
|
||||
// pagination defines an pagination for the request.
|
||||
// pagination defines a pagination for the request.
|
||||
Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||
OrderBy OrderBy `protobuf:"varint,3,opt,name=order_by,json=orderBy,proto3,enum=cosmos.tx.v1beta1.OrderBy" json:"order_by,omitempty"`
|
||||
}
|
||||
|
@ -172,7 +173,7 @@ type GetTxsEventResponse struct {
|
|||
Txs []*Tx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"`
|
||||
// tx_responses is the list of queried TxResponses.
|
||||
TxResponses []*types.TxResponse `protobuf:"bytes,2,rep,name=tx_responses,json=txResponses,proto3" json:"tx_responses,omitempty"`
|
||||
// pagination defines an pagination for the response.
|
||||
// pagination defines a pagination for the response.
|
||||
Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -550,6 +551,133 @@ func (m *GetTxResponse) GetTxResponse() *types.TxResponse {
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs
|
||||
// RPC method.
|
||||
type GetBlockWithTxsRequest struct {
|
||||
// height is the height of the block to query.
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
// pagination defines a pagination for the request.
|
||||
Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsRequest) Reset() { *m = GetBlockWithTxsRequest{} }
|
||||
func (m *GetBlockWithTxsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBlockWithTxsRequest) ProtoMessage() {}
|
||||
func (*GetBlockWithTxsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e0b00a618705eca7, []int{8}
|
||||
}
|
||||
func (m *GetBlockWithTxsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *GetBlockWithTxsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_GetBlockWithTxsRequest.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 *GetBlockWithTxsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetBlockWithTxsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *GetBlockWithTxsRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *GetBlockWithTxsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetBlockWithTxsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetBlockWithTxsRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *GetBlockWithTxsRequest) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsRequest) GetPagination() *query.PageRequest {
|
||||
if m != nil {
|
||||
return m.Pagination
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method.
|
||||
type GetBlockWithTxsResponse struct {
|
||||
// txs are the transactions in the block.
|
||||
Txs []*Tx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"`
|
||||
BlockId *types1.BlockID `protobuf:"bytes,2,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
|
||||
Block *types1.Block `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"`
|
||||
// pagination defines a pagination for the response.
|
||||
Pagination *query.PageResponse `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) Reset() { *m = GetBlockWithTxsResponse{} }
|
||||
func (m *GetBlockWithTxsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBlockWithTxsResponse) ProtoMessage() {}
|
||||
func (*GetBlockWithTxsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e0b00a618705eca7, []int{9}
|
||||
}
|
||||
func (m *GetBlockWithTxsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *GetBlockWithTxsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_GetBlockWithTxsResponse.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 *GetBlockWithTxsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetBlockWithTxsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *GetBlockWithTxsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *GetBlockWithTxsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetBlockWithTxsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetBlockWithTxsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *GetBlockWithTxsResponse) GetTxs() []*Tx {
|
||||
if m != nil {
|
||||
return m.Txs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) GetBlockId() *types1.BlockID {
|
||||
if m != nil {
|
||||
return m.BlockId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) GetBlock() *types1.Block {
|
||||
if m != nil {
|
||||
return m.Block
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) GetPagination() *query.PageResponse {
|
||||
if m != nil {
|
||||
return m.Pagination
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("cosmos.tx.v1beta1.OrderBy", OrderBy_name, OrderBy_value)
|
||||
proto.RegisterEnum("cosmos.tx.v1beta1.BroadcastMode", BroadcastMode_name, BroadcastMode_value)
|
||||
|
@ -561,64 +689,75 @@ func init() {
|
|||
proto.RegisterType((*SimulateResponse)(nil), "cosmos.tx.v1beta1.SimulateResponse")
|
||||
proto.RegisterType((*GetTxRequest)(nil), "cosmos.tx.v1beta1.GetTxRequest")
|
||||
proto.RegisterType((*GetTxResponse)(nil), "cosmos.tx.v1beta1.GetTxResponse")
|
||||
proto.RegisterType((*GetBlockWithTxsRequest)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsRequest")
|
||||
proto.RegisterType((*GetBlockWithTxsResponse)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cosmos/tx/v1beta1/service.proto", fileDescriptor_e0b00a618705eca7) }
|
||||
|
||||
var fileDescriptor_e0b00a618705eca7 = []byte{
|
||||
// 817 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0x8e, 0x9d, 0xa5, 0xc9, 0xbe, 0xa4, 0x4b, 0x76, 0xba, 0x2c, 0x26, 0x0b, 0x6e, 0xd6, 0x4b,
|
||||
0xba, 0x21, 0x12, 0xb6, 0x36, 0x80, 0x84, 0x10, 0x12, 0x8a, 0x93, 0x6c, 0xa9, 0x60, 0x37, 0xab,
|
||||
0x49, 0x11, 0x5a, 0x84, 0x14, 0x39, 0xc9, 0x34, 0xb5, 0x68, 0x3c, 0xa9, 0x67, 0x52, 0x39, 0x6a,
|
||||
0x2b, 0x24, 0x8e, 0x9c, 0x90, 0xf8, 0x19, 0xfc, 0x11, 0x8e, 0x95, 0xb8, 0x70, 0x44, 0x2d, 0x3f,
|
||||
0x82, 0x23, 0xf2, 0x78, 0x92, 0x38, 0xa9, 0xd3, 0x22, 0x4e, 0x99, 0xc9, 0x7c, 0xef, 0x7b, 0xdf,
|
||||
0xfb, 0xe6, 0xcd, 0x33, 0x6c, 0xf7, 0x29, 0x1b, 0x51, 0x66, 0xf1, 0xc0, 0x3a, 0x79, 0xd6, 0x23,
|
||||
0xdc, 0x79, 0x66, 0x31, 0xe2, 0x9f, 0xb8, 0x7d, 0x62, 0x8e, 0x7d, 0xca, 0x29, 0xba, 0x1f, 0x01,
|
||||
0x4c, 0x1e, 0x98, 0x12, 0x50, 0x7c, 0x77, 0x48, 0xe9, 0xf0, 0x88, 0x58, 0xce, 0xd8, 0xb5, 0x1c,
|
||||
0xcf, 0xa3, 0xdc, 0xe1, 0x2e, 0xf5, 0x58, 0x14, 0x50, 0x7c, 0x22, 0x19, 0x7b, 0x0e, 0x23, 0x96,
|
||||
0xd3, 0xeb, 0xbb, 0x73, 0xe2, 0x70, 0x23, 0x41, 0xc5, 0xeb, 0x69, 0x79, 0x20, 0xcf, 0xaa, 0x71,
|
||||
0x82, 0xe3, 0x09, 0xf1, 0xa7, 0x73, 0xcc, 0xd8, 0x19, 0xba, 0x9e, 0xc8, 0x16, 0x61, 0x8d, 0xdf,
|
||||
0x14, 0x40, 0xbb, 0x84, 0xef, 0x07, 0xac, 0x75, 0x42, 0x3c, 0x8e, 0xc9, 0xf1, 0x84, 0x30, 0x8e,
|
||||
0x1e, 0xc2, 0x06, 0x09, 0xf7, 0x4c, 0x53, 0x4a, 0xe9, 0xca, 0x5d, 0x2c, 0x77, 0xe8, 0x39, 0xc0,
|
||||
0x82, 0x42, 0x53, 0x4b, 0x4a, 0x25, 0x57, 0xdb, 0x31, 0x65, 0x85, 0x61, 0x3e, 0x53, 0xe4, 0x9b,
|
||||
0x55, 0x6a, 0xbe, 0x72, 0x86, 0x44, 0x72, 0xe2, 0x58, 0x24, 0xfa, 0x04, 0xb2, 0xd4, 0x1f, 0x10,
|
||||
0xbf, 0xdb, 0x9b, 0x6a, 0xe9, 0x92, 0x52, 0xb9, 0x57, 0x2b, 0x9a, 0xd7, 0x7c, 0x32, 0xdb, 0x21,
|
||||
0xc4, 0x9e, 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 0x63, 0x12, 0x92, 0xf5, 0x36, 0xc4,
|
||||
0x97, 0xed, 0xa3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6b, 0xfe, 0xda, 0x83, 0x9a, 0x07, 0x00,
|
||||
0x00,
|
||||
// 962 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xd1, 0x6e, 0x1a, 0x47,
|
||||
0x14, 0xf5, 0x2e, 0xb6, 0x21, 0x17, 0x3b, 0x21, 0xe3, 0xd4, 0x26, 0x24, 0xc5, 0x64, 0x53, 0x6c,
|
||||
0x07, 0xc9, 0xbb, 0x0a, 0x4d, 0xa5, 0xaa, 0xaa, 0x54, 0x79, 0x81, 0xb8, 0xa8, 0x4d, 0x88, 0x06,
|
||||
0x57, 0x51, 0xaa, 0x4a, 0x68, 0x81, 0x09, 0xac, 0x62, 0x76, 0xf0, 0xce, 0x60, 0x2d, 0x72, 0xac,
|
||||
0x4a, 0x7d, 0xec, 0x53, 0xd5, 0x3e, 0xf4, 0x23, 0xfa, 0x23, 0x7d, 0xb4, 0xd4, 0x97, 0x3e, 0x56,
|
||||
0x76, 0x3f, 0xa0, 0x9f, 0x50, 0xed, 0xec, 0x00, 0x0b, 0x5e, 0xe2, 0xd4, 0xea, 0x8b, 0x3d, 0xc3,
|
||||
0x9c, 0x7b, 0xef, 0x99, 0x33, 0x73, 0xee, 0x2c, 0x6c, 0xb6, 0x28, 0xeb, 0x51, 0x66, 0x70, 0xcf,
|
||||
0x38, 0x7e, 0xdc, 0x24, 0xdc, 0x7a, 0x6c, 0x30, 0xe2, 0x1e, 0xdb, 0x2d, 0xa2, 0xf7, 0x5d, 0xca,
|
||||
0x29, 0xba, 0x1d, 0x00, 0x74, 0xee, 0xe9, 0x12, 0x90, 0xb9, 0xdf, 0xa1, 0xb4, 0x73, 0x48, 0x0c,
|
||||
0xab, 0x6f, 0x1b, 0x96, 0xe3, 0x50, 0x6e, 0x71, 0x9b, 0x3a, 0x2c, 0x08, 0xc8, 0x3c, 0x94, 0x19,
|
||||
0x9b, 0x16, 0x23, 0x86, 0xd5, 0x6c, 0xd9, 0xe3, 0xc4, 0xfe, 0x44, 0x82, 0x32, 0x97, 0xcb, 0x72,
|
||||
0x4f, 0xae, 0x15, 0xc2, 0x09, 0x8e, 0x06, 0xc4, 0x1d, 0x8e, 0x31, 0x7d, 0xab, 0x63, 0x3b, 0xa2,
|
||||
0x9a, 0xc4, 0xde, 0xe7, 0xc4, 0x69, 0x13, 0xb7, 0x67, 0x3b, 0xdc, 0xe0, 0xc3, 0x3e, 0x61, 0x46,
|
||||
0xf3, 0x90, 0xb6, 0xde, 0xcc, 0x5d, 0x15, 0x7f, 0x83, 0x55, 0xed, 0x37, 0x05, 0xd0, 0x3e, 0xe1,
|
||||
0x07, 0x1e, 0xab, 0x1c, 0x13, 0x87, 0x63, 0x72, 0x34, 0x20, 0x8c, 0xa3, 0x75, 0x58, 0x26, 0xfe,
|
||||
0x9c, 0xa5, 0x95, 0x5c, 0x6c, 0xe7, 0x06, 0x96, 0x33, 0xf4, 0x14, 0x60, 0x52, 0x3e, 0xad, 0xe6,
|
||||
0x94, 0x9d, 0x64, 0x71, 0x4b, 0x97, 0xea, 0xf8, 0x5c, 0x75, 0xc1, 0x75, 0xa4, 0x92, 0xfe, 0xc2,
|
||||
0xea, 0x10, 0x99, 0x13, 0x87, 0x22, 0xd1, 0x27, 0x90, 0xa0, 0x6e, 0x9b, 0xb8, 0x8d, 0xe6, 0x30,
|
||||
0x1d, 0xcb, 0x29, 0x3b, 0x37, 0x8b, 0x19, 0xfd, 0x92, 0xc6, 0x7a, 0xcd, 0x87, 0x98, 0x43, 0x1c,
|
||||
0xa7, 0xc1, 0x40, 0x3b, 0x53, 0x60, 0x6d, 0x8a, 0x2d, 0xeb, 0x53, 0x87, 0x11, 0xb4, 0x0d, 0x31,
|
||||
0xee, 0x05, 0x5c, 0x93, 0xc5, 0x0f, 0x22, 0x32, 0x1d, 0x78, 0xd8, 0x47, 0xa0, 0x7d, 0x58, 0xe1,
|
||||
0x5e, 0xc3, 0x95, 0x71, 0x2c, 0xad, 0x8a, 0x88, 0x8f, 0xa6, 0x76, 0x20, 0x4e, 0x28, 0x14, 0x28,
|
||||
0xc1, 0x38, 0xc9, 0xc7, 0x63, 0x3f, 0x51, 0x58, 0x88, 0x98, 0x10, 0x62, 0xfb, 0x4a, 0x21, 0x64,
|
||||
0xa6, 0x50, 0xa8, 0x46, 0x00, 0x99, 0x2e, 0xb5, 0xda, 0x2d, 0x8b, 0x71, 0xbf, 0x58, 0xa0, 0xff,
|
||||
0x5d, 0x48, 0x70, 0xaf, 0xd1, 0x1c, 0x72, 0xe2, 0xef, 0x4a, 0xd9, 0x59, 0xc1, 0x71, 0xee, 0x99,
|
||||
0xfe, 0x14, 0x3d, 0x81, 0xc5, 0x1e, 0x6d, 0x13, 0x21, 0xfe, 0xcd, 0x62, 0x2e, 0x62, 0xb3, 0xe3,
|
||||
0x7c, 0xcf, 0x68, 0x9b, 0x60, 0x81, 0xd6, 0xbe, 0x83, 0xb5, 0xa9, 0x32, 0x52, 0xb8, 0x0a, 0x24,
|
||||
0x43, 0x7a, 0x88, 0x52, 0xef, 0x2b, 0x07, 0x4c, 0xe4, 0xd0, 0x5e, 0xc2, 0xad, 0xba, 0xdd, 0x1b,
|
||||
0x1c, 0x5a, 0x7c, 0x74, 0xda, 0xe8, 0x11, 0xa8, 0xdc, 0x93, 0x09, 0xa3, 0x4f, 0xc4, 0x54, 0xd3,
|
||||
0x0a, 0x56, 0xb9, 0x37, 0xb5, 0x59, 0x75, 0x6a, 0xb3, 0xda, 0x8f, 0x0a, 0xa4, 0x26, 0x99, 0x25,
|
||||
0xe9, 0xcf, 0x21, 0xd1, 0xb1, 0x58, 0xc3, 0x76, 0x5e, 0x53, 0x59, 0xe0, 0xc1, 0x7c, 0xc6, 0xfb,
|
||||
0x16, 0xab, 0x3a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x9f, 0x23, 0x09, 0x44, 0x3c, 0x8c, 0x5a, 0x56, 0x10, 0x48, 0xa3, 0x39, 0x04, 0xd0, 0xaf, 0x0a,
|
||||
0xdc, 0x9a, 0x71, 0x2d, 0x7a, 0x14, 0x9d, 0x3b, 0xa2, 0xa9, 0x64, 0x0a, 0xef, 0x03, 0x95, 0x54,
|
||||
0x76, 0x05, 0x95, 0x6d, 0x94, 0x9f, 0x73, 0x20, 0xc2, 0x9c, 0xc6, 0x49, 0xd0, 0x96, 0x4e, 0xcd,
|
||||
0x2f, 0x7e, 0x3f, 0xcf, 0x2a, 0x67, 0xe7, 0x59, 0xe5, 0xaf, 0xf3, 0xac, 0xf2, 0xd3, 0x45, 0x76,
|
||||
0xe1, 0xec, 0x22, 0xbb, 0xf0, 0xe7, 0x45, 0x76, 0xe1, 0xdb, 0x7c, 0xc7, 0xe6, 0xdd, 0x41, 0x53,
|
||||
0x6f, 0xd1, 0xde, 0x28, 0x55, 0xf0, 0x6f, 0x97, 0xb5, 0xdf, 0x8c, 0x3e, 0x71, 0xbc, 0xe6, 0xb2,
|
||||
0xf8, 0xc0, 0xf9, 0xf8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x11, 0xc0, 0x8c, 0xdd, 0x09,
|
||||
0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -641,6 +780,10 @@ type ServiceClient interface {
|
|||
BroadcastTx(ctx context.Context, in *BroadcastTxRequest, opts ...grpc.CallOption) (*BroadcastTxResponse, error)
|
||||
// GetTxsEvent fetches txs by event.
|
||||
GetTxsEvent(ctx context.Context, in *GetTxsEventRequest, opts ...grpc.CallOption) (*GetTxsEventResponse, error)
|
||||
// GetBlockWithTxs fetches a block with decoded txs.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxsRequest, opts ...grpc.CallOption) (*GetBlockWithTxsResponse, error)
|
||||
}
|
||||
|
||||
type serviceClient struct {
|
||||
|
@ -687,6 +830,15 @@ func (c *serviceClient) GetTxsEvent(ctx context.Context, in *GetTxsEventRequest,
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxsRequest, opts ...grpc.CallOption) (*GetBlockWithTxsResponse, error) {
|
||||
out := new(GetBlockWithTxsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.tx.v1beta1.Service/GetBlockWithTxs", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServer is the server API for Service service.
|
||||
type ServiceServer interface {
|
||||
// Simulate simulates executing a transaction for estimating gas usage.
|
||||
|
@ -697,6 +849,10 @@ type ServiceServer interface {
|
|||
BroadcastTx(context.Context, *BroadcastTxRequest) (*BroadcastTxResponse, error)
|
||||
// GetTxsEvent fetches txs by event.
|
||||
GetTxsEvent(context.Context, *GetTxsEventRequest) (*GetTxsEventResponse, error)
|
||||
// GetBlockWithTxs fetches a block with decoded txs.
|
||||
//
|
||||
// Since: cosmos-sdk 0.45.2
|
||||
GetBlockWithTxs(context.Context, *GetBlockWithTxsRequest) (*GetBlockWithTxsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedServiceServer can be embedded to have forward compatible implementations.
|
||||
|
@ -715,6 +871,9 @@ func (*UnimplementedServiceServer) BroadcastTx(ctx context.Context, req *Broadca
|
|||
func (*UnimplementedServiceServer) GetTxsEvent(ctx context.Context, req *GetTxsEventRequest) (*GetTxsEventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTxsEvent not implemented")
|
||||
}
|
||||
func (*UnimplementedServiceServer) GetBlockWithTxs(ctx context.Context, req *GetBlockWithTxsRequest) (*GetBlockWithTxsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBlockWithTxs not implemented")
|
||||
}
|
||||
|
||||
func RegisterServiceServer(s grpc1.Server, srv ServiceServer) {
|
||||
s.RegisterService(&_Service_serviceDesc, srv)
|
||||
|
@ -792,6 +951,24 @@ func _Service_GetTxsEvent_Handler(srv interface{}, ctx context.Context, dec func
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_GetBlockWithTxs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBlockWithTxsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).GetBlockWithTxs(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.tx.v1beta1.Service/GetBlockWithTxs",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).GetBlockWithTxs(ctx, req.(*GetBlockWithTxsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Service_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cosmos.tx.v1beta1.Service",
|
||||
HandlerType: (*ServiceServer)(nil),
|
||||
|
@ -812,6 +989,10 @@ var _Service_serviceDesc = grpc.ServiceDesc{
|
|||
MethodName: "GetTxsEvent",
|
||||
Handler: _Service_GetTxsEvent_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBlockWithTxs",
|
||||
Handler: _Service_GetBlockWithTxs_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/tx/v1beta1/service.proto",
|
||||
|
@ -1165,6 +1346,119 @@ func (m *GetTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsRequest) 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 *GetBlockWithTxsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Pagination != nil {
|
||||
{
|
||||
size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintService(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Height != 0 {
|
||||
i = encodeVarintService(dAtA, i, uint64(m.Height))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) 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 *GetBlockWithTxsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Pagination != nil {
|
||||
{
|
||||
size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintService(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.Block != nil {
|
||||
{
|
||||
size, err := m.Block.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintService(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if m.BlockId != nil {
|
||||
{
|
||||
size, err := m.BlockId.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintService(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Txs) > 0 {
|
||||
for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Txs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintService(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintService(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovService(v)
|
||||
base := offset
|
||||
|
@ -1316,6 +1610,49 @@ func (m *GetTxResponse) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Height != 0 {
|
||||
n += 1 + sovService(uint64(m.Height))
|
||||
}
|
||||
if m.Pagination != nil {
|
||||
l = m.Pagination.Size()
|
||||
n += 1 + l + sovService(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *GetBlockWithTxsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Txs) > 0 {
|
||||
for _, e := range m.Txs {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovService(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.BlockId != nil {
|
||||
l = m.BlockId.Size()
|
||||
n += 1 + l + sovService(uint64(l))
|
||||
}
|
||||
if m.Block != nil {
|
||||
l = m.Block.Size()
|
||||
n += 1 + l + sovService(uint64(l))
|
||||
}
|
||||
if m.Pagination != nil {
|
||||
l = m.Pagination.Size()
|
||||
n += 1 + l + sovService(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovService(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
@ -2248,6 +2585,303 @@ func (m *GetTxResponse) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *GetBlockWithTxsRequest) 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 ErrIntOverflowService
|
||||
}
|
||||
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: GetBlockWithTxsRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: GetBlockWithTxsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
|
||||
}
|
||||
m.Height = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Height |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Pagination == nil {
|
||||
m.Pagination = &query.PageRequest{}
|
||||
}
|
||||
if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipService(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *GetBlockWithTxsResponse) 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 ErrIntOverflowService
|
||||
}
|
||||
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: GetBlockWithTxsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: GetBlockWithTxsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Txs = append(m.Txs, &Tx{})
|
||||
if err := m.Txs[len(m.Txs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BlockId", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.BlockId == nil {
|
||||
m.BlockId = &types1.BlockID{}
|
||||
}
|
||||
if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Block == nil {
|
||||
m.Block = &types1.Block{}
|
||||
}
|
||||
if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowService
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Pagination == nil {
|
||||
m.Pagination = &query.PageResponse{}
|
||||
}
|
||||
if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipService(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthService
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipService(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
|
|
@ -189,6 +189,78 @@ func local_request_Service_GetTxsEvent_0(ctx context.Context, marshaler runtime.
|
|||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Service_GetBlockWithTxs_0 = &utilities.DoubleArray{Encoding: map[string]int{"height": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_Service_GetBlockWithTxs_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetBlockWithTxsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["height"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height")
|
||||
}
|
||||
|
||||
protoReq.Height, err = runtime.Int64(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetBlockWithTxs_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetBlockWithTxs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Service_GetBlockWithTxs_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetBlockWithTxsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["height"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height")
|
||||
}
|
||||
|
||||
protoReq.Height, err = runtime.Int64(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetBlockWithTxs_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetBlockWithTxs(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterServiceHandlerServer registers the http handlers for service Service to "mux".
|
||||
// UnaryRPC :call ServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
@ -275,6 +347,26 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Service_GetBlockWithTxs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Service_GetBlockWithTxs_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Service_GetBlockWithTxs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -396,6 +488,26 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Service_GetBlockWithTxs_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_Service_GetBlockWithTxs_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Service_GetBlockWithTxs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -407,6 +519,8 @@ var (
|
|||
pattern_Service_BroadcastTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "tx", "v1beta1", "txs"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Service_GetTxsEvent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "tx", "v1beta1", "txs"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Service_GetBlockWithTxs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "tx", "v1beta1", "txs", "block", "height"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -417,4 +531,6 @@ var (
|
|||
forward_Service_BroadcastTx_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Service_GetTxsEvent_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Service_GetBlockWithTxs_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
|
|
@ -3,6 +3,8 @@ package tx
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"strings"
|
||||
|
||||
gogogrpc "github.com/gogo/protobuf/grpc"
|
||||
|
@ -157,6 +159,85 @@ func (s txServer) GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtype
|
|||
}, nil
|
||||
}
|
||||
|
||||
// protoTxProvider is a type which can provide a proto transaction. It is a
|
||||
// workaround to get access to the wrapper TxBuilder's method GetProtoTx().
|
||||
// ref: https://github.com/cosmos/cosmos-sdk/issues/10347
|
||||
type protoTxProvider interface {
|
||||
GetProtoTx() *txtypes.Tx
|
||||
}
|
||||
|
||||
// GetBlockWithTxs returns a block with decoded txs.
|
||||
func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWithTxsRequest) (*txtypes.GetBlockWithTxsResponse, error) {
|
||||
if req == nil {
|
||||
return nil, status.Error(codes.InvalidArgument, "request cannot be nil")
|
||||
}
|
||||
|
||||
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||
currentHeight := sdkCtx.BlockHeight()
|
||||
|
||||
if req.Height < 1 || req.Height > currentHeight {
|
||||
return nil, sdkerrors.ErrInvalidHeight.Wrapf("requested height %d but height must not be less than 1 "+
|
||||
"or greater than the current height %d", req.Height, currentHeight)
|
||||
}
|
||||
|
||||
blockId, block, err := tmservice.GetProtoBlock(ctx, s.clientCtx, &req.Height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var offset, limit uint64
|
||||
if req.Pagination != nil {
|
||||
offset = req.Pagination.Offset
|
||||
limit = req.Pagination.Limit
|
||||
} else {
|
||||
offset = 0
|
||||
limit = pagination.DefaultLimit
|
||||
}
|
||||
|
||||
blockTxs := block.Data.Txs
|
||||
blockTxsLn := uint64(len(blockTxs))
|
||||
txs := make([]*txtypes.Tx, 0, limit)
|
||||
if offset >= blockTxsLn {
|
||||
return nil, sdkerrors.ErrInvalidRequest.Wrapf("out of range: cannot paginate %d txs with offset %d and limit %d", blockTxsLn, offset, limit)
|
||||
}
|
||||
decodeTxAt := func(i uint64) error {
|
||||
tx := blockTxs[i]
|
||||
txb, err := s.clientCtx.TxConfig.TxDecoder()(tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p, ok := txb.(protoTxProvider)
|
||||
if !ok {
|
||||
return sdkerrors.ErrTxDecode.Wrapf("could not cast %T to %T", txb, txtypes.Tx{})
|
||||
}
|
||||
txs = append(txs, p.GetProtoTx())
|
||||
return nil
|
||||
}
|
||||
if req.Pagination != nil && req.Pagination.Reverse {
|
||||
for i, count := offset, uint64(0); i > 0 && count != limit; i, count = i-1, count+1 {
|
||||
if err = decodeTxAt(i); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for i, count := offset, uint64(0); i < blockTxsLn && count != limit; i, count = i+1, count+1 {
|
||||
if err = decodeTxAt(i); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &txtypes.GetBlockWithTxsResponse{
|
||||
Txs: txs,
|
||||
BlockId: &blockId,
|
||||
Block: block,
|
||||
Pagination: &pagination.PageResponse{
|
||||
Total: blockTxsLn,
|
||||
},
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func (s txServer) BroadcastTx(ctx context.Context, req *txtypes.BroadcastTxRequest) (*txtypes.BroadcastTxResponse, error) {
|
||||
return client.TxServiceBroadcast(ctx, s.clientCtx, req)
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ type IntegrationTestSuite struct {
|
|||
cfg network.Config
|
||||
network *network.Network
|
||||
|
||||
txHeight int64
|
||||
queryClient tx.ServiceClient
|
||||
txRes sdk.TxResponse
|
||||
}
|
||||
|
@ -80,7 +81,29 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
|||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &s.txRes))
|
||||
s.Require().Equal(uint32(0), s.txRes.Code)
|
||||
|
||||
out, err = bankcli.MsgSendExec(
|
||||
val.ClientCtx,
|
||||
val.Address,
|
||||
val.Address,
|
||||
sdk.NewCoins(
|
||||
sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)),
|
||||
),
|
||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||
fmt.Sprintf("--%s=2", flags.FlagSequence),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
|
||||
fmt.Sprintf("--gas=%d", flags.DefaultGasLimit),
|
||||
fmt.Sprintf("--%s=foobar", flags.FlagNote),
|
||||
)
|
||||
s.Require().NoError(err)
|
||||
var tr sdk.TxResponse
|
||||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &tr))
|
||||
s.Require().Equal(uint32(0), tr.Code)
|
||||
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
height, err := s.network.LatestHeight()
|
||||
s.Require().NoError(err)
|
||||
s.txHeight = height
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TearDownSuite() {
|
||||
|
@ -588,6 +611,81 @@ func (s *IntegrationTestSuite) TestSimMultiSigTx() {
|
|||
s.Require().Greater(res.GasInfo.GasUsed, uint64(0))
|
||||
}
|
||||
|
||||
func (s IntegrationTestSuite) TestGetBlockWithTxs_GRPC() {
|
||||
testCases := []struct {
|
||||
name string
|
||||
req *tx.GetBlockWithTxsRequest
|
||||
expErr bool
|
||||
expErrMsg string
|
||||
}{
|
||||
{"nil request", nil, true, "request cannot be nil"},
|
||||
{"empty request", &tx.GetBlockWithTxsRequest{}, true, "height must not be less than 1 or greater than the current height"},
|
||||
{"bad height", &tx.GetBlockWithTxsRequest{Height: 99999999}, true, "height must not be less than 1 or greater than the current height"},
|
||||
{"bad pagination", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 1000, Limit: 100}}, true, "out of range"},
|
||||
{"good request", &tx.GetBlockWithTxsRequest{Height: s.txHeight}, false, ""},
|
||||
{"with pagination request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 1}}, false, ""},
|
||||
{"page all request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 100}}, false, ""},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
s.Run(tc.name, func() {
|
||||
// Query the tx via gRPC.
|
||||
grpcRes, err := s.queryClient.GetBlockWithTxs(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
s.Require().Error(err)
|
||||
s.Require().Contains(err.Error(), tc.expErrMsg)
|
||||
} else {
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal("foobar", grpcRes.Txs[0].Body.Memo)
|
||||
s.Require().Equal(grpcRes.Block.Header.Height, tc.req.Height)
|
||||
if tc.req.Pagination != nil {
|
||||
s.Require().LessOrEqual(len(grpcRes.Txs), int(tc.req.Pagination.Limit))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s IntegrationTestSuite) TestGetBlockWithTxs_GRPCGateway() {
|
||||
val := s.network.Validators[0]
|
||||
testCases := []struct {
|
||||
name string
|
||||
url string
|
||||
expErr bool
|
||||
expErrMsg string
|
||||
}{
|
||||
{
|
||||
"empty params",
|
||||
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/0", val.APIAddress),
|
||||
true, "height must not be less than 1 or greater than the current height",
|
||||
},
|
||||
{
|
||||
"bad height",
|
||||
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/%d", val.APIAddress, 9999999),
|
||||
true, "height must not be less than 1 or greater than the current height",
|
||||
},
|
||||
{
|
||||
"good request",
|
||||
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/%d", val.APIAddress, s.txHeight),
|
||||
false, "",
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
s.Run(tc.name, func() {
|
||||
res, err := rest.GetRequest(tc.url)
|
||||
s.Require().NoError(err)
|
||||
if tc.expErr {
|
||||
s.Require().Contains(string(res), tc.expErrMsg)
|
||||
} else {
|
||||
var result tx.GetBlockWithTxsResponse
|
||||
err = val.ClientCtx.Codec.UnmarshalJSON(res, &result)
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal("foobar", result.Txs[0].Body.Memo)
|
||||
s.Require().Equal(result.Block.Header.Height, s.txHeight)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(IntegrationTestSuite))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue