diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f05697049af..84f0a5aa9d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,10 +41,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). * (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BankKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. This function is not on the bank `Keeper` interface, so it's not API-breaking, but only additive on the keeper implementation. - -### Features - * [\#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store +* (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 diff --git a/client/grpc/tmservice/block.go b/client/grpc/tmservice/block.go index 554156982dda..8663195f53c9 100644 --- a/client/grpc/tmservice/block.go +++ b/client/grpc/tmservice/block.go @@ -3,6 +3,7 @@ package tmservice import ( "context" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" @@ -17,3 +18,17 @@ func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*ct 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 +} diff --git a/client/grpc/tmservice/service.go b/client/grpc/tmservice/service.go index cd6e7e5313ef..47a2003bb565 100644 --- a/client/grpc/tmservice/service.go +++ b/client/grpc/tmservice/service.go @@ -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 } diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 7d876f4e91c0..0f50a88cf232 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -541,6 +541,8 @@ - [cosmos/tx/v1beta1/service.proto](#cosmos/tx/v1beta1/service.proto) - [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) - [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) + - [GetBlockWithTxsRequest](#cosmos.tx.v1beta1.GetBlockWithTxsRequest) + - [GetBlockWithTxsResponse](#cosmos.tx.v1beta1.GetBlockWithTxsResponse) - [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) - [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) - [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) @@ -1268,6 +1270,9 @@ tags are stringified and the log is JSON decoded. | `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | | `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | | `timestamp` | [string](#string) | | Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time. | +| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those emitted from the ante handler. Whereas Logs contains the events, with additional metadata, emitted only by processing the messages. + +Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 | @@ -7706,6 +7711,45 @@ Service.BroadcastTx method. + + +### GetBlockWithTxsRequest +GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +RPC method. + +Since: cosmos-sdk 0.45.2 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | height is the height of the block to query. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines a pagination for the request. | + + + + + + + + +### GetBlockWithTxsResponse +GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + +Since: cosmos-sdk 0.45.2 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs are the transactions in the block. | +| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | +| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines a pagination for the response. | + + + + + + ### GetTxRequest @@ -7748,7 +7792,7 @@ RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `events` | [string](#string) | repeated | events is the list of transaction event type. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines a pagination for the request. | | `order_by` | [OrderBy](#cosmos.tx.v1beta1.OrderBy) | | | @@ -7767,7 +7811,7 @@ RPC method. | ----- | ---- | ----- | ----------- | | `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs is the list of queried transactions. | | `tx_responses` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | tx_responses is the list of queried TxResponses. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines a pagination for the response. | @@ -7854,6 +7898,9 @@ Service defines a gRPC service for interacting with transactions. | `GetTx` | [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) | [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) | GetTx fetches a tx by hash. | GET|/cosmos/tx/v1beta1/txs/{hash}| | `BroadcastTx` | [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) | [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) | BroadcastTx broadcast transaction. | POST|/cosmos/tx/v1beta1/txs| | `GetTxsEvent` | [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) | [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) | GetTxsEvent fetches txs by event. | GET|/cosmos/tx/v1beta1/txs| +| `GetBlockWithTxs` | [GetBlockWithTxsRequest](#cosmos.tx.v1beta1.GetBlockWithTxsRequest) | [GetBlockWithTxsResponse](#cosmos.tx.v1beta1.GetBlockWithTxsResponse) | GetBlockWithTxs fetches a block with decoded txs. + +Since: cosmos-sdk 0.45.2 | GET|/cosmos/tx/v1beta1/txs/block/{height}| diff --git a/go.mod b/go.mod index ebd153d70461..d60fe557b397 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,8 @@ require ( github.com/coinbase/rosetta-sdk-go v0.7.0 github.com/confio/ics23/go v0.6.6 github.com/cosmos/btcutil v1.0.4 + github.com/cosmos/cosmos-proto v1.0.0-alpha7 + github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/iavl v0.17.3 github.com/cosmos/ledger-cosmos-go v0.11.1 @@ -49,8 +51,8 @@ require ( github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 - google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 - google.golang.org/grpc v1.42.0 + google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb + google.golang.org/grpc v1.44.0 google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index f59199018105..70b5936eea11 100644 --- a/go.sum +++ b/go.sum @@ -175,6 +175,10 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= +github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= +github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4 h1:z2si9sQNUTj2jw+24SujuUxcoNS3TVga/fdYsS4rJII= +github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4/go.mod h1:gZu6sOu2vl4Fd7I+BjDSx2bxndwPgFLGfOegek3SQQo= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -347,8 +351,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= @@ -1143,7 +1148,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1226,8 +1230,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1289,6 +1293,7 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index acfbf15b3689..7a014f4b9f7d 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -6,6 +6,8 @@ import "cosmos/base/abci/v1beta1/abci.proto"; import "cosmos/tx/v1beta1/tx.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; option (gogoproto.goproto_registration) = true; option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; @@ -34,6 +36,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 @@ -41,7 +49,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; } @@ -63,7 +71,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; } @@ -131,4 +139,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; } \ No newline at end of file diff --git a/types/tx/service.pb.go b/types/tx/service.pb.go index 13c068cae088..f951d37e279f 100644 --- a/types/tx/service.pb.go +++ b/types/tx/service.pb.go @@ -12,6 +12,7 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/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" @@ -109,7 +110,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"` } @@ -175,7 +176,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"` } @@ -553,6 +554,137 @@ func (m *GetTxResponse) GetTxResponse() *types.TxResponse { return nil } +// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +// RPC method. +// +// Since: cosmos-sdk 0.45.2 +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. +// +// Since: cosmos-sdk 0.45.2 +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) golang_proto.RegisterEnum("cosmos.tx.v1beta1.OrderBy", OrderBy_name, OrderBy_value) @@ -574,6 +706,10 @@ func init() { golang_proto.RegisterType((*GetTxRequest)(nil), "cosmos.tx.v1beta1.GetTxRequest") proto.RegisterType((*GetTxResponse)(nil), "cosmos.tx.v1beta1.GetTxResponse") golang_proto.RegisterType((*GetTxResponse)(nil), "cosmos.tx.v1beta1.GetTxResponse") + proto.RegisterType((*GetBlockWithTxsRequest)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsRequest") + golang_proto.RegisterType((*GetBlockWithTxsRequest)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsRequest") + proto.RegisterType((*GetBlockWithTxsResponse)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsResponse") + golang_proto.RegisterType((*GetBlockWithTxsResponse)(nil), "cosmos.tx.v1beta1.GetBlockWithTxsResponse") } func init() { proto.RegisterFile("cosmos/tx/v1beta1/service.proto", fileDescriptor_e0b00a618705eca7) } @@ -582,59 +718,68 @@ func init() { } var fileDescriptor_e0b00a618705eca7 = []byte{ - // 831 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0x5e, 0x3b, 0x65, 0x93, 0xbe, 0x64, 0x4b, 0x3a, 0xbb, 0x14, 0x93, 0x82, 0x37, 0x75, 0xc9, - 0x36, 0x44, 0xc2, 0x56, 0x03, 0x48, 0x08, 0x71, 0x89, 0x93, 0x74, 0x59, 0x41, 0x9b, 0x6a, 0xb2, - 0x08, 0x15, 0x21, 0x45, 0x4e, 0x32, 0xf5, 0x5a, 0x6c, 0x3c, 0x59, 0xcf, 0x64, 0xe5, 0xa8, 0xad, - 0x90, 0x38, 0x72, 0x42, 0xe2, 0x67, 0xf0, 0x27, 0x38, 0x72, 0x5c, 0x89, 0x0b, 0x47, 0xb4, 0xe1, - 0x47, 0x70, 0x44, 0x1e, 0x4f, 0x12, 0x27, 0xeb, 0x74, 0x11, 0xa7, 0xbc, 0xc9, 0x7c, 0xef, 0x7b, - 0xdf, 0xfb, 0xe6, 0xcd, 0x18, 0xf6, 0x07, 0x94, 0x8d, 0x28, 0xb3, 0x78, 0x68, 0x9d, 0x3f, 0xec, - 0x13, 0xee, 0x3c, 0xb4, 0x18, 0x09, 0xce, 0xbd, 0x01, 0x31, 0xc7, 0x01, 0xe5, 0x14, 0xdd, 0x8e, - 0x01, 0x26, 0x0f, 0x4d, 0x09, 0x28, 0xbd, 0xeb, 0x52, 0xea, 0x9e, 0x12, 0xcb, 0x19, 0x7b, 0x96, - 0xe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 0xa9, 0xbc, 0x19, 0x20, 0x6b, 0x56, 0x44, 0xcd, 0x7d, 0xf4, 0x9e, 0x95, 0xf6, - 0xa4, 0x33, 0xeb, 0x45, 0x34, 0x41, 0xaf, 0xd0, 0x0f, 0x90, 0x4f, 0x5c, 0x55, 0x54, 0x79, 0xdd, - 0x0d, 0x5f, 0x96, 0x3f, 0xb8, 0x0e, 0x26, 0x45, 0xdc, 0x13, 0x22, 0xee, 0x1a, 0x77, 0xd2, 0x45, - 0x44, 0x3d, 0xbf, 0x84, 0x7c, 0xe2, 0x91, 0x4d, 0x15, 0x70, 0xf5, 0x93, 0x91, 0x2a, 0x20, 0xe5, - 0xad, 0x36, 0x74, 0x21, 0x40, 0x43, 0x1b, 0x04, 0xd8, 0xcd, 0xdf, 0x2f, 0x75, 0xe5, 0xe2, 0x52, - 0x57, 0xfe, 0xba, 0xd4, 0x95, 0x9f, 0x67, 0xfa, 0xd6, 0x6f, 0x33, 0x5d, 0xb9, 0x98, 0xe9, 0x5b, - 0x7f, 0xce, 0xf4, 0xad, 0x6f, 0x2b, 0xae, 0xc7, 0x4f, 0x26, 0x7d, 0x73, 0x40, 0x47, 0xf3, 0xfc, - 0xf8, 0xe7, 0x43, 0x36, 0xfc, 0xde, 0xe2, 0xd3, 0x31, 0x89, 0x08, 0xfb, 0xdb, 0xe2, 0xeb, 0xf6, - 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x86, 0xcd, 0x5c, 0xb4, 0x07, 0x00, 0x00, + // 976 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x1a, 0x47, + 0x14, 0xf7, 0x2e, 0xb6, 0x21, 0x0f, 0x3b, 0x21, 0x63, 0xd7, 0x26, 0x24, 0xc5, 0x64, 0x53, 0x6c, + 0x07, 0xc9, 0xbb, 0x0a, 0x4d, 0xa5, 0xaa, 0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52, 0x76, 0x57, 0x70, 0x9c, 0x7b, 0x25, 0x7f, 0x8a, 0x1e, 0xc3, 0x62, + 0x8f, 0x76, 0x88, 0x10, 0xff, 0x66, 0x31, 0x17, 0xb1, 0xd9, 0x71, 0xbe, 0xa7, 0xb4, 0x43, 0xb0, + 0x40, 0x6b, 0xdf, 0xc2, 0xda, 0x54, 0x19, 0x29, 0x5c, 0x15, 0x92, 0x21, 0x3d, 0x44, 0xa9, 0x77, + 0x95, 0x03, 0x26, 0x72, 0x68, 0x2f, 0xe0, 0x56, 0xc3, 0xee, 0x0d, 0x8e, 0x4c, 0x3e, 0x3a, 0x6d, + 0xf4, 0x10, 0x54, 0xee, 0xc9, 0x84, 0xd1, 0x27, 0x52, 0x52, 0xd3, 0x0a, 0x56, 0xb9, 0x37, 0xb5, + 0x59, 0x75, 0x6a, 0xb3, 0xda, 0x0f, 0x0a, 0xa4, 0x26, 0x99, 0x25, 0xe9, 0xcf, 0x21, 0x61, 0x99, + 0xac, 0x69, 0x3b, 0xaf, 0xa8, 0x2c, 0x70, 0x7f, 0x3e, 0xe3, 0x03, 0x93, 0xd5, 0x9c, 0x57, 0x14, + 0xc7, 0xad, 0x60, 0x80, 0x3e, 0x85, 0x65, 0x97, 0xb0, 0xc1, 0x11, 0x97, 0xaf, 0x6f, 0x6e, 0x7e, + 0x2c, 0x16, 0x38, 0x2c, 0xf1, 0x9a, 0x06, 0x2b, 0xe2, 0xe5, 0x1b, 0x6d, 0x11, 0xc1, 0x62, 0xd7, + 0x64, 0x5d, 0xc1, 0xe1, 0x06, 0x16, 0x63, 0xed, 0x0c, 0x56, 0x25, 0x46, 0x92, 0xcd, 0x5f, 0xab, + 0x83, 0xd0, 0x60, 0xe6, 0x20, 0xd4, 0xf7, 0x3c, 0x08, 0x0f, 0x36, 0x0e, 0x08, 0x2f, 0xf9, 0xf6, + 0x7f, 0x61, 0xf3, 0xee, 0xa1, 0xc7, 0x42, 0x8e, 0xee, 0x12, 0xdb, 0xea, 0x72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7, 0xa3, 0xcf, 0x1c, 0xaf, 0xb5, 0x2c, 0x3e, + 0x72, 0x3e, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xaa, 0xba, 0x0d, 0xf7, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -657,6 +802,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 { @@ -703,6 +852,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. @@ -713,6 +871,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. @@ -731,6 +893,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) @@ -808,6 +973,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), @@ -828,6 +1011,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", @@ -1181,6 +1368,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 @@ -1332,6 +1632,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 } @@ -2264,6 +2607,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 diff --git a/types/tx/service.pb.gw.go b/types/tx/service.pb.gw.go index 25560e1cdfb2..80a1adf16775 100644 --- a/types/tx/service.pb.gw.go +++ b/types/tx/service.pb.gw.go @@ -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 ) diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 00f123c57112..293542f4d383 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -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) } diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index fd03df3411a7..e4b2567deb06 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -40,6 +40,7 @@ type IntegrationTestSuite struct { cfg network.Config network *network.Network + txHeight int64 queryClient tx.ServiceClient txRes sdk.TxResponse } @@ -79,7 +80,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() { @@ -565,6 +588,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)) } diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 2b9432192388..0b9ebea6cb6d 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -705,59 +705,59 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 825 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xd3, 0x58, - 0x14, 0xcd, 0xeb, 0x4c, 0xd3, 0xf4, 0x46, 0x33, 0x8b, 0xd7, 0x8c, 0x26, 0x75, 0xa7, 0xc9, 0xc8, - 0x9d, 0x69, 0xd3, 0x92, 0xda, 0x4d, 0x8b, 0x54, 0xc1, 0x06, 0x35, 0x45, 0xb0, 0x40, 0xa8, 0x21, - 0xb0, 0x42, 0x42, 0xe8, 0x25, 0x31, 0x26, 0x6a, 0xe2, 0xe7, 0xe6, 0x39, 0x88, 0xaa, 0xaa, 0x84, - 0x90, 0x90, 0x58, 0x01, 0x12, 0x0b, 0x16, 0x6c, 0xca, 0x06, 0x09, 0x96, 0xfc, 0x8a, 0x2e, 0x58, - 0x54, 0x62, 0xc3, 0x0a, 0x50, 0xcb, 0x82, 0x9f, 0x81, 0xf2, 0x3e, 0x5c, 0x27, 0x71, 0x13, 0x2f, - 0xc2, 0x2a, 0xf6, 0xf5, 0xfd, 0x38, 0xe7, 0x3c, 0xdf, 0xe3, 0x40, 0xb6, 0x4a, 0x59, 0x93, 0x32, - 0xb3, 0x42, 0x9c, 0x6d, 0xf3, 0x41, 0xa1, 0x62, 0x79, 0xa4, 0x60, 0xee, 0xb4, 0xad, 0xd6, 0xae, - 0xe1, 0xb6, 0xa8, 0x47, 0xf1, 0x94, 0x48, 0x30, 0x3a, 0x09, 0x86, 0x4c, 0xd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 0xfe, 0xc7, - 0x73, 0x03, 0x80, 0xf8, 0x07, 0xf8, 0x08, 0x41, 0x5c, 0x38, 0x04, 0x5e, 0x38, 0x7b, 0x46, 0x97, - 0x1d, 0x69, 0xb9, 0xe1, 0x89, 0x91, 0x34, 0x11, 0x5e, 0x84, 0xdf, 0x22, 0xf8, 0xa3, 0x6b, 0x85, - 0xb0, 0x71, 0xf6, 0x80, 0xb0, 0xf5, 0xd4, 0xcc, 0xc8, 0xf9, 0x12, 0xd7, 0x79, 0x8e, 0xcb, 0xc0, - 0xf9, 0x50, 0x5c, 0x5c, 0x1a, 0x76, 0x57, 0x2d, 0xa2, 0xaf, 0xd5, 0x1b, 0x04, 0x7f, 0x76, 0x3b, - 0x19, 0x1e, 0x36, 0xb9, 0xd7, 0x5a, 0xb5, 0x95, 0xe8, 0x05, 0x12, 0x6b, 0x9e, 0x63, 0x9d, 0xc7, - 0xff, 0x45, 0xc1, 0x5a, 0xdc, 0x3c, 0x3c, 0xce, 0xa0, 0xa3, 0xe3, 0x0c, 0xfa, 0x76, 0x9c, 0x41, - 0x2f, 0x4e, 0x32, 0xb1, 0xa3, 0x93, 0x4c, 0xec, 0xf3, 0x49, 0x26, 0x76, 0x7b, 0x71, 0xe0, 0x57, - 0xf5, 0xa1, 0x68, 0xcb, 0x3f, 0xae, 0x95, 0x38, 0xff, 0xe7, 0xb8, 0xf6, 0x33, 0x00, 0x00, 0xff, - 0xff, 0xa0, 0xfe, 0xe2, 0x92, 0x11, 0x0b, 0x00, 0x00, + // 829 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6b, 0x13, 0x5b, + 0x18, 0xce, 0xe9, 0xbd, 0x4d, 0xd3, 0x37, 0xdc, 0xbb, 0x38, 0xcd, 0xe5, 0xa6, 0xd3, 0xdb, 0xe4, + 0x32, 0xd5, 0x36, 0xad, 0xe9, 0x4c, 0x9b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 0x04, 0xda, 0x1d, 0x28, 0xed, 0xba, 0xa6, 0x49, 0xed, 0xca, 0x10, + 0x65, 0x3c, 0xf2, 0x3b, 0x94, 0x93, 0xad, 0x47, 0xa7, 0x5b, 0x56, 0xbe, 0xdb, 0x82, 0xc4, 0xe6, + 0x7d, 0x25, 0x5a, 0x67, 0x27, 0x90, 0x6f, 0x27, 0xf4, 0x02, 0xfc, 0xd3, 0x93, 0x2d, 0x49, 0x5f, + 0x80, 0x28, 0xa9, 0xd3, 0xa6, 0xe3, 0x0d, 0xdd, 0x84, 0xfc, 0x9f, 0x6d, 0xd2, 0x45, 0x99, 0xae, + 0x27, 0x00, 0xf3, 0x8e, 0x05, 0xd2, 0x20, 0x75, 0xb5, 0x08, 0x7a, 0x41, 0xae, 0xb0, 0x8a, 0xca, + 0x29, 0x97, 0x20, 0xea, 0xf2, 0x88, 0x9c, 0x32, 0x63, 0x04, 0xf8, 0x93, 0x21, 0x8a, 0xd4, 0x1c, + 0x51, 0xa0, 0x57, 0x40, 0xe3, 0x1d, 0xaf, 0xb6, 0x79, 0xb0, 0x9b, 0x96, 0x47, 0x2a, 0xc4, 0x23, + 0x23, 0x7e, 0x45, 0xf4, 0xf7, 0x08, 0x66, 0x02, 0xc7, 0x48, 0x02, 0xeb, 0x30, 0x59, 0x97, 0x31, + 0xb5, 0x58, 0xb3, 0x81, 0x1c, 0x54, 0xa5, 0x64, 0x71, 0x52, 0x35, 0xba, 0x93, 0x5f, 0x85, 0xe9, + 0x13, 0xa8, 0xbd, 0x82, 0x04, 0x1f, 0xff, 0x3d, 0xbf, 0x88, 0x7d, 0xe4, 0xae, 0x40, 0x4c, 0xc1, + 0x94, 0x12, 0x86, 0xe2, 0xd6, 0x29, 0xca, 0x7d, 0x8c, 0xc1, 0x38, 0xef, 0x8f, 0x5f, 0x23, 0x98, + 0x90, 0xa6, 0x84, 0x33, 0x81, 0x4d, 0x02, 0x1c, 0x5e, 0x5b, 0x0c, 0x91, 0x29, 0xb0, 0x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, 0xcf, 0x84, 0xc1, 0x9a, 0xdf, 0x38, 0x38, 0x4a, 0xa1, 0xc3, 0xa3, 0x14, + 0xfa, 0x7e, 0x94, 0x42, 0x2f, 0x8f, 0x53, 0x91, 0xc3, 0xe3, 0x54, 0xe4, 0xcb, 0x71, 0x2a, 0x72, + 0x77, 0x71, 0xe0, 0x67, 0xf5, 0x91, 0x68, 0xcb, 0xbf, 0xae, 0xa5, 0x28, 0xff, 0xeb, 0xb8, 0xf6, + 0x2b, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x6f, 0x29, 0xd7, 0x12, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.