Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Mar 12, 2024
1 parent cff8134 commit 55ac8e5
Show file tree
Hide file tree
Showing 33 changed files with 1,835 additions and 1,522 deletions.
342 changes: 171 additions & 171 deletions api/cosmos/base/abci/v1beta1/abci.pulsar.go

Large diffs are not rendered by default.

607 changes: 304 additions & 303 deletions api/cosmos/base/tendermint/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

254 changes: 127 additions & 127 deletions api/cosmos/base/tendermint/v1beta1/types.pulsar.go

Large diffs are not rendered by default.

354 changes: 270 additions & 84 deletions api/cosmos/consensus/v1/consensus.pulsar.go

Large diffs are not rendered by default.

172 changes: 86 additions & 86 deletions api/cosmos/store/streaming/abci/grpc.pulsar.go

Large diffs are not rendered by default.

141 changes: 71 additions & 70 deletions api/cosmos/store/v1beta1/listening.pulsar.go

Large diffs are not rendered by default.

459 changes: 230 additions & 229 deletions api/cosmos/tx/v1beta1/service.pulsar.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func (app *BaseApp) GetMaximumBlockGas(ctx sdk.Context) uint64 {
}
}

func (app *BaseApp) validateFinalizeBlockHeight(req *abci.RequestFinalizeBlock) error {
func (app *BaseApp) validateFinalizeBlockHeight(req *abci.FinalizeBlockRequest) error {
if req.Height < 1 {
return fmt.Errorf("invalid height: %d", req.Height)
}
Expand Down Expand Up @@ -703,7 +703,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
return ctx.WithMultiStore(msCache), msCache
}

func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error {
func (app *BaseApp) preBlock(req *abci.FinalizeBlockRequest) error {
if app.preBlocker != nil {
ctx := app.finalizeBlockState.Context()
if err := app.preBlocker(ctx, req); err != nil {
Expand All @@ -720,7 +720,7 @@ func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error {
return nil
}

func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) {
func (app *BaseApp) beginBlock(req *abci.FinalizeBlockRequest) (sdk.BeginBlock, error) {
var (
resp sdk.BeginBlock
err error
Expand Down
6 changes: 3 additions & 3 deletions baseapp/grpcrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewGRPCQueryRouter() *GRPCQueryRouter {

// GRPCQueryHandler defines a function type which handles ABCI Query requests
// using gRPC
type GRPCQueryHandler = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error)
type GRPCQueryHandler = func(ctx sdk.Context, req *abci.QueryRequest) (*abci.QueryResponse, error)

// Route returns the GRPCQueryHandler for a given query route path or nil
// if not found
Expand Down Expand Up @@ -106,7 +106,7 @@ func (qrt *GRPCQueryRouter) registerABCIQueryHandler(sd *grpc.ServiceDesc, metho
)
}

qrt.routes[fqName] = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
qrt.routes[fqName] = func(ctx sdk.Context, req *abci.QueryRequest) (*abci.QueryResponse, error) {
// call the method handler from the service description with the handler object,
// a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data
res, err := methodHandler(handler, ctx, func(i interface{}) error {
Expand All @@ -124,7 +124,7 @@ func (qrt *GRPCQueryRouter) registerABCIQueryHandler(sd *grpc.ServiceDesc, metho
}

// return the result bytes as the response value
return &abci.ResponseQuery{
return &abci.QueryResponse{
Height: req.Height,
Value: resBytes,
}, nil
Expand Down
4 changes: 2 additions & 2 deletions baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestMsgService(t *testing.T) {
app.MsgServiceRouter(),
testdata.MsgServerImpl{},
)
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
_, err = app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1})
require.NoError(t, err)

_, _, addr := testdata.KeyTestPubAddr()
Expand Down Expand Up @@ -197,7 +197,7 @@ func TestMsgService(t *testing.T) {
// Send the tx to the app
txBytes, err := txConfig.TxEncoder()(txBuilder.GetTx())
require.NoError(t, err)
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
res, err := app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1, Txs: [][]byte{txBytes}})
require.NoError(t, err)
require.Equal(t, abci.CodeTypeOK, res.TxResults[0].Code, "res=%+v", res)
}
213 changes: 107 additions & 106 deletions client/grpc/cmtservice/query.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/grpc/cmtservice/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
)

type (
abciQueryFn = func(context.Context, *abci.RequestQuery) (*abci.ResponseQuery, error)
abciQueryFn = func(context.Context, *abci.QueryRequest) (*abci.QueryResponse, error)

queryServer struct {
clientCtx client.Context
Expand Down
6 changes: 3 additions & 3 deletions client/grpc/cmtservice/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

// ToABCIRequestQuery converts a gRPC ABCIQueryRequest type to an ABCI
// RequestQuery type.
func (req *ABCIQueryRequest) ToABCIRequestQuery() *abci.RequestQuery {
return &abci.RequestQuery{
func (req *ABCIQueryRequest) ToABCIRequestQuery() *abci.QueryRequest {
return &abci.QueryRequest{
Data: req.Data,
Path: req.Path,
Height: req.Height,
Expand All @@ -17,7 +17,7 @@ func (req *ABCIQueryRequest) ToABCIRequestQuery() *abci.RequestQuery {

// FromABCIResponseQuery converts an ABCI ResponseQuery type to a gRPC
// ABCIQueryResponse type.
func FromABCIResponseQuery(res *abci.ResponseQuery) *ABCIQueryResponse {
func FromABCIResponseQuery(res *abci.QueryResponse) *ABCIQueryResponse {
var proofOps *ProofOps

if res.ProofOps != nil {
Expand Down
126 changes: 63 additions & 63 deletions client/grpc/cmtservice/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply i
ctx = ctx.WithHeight(height)
}

abciReq := abci.RequestQuery{
abciReq := abci.QueryRequest{
Path: method,
Data: reqBz,
Height: ctx.Height,
Expand Down
14 changes: 7 additions & 7 deletions client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (ctx Context) QueryStore(key []byte, storeName string) ([]byte, int64, erro
// It returns the ResultQuery obtained from the query. The height used to perform
// the query is the RequestQuery Height if it is non-zero, otherwise the context
// height is used.
func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) {
func (ctx Context) QueryABCI(req abci.QueryRequest) (abci.QueryResponse, error) {
return ctx.queryABCI(req)
}

Expand All @@ -61,10 +61,10 @@ func (ctx Context) GetFromAddress() sdk.AccAddress {
return ctx.FromAddress
}

func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) {
func (ctx Context) queryABCI(req abci.QueryRequest) (abci.QueryResponse, error) {
node, err := ctx.GetNode()
if err != nil {
return abci.ResponseQuery{}, err
return abci.QueryResponse{}, err
}

var queryHeight int64
Expand All @@ -82,11 +82,11 @@ func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)

result, err := node.ABCIQueryWithOptions(context.Background(), req.Path, req.Data, opts)
if err != nil {
return abci.ResponseQuery{}, err
return abci.QueryResponse{}, err
}

if !result.Response.IsOK() {
return abci.ResponseQuery{}, sdkErrorToGRPCError(result.Response)
return abci.QueryResponse{}, sdkErrorToGRPCError(result.Response)
}

// data from trusted node or subspace query doesn't need verification
Expand All @@ -97,7 +97,7 @@ func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)
return result.Response, nil
}

func sdkErrorToGRPCError(resp abci.ResponseQuery) error {
func sdkErrorToGRPCError(resp abci.QueryResponse) error {
switch resp.Code {
case sdkerrors.ErrInvalidRequest.ABCICode():
return status.Error(codes.InvalidArgument, resp.Log)
Expand All @@ -114,7 +114,7 @@ func sdkErrorToGRPCError(resp abci.ResponseQuery) error {
// and path. It returns the result and height of the query upon success
// or an error if the query fails.
func (ctx Context) query(path string, key []byte) ([]byte, int64, error) {
resp, err := ctx.queryABCI(abci.RequestQuery{
resp, err := ctx.queryABCI(abci.QueryRequest{
Path: path,
Data: key,
Height: ctx.Height,
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *IntegrationTestSuite) TestQueryABCIHeight() {
clientCtx := val.GetClientCtx()
clientCtx = clientCtx.WithHeight(tc.ctxHeight)

req := abci.RequestQuery{
req := abci.QueryRequest{
Path: "store/bank/key",
Height: tc.reqHeight,
Data: address.MustLengthPrefix(val.GetAddress()),
Expand Down
3 changes: 1 addition & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ deps:
- remote: buf.build
owner: cometbft
repository: cometbft
commit: 33ed361a90514289beabf3189e1d7665
digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d
commit: 4a62c99d422068a5165429b62a7eb824df46cca9
Loading

0 comments on commit 55ac8e5

Please sign in to comment.