diff --git a/.changelog/unreleased/breaking-changes/1533-proto-renames-fix-buf-lints.md b/.changelog/unreleased/breaking-changes/1533-proto-renames-fix-buf-lints.md new file mode 100644 index 0000000000..3335426d5c --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1533-proto-renames-fix-buf-lints.md @@ -0,0 +1,10 @@ +- `[abci]` Renamed the alias types for gRPC requests, responses, and service + instances to follow the naming changes in the proto-derived + `api/cometbft/abci/v1beta4` package + ([\#1533](https://github.com/cometbft/cometbft/pull/1533)): + * The prefixed naming pattern `RequestFoo`, `ReponseFoo` changed to + suffixed `FooRequest`, `FooResponse`. + * Each method gets its own unique request and response type to allow for + independent evolution with backward compatibility. + * `ABCIClient` renamed to `ABCIServiceClient`. + * `ABCIServer` renamed to `ABCIServiceServer`. diff --git a/.changelog/unreleased/breaking-changes/736-proto-enum-rename.md b/.changelog/unreleased/breaking-changes/736-proto-enum-rename.md index af1e488001..f25b4a9809 100644 --- a/.changelog/unreleased/breaking-changes/736-proto-enum-rename.md +++ b/.changelog/unreleased/breaking-changes/736-proto-enum-rename.md @@ -2,5 +2,5 @@ buf-recommended naming conventions adopted in the `abci/v1beta4` proto package ([\#736](https://github.com/cometbft/cometbft/issues/736)). - `[proto]` The `Type` enum field is now required to be set to a value other - than the default `CHECK_TX_TYPE_UNKNOWN` for a valid `RequestCheckTx` + than the default `CHECK_TX_TYPE_UNKNOWN` for a valid `CheckTxRequest` ([\#736](https://github.com/cometbft/cometbft/issues/736)). diff --git a/.changelog/unreleased/improvements/736+-proto-renaming.md b/.changelog/unreleased/improvements/736+-proto-renaming.md new file mode 100644 index 0000000000..b4286f9772 --- /dev/null +++ b/.changelog/unreleased/improvements/736+-proto-renaming.md @@ -0,0 +1,28 @@ +- `[proto]` Add the `abci.v1beta4` versioned proto package with naming changes + to satisfy the + [buf guidelines](https://buf.build/docs/best-practices/style-guide/) + ([#736](https://github.com/cometbft/cometbft/issues/736), + [#1504](https://github.com/cometbft/cometbft/issues/1504), + [#1530](https://github.com/cometbft/cometbft/issues/1530)): + * Names of request and response types used in gRPC changed by making + `Request`/`Response` the suffix instead of the prefix, e.g. + `RequestCheckTx` ⭢ `CheckTxRequest`. + * The `Request` and `Response` multiplex messages are redefined accordingly. + * `CheckTxType` values renamed with the `CHECK_TX_TYPE_` prefix. + * `MisbehaviorType` values renamed with the `MISBEHAVIOR_TYPE_` prefix. + * `Result` enum formerly nested in `ResponseOfferSnapshot` replaced with the package-level + `OfferSnapshotResult`, its values named with the + `OFFER_SNAPSHOT_RESULT_` prefix. + * `Result` enum formerly nested in `ResponseApplyShapshotChunk` replaced with the package-level + `ApplySnapshotChunkResult`, its values named with the + `APPLY_SNAPSHOT_CHUNK_RESULT_` prefix. + * `Status` enum formerly nested in `ResponseProcessProposal` replaced with the package-level + `ProcessProposalStatus`, its values named with the + `PROCESS_PROPOSAL_STATUS_` prefix. + * `Status` enum formerly nested in `ResponseVerifyVoteExtension` replaced with the package-level + `VerifyVoteExtensionStatus`, its values named with the + `VERIFY_VOTE_EXTENSION_STATUS_` prefix. + * New definition of `Misbehavior` using the changed `MisbehaviorType`. + * The gRPC service is renamed `ABCIService` and defined using the types listed above. +- `[proto]` Add `state.v1beta4` package with a new definition for + `ABCIResponsesInfo`, renaming `response_finalize_block` field to `finalize_block`. diff --git a/.changelog/unreleased/improvements/736-proto-enum-rename.md b/.changelog/unreleased/improvements/736-proto-enum-rename.md deleted file mode 100644 index e006dfdc16..0000000000 --- a/.changelog/unreleased/improvements/736-proto-enum-rename.md +++ /dev/null @@ -1,32 +0,0 @@ -- `[proto]` Add the `abci/v1beta4` versioned proto package with naming changes - for enum types to suit the - [buf guidelines](https://buf.build/docs/best-practices/style-guide/#enums): - ([\#736](https://github.com/cometbft/cometbft/issues/736), amended in - [\#1504](https://github.com/cometbft/cometbft/issues/1504)): - * `CheckTxType` values renamed with the `CHECK_TX_TYPE_` prefix. - * `MisbehaviorType` values renamed with the `MISBEHAVIOR_TYPE_` prefix. - * `Result` enum in `ResponseOfferSnapshot` renamed to package level - `OfferSnapshotResult`, its values named with the - `OFFER_SNAPSHOT_RESULT_` prefix. - * `Result` enum in `ResponseApplyShapshotChunk` renamed to package level - `ApplySnapshotChunkResult`, its values named with the - `APPLY_SNAPSHOT_CHUNK_RESULT_` prefix. - * `Status` enum in `ResponseProcessProposal` renamed to package level - `ProcessProposalStatus`, its values named with the - `PROCESS_PROPOSAL_STATUS_` prefix. - * `Status` enum in `ResponseVerifyVoteExtension` renamed to package level - `VerifyVoteExtensionStatus`, its values named with the - `VERIFY_VOTE_EXTENSION_STATUS_` prefix. - * Message types using the enumeration types listed above get new definitions: - `Request`, - `RequestCheckTx`, - `RequestPrepareProposal`, - `RequestProcessProposal`, - `RequestFinalizeBlock`, - `Response`, - `ResponseOfferSnapshot`, - `ResponseApplySnapshotChunk`, - `ResponseProcessProposal`, - `ResponseVerifyVoteExtension`, - `Misbehavior`. - * New version of the `ABCI` service defined using the types listed above. diff --git a/abci/client/client.go b/abci/client/client.go index b274cd3c23..2ddebed23d 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -29,7 +29,7 @@ type Client interface { Error() error // TODO: remove as this is not implemented Flush(context.Context) error - Echo(context.Context, string) (*types.ResponseEcho, error) + Echo(context.Context, string) (*types.EchoResponse, error) // FIXME: All other operations are run synchronously and rely // on the caller to dictate concurrency (i.e. run a go routine), @@ -37,7 +37,7 @@ type Client interface { // for the v0 mempool. We should explore refactoring the // mempool to remove this vestige behavior. SetResponseCallback(Callback) - CheckTxAsync(context.Context, *types.RequestCheckTx) (*ReqRes, error) + CheckTxAsync(context.Context, *types.CheckTxRequest) (*ReqRes, error) } //---------------------------------------- diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index 926e679d68..3a44118b4c 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -23,7 +23,7 @@ type grpcClient struct { service.BaseService mustConnect bool - client types.ABCIClient + client types.ABCIServiceClient conn *grpc.ClientConn chReqRes chan *ReqRes // dispatches "async" responses to callbacks *in order*, needed by mempool @@ -106,7 +106,7 @@ RETRY_LOOP: ENSURE_CONNECTED: for { - _, err := client.Echo(context.Background(), &types.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) + _, err := client.Echo(context.Background(), &types.EchoRequest{Message: "hello"}, grpc.WaitForReady(true)) if err == nil { break ENSURE_CONNECTED } @@ -161,13 +161,13 @@ func (cli *grpcClient) SetResponseCallback(resCb Callback) { //---------------------------------------- -func (cli *grpcClient) CheckTxAsync(ctx context.Context, req *types.RequestCheckTx) (*ReqRes, error) { +func (cli *grpcClient) CheckTxAsync(ctx context.Context, req *types.CheckTxRequest) (*ReqRes, error) { res, err := cli.client.CheckTx(ctx, req, grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) return nil, err } - return cli.finishAsyncCall(types.ToRequestCheckTx(req), &types.Response{Value: &types.Response_CheckTx{CheckTx: res}}), nil + return cli.finishAsyncCall(types.ToCheckTxRequest(req), &types.Response{Value: &types.Response_CheckTx{CheckTx: res}}), nil } // finishAsyncCall creates a ReqRes for an async call, and immediately populates it @@ -182,66 +182,66 @@ func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response) //---------------------------------------- func (cli *grpcClient) Flush(ctx context.Context) error { - _, err := cli.client.Flush(ctx, types.ToRequestFlush().GetFlush(), grpc.WaitForReady(true)) + _, err := cli.client.Flush(ctx, types.ToFlushRequest().GetFlush(), grpc.WaitForReady(true)) return err } -func (cli *grpcClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) { - return cli.client.Echo(ctx, types.ToRequestEcho(msg).GetEcho(), grpc.WaitForReady(true)) +func (cli *grpcClient) Echo(ctx context.Context, msg string) (*types.EchoResponse, error) { + return cli.client.Echo(ctx, types.ToEchoRequest(msg).GetEcho(), grpc.WaitForReady(true)) } -func (cli *grpcClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { +func (cli *grpcClient) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error) { return cli.client.Info(ctx, req, grpc.WaitForReady(true)) } -func (cli *grpcClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (cli *grpcClient) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { return cli.client.CheckTx(ctx, req, grpc.WaitForReady(true)) } -func (cli *grpcClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { - return cli.client.Query(ctx, types.ToRequestQuery(req).GetQuery(), grpc.WaitForReady(true)) +func (cli *grpcClient) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + return cli.client.Query(ctx, types.ToQueryRequest(req).GetQuery(), grpc.WaitForReady(true)) } -func (cli *grpcClient) Commit(ctx context.Context, _ *types.RequestCommit) (*types.ResponseCommit, error) { - return cli.client.Commit(ctx, types.ToRequestCommit().GetCommit(), grpc.WaitForReady(true)) +func (cli *grpcClient) Commit(ctx context.Context, _ *types.CommitRequest) (*types.CommitResponse, error) { + return cli.client.Commit(ctx, types.ToCommitRequest().GetCommit(), grpc.WaitForReady(true)) } -func (cli *grpcClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { - return cli.client.InitChain(ctx, types.ToRequestInitChain(req).GetInitChain(), grpc.WaitForReady(true)) +func (cli *grpcClient) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { + return cli.client.InitChain(ctx, types.ToInitChainRequest(req).GetInitChain(), grpc.WaitForReady(true)) } -func (cli *grpcClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - return cli.client.ListSnapshots(ctx, types.ToRequestListSnapshots(req).GetListSnapshots(), grpc.WaitForReady(true)) +func (cli *grpcClient) ListSnapshots(ctx context.Context, req *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) { + return cli.client.ListSnapshots(ctx, types.ToListSnapshotsRequest(req).GetListSnapshots(), grpc.WaitForReady(true)) } -func (cli *grpcClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - return cli.client.OfferSnapshot(ctx, types.ToRequestOfferSnapshot(req).GetOfferSnapshot(), grpc.WaitForReady(true)) +func (cli *grpcClient) OfferSnapshot(ctx context.Context, req *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) { + return cli.client.OfferSnapshot(ctx, types.ToOfferSnapshotRequest(req).GetOfferSnapshot(), grpc.WaitForReady(true)) } -func (cli *grpcClient) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - return cli.client.LoadSnapshotChunk(ctx, types.ToRequestLoadSnapshotChunk(req).GetLoadSnapshotChunk(), grpc.WaitForReady(true)) +func (cli *grpcClient) LoadSnapshotChunk(ctx context.Context, req *types.LoadSnapshotChunkRequest) (*types.LoadSnapshotChunkResponse, error) { + return cli.client.LoadSnapshotChunk(ctx, types.ToLoadSnapshotChunkRequest(req).GetLoadSnapshotChunk(), grpc.WaitForReady(true)) } -func (cli *grpcClient) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - return cli.client.ApplySnapshotChunk(ctx, types.ToRequestApplySnapshotChunk(req).GetApplySnapshotChunk(), grpc.WaitForReady(true)) +func (cli *grpcClient) ApplySnapshotChunk(ctx context.Context, req *types.ApplySnapshotChunkRequest) (*types.ApplySnapshotChunkResponse, error) { + return cli.client.ApplySnapshotChunk(ctx, types.ToApplySnapshotChunkRequest(req).GetApplySnapshotChunk(), grpc.WaitForReady(true)) } -func (cli *grpcClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { - return cli.client.PrepareProposal(ctx, types.ToRequestPrepareProposal(req).GetPrepareProposal(), grpc.WaitForReady(true)) +func (cli *grpcClient) PrepareProposal(ctx context.Context, req *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) { + return cli.client.PrepareProposal(ctx, types.ToPrepareProposalRequest(req).GetPrepareProposal(), grpc.WaitForReady(true)) } -func (cli *grpcClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { - return cli.client.ProcessProposal(ctx, types.ToRequestProcessProposal(req).GetProcessProposal(), grpc.WaitForReady(true)) +func (cli *grpcClient) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { + return cli.client.ProcessProposal(ctx, types.ToProcessProposalRequest(req).GetProcessProposal(), grpc.WaitForReady(true)) } -func (cli *grpcClient) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) { - return cli.client.ExtendVote(ctx, types.ToRequestExtendVote(req).GetExtendVote(), grpc.WaitForReady(true)) +func (cli *grpcClient) ExtendVote(ctx context.Context, req *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) { + return cli.client.ExtendVote(ctx, types.ToExtendVoteRequest(req).GetExtendVote(), grpc.WaitForReady(true)) } -func (cli *grpcClient) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { - return cli.client.VerifyVoteExtension(ctx, types.ToRequestVerifyVoteExtension(req).GetVerifyVoteExtension(), grpc.WaitForReady(true)) +func (cli *grpcClient) VerifyVoteExtension(ctx context.Context, req *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) { + return cli.client.VerifyVoteExtension(ctx, types.ToVerifyVoteExtensionRequest(req).GetVerifyVoteExtension(), grpc.WaitForReady(true)) } -func (cli *grpcClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { - return cli.client.FinalizeBlock(ctx, types.ToRequestFinalizeBlock(req).GetFinalizeBlock(), grpc.WaitForReady(true)) +func (cli *grpcClient) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { + return cli.client.FinalizeBlock(ctx, types.ToFinalizeBlockRequest(req).GetFinalizeBlock(), grpc.WaitForReady(true)) } diff --git a/abci/client/grpc_client_test.go b/abci/client/grpc_client_test.go index 2eedecb5f1..63e9ceba37 100644 --- a/abci/client/grpc_client_test.go +++ b/abci/client/grpc_client_test.go @@ -58,7 +58,7 @@ func TestGRPC(t *testing.T) { // Send request response, err := client.CheckTx( context.Background(), - &types.RequestCheckTx{ + &types.CheckTxRequest{ Tx: []byte("test"), Type: types.CHECK_TX_TYPE_CHECK, }) diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 95648b4bf8..e1ada512f2 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -46,7 +46,7 @@ func (app *localClient) SetResponseCallback(cb Callback) { app.mtx.Unlock() } -func (app *localClient) CheckTxAsync(ctx context.Context, req *types.RequestCheckTx) (*ReqRes, error) { +func (app *localClient) CheckTxAsync(ctx context.Context, req *types.CheckTxRequest) (*ReqRes, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -55,8 +55,8 @@ func (app *localClient) CheckTxAsync(ctx context.Context, req *types.RequestChec return nil, err } return app.callback( - types.ToRequestCheckTx(req), - types.ToResponseCheckTx(res), + types.ToCheckTxRequest(req), + types.ToCheckTxResponse(res), ), nil } @@ -83,53 +83,53 @@ func (app *localClient) Flush(context.Context) error { return nil } -func (app *localClient) Echo(_ context.Context, msg string) (*types.ResponseEcho, error) { - return &types.ResponseEcho{Message: msg}, nil +func (app *localClient) Echo(_ context.Context, msg string) (*types.EchoResponse, error) { + return &types.EchoResponse{Message: msg}, nil } -func (app *localClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { +func (app *localClient) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.Info(ctx, req) } -func (app *localClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *localClient) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.CheckTx(ctx, req) } -func (app *localClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { +func (app *localClient) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.Query(ctx, req) } -func (app *localClient) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { +func (app *localClient) Commit(ctx context.Context, req *types.CommitRequest) (*types.CommitResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.Commit(ctx, req) } -func (app *localClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *localClient) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.InitChain(ctx, req) } -func (app *localClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (app *localClient) ListSnapshots(ctx context.Context, req *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.ListSnapshots(ctx, req) } -func (app *localClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (app *localClient) OfferSnapshot(ctx context.Context, req *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -137,8 +137,8 @@ func (app *localClient) OfferSnapshot(ctx context.Context, req *types.RequestOff } func (app *localClient) LoadSnapshotChunk(ctx context.Context, - req *types.RequestLoadSnapshotChunk, -) (*types.ResponseLoadSnapshotChunk, error) { + req *types.LoadSnapshotChunkRequest, +) (*types.LoadSnapshotChunkResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -146,43 +146,43 @@ func (app *localClient) LoadSnapshotChunk(ctx context.Context, } func (app *localClient) ApplySnapshotChunk(ctx context.Context, - req *types.RequestApplySnapshotChunk, -) (*types.ResponseApplySnapshotChunk, error) { + req *types.ApplySnapshotChunkRequest, +) (*types.ApplySnapshotChunkResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.ApplySnapshotChunk(ctx, req) } -func (app *localClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { +func (app *localClient) PrepareProposal(ctx context.Context, req *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.PrepareProposal(ctx, req) } -func (app *localClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { +func (app *localClient) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.ProcessProposal(ctx, req) } -func (app *localClient) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) { +func (app *localClient) ExtendVote(ctx context.Context, req *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.ExtendVote(ctx, req) } -func (app *localClient) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { +func (app *localClient) VerifyVoteExtension(ctx context.Context, req *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() return app.Application.VerifyVoteExtension(ctx, req) } -func (app *localClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { +func (app *localClient) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { app.mtx.Lock() defer app.mtx.Unlock() diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index b62a63b45f..c1149af833 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -11,10 +11,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta1" - v2 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta2" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" - v4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // Client is an autogenerated mock type for the Client type @@ -23,23 +20,23 @@ type Client struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error) { +func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseApplySnapshotChunk + var r0 *v1beta4.ApplySnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) *v4.ResponseApplySnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) *v1beta4.ApplySnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*v1beta4.ApplySnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -49,23 +46,23 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *v1.RequestApplySn } // CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) (*v3.ResponseCheckTx, error) { +func (_m *Client) CheckTx(_a0 context.Context, _a1 *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseCheckTx + var r0 *v1beta4.CheckTxResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) (*v3.ResponseCheckTx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) *v3.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) *v1beta4.CheckTxResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCheckTx) + r0 = ret.Get(0).(*v1beta4.CheckTxResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CheckTxRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -75,15 +72,15 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) (*v3.Resp } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTxAsync(_a0 context.Context, _a1 *v4.RequestCheckTx) (*abcicli.ReqRes, error) { +func (_m *Client) CheckTxAsync(_a0 context.Context, _a1 *v1beta4.CheckTxRequest) (*abcicli.ReqRes, error) { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) (*abcicli.ReqRes, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) (*abcicli.ReqRes, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -91,7 +88,7 @@ func (_m *Client) CheckTxAsync(_a0 context.Context, _a1 *v4.RequestCheckTx) (*ab } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CheckTxRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -101,23 +98,23 @@ func (_m *Client) CheckTxAsync(_a0 context.Context, _a1 *v4.RequestCheckTx) (*ab } // Commit provides a mock function with given fields: _a0, _a1 -func (_m *Client) Commit(_a0 context.Context, _a1 *v1.RequestCommit) (*v3.ResponseCommit, error) { +func (_m *Client) Commit(_a0 context.Context, _a1 *v1beta4.CommitRequest) (*v1beta4.CommitResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseCommit + var r0 *v1beta4.CommitResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestCommit) (*v3.ResponseCommit, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CommitRequest) (*v1beta4.CommitResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestCommit) *v3.ResponseCommit); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CommitRequest) *v1beta4.CommitResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCommit) + r0 = ret.Get(0).(*v1beta4.CommitResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestCommit) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CommitRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -127,19 +124,19 @@ func (_m *Client) Commit(_a0 context.Context, _a1 *v1.RequestCommit) (*v3.Respon } // Echo provides a mock function with given fields: _a0, _a1 -func (_m *Client) Echo(_a0 context.Context, _a1 string) (*v1.ResponseEcho, error) { +func (_m *Client) Echo(_a0 context.Context, _a1 string) (*v1beta4.EchoResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseEcho + var r0 *v1beta4.EchoResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1.ResponseEcho, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1beta4.EchoResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1.ResponseEcho); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) *v1beta4.EchoResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseEcho) + r0 = ret.Get(0).(*v1beta4.EchoResponse) } } @@ -167,23 +164,23 @@ func (_m *Client) Error() error { } // ExtendVote provides a mock function with given fields: _a0, _a1 -func (_m *Client) ExtendVote(_a0 context.Context, _a1 *v4.RequestExtendVote) (*v3.ResponseExtendVote, error) { +func (_m *Client) ExtendVote(_a0 context.Context, _a1 *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseExtendVote + var r0 *v1beta4.ExtendVoteResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) (*v3.ResponseExtendVote, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) *v3.ResponseExtendVote); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) *v1beta4.ExtendVoteResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseExtendVote) + r0 = ret.Get(0).(*v1beta4.ExtendVoteResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestExtendVote) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ExtendVoteRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -193,23 +190,23 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *v4.RequestExtendVote) (*v } // FinalizeBlock provides a mock function with given fields: _a0, _a1 -func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error) { +func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseFinalizeBlock + var r0 *v1beta4.FinalizeBlockResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) *v3.ResponseFinalizeBlock); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) *v1beta4.FinalizeBlockResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseFinalizeBlock) + r0 = ret.Get(0).(*v1beta4.FinalizeBlockResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestFinalizeBlock) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.FinalizeBlockRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -233,23 +230,23 @@ func (_m *Client) Flush(_a0 context.Context) error { } // Info provides a mock function with given fields: _a0, _a1 -func (_m *Client) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.ResponseInfo, error) { +func (_m *Client) Info(_a0 context.Context, _a1 *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseInfo + var r0 *v1beta4.InfoResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) (*v1.ResponseInfo, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) *v1.ResponseInfo); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) *v1beta4.InfoResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseInfo) + r0 = ret.Get(0).(*v1beta4.InfoResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v2.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InfoRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -259,23 +256,23 @@ func (_m *Client) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.ResponseIn } // InitChain provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChain(_a0 context.Context, _a1 *v3.RequestInitChain) (*v3.ResponseInitChain, error) { +func (_m *Client) InitChain(_a0 context.Context, _a1 *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseInitChain + var r0 *v1beta4.InitChainResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) (*v3.ResponseInitChain, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) *v3.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) *v1beta4.InitChainResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseInitChain) + r0 = ret.Get(0).(*v1beta4.InitChainResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InitChainRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -299,23 +296,23 @@ func (_m *Client) IsRunning() bool { } // ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error) { +func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseListSnapshots + var r0 *v1beta4.ListSnapshotsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) *v1.ResponseListSnapshots); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) *v1beta4.ListSnapshotsResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseListSnapshots) + r0 = ret.Get(0).(*v1beta4.ListSnapshotsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ListSnapshotsRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -325,23 +322,23 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *v1.RequestListSnapshot } // LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error) { +func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseLoadSnapshotChunk + var r0 *v1beta4.LoadSnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) *v1.ResponseLoadSnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) *v1beta4.LoadSnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*v1beta4.LoadSnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -351,23 +348,23 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.RequestLoadSnap } // OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error) { +func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseOfferSnapshot + var r0 *v1beta4.OfferSnapshotResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) *v4.ResponseOfferSnapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) *v1beta4.OfferSnapshotResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseOfferSnapshot) + r0 = ret.Get(0).(*v1beta4.OfferSnapshotResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.OfferSnapshotRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -410,23 +407,23 @@ func (_m *Client) OnStop() { } // PrepareProposal provides a mock function with given fields: _a0, _a1 -func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error) { +func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v2.ResponsePrepareProposal + var r0 *v1beta4.PrepareProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) *v2.ResponsePrepareProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) *v1beta4.PrepareProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v2.ResponsePrepareProposal) + r0 = ret.Get(0).(*v1beta4.PrepareProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestPrepareProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.PrepareProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -436,23 +433,23 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *v4.RequestPreparePro } // ProcessProposal provides a mock function with given fields: _a0, _a1 -func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error) { +func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseProcessProposal + var r0 *v1beta4.ProcessProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) *v4.ResponseProcessProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) *v1beta4.ProcessProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseProcessProposal) + r0 = ret.Get(0).(*v1beta4.ProcessProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestProcessProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ProcessProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -462,23 +459,23 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *v4.RequestProcessPro } // Query provides a mock function with given fields: _a0, _a1 -func (_m *Client) Query(_a0 context.Context, _a1 *v1.RequestQuery) (*v1.ResponseQuery, error) { +func (_m *Client) Query(_a0 context.Context, _a1 *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseQuery + var r0 *v1beta4.QueryResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) (*v1.ResponseQuery, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) *v1.ResponseQuery); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) *v1beta4.QueryResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseQuery) + r0 = ret.Get(0).(*v1beta4.QueryResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -570,23 +567,23 @@ func (_m *Client) String() string { } // VerifyVoteExtension provides a mock function with given fields: _a0, _a1 -func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error) { +func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseVerifyVoteExtension + var r0 *v1beta4.VerifyVoteExtensionResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) *v4.ResponseVerifyVoteExtension); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) *v1beta4.VerifyVoteExtensionResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseVerifyVoteExtension) + r0 = ret.Get(0).(*v1beta4.VerifyVoteExtensionResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestVerifyVoteExtension) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index f25691401a..7124f83d86 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -120,8 +120,8 @@ func (cli *socketClient) SetResponseCallback(resCb Callback) { cli.mtx.Unlock() } -func (cli *socketClient) CheckTxAsync(ctx context.Context, req *types.RequestCheckTx) (*ReqRes, error) { - return cli.queueRequest(ctx, types.ToRequestCheckTx(req)) +func (cli *socketClient) CheckTxAsync(ctx context.Context, req *types.CheckTxRequest) (*ReqRes, error) { + return cli.queueRequest(ctx, types.ToCheckTxRequest(req)) } //---------------------------------------- @@ -152,7 +152,7 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { } case <-cli.flushTimer.Ch: // flush queue select { - case cli.reqQueue <- NewReqRes(types.ToRequestFlush()): + case cli.reqQueue <- NewReqRes(types.ToFlushRequest()): default: // Probably will fill the buffer, or retry later. } @@ -239,7 +239,7 @@ func (cli *socketClient) didRecvResponse(res *types.Response) error { //---------------------------------------- func (cli *socketClient) Flush(ctx context.Context) error { - reqRes, err := cli.queueRequest(ctx, types.ToRequestFlush()) + reqRes, err := cli.queueRequest(ctx, types.ToFlushRequest()) if err != nil { return err } @@ -247,8 +247,8 @@ func (cli *socketClient) Flush(ctx context.Context) error { return nil } -func (cli *socketClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestEcho(msg)) +func (cli *socketClient) Echo(ctx context.Context, msg string) (*types.EchoResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToEchoRequest(msg)) if err != nil { return nil, err } @@ -258,8 +258,8 @@ func (cli *socketClient) Echo(ctx context.Context, msg string) (*types.ResponseE return reqRes.Response.GetEcho(), cli.Error() } -func (cli *socketClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestInfo(req)) +func (cli *socketClient) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToInfoRequest(req)) if err != nil { return nil, err } @@ -269,8 +269,8 @@ func (cli *socketClient) Info(ctx context.Context, req *types.RequestInfo) (*typ return reqRes.Response.GetInfo(), cli.Error() } -func (cli *socketClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestCheckTx(req)) +func (cli *socketClient) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToCheckTxRequest(req)) if err != nil { return nil, err } @@ -280,8 +280,8 @@ func (cli *socketClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) return reqRes.Response.GetCheckTx(), cli.Error() } -func (cli *socketClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestQuery(req)) +func (cli *socketClient) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToQueryRequest(req)) if err != nil { return nil, err } @@ -291,8 +291,8 @@ func (cli *socketClient) Query(ctx context.Context, req *types.RequestQuery) (*t return reqRes.Response.GetQuery(), cli.Error() } -func (cli *socketClient) Commit(ctx context.Context, _ *types.RequestCommit) (*types.ResponseCommit, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestCommit()) +func (cli *socketClient) Commit(ctx context.Context, _ *types.CommitRequest) (*types.CommitResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToCommitRequest()) if err != nil { return nil, err } @@ -302,8 +302,8 @@ func (cli *socketClient) Commit(ctx context.Context, _ *types.RequestCommit) (*t return reqRes.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestInitChain(req)) +func (cli *socketClient) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToInitChainRequest(req)) if err != nil { return nil, err } @@ -313,8 +313,8 @@ func (cli *socketClient) InitChain(ctx context.Context, req *types.RequestInitCh return reqRes.Response.GetInitChain(), cli.Error() } -func (cli *socketClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestListSnapshots(req)) +func (cli *socketClient) ListSnapshots(ctx context.Context, req *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToListSnapshotsRequest(req)) if err != nil { return nil, err } @@ -324,8 +324,8 @@ func (cli *socketClient) ListSnapshots(ctx context.Context, req *types.RequestLi return reqRes.Response.GetListSnapshots(), cli.Error() } -func (cli *socketClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestOfferSnapshot(req)) +func (cli *socketClient) OfferSnapshot(ctx context.Context, req *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToOfferSnapshotRequest(req)) if err != nil { return nil, err } @@ -335,8 +335,8 @@ func (cli *socketClient) OfferSnapshot(ctx context.Context, req *types.RequestOf return reqRes.Response.GetOfferSnapshot(), cli.Error() } -func (cli *socketClient) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestLoadSnapshotChunk(req)) +func (cli *socketClient) LoadSnapshotChunk(ctx context.Context, req *types.LoadSnapshotChunkRequest) (*types.LoadSnapshotChunkResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToLoadSnapshotChunkRequest(req)) if err != nil { return nil, err } @@ -346,8 +346,8 @@ func (cli *socketClient) LoadSnapshotChunk(ctx context.Context, req *types.Reque return reqRes.Response.GetLoadSnapshotChunk(), cli.Error() } -func (cli *socketClient) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestApplySnapshotChunk(req)) +func (cli *socketClient) ApplySnapshotChunk(ctx context.Context, req *types.ApplySnapshotChunkRequest) (*types.ApplySnapshotChunkResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToApplySnapshotChunkRequest(req)) if err != nil { return nil, err } @@ -357,8 +357,8 @@ func (cli *socketClient) ApplySnapshotChunk(ctx context.Context, req *types.Requ return reqRes.Response.GetApplySnapshotChunk(), cli.Error() } -func (cli *socketClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestPrepareProposal(req)) +func (cli *socketClient) PrepareProposal(ctx context.Context, req *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToPrepareProposalRequest(req)) if err != nil { return nil, err } @@ -368,8 +368,8 @@ func (cli *socketClient) PrepareProposal(ctx context.Context, req *types.Request return reqRes.Response.GetPrepareProposal(), cli.Error() } -func (cli *socketClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestProcessProposal(req)) +func (cli *socketClient) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToProcessProposalRequest(req)) if err != nil { return nil, err } @@ -379,8 +379,8 @@ func (cli *socketClient) ProcessProposal(ctx context.Context, req *types.Request return reqRes.Response.GetProcessProposal(), cli.Error() } -func (cli *socketClient) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestExtendVote(req)) +func (cli *socketClient) ExtendVote(ctx context.Context, req *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToExtendVoteRequest(req)) if err != nil { return nil, err } @@ -390,8 +390,8 @@ func (cli *socketClient) ExtendVote(ctx context.Context, req *types.RequestExten return reqRes.Response.GetExtendVote(), cli.Error() } -func (cli *socketClient) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestVerifyVoteExtension(req)) +func (cli *socketClient) VerifyVoteExtension(ctx context.Context, req *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToVerifyVoteExtensionRequest(req)) if err != nil { return nil, err } @@ -401,8 +401,8 @@ func (cli *socketClient) VerifyVoteExtension(ctx context.Context, req *types.Req return reqRes.Response.GetVerifyVoteExtension(), cli.Error() } -func (cli *socketClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { - reqRes, err := cli.queueRequest(ctx, types.ToRequestFinalizeBlock(req)) +func (cli *socketClient) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { + reqRes, err := cli.queueRequest(ctx, types.ToFinalizeBlockRequest(req)) if err != nil { return nil, err } diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index a916bb212f..8c66228ad6 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -51,7 +51,7 @@ func TestHangingAsyncCalls(t *testing.T) { resp := make(chan error, 1) go func() { // Call CheckTx - reqres, err := c.CheckTxAsync(context.Background(), &types.RequestCheckTx{ + reqres, err := c.CheckTxAsync(context.Background(), &types.CheckTxRequest{ Type: types.CHECK_TX_TYPE_CHECK, }) require.NoError(t, err) @@ -106,7 +106,7 @@ func TestBulk(t *testing.T) { require.NoError(t, err) // Construct request - rfb := &types.RequestFinalizeBlock{Txs: make([][]byte, numTxs)} + rfb := &types.FinalizeBlockRequest{Txs: make([][]byte, numTxs)} for counter := 0; counter < numTxs; counter++ { rfb.Txs[counter] = []byte("test") } @@ -159,9 +159,9 @@ type slowApp struct { types.BaseApplication } -func (slowApp) CheckTx(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (slowApp) CheckTx(context.Context, *types.CheckTxRequest) (*types.CheckTxResponse, error) { time.Sleep(time.Second) - return &types.ResponseCheckTx{}, nil + return &types.CheckTxResponse{}, nil } // TestCallbackInvokedWhenSetLaet ensures that the callback is invoked when @@ -178,7 +178,7 @@ func TestCallbackInvokedWhenSetLate(t *testing.T) { wg: wg, } _, c := setupClientServer(t, app) - reqRes, err := c.CheckTxAsync(ctx, &types.RequestCheckTx{ + reqRes, err := c.CheckTxAsync(ctx, &types.CheckTxRequest{ Type: types.CHECK_TX_TYPE_CHECK, }) require.NoError(t, err) @@ -204,7 +204,7 @@ type blockedABCIApplication struct { types.BaseApplication } -func (b blockedABCIApplication) CheckTxAsync(ctx context.Context, r *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (b blockedABCIApplication) CheckTxAsync(ctx context.Context, r *types.CheckTxRequest) (*types.CheckTxResponse, error) { b.wg.Wait() return b.BaseApplication.CheckTx(ctx, r) } @@ -221,7 +221,7 @@ func TestCallbackInvokedWhenSetEarly(t *testing.T) { wg: wg, } _, c := setupClientServer(t, app) - reqRes, err := c.CheckTxAsync(ctx, &types.RequestCheckTx{ + reqRes, err := c.CheckTxAsync(ctx, &types.CheckTxRequest{ Type: types.CHECK_TX_TYPE_CHECK, }) require.NoError(t, err) diff --git a/abci/client/unsync_local_client.go b/abci/client/unsync_local_client.go index 0adccb1db1..f987e7d7c3 100644 --- a/abci/client/unsync_local_client.go +++ b/abci/client/unsync_local_client.go @@ -43,14 +43,14 @@ func (app *unsyncLocalClient) SetResponseCallback(cb Callback) { app.mtx.Unlock() } -func (app *unsyncLocalClient) CheckTxAsync(ctx context.Context, req *types.RequestCheckTx) (*ReqRes, error) { +func (app *unsyncLocalClient) CheckTxAsync(ctx context.Context, req *types.CheckTxRequest) (*ReqRes, error) { res, err := app.Application.CheckTx(ctx, req) if err != nil { return nil, err } return app.callback( - types.ToRequestCheckTx(req), - types.ToResponseCheckTx(res), + types.ToCheckTxRequest(req), + types.ToCheckTxResponse(res), ), nil } @@ -71,66 +71,66 @@ func (app *unsyncLocalClient) Flush(context.Context) error { return nil } -func (app *unsyncLocalClient) Echo(_ context.Context, msg string) (*types.ResponseEcho, error) { - return &types.ResponseEcho{Message: msg}, nil +func (app *unsyncLocalClient) Echo(_ context.Context, msg string) (*types.EchoResponse, error) { + return &types.EchoResponse{Message: msg}, nil } -func (app *unsyncLocalClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { +func (app *unsyncLocalClient) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error) { return app.Application.Info(ctx, req) } -func (app *unsyncLocalClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *unsyncLocalClient) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { return app.Application.CheckTx(ctx, req) } -func (app *unsyncLocalClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { +func (app *unsyncLocalClient) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { return app.Application.Query(ctx, req) } -func (app *unsyncLocalClient) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { +func (app *unsyncLocalClient) Commit(ctx context.Context, req *types.CommitRequest) (*types.CommitResponse, error) { return app.Application.Commit(ctx, req) } -func (app *unsyncLocalClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *unsyncLocalClient) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { return app.Application.InitChain(ctx, req) } -func (app *unsyncLocalClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (app *unsyncLocalClient) ListSnapshots(ctx context.Context, req *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) { return app.Application.ListSnapshots(ctx, req) } -func (app *unsyncLocalClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (app *unsyncLocalClient) OfferSnapshot(ctx context.Context, req *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) { return app.Application.OfferSnapshot(ctx, req) } func (app *unsyncLocalClient) LoadSnapshotChunk(ctx context.Context, - req *types.RequestLoadSnapshotChunk, -) (*types.ResponseLoadSnapshotChunk, error) { + req *types.LoadSnapshotChunkRequest, +) (*types.LoadSnapshotChunkResponse, error) { return app.Application.LoadSnapshotChunk(ctx, req) } func (app *unsyncLocalClient) ApplySnapshotChunk(ctx context.Context, - req *types.RequestApplySnapshotChunk, -) (*types.ResponseApplySnapshotChunk, error) { + req *types.ApplySnapshotChunkRequest, +) (*types.ApplySnapshotChunkResponse, error) { return app.Application.ApplySnapshotChunk(ctx, req) } -func (app *unsyncLocalClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { +func (app *unsyncLocalClient) PrepareProposal(ctx context.Context, req *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) { return app.Application.PrepareProposal(ctx, req) } -func (app *unsyncLocalClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { +func (app *unsyncLocalClient) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { return app.Application.ProcessProposal(ctx, req) } -func (app *unsyncLocalClient) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) { +func (app *unsyncLocalClient) ExtendVote(ctx context.Context, req *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) { return app.Application.ExtendVote(ctx, req) } -func (app *unsyncLocalClient) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { +func (app *unsyncLocalClient) VerifyVoteExtension(ctx context.Context, req *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) { return app.Application.VerifyVoteExtension(ctx, req) } -func (app *unsyncLocalClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { +func (app *unsyncLocalClient) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { return app.Application.FinalizeBlock(ctx, req) } diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 6fe1432302..46a6ad4896 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -516,7 +516,7 @@ func cmdInfo(cmd *cobra.Command, args []string) error { if len(args) == 1 { version = args[0] } - res, err := client.Info(cmd.Context(), &types.RequestInfo{Version: version}) + res, err := client.Info(cmd.Context(), &types.InfoRequest{Version: version}) if err != nil { return err } @@ -545,7 +545,7 @@ func cmdFinalizeBlock(cmd *cobra.Command, args []string) error { } txs[i] = txBytes } - res, err := client.FinalizeBlock(cmd.Context(), &types.RequestFinalizeBlock{Txs: txs}) + res, err := client.FinalizeBlock(cmd.Context(), &types.FinalizeBlockRequest{Txs: txs}) if err != nil { return err } @@ -578,7 +578,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.CheckTx(cmd.Context(), &types.RequestCheckTx{ + res, err := client.CheckTx(cmd.Context(), &types.CheckTxRequest{ Tx: txBytes, Type: types.CHECK_TX_TYPE_CHECK, }) @@ -596,7 +596,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { // Get application Merkle root hash func cmdCommit(cmd *cobra.Command, args []string) error { - _, err := client.Commit(cmd.Context(), &types.RequestCommit{}) + _, err := client.Commit(cmd.Context(), &types.CommitRequest{}) if err != nil { return err } @@ -619,7 +619,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error { return err } - resQuery, err := client.Query(cmd.Context(), &types.RequestQuery{ + resQuery, err := client.Query(cmd.Context(), &types.QueryRequest{ Data: queryBytes, Path: flagPath, Height: int64(flagHeight), @@ -653,7 +653,7 @@ func cmdPrepareProposal(cmd *cobra.Command, args []string) error { txsBytesArray[i] = txBytes } - res, err := client.PrepareProposal(cmd.Context(), &types.RequestPrepareProposal{ + res, err := client.PrepareProposal(cmd.Context(), &types.PrepareProposalRequest{ Txs: txsBytesArray, // kvstore has to have this parameter in order not to reject a tx as the default value is 0 MaxTxBytes: 65536, @@ -684,7 +684,7 @@ func cmdProcessProposal(cmd *cobra.Command, args []string) error { txsBytesArray[i] = txBytes } - res, err := client.ProcessProposal(cmd.Context(), &types.RequestProcessProposal{ + res, err := client.ProcessProposal(cmd.Context(), &types.ProcessProposalRequest{ Txs: txsBytesArray, }) if err != nil { diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 91e3cb3c27..26cb40dd9d 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -37,7 +37,7 @@ func RandVals(cnt int) []types.ValidatorUpdate { // which allows tests to pass and is fine as long as you // don't make any tx that modify the validator state func InitKVStore(ctx context.Context, app *Application) error { - _, err := app.InitChain(ctx, &types.RequestInitChain{ + _, err := app.InitChain(ctx, &types.InitChainRequest{ Validators: RandVals(1), }) return err diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index c5230e7359..b8cfd35298 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -38,7 +38,7 @@ type Application struct { types.BaseApplication state State - RetainBlocks int64 // blocks to retain after commit (via ResponseCommit.RetainHeight) + RetainBlocks int64 // blocks to retain after commit (via CommitResponse.RetainHeight) stagedTxs [][]byte logger log.Logger @@ -84,7 +84,7 @@ func (app *Application) SetGenBlockEvents() { // begins and let's the application know what Tendermint versions it's interacting with. Based from this information, // Tendermint will ensure it is in sync with the application by potentially replaying the blocks it has. If the // Application returns a 0 appBlockHeight, Tendermint will call InitChain to initialize the application with consensus related data -func (app *Application) Info(context.Context, *types.RequestInfo) (*types.ResponseInfo, error) { +func (app *Application) Info(context.Context, *types.InfoRequest) (*types.InfoResponse, error) { // Tendermint expects the application to persist validators, on start-up we need to reload them to memory if they exist if len(app.valAddrToPubKeyMap) == 0 && app.state.Height > 0 { validators := app.getValidators() @@ -97,7 +97,7 @@ func (app *Application) Info(context.Context, *types.RequestInfo) (*types.Respon } } - return &types.ResponseInfo{ + return &types.InfoResponse{ Data: fmt.Sprintf("{\"size\":%v}", app.state.Size), Version: version.ABCIVersion, AppVersion: AppVersion, @@ -109,13 +109,13 @@ func (app *Application) Info(context.Context, *types.RequestInfo) (*types.Respon // InitChain takes the genesis validators and stores them in the kvstore. It returns the application hash in the // case that the application starts prepopulated with values. This method is called whenever a new instance of the application // starts (i.e. app height = 0). -func (app *Application) InitChain(_ context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *Application) InitChain(_ context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { for _, v := range req.Validators { app.updateValidator(v) } appHash := make([]byte, 8) binary.PutVarint(appHash, app.state.Size) - return &types.ResponseInitChain{ + return &types.InitChainResponse{ AppHash: appHash, }, nil } @@ -127,17 +127,17 @@ func (app *Application) InitChain(_ context.Context, req *types.RequestInitChain // - Contains one and only one `=` // - `=` is not the first or last byte. // - if key is `val` that the validator update transaction is also valid -func (app *Application) CheckTx(_ context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *Application) CheckTx(_ context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { // If it is a validator update transaction, check that it is correctly formatted if isValidatorTx(req.Tx) { if _, _, err := parseValidatorTx(req.Tx); err != nil { - return &types.ResponseCheckTx{Code: CodeTypeInvalidTxFormat}, nil + return &types.CheckTxResponse{Code: CodeTypeInvalidTxFormat}, nil } } else if !isValidTx(req.Tx) { - return &types.ResponseCheckTx{Code: CodeTypeInvalidTxFormat}, nil + return &types.CheckTxResponse{Code: CodeTypeInvalidTxFormat}, nil } - return &types.ResponseCheckTx{Code: CodeTypeOK, GasWanted: 1}, nil + return &types.CheckTxResponse{Code: CodeTypeOK, GasWanted: 1}, nil } // Tx must have a format like key:value or key=value. That is: @@ -160,8 +160,8 @@ func isValidTx(tx []byte) bool { // KVStore has two accepted formats, `:` and `=`, we modify all instances of `:` with `=` to make it consistent. Note: this is // quite a trivial example of transaction modification. // NOTE: we assume that Tendermint will never provide more transactions than can fit in a block. -func (app *Application) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { - return &types.ResponsePrepareProposal{Txs: app.formatTxs(ctx, req.Txs)}, nil +func (app *Application) PrepareProposal(ctx context.Context, req *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) { + return &types.PrepareProposalResponse{Txs: app.formatTxs(ctx, req.Txs)}, nil } // formatTxs validates and excludes invalid transactions @@ -169,7 +169,7 @@ func (app *Application) PrepareProposal(ctx context.Context, req *types.RequestP func (app *Application) formatTxs(ctx context.Context, blockData [][]byte) [][]byte { txs := make([][]byte, 0, len(blockData)) for _, tx := range blockData { - if resp, err := app.CheckTx(ctx, &types.RequestCheckTx{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}); err == nil && resp.Code == CodeTypeOK { + if resp, err := app.CheckTx(ctx, &types.CheckTxRequest{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}); err == nil && resp.Code == CodeTypeOK { txs = append(txs, bytes.Replace(tx, []byte(":"), []byte("="), 1)) } } @@ -178,21 +178,21 @@ func (app *Application) formatTxs(ctx context.Context, blockData [][]byte) [][]b // ProcessProposal is called whenever a node receives a complete proposal. It allows the application to validate the proposal. // Only validators who can vote will have this method called. For the KVstore we reuse CheckTx. -func (app *Application) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { +func (app *Application) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { for _, tx := range req.Txs { // As CheckTx is a full validity check we can simply reuse this - if resp, err := app.CheckTx(ctx, &types.RequestCheckTx{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}); err != nil || resp.Code != CodeTypeOK { - return &types.ResponseProcessProposal{Status: types.PROCESS_PROPOSAL_STATUS_REJECT}, nil + if resp, err := app.CheckTx(ctx, &types.CheckTxRequest{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}); err != nil || resp.Code != CodeTypeOK { + return &types.ProcessProposalResponse{Status: types.PROCESS_PROPOSAL_STATUS_REJECT}, nil } } - return &types.ResponseProcessProposal{Status: types.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil + return &types.ProcessProposalResponse{Status: types.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } // FinalizeBlock executes the block against the application state. It punishes validators who equivocated and // updates validators according to transactions in a block. The rest of the transactions are regular key value // updates and are cached in memory and will be persisted once Commit is called. // ConsensusParams are never changed. -func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { +func (app *Application) FinalizeBlock(_ context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { // reset valset changes app.valUpdates = make([]types.ValidatorUpdate, 0) app.stagedTxs = make([][]byte, 0) @@ -262,7 +262,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinal app.state.Height = req.Height - response := &types.ResponseFinalizeBlock{TxResults: respTxs, ValidatorUpdates: app.valUpdates, AppHash: app.state.Hash()} + response := &types.FinalizeBlockResponse{TxResults: respTxs, ValidatorUpdates: app.valUpdates, AppHash: app.state.Hash()} if !app.genBlockEvents { return response, nil } @@ -324,7 +324,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinal // Commit is called after FinalizeBlock and after Tendermint state which includes the updates to // AppHash, ConsensusParams and ValidatorSet has occurred. // The KVStore persists the validator updates and the new key values -func (app *Application) Commit(context.Context, *types.RequestCommit) (*types.ResponseCommit, error) { +func (app *Application) Commit(context.Context, *types.CommitRequest) (*types.CommitResponse, error) { // apply the validator updates to state (note this is really the validator set at h + 2) for _, valUpdate := range app.valUpdates { app.updateValidator(valUpdate) @@ -346,7 +346,7 @@ func (app *Application) Commit(context.Context, *types.RequestCommit) (*types.Re // persist the state (i.e. size and height) saveState(app.state) - resp := &types.ResponseCommit{} + resp := &types.CommitResponse{} if app.RetainBlocks > 0 && app.state.Height >= app.RetainBlocks { resp.RetainHeight = app.state.Height - app.RetainBlocks + 1 } @@ -354,8 +354,8 @@ func (app *Application) Commit(context.Context, *types.RequestCommit) (*types.Re } // Returns an associated value or nil if missing. -func (app *Application) Query(_ context.Context, reqQuery *types.RequestQuery) (*types.ResponseQuery, error) { - resQuery := &types.ResponseQuery{} +func (app *Application) Query(_ context.Context, reqQuery *types.QueryRequest) (*types.QueryResponse, error) { + resQuery := &types.QueryResponse{} if reqQuery.Path == "/val" { key := []byte(ValidatorPrefix + string(reqQuery.Data)) @@ -364,7 +364,7 @@ func (app *Application) Query(_ context.Context, reqQuery *types.RequestQuery) ( panic(err) } - return &types.ResponseQuery{ + return &types.QueryResponse{ Key: reqQuery.Data, Value: value, }, nil diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index ac076d6d49..49a79b64d4 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -33,28 +33,28 @@ func TestKVStoreKV(t *testing.T) { } func testKVStore(ctx context.Context, t *testing.T, app types.Application, tx []byte, key, value string) { - checkTxResp, err := app.CheckTx(ctx, &types.RequestCheckTx{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}) + checkTxResp, err := app.CheckTx(ctx, &types.CheckTxRequest{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK}) require.NoError(t, err) require.Equal(t, uint32(0), checkTxResp.Code) - ppResp, err := app.PrepareProposal(ctx, &types.RequestPrepareProposal{Txs: [][]byte{tx}}) + ppResp, err := app.PrepareProposal(ctx, &types.PrepareProposalRequest{Txs: [][]byte{tx}}) require.NoError(t, err) require.Len(t, ppResp.Txs, 1) - req := &types.RequestFinalizeBlock{Height: 1, Txs: ppResp.Txs} + req := &types.FinalizeBlockRequest{Height: 1, Txs: ppResp.Txs} ar, err := app.FinalizeBlock(ctx, req) require.NoError(t, err) require.Equal(t, 1, len(ar.TxResults)) require.False(t, ar.TxResults[0].IsErr()) // commit - _, err = app.Commit(ctx, &types.RequestCommit{}) + _, err = app.Commit(ctx, &types.CommitRequest{}) require.NoError(t, err) - info, err := app.Info(ctx, &types.RequestInfo{}) + info, err := app.Info(ctx, &types.InfoRequest{}) require.NoError(t, err) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery, err := app.Query(ctx, &types.RequestQuery{ + resQuery, err := app.Query(ctx, &types.QueryRequest{ Path: "/store", Data: []byte(key), }) @@ -65,7 +65,7 @@ func testKVStore(ctx context.Context, t *testing.T, app types.Application, tx [] require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery, err = app.Query(ctx, &types.RequestQuery{ + resQuery, err = app.Query(ctx, &types.QueryRequest{ Path: "/store", Data: []byte(key), Prove: true, @@ -83,14 +83,14 @@ func TestPersistentKVStoreEmptyTX(t *testing.T) { kvstore := NewPersistentApplication(t.TempDir()) tx := []byte("") - reqCheck := types.RequestCheckTx{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK} + reqCheck := types.CheckTxRequest{Tx: tx, Type: types.CHECK_TX_TYPE_CHECK} resCheck, err := kvstore.CheckTx(ctx, &reqCheck) require.NoError(t, err) require.Equal(t, resCheck.Code, CodeTypeInvalidTxFormat) txs := make([][]byte, 0, 4) txs = append(txs, []byte("key=value"), []byte("key:val"), []byte(""), []byte("kee=value")) - reqPrepare := types.RequestPrepareProposal{Txs: txs, MaxTxBytes: 10 * 1024} + reqPrepare := types.PrepareProposalRequest{Txs: txs, MaxTxBytes: 10 * 1024} resPrepare, err := kvstore.PrepareProposal(ctx, &reqPrepare) require.NoError(t, err) require.Equal(t, len(reqPrepare.Txs)-1, len(resPrepare.Txs), "Empty transaction not properly removed") @@ -114,7 +114,7 @@ func TestPersistentKVStoreInfo(t *testing.T) { require.NoError(t, InitKVStore(ctx, kvstore)) height := int64(0) - resInfo, err := kvstore.Info(ctx, &types.RequestInfo{}) + resInfo, err := kvstore.Info(ctx, &types.InfoRequest{}) require.NoError(t, err) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) @@ -123,14 +123,14 @@ func TestPersistentKVStoreInfo(t *testing.T) { // make and apply block height = int64(1) hash := []byte("foo") - if _, err := kvstore.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Hash: hash, Height: height}); err != nil { + if _, err := kvstore.FinalizeBlock(ctx, &types.FinalizeBlockRequest{Hash: hash, Height: height}); err != nil { t.Fatal(err) } - _, err = kvstore.Commit(ctx, &types.RequestCommit{}) + _, err = kvstore.Commit(ctx, &types.CommitRequest{}) require.NoError(t, err) - resInfo, err = kvstore.Info(ctx, &types.RequestInfo{}) + resInfo, err = kvstore.Info(ctx, &types.InfoRequest{}) require.NoError(t, err) require.Equal(t, height, resInfo.LastBlockHeight) } @@ -147,7 +147,7 @@ func TestValUpdates(t *testing.T) { nInit := 5 vals := RandVals(total) // initialize with the first nInit - _, err := kvstore.InitChain(ctx, &types.RequestInitChain{ + _, err := kvstore.InitChain(ctx, &types.InitChainRequest{ Validators: vals[:nInit], }) require.NoError(t, err) @@ -224,7 +224,7 @@ func TestCheckTx(t *testing.T) { } for idx, tc := range testCases { - resp, err := kvstore.CheckTx(ctx, &types.RequestCheckTx{ + resp, err := kvstore.CheckTx(ctx, &types.CheckTxRequest{ Tx: tc.tx, Type: types.CHECK_TX_TYPE_CHECK, }) @@ -261,14 +261,14 @@ func makeApplyBlock( // make and apply block height := int64(heightInt) hash := []byte("foo") - resFinalizeBlock, err := kvstore.FinalizeBlock(ctx, &types.RequestFinalizeBlock{ + resFinalizeBlock, err := kvstore.FinalizeBlock(ctx, &types.FinalizeBlockRequest{ Hash: hash, Height: height, Txs: txs, }) require.NoError(t, err) - _, err = kvstore.Commit(ctx, &types.RequestCommit{}) + _, err = kvstore.Commit(ctx, &types.CommitRequest{}) require.NoError(t, err) valsEqual(t, diff, resFinalizeBlock.ValidatorUpdates) diff --git a/abci/server/grpc_server.go b/abci/server/grpc_server.go index e0eaefa648..70c78e4a06 100644 --- a/abci/server/grpc_server.go +++ b/abci/server/grpc_server.go @@ -67,10 +67,10 @@ type gRPCApplication struct { types.Application } -func (app *gRPCApplication) Echo(_ context.Context, req *types.RequestEcho) (*types.ResponseEcho, error) { - return &types.ResponseEcho{Message: req.Message}, nil +func (app *gRPCApplication) Echo(_ context.Context, req *types.EchoRequest) (*types.EchoResponse, error) { + return &types.EchoResponse{Message: req.Message}, nil } -func (app *gRPCApplication) Flush(context.Context, *types.RequestFlush) (*types.ResponseFlush, error) { - return &types.ResponseFlush{}, nil +func (app *gRPCApplication) Flush(context.Context, *types.FlushRequest) (*types.FlushResponse, error) { + return &types.FlushResponse{}, nil } diff --git a/abci/server/socket_server.go b/abci/server/socket_server.go index 91a65c32bc..23913167fb 100644 --- a/abci/server/socket_server.go +++ b/abci/server/socket_server.go @@ -162,7 +162,7 @@ func (s *SocketServer) waitForClose(closeConn chan error, connID int) { // Read requests from conn and deal with them func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *types.Response) { var count int - var bufReader = bufio.NewReader(conn) + bufReader := bufio.NewReader(conn) defer func() { // make sure to recover from any app-related panics to allow proper socket cleanup. @@ -184,7 +184,7 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp for { - var req = &types.Request{} + req := &types.Request{} err := types.ReadMessage(bufReader, req) if err != nil { if err == io.EOF { @@ -201,7 +201,7 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp // any error either from the application or because of an unknown request // throws an exception back to the client. This will stop the server and // should also halt the client. - responses <- types.ToResponseException(err.Error()) + responses <- types.ToExceptionResponse(err.Error()) } else { responses <- resp } @@ -213,93 +213,93 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp func (s *SocketServer) handleRequest(ctx context.Context, req *types.Request) (*types.Response, error) { switch r := req.Value.(type) { case *types.Request_Echo: - return types.ToResponseEcho(r.Echo.Message), nil + return types.ToEchoResponse(r.Echo.Message), nil case *types.Request_Flush: - return types.ToResponseFlush(), nil + return types.ToFlushResponse(), nil case *types.Request_Info: res, err := s.app.Info(ctx, r.Info) if err != nil { return nil, err } - return types.ToResponseInfo(res), nil + return types.ToInfoResponse(res), nil case *types.Request_CheckTx: res, err := s.app.CheckTx(ctx, r.CheckTx) if err != nil { return nil, err } - return types.ToResponseCheckTx(res), nil + return types.ToCheckTxResponse(res), nil case *types.Request_Commit: res, err := s.app.Commit(ctx, r.Commit) if err != nil { return nil, err } - return types.ToResponseCommit(res), nil + return types.ToCommitResponse(res), nil case *types.Request_Query: res, err := s.app.Query(ctx, r.Query) if err != nil { return nil, err } - return types.ToResponseQuery(res), nil + return types.ToQueryResponse(res), nil case *types.Request_InitChain: res, err := s.app.InitChain(ctx, r.InitChain) if err != nil { return nil, err } - return types.ToResponseInitChain(res), nil + return types.ToInitChainResponse(res), nil case *types.Request_FinalizeBlock: res, err := s.app.FinalizeBlock(ctx, r.FinalizeBlock) if err != nil { return nil, err } - return types.ToResponseFinalizeBlock(res), nil + return types.ToFinalizeBlockResponse(res), nil case *types.Request_ListSnapshots: res, err := s.app.ListSnapshots(ctx, r.ListSnapshots) if err != nil { return nil, err } - return types.ToResponseListSnapshots(res), nil + return types.ToListSnapshotsResponse(res), nil case *types.Request_OfferSnapshot: res, err := s.app.OfferSnapshot(ctx, r.OfferSnapshot) if err != nil { return nil, err } - return types.ToResponseOfferSnapshot(res), nil + return types.ToOfferSnapshotResponse(res), nil case *types.Request_PrepareProposal: res, err := s.app.PrepareProposal(ctx, r.PrepareProposal) if err != nil { return nil, err } - return types.ToResponsePrepareProposal(res), nil + return types.ToPrepareProposalResponse(res), nil case *types.Request_ProcessProposal: res, err := s.app.ProcessProposal(ctx, r.ProcessProposal) if err != nil { return nil, err } - return types.ToResponseProcessProposal(res), nil + return types.ToProcessProposalResponse(res), nil case *types.Request_LoadSnapshotChunk: res, err := s.app.LoadSnapshotChunk(ctx, r.LoadSnapshotChunk) if err != nil { return nil, err } - return types.ToResponseLoadSnapshotChunk(res), nil + return types.ToLoadSnapshotChunkResponse(res), nil case *types.Request_ApplySnapshotChunk: res, err := s.app.ApplySnapshotChunk(ctx, r.ApplySnapshotChunk) if err != nil { return nil, err } - return types.ToResponseApplySnapshotChunk(res), nil + return types.ToApplySnapshotChunkResponse(res), nil case *types.Request_ExtendVote: res, err := s.app.ExtendVote(ctx, r.ExtendVote) if err != nil { return nil, err } - return types.ToResponseExtendVote(res), nil + return types.ToExtendVoteResponse(res), nil case *types.Request_VerifyVoteExtension: res, err := s.app.VerifyVoteExtension(ctx, r.VerifyVoteExtension) if err != nil { return nil, err } - return types.ToResponseVerifyVoteExtension(res), nil + return types.ToVerifyVoteExtensionResponse(res), nil default: return nil, ErrUnknownRequest{Request: *req} } @@ -308,9 +308,9 @@ func (s *SocketServer) handleRequest(ctx context.Context, req *types.Request) (* // Pull responses from 'responses' and write them to conn. func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *types.Response) { var count int - var bufWriter = bufio.NewWriter(conn) + bufWriter := bufio.NewWriter(conn) for { - var res = <-responses + res := <-responses err := types.WriteMessage(res, bufWriter) if err != nil { closeConn <- fmt.Errorf("error writing message: %w", err) diff --git a/abci/tests/benchmarks/parallel/parallel.go b/abci/tests/benchmarks/parallel/parallel.go index 974ba38153..7082c4f6e6 100644 --- a/abci/tests/benchmarks/parallel/parallel.go +++ b/abci/tests/benchmarks/parallel/parallel.go @@ -10,7 +10,6 @@ import ( ) func main() { - conn, err := cmtnet.Connect("unix://test.sock") if err != nil { log.Fatal(err.Error()) @@ -20,7 +19,7 @@ func main() { go func() { counter := 0 for { - var res = &types.Response{} + res := &types.Response{} err := types.ReadMessage(conn, res) if err != nil { log.Fatal(err.Error()) @@ -35,8 +34,8 @@ func main() { // Write a bunch of requests counter := 0 for i := 0; ; i++ { - var bufWriter = bufio.NewWriter(conn) - var req = types.ToRequestEcho("foobar") + bufWriter := bufio.NewWriter(conn) + req := types.ToEchoRequest("foobar") err := types.WriteMessage(req, bufWriter) if err != nil { diff --git a/abci/tests/benchmarks/simple/simple.go b/abci/tests/benchmarks/simple/simple.go index 2aaa056d06..b2c6aa3f7c 100644 --- a/abci/tests/benchmarks/simple/simple.go +++ b/abci/tests/benchmarks/simple/simple.go @@ -12,7 +12,6 @@ import ( ) func main() { - conn, err := cmtnet.Connect("unix://test.sock") if err != nil { log.Fatal(err.Error()) @@ -21,7 +20,7 @@ func main() { // Make a bunch of requests counter := 0 for i := 0; ; i++ { - req := types.ToRequestEcho("foobar") + req := types.ToEchoRequest("foobar") _, err := makeRequest(conn, req) if err != nil { log.Fatal(err.Error()) @@ -34,14 +33,14 @@ func main() { } func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error) { - var bufWriter = bufio.NewWriter(conn) + bufWriter := bufio.NewWriter(conn) // Write desired request err := types.WriteMessage(req, bufWriter) if err != nil { return nil, err } - err = types.WriteMessage(types.ToRequestFlush(), bufWriter) + err = types.WriteMessage(types.ToFlushRequest(), bufWriter) if err != nil { return nil, err } @@ -51,12 +50,12 @@ func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error } // Read desired response - var res = &types.Response{} + res := &types.Response{} err = types.ReadMessage(conn, res) if err != nil { return nil, err } - var resFlush = &types.Response{} + resFlush := &types.Response{} err = types.ReadMessage(conn, resFlush) if err != nil { return nil, err diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index 66c5df9588..779e3de7a3 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -19,7 +19,7 @@ func InitChain(ctx context.Context, client abcicli.Client) error { power := cmtrand.Int() vals[i] = types.UpdateValidator(pubkey, int64(power), "") } - _, err := client.InitChain(ctx, &types.RequestInitChain{ + _, err := client.InitChain(ctx, &types.InitChainRequest{ Validators: vals, }) if err != nil { @@ -31,7 +31,7 @@ func InitChain(ctx context.Context, client abcicli.Client) error { } func Commit(ctx context.Context, client abcicli.Client) error { - _, err := client.Commit(ctx, &types.RequestCommit{}) + _, err := client.Commit(ctx, &types.CommitRequest{}) if err != nil { fmt.Println("Failed test: Commit") fmt.Printf("error while committing: %v\n", err) @@ -42,7 +42,7 @@ func Commit(ctx context.Context, client abcicli.Client) error { } func FinalizeBlock(ctx context.Context, client abcicli.Client, txBytes [][]byte, codeExp []uint32, dataExp []byte, hashExp []byte) error { - res, _ := client.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: txBytes}) + res, _ := client.FinalizeBlock(ctx, &types.FinalizeBlockRequest{Txs: txBytes}) appHash := res.AppHash for i, tx := range res.TxResults { code, data, log := tx.Code, tx.Data, tx.Log @@ -69,7 +69,7 @@ func FinalizeBlock(ctx context.Context, client abcicli.Client, txBytes [][]byte, } func PrepareProposal(ctx context.Context, client abcicli.Client, txBytes [][]byte, txExpected [][]byte, _ []byte) error { - res, _ := client.PrepareProposal(ctx, &types.RequestPrepareProposal{Txs: txBytes}) + res, _ := client.PrepareProposal(ctx, &types.PrepareProposalRequest{Txs: txBytes}) for i, tx := range res.Txs { if !bytes.Equal(tx, txExpected[i]) { fmt.Println("Failed test: PrepareProposal") @@ -83,7 +83,7 @@ func PrepareProposal(ctx context.Context, client abcicli.Client, txBytes [][]byt } func ProcessProposal(ctx context.Context, client abcicli.Client, txBytes [][]byte, statusExp types.ProcessProposalStatus) error { - res, _ := client.ProcessProposal(ctx, &types.RequestProcessProposal{Txs: txBytes}) + res, _ := client.ProcessProposal(ctx, &types.ProcessProposalRequest{Txs: txBytes}) if res.Status != statusExp { fmt.Println("Failed test: ProcessProposal") fmt.Printf("ProcessProposal response status was unexpected. Got %v expected %v.", @@ -95,7 +95,7 @@ func ProcessProposal(ctx context.Context, client abcicli.Client, txBytes [][]byt } func CheckTx(ctx context.Context, client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.CheckTx(ctx, &types.RequestCheckTx{Tx: txBytes, Type: types.CHECK_TX_TYPE_CHECK}) + res, _ := client.CheckTx(ctx, &types.CheckTxRequest{Tx: txBytes, Type: types.CHECK_TX_TYPE_CHECK}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: CheckTx") diff --git a/abci/types/application.go b/abci/types/application.go index 12064bb8e8..27ea21a10b 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -8,30 +8,30 @@ import "context" // to be driven by a blockchain-based replication engine via the ABCI. type Application interface { // Info/Query Connection - Info(context.Context, *RequestInfo) (*ResponseInfo, error) // Return application info - Query(context.Context, *RequestQuery) (*ResponseQuery, error) // Query for state + Info(context.Context, *InfoRequest) (*InfoResponse, error) // Return application info + Query(context.Context, *QueryRequest) (*QueryResponse, error) // Query for state // Mempool Connection - CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) // Validate a tx for the mempool + CheckTx(context.Context, *CheckTxRequest) (*CheckTxResponse, error) // Validate a tx for the mempool // Consensus Connection - InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) // Initialize blockchain w validators/other info from CometBFT - PrepareProposal(context.Context, *RequestPrepareProposal) (*ResponsePrepareProposal, error) - ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error) + InitChain(context.Context, *InitChainRequest) (*InitChainResponse, error) // Initialize blockchain w validators/other info from CometBFT + PrepareProposal(context.Context, *PrepareProposalRequest) (*PrepareProposalResponse, error) + ProcessProposal(context.Context, *ProcessProposalRequest) (*ProcessProposalResponse, error) // Deliver the decided block with its txs to the Application - FinalizeBlock(context.Context, *RequestFinalizeBlock) (*ResponseFinalizeBlock, error) + FinalizeBlock(context.Context, *FinalizeBlockRequest) (*FinalizeBlockResponse, error) // Create application specific vote extension - ExtendVote(context.Context, *RequestExtendVote) (*ResponseExtendVote, error) + ExtendVote(context.Context, *ExtendVoteRequest) (*ExtendVoteResponse, error) // Verify application's vote extension data - VerifyVoteExtension(context.Context, *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) + VerifyVoteExtension(context.Context, *VerifyVoteExtensionRequest) (*VerifyVoteExtensionResponse, error) // Commit the state and return the application Merkle root hash - Commit(context.Context, *RequestCommit) (*ResponseCommit, error) + Commit(context.Context, *CommitRequest) (*CommitResponse, error) // State Sync Connection - ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) // List available snapshots - OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) // Offer a snapshot to the application - LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) // Load a snapshot chunk - ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) // Apply a shapshot chunk + ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) // List available snapshots + OfferSnapshot(context.Context, *OfferSnapshotRequest) (*OfferSnapshotResponse, error) // Offer a snapshot to the application + LoadSnapshotChunk(context.Context, *LoadSnapshotChunkRequest) (*LoadSnapshotChunkResponse, error) // Load a snapshot chunk + ApplySnapshotChunk(context.Context, *ApplySnapshotChunkRequest) (*ApplySnapshotChunkResponse, error) // Apply a shapshot chunk } //------------------------------------------------------- @@ -45,43 +45,43 @@ func NewBaseApplication() *BaseApplication { return &BaseApplication{} } -func (BaseApplication) Info(context.Context, *RequestInfo) (*ResponseInfo, error) { - return &ResponseInfo{}, nil +func (BaseApplication) Info(context.Context, *InfoRequest) (*InfoResponse, error) { + return &InfoResponse{}, nil } -func (BaseApplication) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) { - return &ResponseCheckTx{Code: CodeTypeOK}, nil +func (BaseApplication) CheckTx(context.Context, *CheckTxRequest) (*CheckTxResponse, error) { + return &CheckTxResponse{Code: CodeTypeOK}, nil } -func (BaseApplication) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) { - return &ResponseCommit{}, nil +func (BaseApplication) Commit(context.Context, *CommitRequest) (*CommitResponse, error) { + return &CommitResponse{}, nil } -func (BaseApplication) Query(context.Context, *RequestQuery) (*ResponseQuery, error) { - return &ResponseQuery{Code: CodeTypeOK}, nil +func (BaseApplication) Query(context.Context, *QueryRequest) (*QueryResponse, error) { + return &QueryResponse{Code: CodeTypeOK}, nil } -func (BaseApplication) InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) { - return &ResponseInitChain{}, nil +func (BaseApplication) InitChain(context.Context, *InitChainRequest) (*InitChainResponse, error) { + return &InitChainResponse{}, nil } -func (BaseApplication) ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) { - return &ResponseListSnapshots{}, nil +func (BaseApplication) ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) { + return &ListSnapshotsResponse{}, nil } -func (BaseApplication) OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) { - return &ResponseOfferSnapshot{}, nil +func (BaseApplication) OfferSnapshot(context.Context, *OfferSnapshotRequest) (*OfferSnapshotResponse, error) { + return &OfferSnapshotResponse{}, nil } -func (BaseApplication) LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) { - return &ResponseLoadSnapshotChunk{}, nil +func (BaseApplication) LoadSnapshotChunk(context.Context, *LoadSnapshotChunkRequest) (*LoadSnapshotChunkResponse, error) { + return &LoadSnapshotChunkResponse{}, nil } -func (BaseApplication) ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) { - return &ResponseApplySnapshotChunk{}, nil +func (BaseApplication) ApplySnapshotChunk(context.Context, *ApplySnapshotChunkRequest) (*ApplySnapshotChunkResponse, error) { + return &ApplySnapshotChunkResponse{}, nil } -func (BaseApplication) PrepareProposal(_ context.Context, req *RequestPrepareProposal) (*ResponsePrepareProposal, error) { +func (BaseApplication) PrepareProposal(_ context.Context, req *PrepareProposalRequest) (*PrepareProposalResponse, error) { txs := make([][]byte, 0, len(req.Txs)) var totalBytes int64 for _, tx := range req.Txs { @@ -91,29 +91,29 @@ func (BaseApplication) PrepareProposal(_ context.Context, req *RequestPreparePro } txs = append(txs, tx) } - return &ResponsePrepareProposal{Txs: txs}, nil + return &PrepareProposalResponse{Txs: txs}, nil } -func (BaseApplication) ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error) { - return &ResponseProcessProposal{Status: PROCESS_PROPOSAL_STATUS_ACCEPT}, nil +func (BaseApplication) ProcessProposal(context.Context, *ProcessProposalRequest) (*ProcessProposalResponse, error) { + return &ProcessProposalResponse{Status: PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } -func (BaseApplication) ExtendVote(context.Context, *RequestExtendVote) (*ResponseExtendVote, error) { - return &ResponseExtendVote{}, nil +func (BaseApplication) ExtendVote(context.Context, *ExtendVoteRequest) (*ExtendVoteResponse, error) { + return &ExtendVoteResponse{}, nil } -func (BaseApplication) VerifyVoteExtension(context.Context, *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) { - return &ResponseVerifyVoteExtension{ +func (BaseApplication) VerifyVoteExtension(context.Context, *VerifyVoteExtensionRequest) (*VerifyVoteExtensionResponse, error) { + return &VerifyVoteExtensionResponse{ Status: VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil } -func (BaseApplication) FinalizeBlock(_ context.Context, req *RequestFinalizeBlock) (*ResponseFinalizeBlock, error) { +func (BaseApplication) FinalizeBlock(_ context.Context, req *FinalizeBlockRequest) (*FinalizeBlockResponse, error) { txs := make([]*ExecTxResult, len(req.Txs)) for i := range req.Txs { txs[i] = &ExecTxResult{Code: CodeTypeOK} } - return &ResponseFinalizeBlock{ + return &FinalizeBlockResponse{ TxResults: txs, }, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index 7cab08ef44..64cdc6a2bb 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -28,97 +28,97 @@ func ReadMessage(r io.Reader, msg proto.Message) error { //---------------------------------------- -func ToRequestEcho(message string) *Request { +func ToEchoRequest(message string) *Request { return &Request{ - Value: &pb.Request_Echo{Echo: &RequestEcho{Message: message}}, + Value: &pb.Request_Echo{Echo: &EchoRequest{Message: message}}, } } -func ToRequestFlush() *Request { +func ToFlushRequest() *Request { return &Request{ - Value: &pb.Request_Flush{Flush: &RequestFlush{}}, + Value: &pb.Request_Flush{Flush: &FlushRequest{}}, } } -func ToRequestInfo(req *RequestInfo) *Request { +func ToInfoRequest(req *InfoRequest) *Request { return &Request{ Value: &pb.Request_Info{Info: req}, } } -func ToRequestCheckTx(req *RequestCheckTx) *Request { +func ToCheckTxRequest(req *CheckTxRequest) *Request { return &Request{ Value: &pb.Request_CheckTx{CheckTx: req}, } } -func ToRequestCommit() *Request { +func ToCommitRequest() *Request { return &Request{ - Value: &pb.Request_Commit{Commit: &RequestCommit{}}, + Value: &pb.Request_Commit{Commit: &CommitRequest{}}, } } -func ToRequestQuery(req *RequestQuery) *Request { +func ToQueryRequest(req *QueryRequest) *Request { return &Request{ Value: &pb.Request_Query{Query: req}, } } -func ToRequestInitChain(req *RequestInitChain) *Request { +func ToInitChainRequest(req *InitChainRequest) *Request { return &Request{ Value: &pb.Request_InitChain{InitChain: req}, } } -func ToRequestListSnapshots(req *RequestListSnapshots) *Request { +func ToListSnapshotsRequest(req *ListSnapshotsRequest) *Request { return &Request{ Value: &pb.Request_ListSnapshots{ListSnapshots: req}, } } -func ToRequestOfferSnapshot(req *RequestOfferSnapshot) *Request { +func ToOfferSnapshotRequest(req *OfferSnapshotRequest) *Request { return &Request{ Value: &pb.Request_OfferSnapshot{OfferSnapshot: req}, } } -func ToRequestLoadSnapshotChunk(req *RequestLoadSnapshotChunk) *Request { +func ToLoadSnapshotChunkRequest(req *LoadSnapshotChunkRequest) *Request { return &Request{ Value: &pb.Request_LoadSnapshotChunk{LoadSnapshotChunk: req}, } } -func ToRequestApplySnapshotChunk(req *RequestApplySnapshotChunk) *Request { +func ToApplySnapshotChunkRequest(req *ApplySnapshotChunkRequest) *Request { return &Request{ Value: &pb.Request_ApplySnapshotChunk{ApplySnapshotChunk: req}, } } -func ToRequestPrepareProposal(req *RequestPrepareProposal) *Request { +func ToPrepareProposalRequest(req *PrepareProposalRequest) *Request { return &Request{ Value: &pb.Request_PrepareProposal{PrepareProposal: req}, } } -func ToRequestProcessProposal(req *RequestProcessProposal) *Request { +func ToProcessProposalRequest(req *ProcessProposalRequest) *Request { return &Request{ Value: &pb.Request_ProcessProposal{ProcessProposal: req}, } } -func ToRequestExtendVote(req *RequestExtendVote) *Request { +func ToExtendVoteRequest(req *ExtendVoteRequest) *Request { return &Request{ Value: &pb.Request_ExtendVote{ExtendVote: req}, } } -func ToRequestVerifyVoteExtension(req *RequestVerifyVoteExtension) *Request { +func ToVerifyVoteExtensionRequest(req *VerifyVoteExtensionRequest) *Request { return &Request{ Value: &pb.Request_VerifyVoteExtension{VerifyVoteExtension: req}, } } -func ToRequestFinalizeBlock(req *RequestFinalizeBlock) *Request { +func ToFinalizeBlockRequest(req *FinalizeBlockRequest) *Request { return &Request{ Value: &pb.Request_FinalizeBlock{FinalizeBlock: req}, } @@ -126,103 +126,103 @@ func ToRequestFinalizeBlock(req *RequestFinalizeBlock) *Request { //---------------------------------------- -func ToResponseException(errStr string) *Response { +func ToExceptionResponse(errStr string) *Response { return &Response{ - Value: &pb.Response_Exception{Exception: &ResponseException{Error: errStr}}, + Value: &pb.Response_Exception{Exception: &ExceptionResponse{Error: errStr}}, } } -func ToResponseEcho(message string) *Response { +func ToEchoResponse(message string) *Response { return &Response{ - Value: &pb.Response_Echo{Echo: &ResponseEcho{Message: message}}, + Value: &pb.Response_Echo{Echo: &EchoResponse{Message: message}}, } } -func ToResponseFlush() *Response { +func ToFlushResponse() *Response { return &Response{ - Value: &pb.Response_Flush{Flush: &ResponseFlush{}}, + Value: &pb.Response_Flush{Flush: &FlushResponse{}}, } } -func ToResponseInfo(res *ResponseInfo) *Response { +func ToInfoResponse(res *InfoResponse) *Response { return &Response{ Value: &pb.Response_Info{Info: res}, } } -func ToResponseCheckTx(res *ResponseCheckTx) *Response { +func ToCheckTxResponse(res *CheckTxResponse) *Response { return &Response{ Value: &pb.Response_CheckTx{CheckTx: res}, } } -func ToResponseCommit(res *ResponseCommit) *Response { +func ToCommitResponse(res *CommitResponse) *Response { return &Response{ Value: &pb.Response_Commit{Commit: res}, } } -func ToResponseQuery(res *ResponseQuery) *Response { +func ToQueryResponse(res *QueryResponse) *Response { return &Response{ Value: &pb.Response_Query{Query: res}, } } -func ToResponseInitChain(res *ResponseInitChain) *Response { +func ToInitChainResponse(res *InitChainResponse) *Response { return &Response{ Value: &pb.Response_InitChain{InitChain: res}, } } -func ToResponseListSnapshots(res *ResponseListSnapshots) *Response { +func ToListSnapshotsResponse(res *ListSnapshotsResponse) *Response { return &Response{ Value: &pb.Response_ListSnapshots{ListSnapshots: res}, } } -func ToResponseOfferSnapshot(res *ResponseOfferSnapshot) *Response { +func ToOfferSnapshotResponse(res *OfferSnapshotResponse) *Response { return &Response{ Value: &pb.Response_OfferSnapshot{OfferSnapshot: res}, } } -func ToResponseLoadSnapshotChunk(res *ResponseLoadSnapshotChunk) *Response { +func ToLoadSnapshotChunkResponse(res *LoadSnapshotChunkResponse) *Response { return &Response{ Value: &pb.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}, } } -func ToResponseApplySnapshotChunk(res *ResponseApplySnapshotChunk) *Response { +func ToApplySnapshotChunkResponse(res *ApplySnapshotChunkResponse) *Response { return &Response{ Value: &pb.Response_ApplySnapshotChunk{ApplySnapshotChunk: res}, } } -func ToResponsePrepareProposal(res *ResponsePrepareProposal) *Response { +func ToPrepareProposalResponse(res *PrepareProposalResponse) *Response { return &Response{ Value: &pb.Response_PrepareProposal{PrepareProposal: res}, } } -func ToResponseProcessProposal(res *ResponseProcessProposal) *Response { +func ToProcessProposalResponse(res *ProcessProposalResponse) *Response { return &Response{ Value: &pb.Response_ProcessProposal{ProcessProposal: res}, } } -func ToResponseExtendVote(res *ResponseExtendVote) *Response { +func ToExtendVoteResponse(res *ExtendVoteResponse) *Response { return &Response{ Value: &pb.Response_ExtendVote{ExtendVote: res}, } } -func ToResponseVerifyVoteExtension(res *ResponseVerifyVoteExtension) *Response { +func ToVerifyVoteExtensionResponse(res *VerifyVoteExtensionResponse) *Response { return &Response{ Value: &pb.Response_VerifyVoteExtension{VerifyVoteExtension: res}, } } -func ToResponseFinalizeBlock(res *ResponseFinalizeBlock) *Response { +func ToFinalizeBlockResponse(res *FinalizeBlockResponse) *Response { return &Response{ Value: &pb.Response_FinalizeBlock{FinalizeBlock: res}, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index b7d3c87684..53a6139412 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -17,7 +17,7 @@ func TestMarshalJSON(t *testing.T) { assert.NoError(t, err) // include empty fields. assert.True(t, strings.Contains(string(b), "code")) - r1 := ResponseCheckTx{ + r1 := CheckTxResponse{ Code: 1, Data: []byte("hello"), GasWanted: 43, @@ -33,7 +33,7 @@ func TestMarshalJSON(t *testing.T) { b, err = json.Marshal(&r1) assert.Nil(t, err) - var r2 ResponseCheckTx + var r2 CheckTxResponse err = json.Unmarshal(b, &r2) assert.Nil(t, err) assert.Equal(t, r1, r2) @@ -41,7 +41,7 @@ func TestMarshalJSON(t *testing.T) { func TestWriteReadMessageSimple(t *testing.T) { cases := []proto.Message{ - &RequestEcho{ + &EchoRequest{ Message: "Hello", }, } @@ -51,7 +51,7 @@ func TestWriteReadMessageSimple(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(RequestEcho) + msg := new(EchoRequest) err = ReadMessage(buf, msg) assert.Nil(t, err) @@ -84,7 +84,7 @@ func TestWriteReadMessage(t *testing.T) { func TestWriteReadMessage2(t *testing.T) { phrase := "hello-world" cases := []proto.Message{ - &ResponseCheckTx{ + &CheckTxResponse{ Data: []byte(phrase), Log: phrase, GasWanted: 10, @@ -105,7 +105,7 @@ func TestWriteReadMessage2(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(ResponseCheckTx) + msg := new(CheckTxResponse) err = ReadMessage(buf, msg) assert.Nil(t, err) diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 501a56963a..ec231929a4 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -7,10 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta1" - v2 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta2" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" - v4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // Application is an autogenerated mock type for the Application type @@ -19,23 +16,23 @@ type Application struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error) { +func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseApplySnapshotChunk + var r0 *v1beta4.ApplySnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) *v4.ResponseApplySnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) *v1beta4.ApplySnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*v1beta4.ApplySnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -45,23 +42,23 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *v1.RequestAp } // CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *Application) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) (*v3.ResponseCheckTx, error) { +func (_m *Application) CheckTx(_a0 context.Context, _a1 *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseCheckTx + var r0 *v1beta4.CheckTxResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) (*v3.ResponseCheckTx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) *v3.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) *v1beta4.CheckTxResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCheckTx) + r0 = ret.Get(0).(*v1beta4.CheckTxResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CheckTxRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -71,23 +68,23 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) (*v3 } // Commit provides a mock function with given fields: _a0, _a1 -func (_m *Application) Commit(_a0 context.Context, _a1 *v1.RequestCommit) (*v3.ResponseCommit, error) { +func (_m *Application) Commit(_a0 context.Context, _a1 *v1beta4.CommitRequest) (*v1beta4.CommitResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseCommit + var r0 *v1beta4.CommitResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestCommit) (*v3.ResponseCommit, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CommitRequest) (*v1beta4.CommitResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestCommit) *v3.ResponseCommit); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CommitRequest) *v1beta4.CommitResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCommit) + r0 = ret.Get(0).(*v1beta4.CommitResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestCommit) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CommitRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -97,23 +94,23 @@ func (_m *Application) Commit(_a0 context.Context, _a1 *v1.RequestCommit) (*v3.R } // ExtendVote provides a mock function with given fields: _a0, _a1 -func (_m *Application) ExtendVote(_a0 context.Context, _a1 *v4.RequestExtendVote) (*v3.ResponseExtendVote, error) { +func (_m *Application) ExtendVote(_a0 context.Context, _a1 *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseExtendVote + var r0 *v1beta4.ExtendVoteResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) (*v3.ResponseExtendVote, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) *v3.ResponseExtendVote); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) *v1beta4.ExtendVoteResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseExtendVote) + r0 = ret.Get(0).(*v1beta4.ExtendVoteResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestExtendVote) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ExtendVoteRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -123,23 +120,23 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *v4.RequestExtendVote } // FinalizeBlock provides a mock function with given fields: _a0, _a1 -func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error) { +func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseFinalizeBlock + var r0 *v1beta4.FinalizeBlockResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) *v3.ResponseFinalizeBlock); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) *v1beta4.FinalizeBlockResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseFinalizeBlock) + r0 = ret.Get(0).(*v1beta4.FinalizeBlockResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestFinalizeBlock) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.FinalizeBlockRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -149,23 +146,23 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *v4.RequestFinaliz } // Info provides a mock function with given fields: _a0, _a1 -func (_m *Application) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.ResponseInfo, error) { +func (_m *Application) Info(_a0 context.Context, _a1 *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseInfo + var r0 *v1beta4.InfoResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) (*v1.ResponseInfo, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) *v1.ResponseInfo); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) *v1beta4.InfoResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseInfo) + r0 = ret.Get(0).(*v1beta4.InfoResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v2.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InfoRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -175,23 +172,23 @@ func (_m *Application) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.Respo } // InitChain provides a mock function with given fields: _a0, _a1 -func (_m *Application) InitChain(_a0 context.Context, _a1 *v3.RequestInitChain) (*v3.ResponseInitChain, error) { +func (_m *Application) InitChain(_a0 context.Context, _a1 *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseInitChain + var r0 *v1beta4.InitChainResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) (*v3.ResponseInitChain, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) *v3.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) *v1beta4.InitChainResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseInitChain) + r0 = ret.Get(0).(*v1beta4.InitChainResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InitChainRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -201,23 +198,23 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *v3.RequestInitChain) } // ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error) { +func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseListSnapshots + var r0 *v1beta4.ListSnapshotsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) *v1.ResponseListSnapshots); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) *v1beta4.ListSnapshotsResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseListSnapshots) + r0 = ret.Get(0).(*v1beta4.ListSnapshotsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ListSnapshotsRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -227,23 +224,23 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *v1.RequestListSna } // LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error) { +func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseLoadSnapshotChunk + var r0 *v1beta4.LoadSnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) *v1.ResponseLoadSnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) *v1beta4.LoadSnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*v1beta4.LoadSnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -253,23 +250,23 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.RequestLoa } // OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error) { +func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseOfferSnapshot + var r0 *v1beta4.OfferSnapshotResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) *v4.ResponseOfferSnapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) *v1beta4.OfferSnapshotResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseOfferSnapshot) + r0 = ret.Get(0).(*v1beta4.OfferSnapshotResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.OfferSnapshotRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -279,23 +276,23 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *v1.RequestOfferSn } // PrepareProposal provides a mock function with given fields: _a0, _a1 -func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error) { +func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v2.ResponsePrepareProposal + var r0 *v1beta4.PrepareProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) *v2.ResponsePrepareProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) *v1beta4.PrepareProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v2.ResponsePrepareProposal) + r0 = ret.Get(0).(*v1beta4.PrepareProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestPrepareProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.PrepareProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -305,23 +302,23 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *v4.RequestPrepa } // ProcessProposal provides a mock function with given fields: _a0, _a1 -func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error) { +func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseProcessProposal + var r0 *v1beta4.ProcessProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) *v4.ResponseProcessProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) *v1beta4.ProcessProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseProcessProposal) + r0 = ret.Get(0).(*v1beta4.ProcessProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestProcessProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ProcessProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -331,23 +328,23 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *v4.RequestProce } // Query provides a mock function with given fields: _a0, _a1 -func (_m *Application) Query(_a0 context.Context, _a1 *v1.RequestQuery) (*v1.ResponseQuery, error) { +func (_m *Application) Query(_a0 context.Context, _a1 *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseQuery + var r0 *v1beta4.QueryResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) (*v1.ResponseQuery, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) *v1.ResponseQuery); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) *v1beta4.QueryResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseQuery) + r0 = ret.Get(0).(*v1beta4.QueryResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -357,23 +354,23 @@ func (_m *Application) Query(_a0 context.Context, _a1 *v1.RequestQuery) (*v1.Res } // VerifyVoteExtension provides a mock function with given fields: _a0, _a1 -func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error) { +func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseVerifyVoteExtension + var r0 *v1beta4.VerifyVoteExtensionResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) *v4.ResponseVerifyVoteExtension); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) *v1beta4.VerifyVoteExtensionResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseVerifyVoteExtension) + r0 = ret.Get(0).(*v1beta4.VerifyVoteExtensionResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestVerifyVoteExtension) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/abci/types/types.go b/abci/types/types.go index 296695747c..b259a92cf9 100644 --- a/abci/types/types.go +++ b/abci/types/types.go @@ -14,22 +14,22 @@ import ( type ( Request = v1beta4.Request - RequestEcho = v1beta1.RequestEcho - RequestFlush = v1beta1.RequestFlush - RequestInfo = v1beta2.RequestInfo - RequestInitChain = v1beta3.RequestInitChain - RequestQuery = v1beta1.RequestQuery - RequestCheckTx = v1beta4.RequestCheckTx - RequestCommit = v1beta1.RequestCommit - RequestListSnapshots = v1beta1.RequestListSnapshots - RequestOfferSnapshot = v1beta1.RequestOfferSnapshot - RequestLoadSnapshotChunk = v1beta1.RequestLoadSnapshotChunk - RequestApplySnapshotChunk = v1beta1.RequestApplySnapshotChunk - RequestPrepareProposal = v1beta4.RequestPrepareProposal - RequestProcessProposal = v1beta4.RequestProcessProposal - RequestExtendVote = v1beta4.RequestExtendVote - RequestVerifyVoteExtension = v1beta3.RequestVerifyVoteExtension - RequestFinalizeBlock = v1beta4.RequestFinalizeBlock + EchoRequest = v1beta4.EchoRequest + FlushRequest = v1beta4.FlushRequest + InfoRequest = v1beta4.InfoRequest + InitChainRequest = v1beta4.InitChainRequest + QueryRequest = v1beta4.QueryRequest + CheckTxRequest = v1beta4.CheckTxRequest + CommitRequest = v1beta4.CommitRequest + ListSnapshotsRequest = v1beta4.ListSnapshotsRequest + OfferSnapshotRequest = v1beta4.OfferSnapshotRequest + LoadSnapshotChunkRequest = v1beta4.LoadSnapshotChunkRequest + ApplySnapshotChunkRequest = v1beta4.ApplySnapshotChunkRequest + PrepareProposalRequest = v1beta4.PrepareProposalRequest + ProcessProposalRequest = v1beta4.ProcessProposalRequest + ExtendVoteRequest = v1beta4.ExtendVoteRequest + VerifyVoteExtensionRequest = v1beta4.VerifyVoteExtensionRequest + FinalizeBlockRequest = v1beta4.FinalizeBlockRequest ) // Discriminated Request variants are defined in the latest proto package. @@ -54,23 +54,23 @@ type ( type ( Response = v1beta4.Response - ResponseException = v1beta1.ResponseException - ResponseEcho = v1beta1.ResponseEcho - ResponseFlush = v1beta1.ResponseFlush - ResponseInfo = v1beta1.ResponseInfo - ResponseInitChain = v1beta3.ResponseInitChain - ResponseQuery = v1beta1.ResponseQuery - ResponseCheckTx = v1beta3.ResponseCheckTx - ResponseCommit = v1beta3.ResponseCommit - ResponseListSnapshots = v1beta1.ResponseListSnapshots - ResponseOfferSnapshot = v1beta4.ResponseOfferSnapshot - ResponseLoadSnapshotChunk = v1beta1.ResponseLoadSnapshotChunk - ResponseApplySnapshotChunk = v1beta4.ResponseApplySnapshotChunk - ResponsePrepareProposal = v1beta2.ResponsePrepareProposal - ResponseProcessProposal = v1beta4.ResponseProcessProposal - ResponseExtendVote = v1beta3.ResponseExtendVote - ResponseVerifyVoteExtension = v1beta4.ResponseVerifyVoteExtension - ResponseFinalizeBlock = v1beta3.ResponseFinalizeBlock + ExceptionResponse = v1beta4.ExceptionResponse + EchoResponse = v1beta4.EchoResponse + FlushResponse = v1beta4.FlushResponse + InfoResponse = v1beta4.InfoResponse + InitChainResponse = v1beta4.InitChainResponse + QueryResponse = v1beta4.QueryResponse + CheckTxResponse = v1beta4.CheckTxResponse + CommitResponse = v1beta4.CommitResponse + ListSnapshotsResponse = v1beta4.ListSnapshotsResponse + OfferSnapshotResponse = v1beta4.OfferSnapshotResponse + LoadSnapshotChunkResponse = v1beta4.LoadSnapshotChunkResponse + ApplySnapshotChunkResponse = v1beta4.ApplySnapshotChunkResponse + PrepareProposalResponse = v1beta4.PrepareProposalResponse + ProcessProposalResponse = v1beta4.ProcessProposalResponse + ExtendVoteResponse = v1beta4.ExtendVoteResponse + VerifyVoteExtensionResponse = v1beta4.VerifyVoteExtensionResponse + FinalizeBlockResponse = v1beta4.FinalizeBlockResponse ) // Discriminated Response variants are defined in the latest proto package. @@ -110,16 +110,16 @@ type ( ) type ( - ABCIClient = v1beta4.ABCIClient - ABCIServer = v1beta4.ABCIServer + ABCIServiceClient = v1beta4.ABCIServiceClient + ABCIServiceServer = v1beta4.ABCIServiceServer ) -func NewABCIClient(cc grpc.ClientConn) ABCIClient { - return v1beta4.NewABCIClient(cc) +func NewABCIClient(cc grpc.ClientConn) ABCIServiceClient { + return v1beta4.NewABCIServiceClient(cc) } -func RegisterABCIServer(s grpc.Server, srv ABCIServer) { - v1beta4.RegisterABCIServer(s, srv) +func RegisterABCIServer(s grpc.Server, srv ABCIServiceServer) { + v1beta4.RegisterABCIServiceServer(s, srv) } type CheckTxType = v1beta4.CheckTxType @@ -191,10 +191,10 @@ type jsonRoundTripper interface { } var ( - _ jsonRoundTripper = (*ResponseCommit)(nil) - _ jsonRoundTripper = (*ResponseQuery)(nil) + _ jsonRoundTripper = (*CommitResponse)(nil) + _ jsonRoundTripper = (*QueryResponse)(nil) _ jsonRoundTripper = (*ExecTxResult)(nil) - _ jsonRoundTripper = (*ResponseCheckTx)(nil) + _ jsonRoundTripper = (*CheckTxResponse)(nil) ) var _ jsonRoundTripper = (*EventAttribute)(nil) diff --git a/api/cometbft/abci/v1beta4/service.pb.go b/api/cometbft/abci/v1beta4/service.pb.go new file mode 100644 index 0000000000..9884c68e46 --- /dev/null +++ b/api/cometbft/abci/v1beta4/service.pb.go @@ -0,0 +1,686 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cometbft/abci/v1beta4/service.proto + +package v1beta4 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { + proto.RegisterFile("cometbft/abci/v1beta4/service.proto", fileDescriptor_5cfd5254dd7743ce) +} + +var fileDescriptor_5cfd5254dd7743ce = []byte{ + // 505 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x5b, 0x69, 0x0c, 0x61, 0x40, 0x08, 0x23, 0x2e, 0x3b, 0x44, 0x82, 0x31, 0xfe, 0x08, + 0x48, 0xd8, 0x40, 0xdc, 0xd7, 0x68, 0x93, 0x2a, 0x4d, 0x6a, 0xd9, 0x60, 0x42, 0x1c, 0x90, 0x9c, + 0xec, 0x0d, 0x31, 0x4d, 0x6d, 0x13, 0x3b, 0xd5, 0x82, 0xf8, 0x10, 0x7c, 0x2c, 0x8e, 0x3b, 0x72, + 0x44, 0x2d, 0x1f, 0x04, 0xa5, 0xb1, 0x09, 0x09, 0xf5, 0x92, 0x5e, 0xfd, 0xfc, 0xde, 0xe7, 0x67, + 0xb7, 0xb1, 0x8c, 0xb6, 0x43, 0x3e, 0x05, 0x15, 0x44, 0xca, 0x23, 0x41, 0x48, 0xbd, 0xd9, 0x6e, + 0x00, 0x8a, 0xbc, 0xf2, 0x24, 0xa4, 0x33, 0x1a, 0x82, 0x2b, 0x52, 0xae, 0x38, 0xbe, 0x6b, 0x20, + 0xb7, 0x80, 0x5c, 0x0d, 0x6d, 0xdd, 0x5b, 0x3d, 0xab, 0x72, 0x01, 0xb2, 0x9c, 0xdc, 0xfb, 0x7d, + 0x03, 0x5d, 0xdf, 0x1f, 0xf8, 0xc3, 0x93, 0xb2, 0x0f, 0x8f, 0xd0, 0xc6, 0x41, 0x18, 0x73, 0x7c, + 0xdf, 0x5d, 0x59, 0xe9, 0x16, 0xe1, 0x31, 0x7c, 0xc9, 0x40, 0xaa, 0xad, 0xed, 0x4b, 0x19, 0x29, + 0x38, 0x93, 0x80, 0x8f, 0xd1, 0x95, 0xc3, 0x24, 0x93, 0x31, 0xb6, 0xd1, 0xcb, 0xd4, 0x54, 0x3e, + 0xb8, 0x1c, 0xd2, 0x9d, 0x23, 0xb4, 0x31, 0x64, 0x91, 0x7d, 0x93, 0x45, 0xd8, 0xb6, 0xc9, 0x92, + 0xd1, 0x85, 0xef, 0xd1, 0x55, 0x3f, 0x86, 0x70, 0xf2, 0xf6, 0x1c, 0xef, 0x58, 0x78, 0x9d, 0x9b, + 0xda, 0x87, 0x6d, 0x58, 0x75, 0xfc, 0x37, 0x19, 0xa4, 0xb9, 0xf5, 0xf8, 0xcb, 0xb4, 0xed, 0xf8, + 0x1a, 0xd2, 0x9d, 0xef, 0xd0, 0xa6, 0xcf, 0xa7, 0x53, 0xaa, 0xb0, 0x8d, 0x2f, 0x63, 0xd3, 0xba, + 0xd3, 0x42, 0xe9, 0xda, 0x8f, 0xe8, 0xda, 0x90, 0x51, 0xe5, 0xc7, 0x84, 0x32, 0xfc, 0xc8, 0xfa, + 0xb3, 0x69, 0xc2, 0x94, 0x3f, 0x6e, 0x07, 0x75, 0xff, 0x67, 0x74, 0xf3, 0x88, 0x4a, 0x75, 0xc2, + 0x88, 0x90, 0x31, 0x57, 0x12, 0x3f, 0xb5, 0x8c, 0xd6, 0x28, 0xe3, 0x79, 0xd6, 0x0d, 0xae, 0x5c, + 0xa3, 0x28, 0x82, 0xd4, 0x24, 0x56, 0x57, 0x8d, 0x6a, 0x73, 0x35, 0x60, 0xed, 0x9a, 0xa1, 0xdb, + 0x47, 0x9c, 0x9c, 0x99, 0x75, 0x3f, 0xce, 0xd8, 0x04, 0x7b, 0xb6, 0xed, 0x36, 0x49, 0xe3, 0x7c, + 0xd1, 0x7d, 0x40, 0x7b, 0x73, 0x84, 0xf7, 0x85, 0x48, 0xf2, 0xba, 0xd8, 0xd6, 0xf3, 0x3f, 0x6a, + 0xcc, 0xbb, 0x6b, 0x4c, 0x68, 0xb5, 0x40, 0xb7, 0xc6, 0x29, 0x08, 0x92, 0xc2, 0x38, 0xe5, 0x82, + 0x4b, 0x92, 0xe0, 0xe7, 0x96, 0x96, 0x06, 0x67, 0xa4, 0x6e, 0x57, 0xfc, 0x5f, 0x23, 0x0f, 0x41, + 0xca, 0x0e, 0xc6, 0x1a, 0xd7, 0x6e, 0x6c, 0xe0, 0xda, 0x48, 0x10, 0x3a, 0x38, 0x57, 0xc0, 0xce, + 0x4e, 0xb9, 0x02, 0x6c, 0xfb, 0xcc, 0x2b, 0xc4, 0x78, 0x9e, 0x74, 0x20, 0xb5, 0xe2, 0x1b, 0xba, + 0x73, 0x0a, 0x29, 0x8d, 0xf2, 0x62, 0x75, 0x99, 0x4b, 0xca, 0x19, 0xb6, 0xfd, 0x21, 0x2b, 0x58, + 0x23, 0xdd, 0x5b, 0x67, 0xa4, 0xba, 0x23, 0x87, 0x94, 0x91, 0x84, 0x7e, 0x85, 0x41, 0xc2, 0xc3, + 0x89, 0xf5, 0x8e, 0xd4, 0xa8, 0xb6, 0x3b, 0xd2, 0x80, 0x4b, 0xd7, 0x60, 0xfc, 0x63, 0xee, 0xf4, + 0x2f, 0xe6, 0x4e, 0xff, 0xd7, 0xdc, 0xe9, 0x7f, 0x5f, 0x38, 0xbd, 0x8b, 0x85, 0xd3, 0xfb, 0xb9, + 0x70, 0x7a, 0x1f, 0x5e, 0x7f, 0xa2, 0x2a, 0xce, 0x82, 0xa2, 0xcd, 0xfb, 0xfb, 0x5c, 0x55, 0xef, + 0x96, 0xa0, 0xde, 0xca, 0x47, 0x2c, 0xd8, 0x5c, 0xbe, 0x5f, 0x2f, 0xff, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x41, 0x09, 0x15, 0xff, 0x20, 0x07, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ABCIServiceClient is the client API for ABCIService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ABCIServiceClient interface { + Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) + Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error) + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) + CheckTx(ctx context.Context, in *CheckTxRequest, opts ...grpc.CallOption) (*CheckTxResponse, error) + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + InitChain(ctx context.Context, in *InitChainRequest, opts ...grpc.CallOption) (*InitChainResponse, error) + ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) + OfferSnapshot(ctx context.Context, in *OfferSnapshotRequest, opts ...grpc.CallOption) (*OfferSnapshotResponse, error) + LoadSnapshotChunk(ctx context.Context, in *LoadSnapshotChunkRequest, opts ...grpc.CallOption) (*LoadSnapshotChunkResponse, error) + ApplySnapshotChunk(ctx context.Context, in *ApplySnapshotChunkRequest, opts ...grpc.CallOption) (*ApplySnapshotChunkResponse, error) + PrepareProposal(ctx context.Context, in *PrepareProposalRequest, opts ...grpc.CallOption) (*PrepareProposalResponse, error) + ProcessProposal(ctx context.Context, in *ProcessProposalRequest, opts ...grpc.CallOption) (*ProcessProposalResponse, error) + ExtendVote(ctx context.Context, in *ExtendVoteRequest, opts ...grpc.CallOption) (*ExtendVoteResponse, error) + VerifyVoteExtension(ctx context.Context, in *VerifyVoteExtensionRequest, opts ...grpc.CallOption) (*VerifyVoteExtensionResponse, error) + FinalizeBlock(ctx context.Context, in *FinalizeBlockRequest, opts ...grpc.CallOption) (*FinalizeBlockResponse, error) +} + +type aBCIServiceClient struct { + cc grpc1.ClientConn +} + +func NewABCIServiceClient(cc grpc1.ClientConn) ABCIServiceClient { + return &aBCIServiceClient{cc} +} + +func (c *aBCIServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + out := new(EchoResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/Echo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error) { + out := new(FlushResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/Flush", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/Info", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) CheckTx(ctx context.Context, in *CheckTxRequest, opts ...grpc.CallOption) (*CheckTxResponse, error) { + out := new(CheckTxResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/CheckTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/Query", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/Commit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) InitChain(ctx context.Context, in *InitChainRequest, opts ...grpc.CallOption) (*InitChainResponse, error) { + out := new(InitChainResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/InitChain", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) { + out := new(ListSnapshotsResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/ListSnapshots", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) OfferSnapshot(ctx context.Context, in *OfferSnapshotRequest, opts ...grpc.CallOption) (*OfferSnapshotResponse, error) { + out := new(OfferSnapshotResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/OfferSnapshot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) LoadSnapshotChunk(ctx context.Context, in *LoadSnapshotChunkRequest, opts ...grpc.CallOption) (*LoadSnapshotChunkResponse, error) { + out := new(LoadSnapshotChunkResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/LoadSnapshotChunk", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) ApplySnapshotChunk(ctx context.Context, in *ApplySnapshotChunkRequest, opts ...grpc.CallOption) (*ApplySnapshotChunkResponse, error) { + out := new(ApplySnapshotChunkResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/ApplySnapshotChunk", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) PrepareProposal(ctx context.Context, in *PrepareProposalRequest, opts ...grpc.CallOption) (*PrepareProposalResponse, error) { + out := new(PrepareProposalResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/PrepareProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) ProcessProposal(ctx context.Context, in *ProcessProposalRequest, opts ...grpc.CallOption) (*ProcessProposalResponse, error) { + out := new(ProcessProposalResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/ProcessProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) ExtendVote(ctx context.Context, in *ExtendVoteRequest, opts ...grpc.CallOption) (*ExtendVoteResponse, error) { + out := new(ExtendVoteResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/ExtendVote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) VerifyVoteExtension(ctx context.Context, in *VerifyVoteExtensionRequest, opts ...grpc.CallOption) (*VerifyVoteExtensionResponse, error) { + out := new(VerifyVoteExtensionResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/VerifyVoteExtension", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIServiceClient) FinalizeBlock(ctx context.Context, in *FinalizeBlockRequest, opts ...grpc.CallOption) (*FinalizeBlockResponse, error) { + out := new(FinalizeBlockResponse) + err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCIService/FinalizeBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ABCIServiceServer is the server API for ABCIService service. +type ABCIServiceServer interface { + Echo(context.Context, *EchoRequest) (*EchoResponse, error) + Flush(context.Context, *FlushRequest) (*FlushResponse, error) + Info(context.Context, *InfoRequest) (*InfoResponse, error) + CheckTx(context.Context, *CheckTxRequest) (*CheckTxResponse, error) + Query(context.Context, *QueryRequest) (*QueryResponse, error) + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + InitChain(context.Context, *InitChainRequest) (*InitChainResponse, error) + ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) + OfferSnapshot(context.Context, *OfferSnapshotRequest) (*OfferSnapshotResponse, error) + LoadSnapshotChunk(context.Context, *LoadSnapshotChunkRequest) (*LoadSnapshotChunkResponse, error) + ApplySnapshotChunk(context.Context, *ApplySnapshotChunkRequest) (*ApplySnapshotChunkResponse, error) + PrepareProposal(context.Context, *PrepareProposalRequest) (*PrepareProposalResponse, error) + ProcessProposal(context.Context, *ProcessProposalRequest) (*ProcessProposalResponse, error) + ExtendVote(context.Context, *ExtendVoteRequest) (*ExtendVoteResponse, error) + VerifyVoteExtension(context.Context, *VerifyVoteExtensionRequest) (*VerifyVoteExtensionResponse, error) + FinalizeBlock(context.Context, *FinalizeBlockRequest) (*FinalizeBlockResponse, error) +} + +// UnimplementedABCIServiceServer can be embedded to have forward compatible implementations. +type UnimplementedABCIServiceServer struct { +} + +func (*UnimplementedABCIServiceServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (*UnimplementedABCIServiceServer) Flush(ctx context.Context, req *FlushRequest) (*FlushResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") +} +func (*UnimplementedABCIServiceServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} +func (*UnimplementedABCIServiceServer) CheckTx(ctx context.Context, req *CheckTxRequest) (*CheckTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented") +} +func (*UnimplementedABCIServiceServer) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (*UnimplementedABCIServiceServer) Commit(ctx context.Context, req *CommitRequest) (*CommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") +} +func (*UnimplementedABCIServiceServer) InitChain(ctx context.Context, req *InitChainRequest) (*InitChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") +} +func (*UnimplementedABCIServiceServer) ListSnapshots(ctx context.Context, req *ListSnapshotsRequest) (*ListSnapshotsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented") +} +func (*UnimplementedABCIServiceServer) OfferSnapshot(ctx context.Context, req *OfferSnapshotRequest) (*OfferSnapshotResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OfferSnapshot not implemented") +} +func (*UnimplementedABCIServiceServer) LoadSnapshotChunk(ctx context.Context, req *LoadSnapshotChunkRequest) (*LoadSnapshotChunkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadSnapshotChunk not implemented") +} +func (*UnimplementedABCIServiceServer) ApplySnapshotChunk(ctx context.Context, req *ApplySnapshotChunkRequest) (*ApplySnapshotChunkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplySnapshotChunk not implemented") +} +func (*UnimplementedABCIServiceServer) PrepareProposal(ctx context.Context, req *PrepareProposalRequest) (*PrepareProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PrepareProposal not implemented") +} +func (*UnimplementedABCIServiceServer) ProcessProposal(ctx context.Context, req *ProcessProposalRequest) (*ProcessProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented") +} +func (*UnimplementedABCIServiceServer) ExtendVote(ctx context.Context, req *ExtendVoteRequest) (*ExtendVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExtendVote not implemented") +} +func (*UnimplementedABCIServiceServer) VerifyVoteExtension(ctx context.Context, req *VerifyVoteExtensionRequest) (*VerifyVoteExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyVoteExtension not implemented") +} +func (*UnimplementedABCIServiceServer) FinalizeBlock(ctx context.Context, req *FinalizeBlockRequest) (*FinalizeBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented") +} + +func RegisterABCIServiceServer(s grpc1.Server, srv ABCIServiceServer) { + s.RegisterService(&_ABCIService_serviceDesc, srv) +} + +func _ABCIService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EchoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/Echo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).Echo(ctx, req.(*EchoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FlushRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).Flush(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/Flush", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).Flush(ctx, req.(*FlushRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/Info", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).Info(ctx, req.(*InfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).CheckTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/CheckTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).CheckTx(ctx, req.(*CheckTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/Query", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).InitChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/InitChain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).InitChain(ctx, req.(*InitChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSnapshotsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).ListSnapshots(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/ListSnapshots", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).ListSnapshots(ctx, req.(*ListSnapshotsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OfferSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).OfferSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/OfferSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).OfferSnapshot(ctx, req.(*OfferSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoadSnapshotChunkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).LoadSnapshotChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/LoadSnapshotChunk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).LoadSnapshotChunk(ctx, req.(*LoadSnapshotChunkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplySnapshotChunkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).ApplySnapshotChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/ApplySnapshotChunk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).ApplySnapshotChunk(ctx, req.(*ApplySnapshotChunkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_PrepareProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PrepareProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).PrepareProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/PrepareProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).PrepareProposal(ctx, req.(*PrepareProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProcessProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).ProcessProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/ProcessProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).ProcessProposal(ctx, req.(*ProcessProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_ExtendVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExtendVoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).ExtendVote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/ExtendVote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).ExtendVote(ctx, req.(*ExtendVoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_VerifyVoteExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyVoteExtensionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).VerifyVoteExtension(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/VerifyVoteExtension", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).VerifyVoteExtension(ctx, req.(*VerifyVoteExtensionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIService_FinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FinalizeBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIServiceServer).FinalizeBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cometbft.abci.v1beta4.ABCIService/FinalizeBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIServiceServer).FinalizeBlock(ctx, req.(*FinalizeBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ABCIService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cometbft.abci.v1beta4.ABCIService", + HandlerType: (*ABCIServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _ABCIService_Echo_Handler, + }, + { + MethodName: "Flush", + Handler: _ABCIService_Flush_Handler, + }, + { + MethodName: "Info", + Handler: _ABCIService_Info_Handler, + }, + { + MethodName: "CheckTx", + Handler: _ABCIService_CheckTx_Handler, + }, + { + MethodName: "Query", + Handler: _ABCIService_Query_Handler, + }, + { + MethodName: "Commit", + Handler: _ABCIService_Commit_Handler, + }, + { + MethodName: "InitChain", + Handler: _ABCIService_InitChain_Handler, + }, + { + MethodName: "ListSnapshots", + Handler: _ABCIService_ListSnapshots_Handler, + }, + { + MethodName: "OfferSnapshot", + Handler: _ABCIService_OfferSnapshot_Handler, + }, + { + MethodName: "LoadSnapshotChunk", + Handler: _ABCIService_LoadSnapshotChunk_Handler, + }, + { + MethodName: "ApplySnapshotChunk", + Handler: _ABCIService_ApplySnapshotChunk_Handler, + }, + { + MethodName: "PrepareProposal", + Handler: _ABCIService_PrepareProposal_Handler, + }, + { + MethodName: "ProcessProposal", + Handler: _ABCIService_ProcessProposal_Handler, + }, + { + MethodName: "ExtendVote", + Handler: _ABCIService_ExtendVote_Handler, + }, + { + MethodName: "VerifyVoteExtension", + Handler: _ABCIService_VerifyVoteExtension_Handler, + }, + { + MethodName: "FinalizeBlock", + Handler: _ABCIService_FinalizeBlock_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cometbft/abci/v1beta4/service.proto", +} diff --git a/api/cometbft/abci/v1beta4/types.go b/api/cometbft/abci/v1beta4/types.go index ca8b0da32f..f8055de90d 100644 --- a/api/cometbft/abci/v1beta4/types.go +++ b/api/cometbft/abci/v1beta4/types.go @@ -1,20 +1,91 @@ package v1beta4 +import ( + "bytes" + + "github.com/cosmos/gogoproto/jsonpb" +) + +const ( + CodeTypeOK uint32 = 0 +) + +// IsOK returns true if Code is OK. +func (r CheckTxResponse) IsOK() bool { + return r.Code == CodeTypeOK +} + +// IsErr returns true if Code is something other than OK. +func (r CheckTxResponse) IsErr() bool { + return r.Code != CodeTypeOK +} + +// IsOK returns true if Code is OK. +func (r QueryResponse) IsOK() bool { + return r.Code == CodeTypeOK +} + +// IsErr returns true if Code is something other than OK. +func (r QueryResponse) IsErr() bool { + return r.Code != CodeTypeOK +} + // IsAccepted returns true if Code is ACCEPT -func (r ResponseProcessProposal) IsAccepted() bool { +func (r ProcessProposalResponse) IsAccepted() bool { return r.Status == PROCESS_PROPOSAL_STATUS_ACCEPT } // IsStatusUnknown returns true if Code is UNKNOWN -func (r ResponseProcessProposal) IsStatusUnknown() bool { +func (r ProcessProposalResponse) IsStatusUnknown() bool { return r.Status == PROCESS_PROPOSAL_STATUS_UNKNOWN } -func (r ResponseVerifyVoteExtension) IsAccepted() bool { +func (r VerifyVoteExtensionResponse) IsAccepted() bool { return r.Status == VERIFY_VOTE_EXTENSION_STATUS_ACCEPT } // IsStatusUnknown returns true if Code is Unknown -func (r ResponseVerifyVoteExtension) IsStatusUnknown() bool { +func (r VerifyVoteExtensionResponse) IsStatusUnknown() bool { return r.Status == VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN } + +//--------------------------------------------------------------------------- +// override JSON marshaling so we emit defaults (ie. disable omitempty) + +var ( + jsonpbMarshaller = jsonpb.Marshaler{ + EnumsAsInts: true, + EmitDefaults: true, + } + jsonpbUnmarshaller = jsonpb.Unmarshaler{} +) + +func (r *CheckTxResponse) MarshalJSON() ([]byte, error) { + s, err := jsonpbMarshaller.MarshalToString(r) + return []byte(s), err +} + +func (r *CheckTxResponse) UnmarshalJSON(b []byte) error { + reader := bytes.NewBuffer(b) + return jsonpbUnmarshaller.Unmarshal(reader, r) +} + +func (r *QueryResponse) MarshalJSON() ([]byte, error) { + s, err := jsonpbMarshaller.MarshalToString(r) + return []byte(s), err +} + +func (r *QueryResponse) UnmarshalJSON(b []byte) error { + reader := bytes.NewBuffer(b) + return jsonpbUnmarshaller.Unmarshal(reader, r) +} + +func (r *CommitResponse) MarshalJSON() ([]byte, error) { + s, err := jsonpbMarshaller.MarshalToString(r) + return []byte(s), err +} + +func (r *CommitResponse) UnmarshalJSON(b []byte) error { + reader := bytes.NewBuffer(b) + return jsonpbUnmarshaller.Unmarshal(reader, r) +} diff --git a/api/cometbft/abci/v1beta4/types.pb.go b/api/cometbft/abci/v1beta4/types.pb.go index 7144edd56d..95bf35109b 100644 --- a/api/cometbft/abci/v1beta4/types.pb.go +++ b/api/cometbft/abci/v1beta4/types.pb.go @@ -4,19 +4,16 @@ package v1beta4 import ( - context "context" fmt "fmt" v1beta1 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta1" v1beta2 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta2" - v1beta3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" + v1beta31 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" + v1beta11 "github.com/cometbft/cometbft/api/cometbft/crypto/v1beta1" + v1beta3 "github.com/cometbft/cometbft/api/cometbft/types/v1beta3" _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "github.com/cosmos/gogoproto/types" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -291,52 +288,52 @@ type isRequest_Value interface { } type Request_Echo struct { - Echo *v1beta1.RequestEcho `protobuf:"bytes,1,opt,name=echo,proto3,oneof" json:"echo,omitempty"` + Echo *EchoRequest `protobuf:"bytes,1,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } type Request_Flush struct { - Flush *v1beta1.RequestFlush `protobuf:"bytes,2,opt,name=flush,proto3,oneof" json:"flush,omitempty"` + Flush *FlushRequest `protobuf:"bytes,2,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } type Request_Info struct { - Info *v1beta2.RequestInfo `protobuf:"bytes,3,opt,name=info,proto3,oneof" json:"info,omitempty"` + Info *InfoRequest `protobuf:"bytes,3,opt,name=info,proto3,oneof" json:"info,omitempty"` } type Request_InitChain struct { - InitChain *v1beta3.RequestInitChain `protobuf:"bytes,5,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` + InitChain *InitChainRequest `protobuf:"bytes,5,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Request_Query struct { - Query *v1beta1.RequestQuery `protobuf:"bytes,6,opt,name=query,proto3,oneof" json:"query,omitempty"` + Query *QueryRequest `protobuf:"bytes,6,opt,name=query,proto3,oneof" json:"query,omitempty"` } type Request_CheckTx struct { - CheckTx *RequestCheckTx `protobuf:"bytes,8,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` + CheckTx *CheckTxRequest `protobuf:"bytes,8,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } type Request_Commit struct { - Commit *v1beta1.RequestCommit `protobuf:"bytes,11,opt,name=commit,proto3,oneof" json:"commit,omitempty"` + Commit *CommitRequest `protobuf:"bytes,11,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } type Request_ListSnapshots struct { - ListSnapshots *v1beta1.RequestListSnapshots `protobuf:"bytes,12,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` + ListSnapshots *ListSnapshotsRequest `protobuf:"bytes,12,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` } type Request_OfferSnapshot struct { - OfferSnapshot *v1beta1.RequestOfferSnapshot `protobuf:"bytes,13,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` + OfferSnapshot *OfferSnapshotRequest `protobuf:"bytes,13,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` } type Request_LoadSnapshotChunk struct { - LoadSnapshotChunk *v1beta1.RequestLoadSnapshotChunk `protobuf:"bytes,14,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` + LoadSnapshotChunk *LoadSnapshotChunkRequest `protobuf:"bytes,14,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` } type Request_ApplySnapshotChunk struct { - ApplySnapshotChunk *v1beta1.RequestApplySnapshotChunk `protobuf:"bytes,15,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` + ApplySnapshotChunk *ApplySnapshotChunkRequest `protobuf:"bytes,15,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` } type Request_PrepareProposal struct { - PrepareProposal *RequestPrepareProposal `protobuf:"bytes,16,opt,name=prepare_proposal,json=prepareProposal,proto3,oneof" json:"prepare_proposal,omitempty"` + PrepareProposal *PrepareProposalRequest `protobuf:"bytes,16,opt,name=prepare_proposal,json=prepareProposal,proto3,oneof" json:"prepare_proposal,omitempty"` } type Request_ProcessProposal struct { - ProcessProposal *RequestProcessProposal `protobuf:"bytes,17,opt,name=process_proposal,json=processProposal,proto3,oneof" json:"process_proposal,omitempty"` + ProcessProposal *ProcessProposalRequest `protobuf:"bytes,17,opt,name=process_proposal,json=processProposal,proto3,oneof" json:"process_proposal,omitempty"` } type Request_ExtendVote struct { - ExtendVote *RequestExtendVote `protobuf:"bytes,18,opt,name=extend_vote,json=extendVote,proto3,oneof" json:"extend_vote,omitempty"` + ExtendVote *ExtendVoteRequest `protobuf:"bytes,18,opt,name=extend_vote,json=extendVote,proto3,oneof" json:"extend_vote,omitempty"` } type Request_VerifyVoteExtension struct { - VerifyVoteExtension *v1beta3.RequestVerifyVoteExtension `protobuf:"bytes,19,opt,name=verify_vote_extension,json=verifyVoteExtension,proto3,oneof" json:"verify_vote_extension,omitempty"` + VerifyVoteExtension *VerifyVoteExtensionRequest `protobuf:"bytes,19,opt,name=verify_vote_extension,json=verifyVoteExtension,proto3,oneof" json:"verify_vote_extension,omitempty"` } type Request_FinalizeBlock struct { - FinalizeBlock *RequestFinalizeBlock `protobuf:"bytes,20,opt,name=finalize_block,json=finalizeBlock,proto3,oneof" json:"finalize_block,omitempty"` + FinalizeBlock *FinalizeBlockRequest `protobuf:"bytes,20,opt,name=finalize_block,json=finalizeBlock,proto3,oneof" json:"finalize_block,omitempty"` } func (*Request_Echo) isRequest_Value() {} @@ -363,112 +360,112 @@ func (m *Request) GetValue() isRequest_Value { return nil } -func (m *Request) GetEcho() *v1beta1.RequestEcho { +func (m *Request) GetEcho() *EchoRequest { if x, ok := m.GetValue().(*Request_Echo); ok { return x.Echo } return nil } -func (m *Request) GetFlush() *v1beta1.RequestFlush { +func (m *Request) GetFlush() *FlushRequest { if x, ok := m.GetValue().(*Request_Flush); ok { return x.Flush } return nil } -func (m *Request) GetInfo() *v1beta2.RequestInfo { +func (m *Request) GetInfo() *InfoRequest { if x, ok := m.GetValue().(*Request_Info); ok { return x.Info } return nil } -func (m *Request) GetInitChain() *v1beta3.RequestInitChain { +func (m *Request) GetInitChain() *InitChainRequest { if x, ok := m.GetValue().(*Request_InitChain); ok { return x.InitChain } return nil } -func (m *Request) GetQuery() *v1beta1.RequestQuery { +func (m *Request) GetQuery() *QueryRequest { if x, ok := m.GetValue().(*Request_Query); ok { return x.Query } return nil } -func (m *Request) GetCheckTx() *RequestCheckTx { +func (m *Request) GetCheckTx() *CheckTxRequest { if x, ok := m.GetValue().(*Request_CheckTx); ok { return x.CheckTx } return nil } -func (m *Request) GetCommit() *v1beta1.RequestCommit { +func (m *Request) GetCommit() *CommitRequest { if x, ok := m.GetValue().(*Request_Commit); ok { return x.Commit } return nil } -func (m *Request) GetListSnapshots() *v1beta1.RequestListSnapshots { +func (m *Request) GetListSnapshots() *ListSnapshotsRequest { if x, ok := m.GetValue().(*Request_ListSnapshots); ok { return x.ListSnapshots } return nil } -func (m *Request) GetOfferSnapshot() *v1beta1.RequestOfferSnapshot { +func (m *Request) GetOfferSnapshot() *OfferSnapshotRequest { if x, ok := m.GetValue().(*Request_OfferSnapshot); ok { return x.OfferSnapshot } return nil } -func (m *Request) GetLoadSnapshotChunk() *v1beta1.RequestLoadSnapshotChunk { +func (m *Request) GetLoadSnapshotChunk() *LoadSnapshotChunkRequest { if x, ok := m.GetValue().(*Request_LoadSnapshotChunk); ok { return x.LoadSnapshotChunk } return nil } -func (m *Request) GetApplySnapshotChunk() *v1beta1.RequestApplySnapshotChunk { +func (m *Request) GetApplySnapshotChunk() *ApplySnapshotChunkRequest { if x, ok := m.GetValue().(*Request_ApplySnapshotChunk); ok { return x.ApplySnapshotChunk } return nil } -func (m *Request) GetPrepareProposal() *RequestPrepareProposal { +func (m *Request) GetPrepareProposal() *PrepareProposalRequest { if x, ok := m.GetValue().(*Request_PrepareProposal); ok { return x.PrepareProposal } return nil } -func (m *Request) GetProcessProposal() *RequestProcessProposal { +func (m *Request) GetProcessProposal() *ProcessProposalRequest { if x, ok := m.GetValue().(*Request_ProcessProposal); ok { return x.ProcessProposal } return nil } -func (m *Request) GetExtendVote() *RequestExtendVote { +func (m *Request) GetExtendVote() *ExtendVoteRequest { if x, ok := m.GetValue().(*Request_ExtendVote); ok { return x.ExtendVote } return nil } -func (m *Request) GetVerifyVoteExtension() *v1beta3.RequestVerifyVoteExtension { +func (m *Request) GetVerifyVoteExtension() *VerifyVoteExtensionRequest { if x, ok := m.GetValue().(*Request_VerifyVoteExtension); ok { return x.VerifyVoteExtension } return nil } -func (m *Request) GetFinalizeBlock() *RequestFinalizeBlock { +func (m *Request) GetFinalizeBlock() *FinalizeBlockRequest { if x, ok := m.GetValue().(*Request_FinalizeBlock); ok { return x.FinalizeBlock } @@ -497,23 +494,22 @@ func (*Request) XXX_OneofWrappers() []interface{} { } } -type RequestCheckTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` - Type CheckTxType `protobuf:"varint,3,opt,name=type,proto3,enum=cometbft.abci.v1beta4.CheckTxType" json:"type,omitempty"` +type EchoRequest struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } -func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { +func (m *EchoRequest) Reset() { *m = EchoRequest{} } +func (m *EchoRequest) String() string { return proto.CompactTextString(m) } +func (*EchoRequest) ProtoMessage() {} +func (*EchoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_120b31222941659d, []int{1} } -func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { +func (m *EchoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestCheckTx.Marshal(b, m, deterministic) + return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -523,59 +519,40 @@ func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *RequestCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestCheckTx.Merge(m, src) +func (m *EchoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoRequest.Merge(m, src) } -func (m *RequestCheckTx) XXX_Size() int { +func (m *EchoRequest) XXX_Size() int { return m.Size() } -func (m *RequestCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestCheckTx.DiscardUnknown(m) +func (m *EchoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EchoRequest.DiscardUnknown(m) } -var xxx_messageInfo_RequestCheckTx proto.InternalMessageInfo - -func (m *RequestCheckTx) GetTx() []byte { - if m != nil { - return m.Tx - } - return nil -} +var xxx_messageInfo_EchoRequest proto.InternalMessageInfo -func (m *RequestCheckTx) GetType() CheckTxType { +func (m *EchoRequest) GetMessage() string { if m != nil { - return m.Type + return m.Message } - return CHECK_TX_TYPE_UNKNOWN + return "" } -type RequestPrepareProposal struct { - // the modified transactions cannot exceed this size. - MaxTxBytes int64 `protobuf:"varint,1,opt,name=max_tx_bytes,json=maxTxBytes,proto3" json:"max_tx_bytes,omitempty"` - // txs is an array of transactions that will be included in a block, - // sent to the app for possible modifications. - Txs [][]byte `protobuf:"bytes,2,rep,name=txs,proto3" json:"txs,omitempty"` - LocalLastCommit v1beta3.ExtendedCommitInfo `protobuf:"bytes,3,opt,name=local_last_commit,json=localLastCommit,proto3" json:"local_last_commit"` - Misbehavior []Misbehavior `protobuf:"bytes,4,rep,name=misbehavior,proto3" json:"misbehavior"` - Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` - NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - // address of the public key of the validator proposing the block. - ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +type FlushRequest struct { } -func (m *RequestPrepareProposal) Reset() { *m = RequestPrepareProposal{} } -func (m *RequestPrepareProposal) String() string { return proto.CompactTextString(m) } -func (*RequestPrepareProposal) ProtoMessage() {} -func (*RequestPrepareProposal) Descriptor() ([]byte, []int) { +func (m *FlushRequest) Reset() { *m = FlushRequest{} } +func (m *FlushRequest) String() string { return proto.CompactTextString(m) } +func (*FlushRequest) ProtoMessage() {} +func (*FlushRequest) Descriptor() ([]byte, []int) { return fileDescriptor_120b31222941659d, []int{2} } -func (m *RequestPrepareProposal) XXX_Unmarshal(b []byte) error { +func (m *FlushRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestPrepareProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *FlushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestPrepareProposal.Marshal(b, m, deterministic) + return xxx_messageInfo_FlushRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -585,99 +562,107 @@ func (m *RequestPrepareProposal) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *RequestPrepareProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestPrepareProposal.Merge(m, src) +func (m *FlushRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushRequest.Merge(m, src) } -func (m *RequestPrepareProposal) XXX_Size() int { +func (m *FlushRequest) XXX_Size() int { return m.Size() } -func (m *RequestPrepareProposal) XXX_DiscardUnknown() { - xxx_messageInfo_RequestPrepareProposal.DiscardUnknown(m) +func (m *FlushRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FlushRequest.DiscardUnknown(m) } -var xxx_messageInfo_RequestPrepareProposal proto.InternalMessageInfo +var xxx_messageInfo_FlushRequest proto.InternalMessageInfo -func (m *RequestPrepareProposal) GetMaxTxBytes() int64 { - if m != nil { - return m.MaxTxBytes - } - return 0 +type InfoRequest struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + BlockVersion uint64 `protobuf:"varint,2,opt,name=block_version,json=blockVersion,proto3" json:"block_version,omitempty"` + P2PVersion uint64 `protobuf:"varint,3,opt,name=p2p_version,json=p2pVersion,proto3" json:"p2p_version,omitempty"` + AbciVersion string `protobuf:"bytes,4,opt,name=abci_version,json=abciVersion,proto3" json:"abci_version,omitempty"` } -func (m *RequestPrepareProposal) GetTxs() [][]byte { - if m != nil { - return m.Txs - } - return nil +func (m *InfoRequest) Reset() { *m = InfoRequest{} } +func (m *InfoRequest) String() string { return proto.CompactTextString(m) } +func (*InfoRequest) ProtoMessage() {} +func (*InfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{3} } - -func (m *RequestPrepareProposal) GetLocalLastCommit() v1beta3.ExtendedCommitInfo { - if m != nil { - return m.LocalLastCommit - } - return v1beta3.ExtendedCommitInfo{} +func (m *InfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (m *RequestPrepareProposal) GetMisbehavior() []Misbehavior { - if m != nil { - return m.Misbehavior +func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *InfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoRequest.Merge(m, src) +} +func (m *InfoRequest) XXX_Size() int { + return m.Size() +} +func (m *InfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InfoRequest.DiscardUnknown(m) } -func (m *RequestPrepareProposal) GetHeight() int64 { +var xxx_messageInfo_InfoRequest proto.InternalMessageInfo + +func (m *InfoRequest) GetVersion() string { if m != nil { - return m.Height + return m.Version } - return 0 + return "" } -func (m *RequestPrepareProposal) GetTime() time.Time { +func (m *InfoRequest) GetBlockVersion() uint64 { if m != nil { - return m.Time + return m.BlockVersion } - return time.Time{} + return 0 } -func (m *RequestPrepareProposal) GetNextValidatorsHash() []byte { +func (m *InfoRequest) GetP2PVersion() uint64 { if m != nil { - return m.NextValidatorsHash + return m.P2PVersion } - return nil + return 0 } -func (m *RequestPrepareProposal) GetProposerAddress() []byte { +func (m *InfoRequest) GetAbciVersion() string { if m != nil { - return m.ProposerAddress + return m.AbciVersion } - return nil + return "" } -type RequestProcessProposal struct { - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` - ProposedLastCommit v1beta3.CommitInfo `protobuf:"bytes,2,opt,name=proposed_last_commit,json=proposedLastCommit,proto3" json:"proposed_last_commit"` - Misbehavior []Misbehavior `protobuf:"bytes,3,rep,name=misbehavior,proto3" json:"misbehavior"` - // Merkle root hash of the fields of the proposed block. - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` - NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - // address of the public key of the original proposer of the block. - ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +type InitChainRequest struct { + Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *v1beta3.ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` + Validators []v1beta1.ValidatorUpdate `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + InitialHeight int64 `protobuf:"varint,6,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` } -func (m *RequestProcessProposal) Reset() { *m = RequestProcessProposal{} } -func (m *RequestProcessProposal) String() string { return proto.CompactTextString(m) } -func (*RequestProcessProposal) ProtoMessage() {} -func (*RequestProcessProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{3} +func (m *InitChainRequest) Reset() { *m = InitChainRequest{} } +func (m *InitChainRequest) String() string { return proto.CompactTextString(m) } +func (*InitChainRequest) ProtoMessage() {} +func (*InitChainRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{4} } -func (m *RequestProcessProposal) XXX_Unmarshal(b []byte) error { +func (m *InitChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestProcessProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InitChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestProcessProposal.Marshal(b, m, deterministic) + return xxx_messageInfo_InitChainRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -687,102 +672,79 @@ func (m *RequestProcessProposal) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *RequestProcessProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestProcessProposal.Merge(m, src) +func (m *InitChainRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitChainRequest.Merge(m, src) } -func (m *RequestProcessProposal) XXX_Size() int { +func (m *InitChainRequest) XXX_Size() int { return m.Size() } -func (m *RequestProcessProposal) XXX_DiscardUnknown() { - xxx_messageInfo_RequestProcessProposal.DiscardUnknown(m) +func (m *InitChainRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InitChainRequest.DiscardUnknown(m) } -var xxx_messageInfo_RequestProcessProposal proto.InternalMessageInfo +var xxx_messageInfo_InitChainRequest proto.InternalMessageInfo -func (m *RequestProcessProposal) GetTxs() [][]byte { +func (m *InitChainRequest) GetTime() time.Time { if m != nil { - return m.Txs + return m.Time } - return nil + return time.Time{} } -func (m *RequestProcessProposal) GetProposedLastCommit() v1beta3.CommitInfo { +func (m *InitChainRequest) GetChainId() string { if m != nil { - return m.ProposedLastCommit + return m.ChainId } - return v1beta3.CommitInfo{} + return "" } -func (m *RequestProcessProposal) GetMisbehavior() []Misbehavior { +func (m *InitChainRequest) GetConsensusParams() *v1beta3.ConsensusParams { if m != nil { - return m.Misbehavior + return m.ConsensusParams } return nil } -func (m *RequestProcessProposal) GetHash() []byte { +func (m *InitChainRequest) GetValidators() []v1beta1.ValidatorUpdate { if m != nil { - return m.Hash + return m.Validators } return nil } -func (m *RequestProcessProposal) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *RequestProcessProposal) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *RequestProcessProposal) GetNextValidatorsHash() []byte { +func (m *InitChainRequest) GetAppStateBytes() []byte { if m != nil { - return m.NextValidatorsHash + return m.AppStateBytes } return nil } -func (m *RequestProcessProposal) GetProposerAddress() []byte { +func (m *InitChainRequest) GetInitialHeight() int64 { if m != nil { - return m.ProposerAddress + return m.InitialHeight } - return nil + return 0 } -// Extends a vote with application-injected data -type RequestExtendVote struct { - // the hash of the block that this vote may be referring to - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - // the height of the extended vote - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - // info of the block that this vote may be referring to - Time time.Time `protobuf:"bytes,3,opt,name=time,proto3,stdtime" json:"time"` - Txs [][]byte `protobuf:"bytes,4,rep,name=txs,proto3" json:"txs,omitempty"` - ProposedLastCommit v1beta3.CommitInfo `protobuf:"bytes,5,opt,name=proposed_last_commit,json=proposedLastCommit,proto3" json:"proposed_last_commit"` - Misbehavior []Misbehavior `protobuf:"bytes,6,rep,name=misbehavior,proto3" json:"misbehavior"` - NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - // address of the public key of the original proposer of the block. - ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +type QueryRequest struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` } -func (m *RequestExtendVote) Reset() { *m = RequestExtendVote{} } -func (m *RequestExtendVote) String() string { return proto.CompactTextString(m) } -func (*RequestExtendVote) ProtoMessage() {} -func (*RequestExtendVote) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{4} +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{5} } -func (m *RequestExtendVote) XXX_Unmarshal(b []byte) error { +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestExtendVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestExtendVote.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -792,99 +754,113 @@ func (m *RequestExtendVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *RequestExtendVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestExtendVote.Merge(m, src) +func (m *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) } -func (m *RequestExtendVote) XXX_Size() int { +func (m *QueryRequest) XXX_Size() int { return m.Size() } -func (m *RequestExtendVote) XXX_DiscardUnknown() { - xxx_messageInfo_RequestExtendVote.DiscardUnknown(m) +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) } -var xxx_messageInfo_RequestExtendVote proto.InternalMessageInfo +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo -func (m *RequestExtendVote) GetHash() []byte { +func (m *QueryRequest) GetData() []byte { if m != nil { - return m.Hash + return m.Data } return nil } -func (m *RequestExtendVote) GetHeight() int64 { +func (m *QueryRequest) GetPath() string { if m != nil { - return m.Height + return m.Path } - return 0 + return "" } -func (m *RequestExtendVote) GetTime() time.Time { +func (m *QueryRequest) GetHeight() int64 { if m != nil { - return m.Time + return m.Height } - return time.Time{} + return 0 } -func (m *RequestExtendVote) GetTxs() [][]byte { +func (m *QueryRequest) GetProve() bool { if m != nil { - return m.Txs + return m.Prove } - return nil + return false } -func (m *RequestExtendVote) GetProposedLastCommit() v1beta3.CommitInfo { - if m != nil { - return m.ProposedLastCommit - } - return v1beta3.CommitInfo{} +type CheckTxRequest struct { + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + Type CheckTxType `protobuf:"varint,3,opt,name=type,proto3,enum=cometbft.abci.v1beta4.CheckTxType" json:"type,omitempty"` } -func (m *RequestExtendVote) GetMisbehavior() []Misbehavior { - if m != nil { - return m.Misbehavior +func (m *CheckTxRequest) Reset() { *m = CheckTxRequest{} } +func (m *CheckTxRequest) String() string { return proto.CompactTextString(m) } +func (*CheckTxRequest) ProtoMessage() {} +func (*CheckTxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{6} +} +func (m *CheckTxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckTxRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *CheckTxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckTxRequest.Merge(m, src) +} +func (m *CheckTxRequest) XXX_Size() int { + return m.Size() +} +func (m *CheckTxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CheckTxRequest.DiscardUnknown(m) } -func (m *RequestExtendVote) GetNextValidatorsHash() []byte { +var xxx_messageInfo_CheckTxRequest proto.InternalMessageInfo + +func (m *CheckTxRequest) GetTx() []byte { if m != nil { - return m.NextValidatorsHash + return m.Tx } return nil } -func (m *RequestExtendVote) GetProposerAddress() []byte { +func (m *CheckTxRequest) GetType() CheckTxType { if m != nil { - return m.ProposerAddress + return m.Type } - return nil + return CHECK_TX_TYPE_UNKNOWN } -type RequestFinalizeBlock struct { - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` - DecidedLastCommit v1beta3.CommitInfo `protobuf:"bytes,2,opt,name=decided_last_commit,json=decidedLastCommit,proto3" json:"decided_last_commit"` - Misbehavior []Misbehavior `protobuf:"bytes,3,rep,name=misbehavior,proto3" json:"misbehavior"` - // Merkle root hash of the fields of the decided block. - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` - NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - // address of the public key of the original proposer of the block. - ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +type CommitRequest struct { } -func (m *RequestFinalizeBlock) Reset() { *m = RequestFinalizeBlock{} } -func (m *RequestFinalizeBlock) String() string { return proto.CompactTextString(m) } -func (*RequestFinalizeBlock) ProtoMessage() {} -func (*RequestFinalizeBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{5} +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{7} } -func (m *RequestFinalizeBlock) XXX_Unmarshal(b []byte) error { +func (m *CommitRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestFinalizeBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *CommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestFinalizeBlock.Marshal(b, m, deterministic) + return xxx_messageInfo_CommitRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -894,108 +870,188 @@ func (m *RequestFinalizeBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *RequestFinalizeBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestFinalizeBlock.Merge(m, src) +func (m *CommitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitRequest.Merge(m, src) } -func (m *RequestFinalizeBlock) XXX_Size() int { +func (m *CommitRequest) XXX_Size() int { return m.Size() } -func (m *RequestFinalizeBlock) XXX_DiscardUnknown() { - xxx_messageInfo_RequestFinalizeBlock.DiscardUnknown(m) +func (m *CommitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CommitRequest.DiscardUnknown(m) } -var xxx_messageInfo_RequestFinalizeBlock proto.InternalMessageInfo +var xxx_messageInfo_CommitRequest proto.InternalMessageInfo -func (m *RequestFinalizeBlock) GetTxs() [][]byte { - if m != nil { - return m.Txs +// Request to list available snapshots +type ListSnapshotsRequest struct { +} + +func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } +func (m *ListSnapshotsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsRequest) ProtoMessage() {} +func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{8} +} +func (m *ListSnapshotsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListSnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListSnapshotsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *ListSnapshotsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListSnapshotsRequest.Merge(m, src) +} +func (m *ListSnapshotsRequest) XXX_Size() int { + return m.Size() +} +func (m *ListSnapshotsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListSnapshotsRequest.DiscardUnknown(m) } -func (m *RequestFinalizeBlock) GetDecidedLastCommit() v1beta3.CommitInfo { - if m != nil { - return m.DecidedLastCommit +var xxx_messageInfo_ListSnapshotsRequest proto.InternalMessageInfo + +// Request offering a snapshot to the application +type OfferSnapshotRequest struct { + Snapshot *v1beta1.Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + AppHash []byte `protobuf:"bytes,2,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +func (m *OfferSnapshotRequest) Reset() { *m = OfferSnapshotRequest{} } +func (m *OfferSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*OfferSnapshotRequest) ProtoMessage() {} +func (*OfferSnapshotRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{9} +} +func (m *OfferSnapshotRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OfferSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OfferSnapshotRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return v1beta3.CommitInfo{} +} +func (m *OfferSnapshotRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfferSnapshotRequest.Merge(m, src) +} +func (m *OfferSnapshotRequest) XXX_Size() int { + return m.Size() +} +func (m *OfferSnapshotRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OfferSnapshotRequest.DiscardUnknown(m) } -func (m *RequestFinalizeBlock) GetMisbehavior() []Misbehavior { +var xxx_messageInfo_OfferSnapshotRequest proto.InternalMessageInfo + +func (m *OfferSnapshotRequest) GetSnapshot() *v1beta1.Snapshot { if m != nil { - return m.Misbehavior + return m.Snapshot } return nil } -func (m *RequestFinalizeBlock) GetHash() []byte { +func (m *OfferSnapshotRequest) GetAppHash() []byte { if m != nil { - return m.Hash + return m.AppHash } return nil } -func (m *RequestFinalizeBlock) GetHeight() int64 { - if m != nil { - return m.Height +// Request to load a snapshot chunk +type LoadSnapshotChunkRequest struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` + Chunk uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"` +} + +func (m *LoadSnapshotChunkRequest) Reset() { *m = LoadSnapshotChunkRequest{} } +func (m *LoadSnapshotChunkRequest) String() string { return proto.CompactTextString(m) } +func (*LoadSnapshotChunkRequest) ProtoMessage() {} +func (*LoadSnapshotChunkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{10} +} +func (m *LoadSnapshotChunkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoadSnapshotChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoadSnapshotChunkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return 0 +} +func (m *LoadSnapshotChunkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadSnapshotChunkRequest.Merge(m, src) +} +func (m *LoadSnapshotChunkRequest) XXX_Size() int { + return m.Size() +} +func (m *LoadSnapshotChunkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LoadSnapshotChunkRequest.DiscardUnknown(m) } -func (m *RequestFinalizeBlock) GetTime() time.Time { +var xxx_messageInfo_LoadSnapshotChunkRequest proto.InternalMessageInfo + +func (m *LoadSnapshotChunkRequest) GetHeight() uint64 { if m != nil { - return m.Time + return m.Height } - return time.Time{} + return 0 } -func (m *RequestFinalizeBlock) GetNextValidatorsHash() []byte { +func (m *LoadSnapshotChunkRequest) GetFormat() uint32 { if m != nil { - return m.NextValidatorsHash + return m.Format } - return nil + return 0 } -func (m *RequestFinalizeBlock) GetProposerAddress() []byte { +func (m *LoadSnapshotChunkRequest) GetChunk() uint32 { if m != nil { - return m.ProposerAddress + return m.Chunk } - return nil + return 0 } -type Response struct { - // Types that are valid to be assigned to Value: - // *Response_Exception - // *Response_Echo - // *Response_Flush - // *Response_Info - // *Response_InitChain - // *Response_Query - // *Response_CheckTx - // *Response_Commit - // *Response_ListSnapshots - // *Response_OfferSnapshot - // *Response_LoadSnapshotChunk - // *Response_ApplySnapshotChunk - // *Response_PrepareProposal - // *Response_ProcessProposal - // *Response_ExtendVote - // *Response_VerifyVoteExtension - // *Response_FinalizeBlock - Value isResponse_Value `protobuf_oneof:"value"` +// Request to apply a snapshot chunk +type ApplySnapshotChunkRequest struct { + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{6} +func (m *ApplySnapshotChunkRequest) Reset() { *m = ApplySnapshotChunkRequest{} } +func (m *ApplySnapshotChunkRequest) String() string { return proto.CompactTextString(m) } +func (*ApplySnapshotChunkRequest) ProtoMessage() {} +func (*ApplySnapshotChunkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{11} } -func (m *Response) XXX_Unmarshal(b []byte) error { +func (m *ApplySnapshotChunkRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ApplySnapshotChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) + return xxx_messageInfo_ApplySnapshotChunkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1005,259 +1061,168 @@ func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) +func (m *ApplySnapshotChunkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplySnapshotChunkRequest.Merge(m, src) } -func (m *Response) XXX_Size() int { +func (m *ApplySnapshotChunkRequest) XXX_Size() int { return m.Size() } -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -type isResponse_Value interface { - isResponse_Value() - MarshalTo([]byte) (int, error) - Size() int -} - -type Response_Exception struct { - Exception *v1beta1.ResponseException `protobuf:"bytes,1,opt,name=exception,proto3,oneof" json:"exception,omitempty"` -} -type Response_Echo struct { - Echo *v1beta1.ResponseEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` -} -type Response_Flush struct { - Flush *v1beta1.ResponseFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` -} -type Response_Info struct { - Info *v1beta1.ResponseInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` -} -type Response_InitChain struct { - InitChain *v1beta3.ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` -} -type Response_Query struct { - Query *v1beta1.ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` -} -type Response_CheckTx struct { - CheckTx *v1beta3.ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` -} -type Response_Commit struct { - Commit *v1beta3.ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` -} -type Response_ListSnapshots struct { - ListSnapshots *v1beta1.ResponseListSnapshots `protobuf:"bytes,13,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` -} -type Response_OfferSnapshot struct { - OfferSnapshot *ResponseOfferSnapshot `protobuf:"bytes,14,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` -} -type Response_LoadSnapshotChunk struct { - LoadSnapshotChunk *v1beta1.ResponseLoadSnapshotChunk `protobuf:"bytes,15,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` -} -type Response_ApplySnapshotChunk struct { - ApplySnapshotChunk *ResponseApplySnapshotChunk `protobuf:"bytes,16,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` -} -type Response_PrepareProposal struct { - PrepareProposal *v1beta2.ResponsePrepareProposal `protobuf:"bytes,17,opt,name=prepare_proposal,json=prepareProposal,proto3,oneof" json:"prepare_proposal,omitempty"` -} -type Response_ProcessProposal struct { - ProcessProposal *ResponseProcessProposal `protobuf:"bytes,18,opt,name=process_proposal,json=processProposal,proto3,oneof" json:"process_proposal,omitempty"` -} -type Response_ExtendVote struct { - ExtendVote *v1beta3.ResponseExtendVote `protobuf:"bytes,19,opt,name=extend_vote,json=extendVote,proto3,oneof" json:"extend_vote,omitempty"` -} -type Response_VerifyVoteExtension struct { - VerifyVoteExtension *ResponseVerifyVoteExtension `protobuf:"bytes,20,opt,name=verify_vote_extension,json=verifyVoteExtension,proto3,oneof" json:"verify_vote_extension,omitempty"` -} -type Response_FinalizeBlock struct { - FinalizeBlock *v1beta3.ResponseFinalizeBlock `protobuf:"bytes,21,opt,name=finalize_block,json=finalizeBlock,proto3,oneof" json:"finalize_block,omitempty"` +func (m *ApplySnapshotChunkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ApplySnapshotChunkRequest.DiscardUnknown(m) } -func (*Response_Exception) isResponse_Value() {} -func (*Response_Echo) isResponse_Value() {} -func (*Response_Flush) isResponse_Value() {} -func (*Response_Info) isResponse_Value() {} -func (*Response_InitChain) isResponse_Value() {} -func (*Response_Query) isResponse_Value() {} -func (*Response_CheckTx) isResponse_Value() {} -func (*Response_Commit) isResponse_Value() {} -func (*Response_ListSnapshots) isResponse_Value() {} -func (*Response_OfferSnapshot) isResponse_Value() {} -func (*Response_LoadSnapshotChunk) isResponse_Value() {} -func (*Response_ApplySnapshotChunk) isResponse_Value() {} -func (*Response_PrepareProposal) isResponse_Value() {} -func (*Response_ProcessProposal) isResponse_Value() {} -func (*Response_ExtendVote) isResponse_Value() {} -func (*Response_VerifyVoteExtension) isResponse_Value() {} -func (*Response_FinalizeBlock) isResponse_Value() {} +var xxx_messageInfo_ApplySnapshotChunkRequest proto.InternalMessageInfo -func (m *Response) GetValue() isResponse_Value { +func (m *ApplySnapshotChunkRequest) GetIndex() uint32 { if m != nil { - return m.Value + return m.Index } - return nil + return 0 } -func (m *Response) GetException() *v1beta1.ResponseException { - if x, ok := m.GetValue().(*Response_Exception); ok { - return x.Exception +func (m *ApplySnapshotChunkRequest) GetChunk() []byte { + if m != nil { + return m.Chunk } return nil } -func (m *Response) GetEcho() *v1beta1.ResponseEcho { - if x, ok := m.GetValue().(*Response_Echo); ok { - return x.Echo +func (m *ApplySnapshotChunkRequest) GetSender() string { + if m != nil { + return m.Sender } - return nil + return "" } -func (m *Response) GetFlush() *v1beta1.ResponseFlush { - if x, ok := m.GetValue().(*Response_Flush); ok { - return x.Flush - } - return nil +type PrepareProposalRequest struct { + // the modified transactions cannot exceed this size. + MaxTxBytes int64 `protobuf:"varint,1,opt,name=max_tx_bytes,json=maxTxBytes,proto3" json:"max_tx_bytes,omitempty"` + // txs is an array of transactions that will be included in a block, + // sent to the app for possible modifications. + Txs [][]byte `protobuf:"bytes,2,rep,name=txs,proto3" json:"txs,omitempty"` + LocalLastCommit v1beta31.ExtendedCommitInfo `protobuf:"bytes,3,opt,name=local_last_commit,json=localLastCommit,proto3" json:"local_last_commit"` + Misbehavior []Misbehavior `protobuf:"bytes,4,rep,name=misbehavior,proto3" json:"misbehavior"` + Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` + NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // address of the public key of the validator proposing the block. + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } -func (m *Response) GetInfo() *v1beta1.ResponseInfo { - if x, ok := m.GetValue().(*Response_Info); ok { - return x.Info - } - return nil +func (m *PrepareProposalRequest) Reset() { *m = PrepareProposalRequest{} } +func (m *PrepareProposalRequest) String() string { return proto.CompactTextString(m) } +func (*PrepareProposalRequest) ProtoMessage() {} +func (*PrepareProposalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{12} } - -func (m *Response) GetInitChain() *v1beta3.ResponseInitChain { - if x, ok := m.GetValue().(*Response_InitChain); ok { - return x.InitChain - } - return nil +func (m *PrepareProposalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (m *Response) GetQuery() *v1beta1.ResponseQuery { - if x, ok := m.GetValue().(*Response_Query); ok { - return x.Query +func (m *PrepareProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrepareProposalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil } - -func (m *Response) GetCheckTx() *v1beta3.ResponseCheckTx { - if x, ok := m.GetValue().(*Response_CheckTx); ok { - return x.CheckTx - } - return nil +func (m *PrepareProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrepareProposalRequest.Merge(m, src) } - -func (m *Response) GetCommit() *v1beta3.ResponseCommit { - if x, ok := m.GetValue().(*Response_Commit); ok { - return x.Commit - } - return nil +func (m *PrepareProposalRequest) XXX_Size() int { + return m.Size() } - -func (m *Response) GetListSnapshots() *v1beta1.ResponseListSnapshots { - if x, ok := m.GetValue().(*Response_ListSnapshots); ok { - return x.ListSnapshots - } - return nil +func (m *PrepareProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PrepareProposalRequest.DiscardUnknown(m) } -func (m *Response) GetOfferSnapshot() *ResponseOfferSnapshot { - if x, ok := m.GetValue().(*Response_OfferSnapshot); ok { - return x.OfferSnapshot - } - return nil -} +var xxx_messageInfo_PrepareProposalRequest proto.InternalMessageInfo -func (m *Response) GetLoadSnapshotChunk() *v1beta1.ResponseLoadSnapshotChunk { - if x, ok := m.GetValue().(*Response_LoadSnapshotChunk); ok { - return x.LoadSnapshotChunk +func (m *PrepareProposalRequest) GetMaxTxBytes() int64 { + if m != nil { + return m.MaxTxBytes } - return nil + return 0 } -func (m *Response) GetApplySnapshotChunk() *ResponseApplySnapshotChunk { - if x, ok := m.GetValue().(*Response_ApplySnapshotChunk); ok { - return x.ApplySnapshotChunk +func (m *PrepareProposalRequest) GetTxs() [][]byte { + if m != nil { + return m.Txs } return nil } -func (m *Response) GetPrepareProposal() *v1beta2.ResponsePrepareProposal { - if x, ok := m.GetValue().(*Response_PrepareProposal); ok { - return x.PrepareProposal +func (m *PrepareProposalRequest) GetLocalLastCommit() v1beta31.ExtendedCommitInfo { + if m != nil { + return m.LocalLastCommit } - return nil + return v1beta31.ExtendedCommitInfo{} } -func (m *Response) GetProcessProposal() *ResponseProcessProposal { - if x, ok := m.GetValue().(*Response_ProcessProposal); ok { - return x.ProcessProposal +func (m *PrepareProposalRequest) GetMisbehavior() []Misbehavior { + if m != nil { + return m.Misbehavior } return nil } -func (m *Response) GetExtendVote() *v1beta3.ResponseExtendVote { - if x, ok := m.GetValue().(*Response_ExtendVote); ok { - return x.ExtendVote +func (m *PrepareProposalRequest) GetHeight() int64 { + if m != nil { + return m.Height } - return nil + return 0 } -func (m *Response) GetVerifyVoteExtension() *ResponseVerifyVoteExtension { - if x, ok := m.GetValue().(*Response_VerifyVoteExtension); ok { - return x.VerifyVoteExtension +func (m *PrepareProposalRequest) GetTime() time.Time { + if m != nil { + return m.Time } - return nil + return time.Time{} } -func (m *Response) GetFinalizeBlock() *v1beta3.ResponseFinalizeBlock { - if x, ok := m.GetValue().(*Response_FinalizeBlock); ok { - return x.FinalizeBlock +func (m *PrepareProposalRequest) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Response) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Response_Exception)(nil), - (*Response_Echo)(nil), - (*Response_Flush)(nil), - (*Response_Info)(nil), - (*Response_InitChain)(nil), - (*Response_Query)(nil), - (*Response_CheckTx)(nil), - (*Response_Commit)(nil), - (*Response_ListSnapshots)(nil), - (*Response_OfferSnapshot)(nil), - (*Response_LoadSnapshotChunk)(nil), - (*Response_ApplySnapshotChunk)(nil), - (*Response_PrepareProposal)(nil), - (*Response_ProcessProposal)(nil), - (*Response_ExtendVote)(nil), - (*Response_VerifyVoteExtension)(nil), - (*Response_FinalizeBlock)(nil), +func (m *PrepareProposalRequest) GetProposerAddress() []byte { + if m != nil { + return m.ProposerAddress } + return nil } -type ResponseOfferSnapshot struct { - Result OfferSnapshotResult `protobuf:"varint,1,opt,name=result,proto3,enum=cometbft.abci.v1beta4.OfferSnapshotResult" json:"result,omitempty"` +type ProcessProposalRequest struct { + Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + ProposedLastCommit v1beta31.CommitInfo `protobuf:"bytes,2,opt,name=proposed_last_commit,json=proposedLastCommit,proto3" json:"proposed_last_commit"` + Misbehavior []Misbehavior `protobuf:"bytes,3,rep,name=misbehavior,proto3" json:"misbehavior"` + // Merkle root hash of the fields of the proposed block. + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` + NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // address of the public key of the original proposer of the block. + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } -func (m *ResponseOfferSnapshot) Reset() { *m = ResponseOfferSnapshot{} } -func (m *ResponseOfferSnapshot) String() string { return proto.CompactTextString(m) } -func (*ResponseOfferSnapshot) ProtoMessage() {} -func (*ResponseOfferSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{7} +func (m *ProcessProposalRequest) Reset() { *m = ProcessProposalRequest{} } +func (m *ProcessProposalRequest) String() string { return proto.CompactTextString(m) } +func (*ProcessProposalRequest) ProtoMessage() {} +func (*ProcessProposalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{13} } -func (m *ResponseOfferSnapshot) XXX_Unmarshal(b []byte) error { +func (m *ProcessProposalRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseOfferSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProcessProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseOfferSnapshot.Marshal(b, m, deterministic) + return xxx_messageInfo_ProcessProposalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1267,101 +1232,102 @@ func (m *ResponseOfferSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *ResponseOfferSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseOfferSnapshot.Merge(m, src) +func (m *ProcessProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessProposalRequest.Merge(m, src) } -func (m *ResponseOfferSnapshot) XXX_Size() int { +func (m *ProcessProposalRequest) XXX_Size() int { return m.Size() } -func (m *ResponseOfferSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseOfferSnapshot.DiscardUnknown(m) +func (m *ProcessProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessProposalRequest.DiscardUnknown(m) } -var xxx_messageInfo_ResponseOfferSnapshot proto.InternalMessageInfo +var xxx_messageInfo_ProcessProposalRequest proto.InternalMessageInfo -func (m *ResponseOfferSnapshot) GetResult() OfferSnapshotResult { +func (m *ProcessProposalRequest) GetTxs() [][]byte { if m != nil { - return m.Result + return m.Txs } - return OFFER_SNAPSHOT_RESULT_UNKNOWN + return nil } -type ResponseApplySnapshotChunk struct { - Result ApplySnapshotChunkResult `protobuf:"varint,1,opt,name=result,proto3,enum=cometbft.abci.v1beta4.ApplySnapshotChunkResult" json:"result,omitempty"` - RefetchChunks []uint32 `protobuf:"varint,2,rep,packed,name=refetch_chunks,json=refetchChunks,proto3" json:"refetch_chunks,omitempty"` - RejectSenders []string `protobuf:"bytes,3,rep,name=reject_senders,json=rejectSenders,proto3" json:"reject_senders,omitempty"` +func (m *ProcessProposalRequest) GetProposedLastCommit() v1beta31.CommitInfo { + if m != nil { + return m.ProposedLastCommit + } + return v1beta31.CommitInfo{} } -func (m *ResponseApplySnapshotChunk) Reset() { *m = ResponseApplySnapshotChunk{} } -func (m *ResponseApplySnapshotChunk) String() string { return proto.CompactTextString(m) } -func (*ResponseApplySnapshotChunk) ProtoMessage() {} -func (*ResponseApplySnapshotChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{8} -} -func (m *ResponseApplySnapshotChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseApplySnapshotChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseApplySnapshotChunk.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 *ProcessProposalRequest) GetMisbehavior() []Misbehavior { + if m != nil { + return m.Misbehavior } + return nil } -func (m *ResponseApplySnapshotChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseApplySnapshotChunk.Merge(m, src) -} -func (m *ResponseApplySnapshotChunk) XXX_Size() int { - return m.Size() -} -func (m *ResponseApplySnapshotChunk) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseApplySnapshotChunk.DiscardUnknown(m) + +func (m *ProcessProposalRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil } -var xxx_messageInfo_ResponseApplySnapshotChunk proto.InternalMessageInfo +func (m *ProcessProposalRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} -func (m *ResponseApplySnapshotChunk) GetResult() ApplySnapshotChunkResult { +func (m *ProcessProposalRequest) GetTime() time.Time { if m != nil { - return m.Result + return m.Time } - return APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN + return time.Time{} } -func (m *ResponseApplySnapshotChunk) GetRefetchChunks() []uint32 { +func (m *ProcessProposalRequest) GetNextValidatorsHash() []byte { if m != nil { - return m.RefetchChunks + return m.NextValidatorsHash } return nil } -func (m *ResponseApplySnapshotChunk) GetRejectSenders() []string { +func (m *ProcessProposalRequest) GetProposerAddress() []byte { if m != nil { - return m.RejectSenders + return m.ProposerAddress } return nil } -type ResponseProcessProposal struct { - Status ProcessProposalStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cometbft.abci.v1beta4.ProcessProposalStatus" json:"status,omitempty"` +// Extends a vote with application-injected data +type ExtendVoteRequest struct { + // the hash of the block that this vote may be referring to + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // the height of the extended vote + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // info of the block that this vote may be referring to + Time time.Time `protobuf:"bytes,3,opt,name=time,proto3,stdtime" json:"time"` + Txs [][]byte `protobuf:"bytes,4,rep,name=txs,proto3" json:"txs,omitempty"` + ProposedLastCommit v1beta31.CommitInfo `protobuf:"bytes,5,opt,name=proposed_last_commit,json=proposedLastCommit,proto3" json:"proposed_last_commit"` + Misbehavior []Misbehavior `protobuf:"bytes,6,rep,name=misbehavior,proto3" json:"misbehavior"` + NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // address of the public key of the original proposer of the block. + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } -func (m *ResponseProcessProposal) Reset() { *m = ResponseProcessProposal{} } -func (m *ResponseProcessProposal) String() string { return proto.CompactTextString(m) } -func (*ResponseProcessProposal) ProtoMessage() {} -func (*ResponseProcessProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{9} +func (m *ExtendVoteRequest) Reset() { *m = ExtendVoteRequest{} } +func (m *ExtendVoteRequest) String() string { return proto.CompactTextString(m) } +func (*ExtendVoteRequest) ProtoMessage() {} +func (*ExtendVoteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{14} } -func (m *ResponseProcessProposal) XXX_Unmarshal(b []byte) error { +func (m *ExtendVoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseProcessProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ExtendVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseProcessProposal.Marshal(b, m, deterministic) + return xxx_messageInfo_ExtendVoteRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1371,95 +1337,96 @@ func (m *ResponseProcessProposal) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *ResponseProcessProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseProcessProposal.Merge(m, src) +func (m *ExtendVoteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendVoteRequest.Merge(m, src) } -func (m *ResponseProcessProposal) XXX_Size() int { +func (m *ExtendVoteRequest) XXX_Size() int { return m.Size() } -func (m *ResponseProcessProposal) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseProcessProposal.DiscardUnknown(m) +func (m *ExtendVoteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendVoteRequest.DiscardUnknown(m) } -var xxx_messageInfo_ResponseProcessProposal proto.InternalMessageInfo +var xxx_messageInfo_ExtendVoteRequest proto.InternalMessageInfo -func (m *ResponseProcessProposal) GetStatus() ProcessProposalStatus { +func (m *ExtendVoteRequest) GetHash() []byte { if m != nil { - return m.Status + return m.Hash } - return PROCESS_PROPOSAL_STATUS_UNKNOWN + return nil } -type ResponseVerifyVoteExtension struct { - Status VerifyVoteExtensionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cometbft.abci.v1beta4.VerifyVoteExtensionStatus" json:"status,omitempty"` -} - -func (m *ResponseVerifyVoteExtension) Reset() { *m = ResponseVerifyVoteExtension{} } -func (m *ResponseVerifyVoteExtension) String() string { return proto.CompactTextString(m) } -func (*ResponseVerifyVoteExtension) ProtoMessage() {} -func (*ResponseVerifyVoteExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{10} -} -func (m *ResponseVerifyVoteExtension) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *ExtendVoteRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 } -func (m *ResponseVerifyVoteExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseVerifyVoteExtension.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 *ExtendVoteRequest) GetTime() time.Time { + if m != nil { + return m.Time } + return time.Time{} } -func (m *ResponseVerifyVoteExtension) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseVerifyVoteExtension.Merge(m, src) + +func (m *ExtendVoteRequest) GetTxs() [][]byte { + if m != nil { + return m.Txs + } + return nil } -func (m *ResponseVerifyVoteExtension) XXX_Size() int { - return m.Size() + +func (m *ExtendVoteRequest) GetProposedLastCommit() v1beta31.CommitInfo { + if m != nil { + return m.ProposedLastCommit + } + return v1beta31.CommitInfo{} } -func (m *ResponseVerifyVoteExtension) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseVerifyVoteExtension.DiscardUnknown(m) + +func (m *ExtendVoteRequest) GetMisbehavior() []Misbehavior { + if m != nil { + return m.Misbehavior + } + return nil } -var xxx_messageInfo_ResponseVerifyVoteExtension proto.InternalMessageInfo +func (m *ExtendVoteRequest) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash + } + return nil +} -func (m *ResponseVerifyVoteExtension) GetStatus() VerifyVoteExtensionStatus { +func (m *ExtendVoteRequest) GetProposerAddress() []byte { if m != nil { - return m.Status + return m.ProposerAddress } - return VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN + return nil } -type Misbehavior struct { - Type MisbehaviorType `protobuf:"varint,1,opt,name=type,proto3,enum=cometbft.abci.v1beta4.MisbehaviorType" json:"type,omitempty"` - // The offending validator - Validator v1beta1.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` - // The height when the offense occurred - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - // The corresponding time where the offense occurred - Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` - // Total voting power of the validator set in case the ABCI application does - // not store historical validators. - // https://github.com/tendermint/tendermint/issues/4581 - TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` +// Request to verify a vote extension +type VerifyVoteExtensionRequest struct { + // the hash of the block that this received vote corresponds to + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // the validator that signed the vote extension + ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + VoteExtension []byte `protobuf:"bytes,4,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"` } -func (m *Misbehavior) Reset() { *m = Misbehavior{} } -func (m *Misbehavior) String() string { return proto.CompactTextString(m) } -func (*Misbehavior) ProtoMessage() {} -func (*Misbehavior) Descriptor() ([]byte, []int) { - return fileDescriptor_120b31222941659d, []int{11} +func (m *VerifyVoteExtensionRequest) Reset() { *m = VerifyVoteExtensionRequest{} } +func (m *VerifyVoteExtensionRequest) String() string { return proto.CompactTextString(m) } +func (*VerifyVoteExtensionRequest) ProtoMessage() {} +func (*VerifyVoteExtensionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{15} } -func (m *Misbehavior) XXX_Unmarshal(b []byte) error { +func (m *VerifyVoteExtensionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Misbehavior) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *VerifyVoteExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Misbehavior.Marshal(b, m, deterministic) + return xxx_messageInfo_VerifyVoteExtensionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1469,1769 +1436,1746 @@ func (m *Misbehavior) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *Misbehavior) XXX_Merge(src proto.Message) { - xxx_messageInfo_Misbehavior.Merge(m, src) +func (m *VerifyVoteExtensionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerifyVoteExtensionRequest.Merge(m, src) } -func (m *Misbehavior) XXX_Size() int { +func (m *VerifyVoteExtensionRequest) XXX_Size() int { return m.Size() } -func (m *Misbehavior) XXX_DiscardUnknown() { - xxx_messageInfo_Misbehavior.DiscardUnknown(m) +func (m *VerifyVoteExtensionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_VerifyVoteExtensionRequest.DiscardUnknown(m) } -var xxx_messageInfo_Misbehavior proto.InternalMessageInfo +var xxx_messageInfo_VerifyVoteExtensionRequest proto.InternalMessageInfo -func (m *Misbehavior) GetType() MisbehaviorType { +func (m *VerifyVoteExtensionRequest) GetHash() []byte { if m != nil { - return m.Type + return m.Hash } - return MISBEHAVIOR_TYPE_UNKNOWN + return nil } -func (m *Misbehavior) GetValidator() v1beta1.Validator { +func (m *VerifyVoteExtensionRequest) GetValidatorAddress() []byte { if m != nil { - return m.Validator + return m.ValidatorAddress } - return v1beta1.Validator{} + return nil } -func (m *Misbehavior) GetHeight() int64 { +func (m *VerifyVoteExtensionRequest) GetHeight() int64 { if m != nil { return m.Height } return 0 } -func (m *Misbehavior) GetTime() time.Time { +func (m *VerifyVoteExtensionRequest) GetVoteExtension() []byte { if m != nil { - return m.Time + return m.VoteExtension } - return time.Time{} + return nil } -func (m *Misbehavior) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 +type FinalizeBlockRequest struct { + Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + DecidedLastCommit v1beta31.CommitInfo `protobuf:"bytes,2,opt,name=decided_last_commit,json=decidedLastCommit,proto3" json:"decided_last_commit"` + Misbehavior []Misbehavior `protobuf:"bytes,3,rep,name=misbehavior,proto3" json:"misbehavior"` + // Merkle root hash of the fields of the decided block. + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + Height int64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time"` + NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // address of the public key of the original proposer of the block. + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } -func init() { - proto.RegisterEnum("cometbft.abci.v1beta4.CheckTxType", CheckTxType_name, CheckTxType_value) - proto.RegisterEnum("cometbft.abci.v1beta4.OfferSnapshotResult", OfferSnapshotResult_name, OfferSnapshotResult_value) - proto.RegisterEnum("cometbft.abci.v1beta4.ApplySnapshotChunkResult", ApplySnapshotChunkResult_name, ApplySnapshotChunkResult_value) - proto.RegisterEnum("cometbft.abci.v1beta4.ProcessProposalStatus", ProcessProposalStatus_name, ProcessProposalStatus_value) - proto.RegisterEnum("cometbft.abci.v1beta4.VerifyVoteExtensionStatus", VerifyVoteExtensionStatus_name, VerifyVoteExtensionStatus_value) - proto.RegisterEnum("cometbft.abci.v1beta4.MisbehaviorType", MisbehaviorType_name, MisbehaviorType_value) - proto.RegisterType((*Request)(nil), "cometbft.abci.v1beta4.Request") - proto.RegisterType((*RequestCheckTx)(nil), "cometbft.abci.v1beta4.RequestCheckTx") - proto.RegisterType((*RequestPrepareProposal)(nil), "cometbft.abci.v1beta4.RequestPrepareProposal") - proto.RegisterType((*RequestProcessProposal)(nil), "cometbft.abci.v1beta4.RequestProcessProposal") - proto.RegisterType((*RequestExtendVote)(nil), "cometbft.abci.v1beta4.RequestExtendVote") - proto.RegisterType((*RequestFinalizeBlock)(nil), "cometbft.abci.v1beta4.RequestFinalizeBlock") - proto.RegisterType((*Response)(nil), "cometbft.abci.v1beta4.Response") - proto.RegisterType((*ResponseOfferSnapshot)(nil), "cometbft.abci.v1beta4.ResponseOfferSnapshot") - proto.RegisterType((*ResponseApplySnapshotChunk)(nil), "cometbft.abci.v1beta4.ResponseApplySnapshotChunk") - proto.RegisterType((*ResponseProcessProposal)(nil), "cometbft.abci.v1beta4.ResponseProcessProposal") - proto.RegisterType((*ResponseVerifyVoteExtension)(nil), "cometbft.abci.v1beta4.ResponseVerifyVoteExtension") - proto.RegisterType((*Misbehavior)(nil), "cometbft.abci.v1beta4.Misbehavior") +func (m *FinalizeBlockRequest) Reset() { *m = FinalizeBlockRequest{} } +func (m *FinalizeBlockRequest) String() string { return proto.CompactTextString(m) } +func (*FinalizeBlockRequest) ProtoMessage() {} +func (*FinalizeBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{16} } - -func init() { proto.RegisterFile("cometbft/abci/v1beta4/types.proto", fileDescriptor_120b31222941659d) } - -var fileDescriptor_120b31222941659d = []byte{ - // 2069 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4b, 0x73, 0xdb, 0xd6, - 0x15, 0xe6, 0x03, 0xa2, 0xa8, 0xa3, 0x17, 0x74, 0x25, 0x25, 0x08, 0x92, 0x4a, 0x32, 0x15, 0x3f, - 0xe2, 0xa4, 0xa4, 0x2d, 0x6b, 0x32, 0x4d, 0x9b, 0x69, 0x87, 0xa4, 0xa1, 0x80, 0xb2, 0x2c, 0xb2, - 0x97, 0x90, 0x62, 0xc5, 0x33, 0xc1, 0x80, 0xe4, 0xa5, 0x88, 0x98, 0x22, 0x18, 0x02, 0x54, 0xa9, - 0x4e, 0x97, 0x5d, 0x74, 0xba, 0x89, 0x17, 0xdd, 0x76, 0xda, 0x99, 0xf6, 0x1f, 0xf4, 0x4f, 0x64, - 0x99, 0x65, 0x37, 0x7d, 0x8c, 0xfd, 0x1b, 0xba, 0xe9, 0xaa, 0x73, 0x2f, 0x00, 0x3e, 0x01, 0x10, - 0xa8, 0xdb, 0x45, 0x67, 0xba, 0x23, 0xee, 0x3d, 0xdf, 0x77, 0xee, 0xf3, 0xdc, 0xf3, 0xf1, 0xc0, - 0xad, 0xba, 0x71, 0x45, 0xac, 0x5a, 0xd3, 0xca, 0x69, 0xb5, 0xba, 0x9e, 0xbb, 0x7e, 0x58, 0x23, - 0x96, 0x76, 0x98, 0xb3, 0x6e, 0xba, 0xc4, 0xcc, 0x76, 0x7b, 0x86, 0x65, 0xa0, 0x6d, 0xd7, 0x24, - 0x4b, 0x4d, 0xb2, 0x8e, 0x89, 0xe8, 0x89, 0x7c, 0x38, 0x8e, 0xf4, 0x36, 0x39, 0x98, 0x6f, 0xf2, - 0x68, 0xc2, 0x64, 0xeb, 0xd2, 0xb8, 0x34, 0xd8, 0xcf, 0x1c, 0xfd, 0xe5, 0xb4, 0xee, 0x5e, 0x1a, - 0xc6, 0x65, 0x9b, 0xe4, 0xd8, 0x57, 0xad, 0xdf, 0xcc, 0x59, 0xfa, 0x15, 0x31, 0x2d, 0xed, 0xaa, - 0x6b, 0x1b, 0x64, 0x7e, 0x07, 0xb0, 0x88, 0xc9, 0xd7, 0x7d, 0x62, 0x5a, 0xe8, 0x07, 0xc0, 0x91, - 0x7a, 0xcb, 0x10, 0xe2, 0x7b, 0xf1, 0x7b, 0xcb, 0x07, 0x99, 0xac, 0xd7, 0x8c, 0x1e, 0x66, 0x1d, - 0x6b, 0xa9, 0xde, 0x32, 0xe4, 0x18, 0x66, 0x08, 0xf4, 0x23, 0x58, 0x68, 0xb6, 0xfb, 0x66, 0x4b, - 0x48, 0x30, 0xe8, 0x7e, 0x30, 0xf4, 0x88, 0x9a, 0xca, 0x31, 0x6c, 0x63, 0xa8, 0x5b, 0xbd, 0xd3, - 0x34, 0x84, 0x64, 0x80, 0xdb, 0x03, 0x17, 0x5b, 0xea, 0x34, 0x99, 0x5b, 0x8a, 0x40, 0x32, 0x80, - 0xde, 0xd1, 0x2d, 0xb5, 0xde, 0xd2, 0xf4, 0x8e, 0xb0, 0xc0, 0xf0, 0x77, 0x3d, 0xf1, 0x8f, 0x46, - 0x78, 0xdd, 0x2a, 0x52, 0x73, 0x39, 0x86, 0x97, 0x74, 0xf7, 0x83, 0x4e, 0xe0, 0xeb, 0x3e, 0xe9, - 0xdd, 0x08, 0xa9, 0x30, 0x13, 0xf8, 0x29, 0x35, 0xa5, 0x13, 0x60, 0x18, 0x54, 0x80, 0x74, 0xbd, - 0x45, 0xea, 0x2f, 0x54, 0x6b, 0x20, 0xa4, 0x19, 0xfe, 0xb6, 0x27, 0xfe, 0xd0, 0xc5, 0x17, 0xa9, - 0xb5, 0x32, 0x90, 0x63, 0x78, 0xb1, 0x6e, 0xff, 0x44, 0x3f, 0x86, 0x54, 0xdd, 0xb8, 0xba, 0xd2, - 0x2d, 0x61, 0x99, 0x31, 0xbc, 0x1f, 0x3c, 0x82, 0x22, 0xb3, 0x95, 0x63, 0xd8, 0x41, 0x21, 0x05, - 0xd6, 0xda, 0xba, 0x69, 0xa9, 0x66, 0x47, 0xeb, 0x9a, 0x2d, 0xc3, 0x32, 0x85, 0x15, 0xc6, 0xf3, - 0x61, 0x30, 0xcf, 0x89, 0x6e, 0x5a, 0x55, 0x17, 0x22, 0xc7, 0xf0, 0x6a, 0x7b, 0xbc, 0x81, 0xb2, - 0x1a, 0xcd, 0x26, 0xe9, 0x0d, 0x69, 0x85, 0xd5, 0x30, 0xac, 0x65, 0x8a, 0x71, 0x59, 0x28, 0xab, - 0x31, 0xde, 0x80, 0x34, 0xd8, 0x6c, 0x1b, 0x5a, 0x63, 0x48, 0xaa, 0xd6, 0x5b, 0xfd, 0xce, 0x0b, - 0x61, 0x8d, 0x51, 0xe7, 0xe6, 0x0c, 0xd8, 0xd0, 0x1a, 0x2e, 0x51, 0x91, 0xc2, 0xe4, 0x18, 0xde, - 0x68, 0x4f, 0x37, 0xa2, 0x06, 0x6c, 0x69, 0xdd, 0x6e, 0xfb, 0x66, 0xda, 0xc7, 0x3a, 0xf3, 0xf1, - 0x20, 0xd8, 0x47, 0x9e, 0x22, 0xa7, 0x9d, 0x20, 0x6d, 0xa6, 0x15, 0x7d, 0x01, 0x7c, 0xb7, 0x47, - 0xba, 0x5a, 0x8f, 0xa8, 0xdd, 0x9e, 0xd1, 0x35, 0x4c, 0xad, 0x2d, 0xf0, 0xcc, 0xc3, 0xf7, 0x83, - 0x0f, 0x40, 0xc5, 0x46, 0x55, 0x1c, 0x90, 0x1c, 0xc3, 0xeb, 0xdd, 0xc9, 0x26, 0x9b, 0xdb, 0xa8, - 0x13, 0xd3, 0x1c, 0x71, 0x6f, 0x84, 0xe3, 0x66, 0xa8, 0x49, 0xee, 0x89, 0x26, 0xf4, 0x04, 0x96, - 0xc9, 0xc0, 0x22, 0x9d, 0x86, 0x7a, 0x6d, 0x58, 0x44, 0x40, 0x8c, 0xf6, 0x5e, 0x30, 0xad, 0xc4, - 0x00, 0xe7, 0x86, 0x45, 0xe4, 0x18, 0x06, 0x32, 0xfc, 0x42, 0x97, 0xb0, 0x7d, 0x4d, 0x7a, 0x7a, - 0xf3, 0x86, 0x91, 0xa9, 0xac, 0xc7, 0xd4, 0x8d, 0x8e, 0xb0, 0xc9, 0x68, 0x1f, 0x06, 0xdf, 0xc7, - 0x73, 0x06, 0xa5, 0x44, 0x92, 0x0b, 0x94, 0x63, 0x78, 0xf3, 0x7a, 0xb6, 0x99, 0x1e, 0xc6, 0xa6, - 0xde, 0xd1, 0xda, 0xfa, 0xcf, 0x89, 0x5a, 0x6b, 0x1b, 0xf5, 0x17, 0xc2, 0x56, 0xc0, 0x61, 0x1c, - 0x0e, 0xfc, 0xc8, 0xc1, 0x14, 0x28, 0x84, 0x1e, 0xc6, 0xe6, 0x78, 0x43, 0x61, 0x11, 0x16, 0xae, - 0xb5, 0x76, 0x9f, 0x1c, 0x73, 0x69, 0x8e, 0x5f, 0x38, 0xe6, 0xd2, 0x8b, 0x7c, 0xfa, 0x98, 0x4b, - 0x2f, 0xf1, 0x70, 0xcc, 0xa5, 0x81, 0x5f, 0xce, 0x7c, 0x09, 0x6b, 0x93, 0xd7, 0x16, 0xad, 0x41, - 0xc2, 0x1a, 0xb0, 0x28, 0xb9, 0x82, 0x13, 0xd6, 0x00, 0x7d, 0x0c, 0x1c, 0x8d, 0xc4, 0x2c, 0x80, - 0xad, 0xf9, 0x04, 0xb0, 0xc3, 0xac, 0x83, 0x56, 0x6e, 0xba, 0x04, 0x33, 0xfb, 0x63, 0x2e, 0x9d, - 0xe0, 0x93, 0x99, 0x3f, 0x26, 0xe1, 0x2d, 0xef, 0x63, 0x81, 0xf6, 0x60, 0xe5, 0x4a, 0x1b, 0xa8, - 0xd6, 0x40, 0xad, 0xdd, 0x58, 0xc4, 0x64, 0x2e, 0x93, 0x18, 0xae, 0xb4, 0x81, 0x32, 0x28, 0xd0, - 0x16, 0xc4, 0x43, 0xd2, 0x1a, 0x98, 0x42, 0x62, 0x2f, 0x79, 0x6f, 0x05, 0xd3, 0x9f, 0xe8, 0x39, - 0x6c, 0xb4, 0x8d, 0xba, 0xd6, 0x56, 0xdb, 0x9a, 0x69, 0xa9, 0x4e, 0x4c, 0xb1, 0x43, 0xeb, 0x07, - 0x3e, 0x5b, 0x61, 0x6f, 0x2d, 0x69, 0xd8, 0x41, 0x85, 0x46, 0xd8, 0x02, 0xf7, 0xed, 0x5f, 0x77, - 0x63, 0x78, 0x9d, 0x31, 0x9d, 0x68, 0x6e, 0xbc, 0x41, 0xc7, 0xb0, 0x7c, 0xa5, 0x9b, 0x35, 0xd2, - 0xd2, 0xae, 0x75, 0xa3, 0x27, 0x70, 0x7b, 0x49, 0xdf, 0x88, 0x7d, 0x98, 0x7d, 0x3a, 0xb2, 0x74, - 0xf8, 0xc6, 0xc1, 0xe8, 0x2d, 0x48, 0xb5, 0x88, 0x7e, 0xd9, 0xb2, 0x58, 0xe0, 0x4e, 0x62, 0xe7, - 0x8b, 0x3e, 0x07, 0xf4, 0x91, 0x72, 0x22, 0xb1, 0x98, 0xb5, 0x5f, 0xb0, 0xac, 0xfb, 0x82, 0x65, - 0x15, 0xf7, 0x05, 0x2b, 0xa4, 0x29, 0xe9, 0xcb, 0xbf, 0xed, 0xc6, 0x31, 0x43, 0xa0, 0x07, 0xb0, - 0xd5, 0x21, 0x03, 0x4b, 0xbd, 0xd6, 0xda, 0x7a, 0x43, 0xb3, 0x8c, 0x9e, 0xa9, 0xb6, 0x34, 0xb3, - 0x25, 0x2c, 0xb2, 0x9d, 0x42, 0xb4, 0xef, 0x7c, 0xd8, 0x25, 0x6b, 0x66, 0x0b, 0x7d, 0xc0, 0x2e, - 0x59, 0xd7, 0x30, 0x49, 0x4f, 0xd5, 0x1a, 0x8d, 0x1e, 0x31, 0x4d, 0x16, 0xc1, 0x57, 0xd8, 0x9d, - 0x61, 0xed, 0x79, 0xbb, 0x39, 0xf3, 0x9b, 0xf1, 0x6d, 0x9a, 0xbc, 0x4e, 0xce, 0x26, 0xc4, 0x47, - 0x9b, 0x70, 0x01, 0x5b, 0x0e, 0xbe, 0x31, 0xb1, 0x0f, 0xf6, 0xf3, 0x78, 0xcb, 0x67, 0x1f, 0x66, - 0xd6, 0x1f, 0xb9, 0x24, 0xfe, 0x5b, 0x90, 0x7c, 0x93, 0x2d, 0x40, 0xc0, 0xb1, 0x05, 0xe2, 0xd8, - 0x94, 0xd9, 0xef, 0xff, 0xb5, 0x6d, 0xf9, 0x26, 0x09, 0x1b, 0x33, 0x11, 0x6a, 0x38, 0xb1, 0xb8, - 0xe7, 0xc4, 0x12, 0x9e, 0x13, 0x4b, 0x46, 0x9e, 0x98, 0xb3, 0xef, 0xdc, 0xfc, 0x7d, 0x5f, 0xf8, - 0x8f, 0xef, 0x7b, 0xea, 0x4d, 0xf6, 0xfd, 0xbf, 0xba, 0x23, 0x2f, 0x93, 0xb0, 0xe5, 0x15, 0x7a, - 0x3d, 0xae, 0xc9, 0xe7, 0xb0, 0xd9, 0x20, 0x75, 0xbd, 0xf1, 0x66, 0xb7, 0x64, 0xc3, 0xe1, 0xf8, - 0xff, 0x25, 0xf1, 0xdb, 0x92, 0x7f, 0x02, 0xa4, 0x31, 0x31, 0xbb, 0x46, 0xc7, 0x24, 0x48, 0x86, - 0x25, 0x32, 0xa8, 0x93, 0xae, 0x45, 0xdf, 0xe8, 0x78, 0xc0, 0xd3, 0x4f, 0xf3, 0x21, 0x1b, 0x23, - 0xb9, 0xf6, 0x34, 0x69, 0x1e, 0x82, 0xd1, 0x27, 0x8e, 0x5e, 0x98, 0x97, 0xf4, 0x3b, 0x24, 0xe3, - 0x82, 0xe1, 0x53, 0x57, 0x30, 0x24, 0xe7, 0x64, 0xbb, 0x36, 0x76, 0x4a, 0x31, 0x7c, 0xe2, 0x28, - 0x06, 0x2e, 0x94, 0xe3, 0x09, 0xc9, 0x50, 0x9a, 0x90, 0x0c, 0xa9, 0x80, 0xe9, 0x3f, 0x1a, 0x23, - 0xf0, 0xd4, 0x0c, 0x9f, 0xba, 0x9a, 0x61, 0x31, 0xd4, 0x1c, 0xa6, 0x44, 0x43, 0x71, 0x4c, 0x34, - 0x2c, 0x31, 0x82, 0x3b, 0x73, 0x86, 0xe1, 0xa1, 0x1a, 0x7e, 0x32, 0x54, 0x0d, 0x2b, 0x01, 0xba, - 0x63, 0x8c, 0x62, 0x5a, 0x36, 0x9c, 0xcd, 0xc8, 0x06, 0x3b, 0xc1, 0xff, 0x68, 0xce, 0x64, 0xe6, - 0xe8, 0x86, 0xb3, 0x19, 0xdd, 0xb0, 0x16, 0x40, 0x7b, 0x38, 0xa4, 0x9d, 0x23, 0x1c, 0x6a, 0xde, - 0xc2, 0x61, 0x5e, 0x52, 0xef, 0x0c, 0x39, 0x9c, 0x72, 0x20, 0x3e, 0xca, 0x81, 0x0f, 0xc8, 0x66, - 0x47, 0x13, 0x08, 0x2d, 0x1d, 0x9e, 0x7b, 0x48, 0x07, 0x3b, 0xbd, 0xcf, 0xfa, 0x0a, 0x60, 0xdb, - 0x45, 0x08, 0xed, 0xf0, 0xdc, 0x43, 0x3b, 0xa0, 0x00, 0xf2, 0xc3, 0x31, 0xf2, 0xb9, 0xe2, 0xe1, - 0x64, 0x52, 0x3c, 0x6c, 0x06, 0xa6, 0x96, 0xa3, 0x08, 0xe2, 0xa3, 0x1e, 0x5a, 0x7e, 0xea, 0xc1, - 0xce, 0xed, 0x0f, 0xe6, 0x8c, 0x37, 0x82, 0x7c, 0x38, 0x9b, 0x91, 0x0f, 0xdb, 0x01, 0x67, 0x72, - 0x34, 0xf4, 0xf0, 0xfa, 0x61, 0x81, 0x4f, 0x1d, 0x73, 0xe9, 0x34, 0xbf, 0x64, 0x2b, 0x87, 0x63, - 0x2e, 0xbd, 0xcc, 0xaf, 0x64, 0x9e, 0xc3, 0xb6, 0xe7, 0xf1, 0x46, 0x05, 0x48, 0xf5, 0x88, 0xd9, - 0x6f, 0x5b, 0x2c, 0x0a, 0xaf, 0x1d, 0xdc, 0xf7, 0x99, 0xeb, 0x04, 0x0a, 0x33, 0x04, 0x76, 0x90, - 0x99, 0x3f, 0xc5, 0x41, 0xf4, 0x3f, 0x7b, 0xe8, 0xb3, 0x29, 0x17, 0x39, 0x1f, 0x17, 0xb3, 0xd0, - 0x49, 0x3f, 0xe8, 0x36, 0xac, 0xf5, 0x48, 0x93, 0x58, 0xf5, 0x96, 0x7d, 0x1d, 0x6c, 0xc9, 0xb1, - 0x8a, 0x57, 0x9d, 0x56, 0x86, 0x31, 0x6d, 0xb3, 0xaf, 0x48, 0xdd, 0x52, 0x4d, 0xaa, 0x28, 0x7a, - 0x26, 0x7b, 0x7a, 0x97, 0xa8, 0x19, 0x6d, 0xad, 0xda, 0x8d, 0x19, 0x15, 0xde, 0xf6, 0x39, 0x70, - 0xe8, 0x31, 0xa4, 0x4c, 0x4b, 0xb3, 0xfa, 0xa6, 0x33, 0x62, 0xbf, 0x88, 0x31, 0x85, 0xab, 0x32, - 0x0c, 0x76, 0xb0, 0x99, 0x4b, 0x78, 0x37, 0xe0, 0x84, 0x20, 0x79, 0xca, 0xc9, 0x03, 0x1f, 0x27, - 0x1e, 0xd8, 0x29, 0x47, 0xdf, 0x24, 0x60, 0x79, 0x2c, 0x7f, 0x40, 0x3f, 0x74, 0xa4, 0xa0, 0xcd, - 0x7b, 0x67, 0x7e, 0xc6, 0x31, 0x92, 0x83, 0xe8, 0x31, 0x2c, 0x0d, 0x5f, 0x7f, 0xe7, 0x4d, 0xdd, - 0xf3, 0x89, 0x69, 0xc3, 0x54, 0xc0, 0x49, 0x58, 0x46, 0xc0, 0xb1, 0xd4, 0x24, 0xe9, 0x99, 0x9a, - 0x70, 0x91, 0x53, 0x93, 0x8f, 0x00, 0x59, 0x86, 0xa5, 0xb5, 0xe9, 0x0d, 0xd5, 0x3b, 0x97, 0x6a, - 0xd7, 0xf8, 0x19, 0xe9, 0x39, 0x89, 0x0f, 0xcf, 0x7a, 0xce, 0x59, 0x47, 0x85, 0xb6, 0xdf, 0xaf, - 0xc1, 0xf2, 0x98, 0xd2, 0x45, 0xef, 0xc0, 0x76, 0x51, 0x96, 0x8a, 0x4f, 0x54, 0xe5, 0x99, 0xaa, - 0x5c, 0x54, 0x24, 0xf5, 0xec, 0xf4, 0xc9, 0x69, 0xf9, 0xf3, 0x53, 0x3e, 0x36, 0xdb, 0x85, 0x25, - 0xf6, 0xcd, 0xc7, 0xd1, 0xdb, 0xb0, 0x39, 0xd9, 0x65, 0x77, 0x24, 0x44, 0xee, 0x57, 0x7f, 0xd8, - 0x89, 0xdd, 0xff, 0x47, 0x1c, 0x36, 0x3d, 0x6e, 0x05, 0xba, 0x05, 0xdf, 0x2b, 0x1f, 0x1d, 0x49, - 0x58, 0xad, 0x9e, 0xe6, 0x2b, 0x55, 0xb9, 0xac, 0xa8, 0x58, 0xaa, 0x9e, 0x9d, 0x28, 0x63, 0x4e, - 0xf7, 0xe0, 0x3d, 0x6f, 0x93, 0x7c, 0xb1, 0x28, 0x55, 0x14, 0x3e, 0x8e, 0x76, 0xe1, 0x5d, 0x1f, - 0x8b, 0x42, 0x19, 0x2b, 0x7c, 0xc2, 0x9f, 0x02, 0x4b, 0xc7, 0x52, 0x51, 0xe1, 0x93, 0xe8, 0x2e, - 0xec, 0x07, 0x59, 0xa8, 0x47, 0x65, 0xfc, 0x34, 0xaf, 0xf0, 0xdc, 0x5c, 0xc3, 0xaa, 0x74, 0xfa, - 0x58, 0xc2, 0xfc, 0x82, 0x33, 0xef, 0xdf, 0x27, 0x40, 0xf0, 0xbb, 0xaa, 0x94, 0x2b, 0x5f, 0xa9, - 0x9c, 0x5c, 0x8c, 0xb8, 0x8a, 0xf2, 0xd9, 0xe9, 0x93, 0xd9, 0x25, 0xb8, 0x03, 0x99, 0x20, 0xc3, - 0xe1, 0x42, 0xdc, 0x86, 0x5b, 0x81, 0x76, 0xce, 0x72, 0xcc, 0x31, 0xc3, 0x92, 0x82, 0x2f, 0xf8, - 0x24, 0xca, 0xc2, 0xfd, 0xb9, 0x66, 0xc3, 0x3e, 0x9e, 0x43, 0x39, 0xf8, 0x30, 0xd8, 0xde, 0x5e, - 0x20, 0x17, 0xe0, 0x2e, 0xd1, 0xaf, 0xe3, 0xb0, 0xed, 0x19, 0x1b, 0xd0, 0x3e, 0xec, 0x56, 0x70, - 0xb9, 0x28, 0x55, 0xab, 0x6a, 0x05, 0x97, 0x2b, 0xe5, 0x6a, 0xfe, 0x44, 0xad, 0x2a, 0x79, 0xe5, - 0xac, 0x3a, 0xb6, 0x36, 0x19, 0xd8, 0xf1, 0x33, 0x1a, 0xae, 0x4b, 0x80, 0x8d, 0x73, 0x02, 0xdc, - 0x73, 0xfa, 0xdb, 0x38, 0xbc, 0xe3, 0x1b, 0x43, 0xd0, 0x3d, 0x78, 0xff, 0x5c, 0xc2, 0xa5, 0xa3, - 0x0b, 0xf5, 0xbc, 0xac, 0x48, 0xaa, 0xf4, 0x4c, 0x91, 0x4e, 0xab, 0xa5, 0xf2, 0xe9, 0xec, 0xa8, - 0xee, 0xc2, 0x7e, 0xa0, 0xe5, 0x70, 0x68, 0xf3, 0x0c, 0xa7, 0xc6, 0xf7, 0xcb, 0x38, 0xac, 0x4f, - 0xc5, 0x22, 0xf4, 0x1e, 0x08, 0x4f, 0x4b, 0xd5, 0x82, 0x24, 0xe7, 0xcf, 0x4b, 0x65, 0x3c, 0x7d, - 0x67, 0xf7, 0x61, 0x77, 0xa6, 0xf7, 0xf1, 0x59, 0xe5, 0xa4, 0x54, 0xcc, 0x2b, 0x12, 0x73, 0xca, - 0xc7, 0xe9, 0xc4, 0x66, 0x8c, 0x4e, 0x4a, 0x9f, 0xc9, 0x8a, 0x5a, 0x3c, 0x29, 0x49, 0xa7, 0x8a, - 0x9a, 0x57, 0x94, 0xfc, 0xe8, 0x3a, 0x1f, 0xfc, 0x65, 0x05, 0xb8, 0x7c, 0xa1, 0x58, 0x42, 0x65, - 0xe0, 0xa8, 0x4a, 0x40, 0x21, 0x4a, 0x0f, 0x62, 0x18, 0xb9, 0x81, 0x30, 0x2c, 0x30, 0xe9, 0x80, - 0xc2, 0x54, 0x24, 0xc4, 0x50, 0x2a, 0x84, 0x0e, 0x92, 0x2a, 0x0a, 0x14, 0xa2, 0x50, 0x21, 0x86, - 0x91, 0x26, 0xe8, 0x19, 0x2c, 0xba, 0xff, 0x2c, 0x86, 0xab, 0x1b, 0x88, 0x21, 0x95, 0x02, 0x9d, - 0x3e, 0x53, 0x1d, 0x28, 0x4c, 0x3d, 0x43, 0x0c, 0x25, 0x60, 0xd0, 0x19, 0xa4, 0x1c, 0x91, 0x1d, - 0xaa, 0x44, 0x21, 0x86, 0x93, 0x24, 0xe8, 0x4b, 0x58, 0x1a, 0xca, 0x2c, 0x14, 0xb6, 0x86, 0x23, - 0x86, 0x56, 0x6e, 0xe8, 0x2b, 0x58, 0x9d, 0xd0, 0x2c, 0x28, 0x4a, 0x61, 0x44, 0x8c, 0x24, 0x87, - 0xa8, 0xaf, 0xc9, 0x4c, 0x2f, 0x4a, 0xb9, 0x44, 0x8c, 0xa4, 0x91, 0xd0, 0x35, 0x6c, 0xcc, 0x08, - 0x1b, 0x14, 0xb5, 0x86, 0x22, 0x46, 0xd6, 0x4e, 0xe8, 0x06, 0x90, 0x47, 0xbe, 0x19, 0xb9, 0xb0, - 0x22, 0x46, 0x17, 0x54, 0xa8, 0x0b, 0xeb, 0xd3, 0x7f, 0x94, 0x47, 0x2b, 0xb7, 0x88, 0x11, 0x25, - 0x96, 0xed, 0x71, 0x32, 0x4f, 0x8d, 0x56, 0x84, 0x11, 0x23, 0xea, 0x2e, 0xa4, 0x01, 0x8c, 0xfd, - 0x9d, 0x19, 0xba, 0x34, 0x23, 0x86, 0xd7, 0x61, 0xe8, 0x17, 0xb0, 0xe9, 0x95, 0x1b, 0x47, 0xaf, - 0xd7, 0x88, 0xff, 0x86, 0x48, 0xa3, 0x77, 0x64, 0xf2, 0xdf, 0xc1, 0x28, 0x55, 0x1c, 0x31, 0x92, - 0x66, 0x2b, 0x54, 0xbe, 0x7d, 0xb5, 0x13, 0xff, 0xee, 0xd5, 0x4e, 0xfc, 0xef, 0xaf, 0x76, 0xe2, - 0x2f, 0x5f, 0xef, 0xc4, 0xbe, 0x7b, 0xbd, 0x13, 0xfb, 0xf3, 0xeb, 0x9d, 0xd8, 0x17, 0x1f, 0x5f, - 0xea, 0x56, 0xab, 0x5f, 0xa3, 0x6c, 0xb9, 0x61, 0x89, 0x7d, 0x54, 0x6b, 0xef, 0xea, 0x39, 0xcf, - 0xc2, 0x7f, 0x2d, 0xc5, 0xd2, 0xe6, 0x47, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xab, 0x52, - 0x89, 0x18, 0x20, 0x00, 0x00, +func (m *FinalizeBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ABCIClient is the client API for ABCI service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ABCIClient interface { - Echo(ctx context.Context, in *v1beta1.RequestEcho, opts ...grpc.CallOption) (*v1beta1.ResponseEcho, error) - Flush(ctx context.Context, in *v1beta1.RequestFlush, opts ...grpc.CallOption) (*v1beta1.ResponseFlush, error) - Info(ctx context.Context, in *v1beta2.RequestInfo, opts ...grpc.CallOption) (*v1beta1.ResponseInfo, error) - CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*v1beta3.ResponseCheckTx, error) - Query(ctx context.Context, in *v1beta1.RequestQuery, opts ...grpc.CallOption) (*v1beta1.ResponseQuery, error) - Commit(ctx context.Context, in *v1beta1.RequestCommit, opts ...grpc.CallOption) (*v1beta3.ResponseCommit, error) - InitChain(ctx context.Context, in *v1beta3.RequestInitChain, opts ...grpc.CallOption) (*v1beta3.ResponseInitChain, error) - ListSnapshots(ctx context.Context, in *v1beta1.RequestListSnapshots, opts ...grpc.CallOption) (*v1beta1.ResponseListSnapshots, error) - OfferSnapshot(ctx context.Context, in *v1beta1.RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) - LoadSnapshotChunk(ctx context.Context, in *v1beta1.RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*v1beta1.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunk(ctx context.Context, in *v1beta1.RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) - PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*v1beta2.ResponsePrepareProposal, error) - ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error) - ExtendVote(ctx context.Context, in *RequestExtendVote, opts ...grpc.CallOption) (*v1beta3.ResponseExtendVote, error) - VerifyVoteExtension(ctx context.Context, in *v1beta3.RequestVerifyVoteExtension, opts ...grpc.CallOption) (*ResponseVerifyVoteExtension, error) - FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock, opts ...grpc.CallOption) (*v1beta3.ResponseFinalizeBlock, error) -} - -type aBCIClient struct { - cc grpc1.ClientConn -} - -func NewABCIClient(cc grpc1.ClientConn) ABCIClient { - return &aBCIClient{cc} -} - -func (c *aBCIClient) Echo(ctx context.Context, in *v1beta1.RequestEcho, opts ...grpc.CallOption) (*v1beta1.ResponseEcho, error) { - out := new(v1beta1.ResponseEcho) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/Echo", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FinalizeBlockRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil } - -func (c *aBCIClient) Flush(ctx context.Context, in *v1beta1.RequestFlush, opts ...grpc.CallOption) (*v1beta1.ResponseFlush, error) { - out := new(v1beta1.ResponseFlush) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/Flush", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *FinalizeBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FinalizeBlockRequest.Merge(m, src) } - -func (c *aBCIClient) Info(ctx context.Context, in *v1beta2.RequestInfo, opts ...grpc.CallOption) (*v1beta1.ResponseInfo, error) { - out := new(v1beta1.ResponseInfo) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *FinalizeBlockRequest) XXX_Size() int { + return m.Size() } - -func (c *aBCIClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*v1beta3.ResponseCheckTx, error) { - out := new(v1beta3.ResponseCheckTx) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/CheckTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *FinalizeBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FinalizeBlockRequest.DiscardUnknown(m) } -func (c *aBCIClient) Query(ctx context.Context, in *v1beta1.RequestQuery, opts ...grpc.CallOption) (*v1beta1.ResponseQuery, error) { - out := new(v1beta1.ResponseQuery) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/Query", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +var xxx_messageInfo_FinalizeBlockRequest proto.InternalMessageInfo -func (c *aBCIClient) Commit(ctx context.Context, in *v1beta1.RequestCommit, opts ...grpc.CallOption) (*v1beta3.ResponseCommit, error) { - out := new(v1beta3.ResponseCommit) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/Commit", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetTxs() [][]byte { + if m != nil { + return m.Txs } - return out, nil + return nil } -func (c *aBCIClient) InitChain(ctx context.Context, in *v1beta3.RequestInitChain, opts ...grpc.CallOption) (*v1beta3.ResponseInitChain, error) { - out := new(v1beta3.ResponseInitChain) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/InitChain", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetDecidedLastCommit() v1beta31.CommitInfo { + if m != nil { + return m.DecidedLastCommit } - return out, nil + return v1beta31.CommitInfo{} } -func (c *aBCIClient) ListSnapshots(ctx context.Context, in *v1beta1.RequestListSnapshots, opts ...grpc.CallOption) (*v1beta1.ResponseListSnapshots, error) { - out := new(v1beta1.ResponseListSnapshots) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/ListSnapshots", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetMisbehavior() []Misbehavior { + if m != nil { + return m.Misbehavior } - return out, nil + return nil } -func (c *aBCIClient) OfferSnapshot(ctx context.Context, in *v1beta1.RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) { - out := new(ResponseOfferSnapshot) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/OfferSnapshot", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetHash() []byte { + if m != nil { + return m.Hash } - return out, nil + return nil } -func (c *aBCIClient) LoadSnapshotChunk(ctx context.Context, in *v1beta1.RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*v1beta1.ResponseLoadSnapshotChunk, error) { - out := new(v1beta1.ResponseLoadSnapshotChunk) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/LoadSnapshotChunk", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetHeight() int64 { + if m != nil { + return m.Height } - return out, nil + return 0 } -func (c *aBCIClient) ApplySnapshotChunk(ctx context.Context, in *v1beta1.RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) { - out := new(ResponseApplySnapshotChunk) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/ApplySnapshotChunk", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetTime() time.Time { + if m != nil { + return m.Time } - return out, nil + return time.Time{} } -func (c *aBCIClient) PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*v1beta2.ResponsePrepareProposal, error) { - out := new(v1beta2.ResponsePrepareProposal) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/PrepareProposal", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash } - return out, nil + return nil } -func (c *aBCIClient) ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error) { - out := new(ResponseProcessProposal) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/ProcessProposal", in, out, opts...) - if err != nil { - return nil, err +func (m *FinalizeBlockRequest) GetProposerAddress() []byte { + if m != nil { + return m.ProposerAddress } - return out, nil + return nil } -func (c *aBCIClient) ExtendVote(ctx context.Context, in *RequestExtendVote, opts ...grpc.CallOption) (*v1beta3.ResponseExtendVote, error) { - out := new(v1beta3.ResponseExtendVote) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/ExtendVote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type Response struct { + // Types that are valid to be assigned to Value: + // *Response_Exception + // *Response_Echo + // *Response_Flush + // *Response_Info + // *Response_InitChain + // *Response_Query + // *Response_CheckTx + // *Response_Commit + // *Response_ListSnapshots + // *Response_OfferSnapshot + // *Response_LoadSnapshotChunk + // *Response_ApplySnapshotChunk + // *Response_PrepareProposal + // *Response_ProcessProposal + // *Response_ExtendVote + // *Response_VerifyVoteExtension + // *Response_FinalizeBlock + Value isResponse_Value `protobuf_oneof:"value"` } -func (c *aBCIClient) VerifyVoteExtension(ctx context.Context, in *v1beta3.RequestVerifyVoteExtension, opts ...grpc.CallOption) (*ResponseVerifyVoteExtension, error) { - out := new(ResponseVerifyVoteExtension) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/VerifyVoteExtension", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{17} } - -func (c *aBCIClient) FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock, opts ...grpc.CallOption) (*v1beta3.ResponseFinalizeBlock, error) { - out := new(v1beta3.ResponseFinalizeBlock) - err := c.cc.Invoke(ctx, "/cometbft.abci.v1beta4.ABCI/FinalizeBlock", in, out, opts...) - if err != nil { - return nil, err +func (m *Response) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Response.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil } - -// ABCIServer is the server API for ABCI service. -type ABCIServer interface { - Echo(context.Context, *v1beta1.RequestEcho) (*v1beta1.ResponseEcho, error) - Flush(context.Context, *v1beta1.RequestFlush) (*v1beta1.ResponseFlush, error) - Info(context.Context, *v1beta2.RequestInfo) (*v1beta1.ResponseInfo, error) - CheckTx(context.Context, *RequestCheckTx) (*v1beta3.ResponseCheckTx, error) - Query(context.Context, *v1beta1.RequestQuery) (*v1beta1.ResponseQuery, error) - Commit(context.Context, *v1beta1.RequestCommit) (*v1beta3.ResponseCommit, error) - InitChain(context.Context, *v1beta3.RequestInitChain) (*v1beta3.ResponseInitChain, error) - ListSnapshots(context.Context, *v1beta1.RequestListSnapshots) (*v1beta1.ResponseListSnapshots, error) - OfferSnapshot(context.Context, *v1beta1.RequestOfferSnapshot) (*ResponseOfferSnapshot, error) - LoadSnapshotChunk(context.Context, *v1beta1.RequestLoadSnapshotChunk) (*v1beta1.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunk(context.Context, *v1beta1.RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) - PrepareProposal(context.Context, *RequestPrepareProposal) (*v1beta2.ResponsePrepareProposal, error) - ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error) - ExtendVote(context.Context, *RequestExtendVote) (*v1beta3.ResponseExtendVote, error) - VerifyVoteExtension(context.Context, *v1beta3.RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) - FinalizeBlock(context.Context, *RequestFinalizeBlock) (*v1beta3.ResponseFinalizeBlock, error) +func (m *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(m, src) +} +func (m *Response) XXX_Size() int { + return m.Size() } +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) +} + +var xxx_messageInfo_Response proto.InternalMessageInfo -// UnimplementedABCIServer can be embedded to have forward compatible implementations. -type UnimplementedABCIServer struct { +type isResponse_Value interface { + isResponse_Value() + MarshalTo([]byte) (int, error) + Size() int } -func (*UnimplementedABCIServer) Echo(ctx context.Context, req *v1beta1.RequestEcho) (*v1beta1.ResponseEcho, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +type Response_Exception struct { + Exception *ExceptionResponse `protobuf:"bytes,1,opt,name=exception,proto3,oneof" json:"exception,omitempty"` } -func (*UnimplementedABCIServer) Flush(ctx context.Context, req *v1beta1.RequestFlush) (*v1beta1.ResponseFlush, error) { - return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") +type Response_Echo struct { + Echo *EchoResponse `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } -func (*UnimplementedABCIServer) Info(ctx context.Context, req *v1beta2.RequestInfo) (*v1beta1.ResponseInfo, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +type Response_Flush struct { + Flush *FlushResponse `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } -func (*UnimplementedABCIServer) CheckTx(ctx context.Context, req *RequestCheckTx) (*v1beta3.ResponseCheckTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented") +type Response_Info struct { + Info *InfoResponse `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` } -func (*UnimplementedABCIServer) Query(ctx context.Context, req *v1beta1.RequestQuery) (*v1beta1.ResponseQuery, error) { - return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +type Response_InitChain struct { + InitChain *InitChainResponse `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } -func (*UnimplementedABCIServer) Commit(ctx context.Context, req *v1beta1.RequestCommit) (*v1beta3.ResponseCommit, error) { - return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") +type Response_Query struct { + Query *QueryResponse `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` } -func (*UnimplementedABCIServer) InitChain(ctx context.Context, req *v1beta3.RequestInitChain) (*v1beta3.ResponseInitChain, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") +type Response_CheckTx struct { + CheckTx *CheckTxResponse `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } -func (*UnimplementedABCIServer) ListSnapshots(ctx context.Context, req *v1beta1.RequestListSnapshots) (*v1beta1.ResponseListSnapshots, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented") +type Response_Commit struct { + Commit *CommitResponse `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } -func (*UnimplementedABCIServer) OfferSnapshot(ctx context.Context, req *v1beta1.RequestOfferSnapshot) (*ResponseOfferSnapshot, error) { - return nil, status.Errorf(codes.Unimplemented, "method OfferSnapshot not implemented") +type Response_ListSnapshots struct { + ListSnapshots *ListSnapshotsResponse `protobuf:"bytes,13,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` } -func (*UnimplementedABCIServer) LoadSnapshotChunk(ctx context.Context, req *v1beta1.RequestLoadSnapshotChunk) (*v1beta1.ResponseLoadSnapshotChunk, error) { - return nil, status.Errorf(codes.Unimplemented, "method LoadSnapshotChunk not implemented") +type Response_OfferSnapshot struct { + OfferSnapshot *OfferSnapshotResponse `protobuf:"bytes,14,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` } -func (*UnimplementedABCIServer) ApplySnapshotChunk(ctx context.Context, req *v1beta1.RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) { - return nil, status.Errorf(codes.Unimplemented, "method ApplySnapshotChunk not implemented") +type Response_LoadSnapshotChunk struct { + LoadSnapshotChunk *LoadSnapshotChunkResponse `protobuf:"bytes,15,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` } -func (*UnimplementedABCIServer) PrepareProposal(ctx context.Context, req *RequestPrepareProposal) (*v1beta2.ResponsePrepareProposal, error) { - return nil, status.Errorf(codes.Unimplemented, "method PrepareProposal not implemented") +type Response_ApplySnapshotChunk struct { + ApplySnapshotChunk *ApplySnapshotChunkResponse `protobuf:"bytes,16,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` } -func (*UnimplementedABCIServer) ProcessProposal(ctx context.Context, req *RequestProcessProposal) (*ResponseProcessProposal, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented") +type Response_PrepareProposal struct { + PrepareProposal *PrepareProposalResponse `protobuf:"bytes,17,opt,name=prepare_proposal,json=prepareProposal,proto3,oneof" json:"prepare_proposal,omitempty"` } -func (*UnimplementedABCIServer) ExtendVote(ctx context.Context, req *RequestExtendVote) (*v1beta3.ResponseExtendVote, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExtendVote not implemented") +type Response_ProcessProposal struct { + ProcessProposal *ProcessProposalResponse `protobuf:"bytes,18,opt,name=process_proposal,json=processProposal,proto3,oneof" json:"process_proposal,omitempty"` } -func (*UnimplementedABCIServer) VerifyVoteExtension(ctx context.Context, req *v1beta3.RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyVoteExtension not implemented") +type Response_ExtendVote struct { + ExtendVote *ExtendVoteResponse `protobuf:"bytes,19,opt,name=extend_vote,json=extendVote,proto3,oneof" json:"extend_vote,omitempty"` } -func (*UnimplementedABCIServer) FinalizeBlock(ctx context.Context, req *RequestFinalizeBlock) (*v1beta3.ResponseFinalizeBlock, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented") +type Response_VerifyVoteExtension struct { + VerifyVoteExtension *VerifyVoteExtensionResponse `protobuf:"bytes,20,opt,name=verify_vote_extension,json=verifyVoteExtension,proto3,oneof" json:"verify_vote_extension,omitempty"` } - -func RegisterABCIServer(s grpc1.Server, srv ABCIServer) { - s.RegisterService(&_ABCI_serviceDesc, srv) +type Response_FinalizeBlock struct { + FinalizeBlock *FinalizeBlockResponse `protobuf:"bytes,21,opt,name=finalize_block,json=finalizeBlock,proto3,oneof" json:"finalize_block,omitempty"` } -func _ABCI_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestEcho) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).Echo(ctx, req.(*v1beta1.RequestEcho)) +func (*Response_Exception) isResponse_Value() {} +func (*Response_Echo) isResponse_Value() {} +func (*Response_Flush) isResponse_Value() {} +func (*Response_Info) isResponse_Value() {} +func (*Response_InitChain) isResponse_Value() {} +func (*Response_Query) isResponse_Value() {} +func (*Response_CheckTx) isResponse_Value() {} +func (*Response_Commit) isResponse_Value() {} +func (*Response_ListSnapshots) isResponse_Value() {} +func (*Response_OfferSnapshot) isResponse_Value() {} +func (*Response_LoadSnapshotChunk) isResponse_Value() {} +func (*Response_ApplySnapshotChunk) isResponse_Value() {} +func (*Response_PrepareProposal) isResponse_Value() {} +func (*Response_ProcessProposal) isResponse_Value() {} +func (*Response_ExtendVote) isResponse_Value() {} +func (*Response_VerifyVoteExtension) isResponse_Value() {} +func (*Response_FinalizeBlock) isResponse_Value() {} + +func (m *Response) GetValue() isResponse_Value { + if m != nil { + return m.Value } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestFlush) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).Flush(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/Flush", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).Flush(ctx, req.(*v1beta1.RequestFlush)) +func (m *Response) GetException() *ExceptionResponse { + if x, ok := m.GetValue().(*Response_Exception); ok { + return x.Exception } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta2.RequestInfo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).Info(ctx, req.(*v1beta2.RequestInfo)) +func (m *Response) GetEcho() *EchoResponse { + if x, ok := m.GetValue().(*Response_Echo); ok { + return x.Echo } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestCheckTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).CheckTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/CheckTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).CheckTx(ctx, req.(*RequestCheckTx)) +func (m *Response) GetFlush() *FlushResponse { + if x, ok := m.GetValue().(*Response_Flush); ok { + return x.Flush } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestQuery) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).Query(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/Query", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).Query(ctx, req.(*v1beta1.RequestQuery)) +func (m *Response) GetInfo() *InfoResponse { + if x, ok := m.GetValue().(*Response_Info); ok { + return x.Info } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestCommit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).Commit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/Commit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).Commit(ctx, req.(*v1beta1.RequestCommit)) +func (m *Response) GetInitChain() *InitChainResponse { + if x, ok := m.GetValue().(*Response_InitChain); ok { + return x.InitChain } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta3.RequestInitChain) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).InitChain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/InitChain", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).InitChain(ctx, req.(*v1beta3.RequestInitChain)) +func (m *Response) GetQuery() *QueryResponse { + if x, ok := m.GetValue().(*Response_Query); ok { + return x.Query } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestListSnapshots) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).ListSnapshots(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/ListSnapshots", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).ListSnapshots(ctx, req.(*v1beta1.RequestListSnapshots)) +func (m *Response) GetCheckTx() *CheckTxResponse { + if x, ok := m.GetValue().(*Response_CheckTx); ok { + return x.CheckTx } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestOfferSnapshot) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).OfferSnapshot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/OfferSnapshot", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).OfferSnapshot(ctx, req.(*v1beta1.RequestOfferSnapshot)) +func (m *Response) GetCommit() *CommitResponse { + if x, ok := m.GetValue().(*Response_Commit); ok { + return x.Commit } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestLoadSnapshotChunk) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).LoadSnapshotChunk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/LoadSnapshotChunk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).LoadSnapshotChunk(ctx, req.(*v1beta1.RequestLoadSnapshotChunk)) +func (m *Response) GetListSnapshots() *ListSnapshotsResponse { + if x, ok := m.GetValue().(*Response_ListSnapshots); ok { + return x.ListSnapshots } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta1.RequestApplySnapshotChunk) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).ApplySnapshotChunk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/ApplySnapshotChunk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).ApplySnapshotChunk(ctx, req.(*v1beta1.RequestApplySnapshotChunk)) +func (m *Response) GetOfferSnapshot() *OfferSnapshotResponse { + if x, ok := m.GetValue().(*Response_OfferSnapshot); ok { + return x.OfferSnapshot } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_PrepareProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestPrepareProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).PrepareProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/PrepareProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).PrepareProposal(ctx, req.(*RequestPrepareProposal)) +func (m *Response) GetLoadSnapshotChunk() *LoadSnapshotChunkResponse { + if x, ok := m.GetValue().(*Response_LoadSnapshotChunk); ok { + return x.LoadSnapshotChunk } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestProcessProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).ProcessProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/ProcessProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).ProcessProposal(ctx, req.(*RequestProcessProposal)) +func (m *Response) GetApplySnapshotChunk() *ApplySnapshotChunkResponse { + if x, ok := m.GetValue().(*Response_ApplySnapshotChunk); ok { + return x.ApplySnapshotChunk } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_ExtendVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestExtendVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).ExtendVote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/ExtendVote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).ExtendVote(ctx, req.(*RequestExtendVote)) +func (m *Response) GetPrepareProposal() *PrepareProposalResponse { + if x, ok := m.GetValue().(*Response_PrepareProposal); ok { + return x.PrepareProposal } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_VerifyVoteExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1beta3.RequestVerifyVoteExtension) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).VerifyVoteExtension(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/VerifyVoteExtension", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).VerifyVoteExtension(ctx, req.(*v1beta3.RequestVerifyVoteExtension)) +func (m *Response) GetProcessProposal() *ProcessProposalResponse { + if x, ok := m.GetValue().(*Response_ProcessProposal); ok { + return x.ProcessProposal } - return interceptor(ctx, in, info, handler) + return nil } -func _ABCI_FinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestFinalizeBlock) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIServer).FinalizeBlock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cometbft.abci.v1beta4.ABCI/FinalizeBlock", +func (m *Response) GetExtendVote() *ExtendVoteResponse { + if x, ok := m.GetValue().(*Response_ExtendVote); ok { + return x.ExtendVote } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIServer).FinalizeBlock(ctx, req.(*RequestFinalizeBlock)) + return nil +} + +func (m *Response) GetVerifyVoteExtension() *VerifyVoteExtensionResponse { + if x, ok := m.GetValue().(*Response_VerifyVoteExtension); ok { + return x.VerifyVoteExtension } - return interceptor(ctx, in, info, handler) + return nil } -var _ABCI_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cometbft.abci.v1beta4.ABCI", - HandlerType: (*ABCIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _ABCI_Echo_Handler, - }, - { - MethodName: "Flush", - Handler: _ABCI_Flush_Handler, - }, - { - MethodName: "Info", - Handler: _ABCI_Info_Handler, - }, - { - MethodName: "CheckTx", - Handler: _ABCI_CheckTx_Handler, - }, - { - MethodName: "Query", - Handler: _ABCI_Query_Handler, - }, - { - MethodName: "Commit", - Handler: _ABCI_Commit_Handler, - }, - { - MethodName: "InitChain", - Handler: _ABCI_InitChain_Handler, - }, - { - MethodName: "ListSnapshots", - Handler: _ABCI_ListSnapshots_Handler, - }, - { - MethodName: "OfferSnapshot", - Handler: _ABCI_OfferSnapshot_Handler, - }, - { - MethodName: "LoadSnapshotChunk", - Handler: _ABCI_LoadSnapshotChunk_Handler, - }, - { - MethodName: "ApplySnapshotChunk", - Handler: _ABCI_ApplySnapshotChunk_Handler, - }, - { - MethodName: "PrepareProposal", - Handler: _ABCI_PrepareProposal_Handler, - }, - { - MethodName: "ProcessProposal", - Handler: _ABCI_ProcessProposal_Handler, - }, - { - MethodName: "ExtendVote", - Handler: _ABCI_ExtendVote_Handler, - }, - { - MethodName: "VerifyVoteExtension", - Handler: _ABCI_VerifyVoteExtension_Handler, - }, - { - MethodName: "FinalizeBlock", - Handler: _ABCI_FinalizeBlock_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cometbft/abci/v1beta4/types.proto", +func (m *Response) GetFinalizeBlock() *FinalizeBlockResponse { + if x, ok := m.GetValue().(*Response_FinalizeBlock); ok { + return x.FinalizeBlock + } + return nil } -func (m *Request) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Response) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Response_Exception)(nil), + (*Response_Echo)(nil), + (*Response_Flush)(nil), + (*Response_Info)(nil), + (*Response_InitChain)(nil), + (*Response_Query)(nil), + (*Response_CheckTx)(nil), + (*Response_Commit)(nil), + (*Response_ListSnapshots)(nil), + (*Response_OfferSnapshot)(nil), + (*Response_LoadSnapshotChunk)(nil), + (*Response_ApplySnapshotChunk)(nil), + (*Response_PrepareProposal)(nil), + (*Response_ProcessProposal)(nil), + (*Response_ExtendVote)(nil), + (*Response_VerifyVoteExtension)(nil), + (*Response_FinalizeBlock)(nil), } - return dAtA[:n], nil } -func (m *Request) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// nondeterministic +type ExceptionResponse struct { + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } -func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != nil { - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } +func (m *ExceptionResponse) Reset() { *m = ExceptionResponse{} } +func (m *ExceptionResponse) String() string { return proto.CompactTextString(m) } +func (*ExceptionResponse) ProtoMessage() {} +func (*ExceptionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{18} +} +func (m *ExceptionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExceptionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExceptionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *ExceptionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExceptionResponse.Merge(m, src) +} +func (m *ExceptionResponse) XXX_Size() int { + return m.Size() +} +func (m *ExceptionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ExceptionResponse.DiscardUnknown(m) } -func (m *Request_Echo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +var xxx_messageInfo_ExceptionResponse proto.InternalMessageInfo + +func (m *ExceptionResponse) GetError() string { + if m != nil { + return m.Error + } + return "" } -func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Echo != nil { - { - size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +type EchoResponse struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *EchoResponse) Reset() { *m = EchoResponse{} } +func (m *EchoResponse) String() string { return proto.CompactTextString(m) } +func (*EchoResponse) ProtoMessage() {} +func (*EchoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{19} +} +func (m *EchoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Request_Flush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *EchoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoResponse.Merge(m, src) +} +func (m *EchoResponse) XXX_Size() int { + return m.Size() +} +func (m *EchoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EchoResponse.DiscardUnknown(m) } -func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Flush != nil { - { - size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +var xxx_messageInfo_EchoResponse proto.InternalMessageInfo + +func (m *EchoResponse) GetMessage() string { + if m != nil { + return m.Message } - return len(dAtA) - i, nil + return "" } -func (m *Request_Info) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +type FlushResponse struct { } -func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Info != nil { - { - size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *FlushResponse) Reset() { *m = FlushResponse{} } +func (m *FlushResponse) String() string { return proto.CompactTextString(m) } +func (*FlushResponse) ProtoMessage() {} +func (*FlushResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{20} +} +func (m *FlushResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FlushResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x1a + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Request_InitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *FlushResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushResponse.Merge(m, src) +} +func (m *FlushResponse) XXX_Size() int { + return m.Size() +} +func (m *FlushResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FlushResponse.DiscardUnknown(m) } -func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.InitChain != nil { - { - size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +var xxx_messageInfo_FlushResponse proto.InternalMessageInfo + +type InfoResponse struct { + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + AppVersion uint64 `protobuf:"varint,3,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` + LastBlockHeight int64 `protobuf:"varint,4,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` + LastBlockAppHash []byte `protobuf:"bytes,5,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` +} + +func (m *InfoResponse) Reset() { *m = InfoResponse{} } +func (m *InfoResponse) String() string { return proto.CompactTextString(m) } +func (*InfoResponse) ProtoMessage() {} +func (*InfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{21} +} +func (m *InfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x2a + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Request_Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *InfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoResponse.Merge(m, src) +} +func (m *InfoResponse) XXX_Size() int { + return m.Size() +} +func (m *InfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InfoResponse.DiscardUnknown(m) } -func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Query != nil { - { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 +var xxx_messageInfo_InfoResponse proto.InternalMessageInfo + +func (m *InfoResponse) GetData() string { + if m != nil { + return m.Data } - return len(dAtA) - i, nil + return "" } -func (m *Request_CheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +func (m *InfoResponse) GetVersion() string { + if m != nil { + return m.Version + } + return "" } -func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 +func (m *InfoResponse) GetAppVersion() uint64 { + if m != nil { + return m.AppVersion } - return len(dAtA) - i, nil + return 0 } -func (m *Request_Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +func (m *InfoResponse) GetLastBlockHeight() int64 { + if m != nil { + return m.LastBlockHeight + } + return 0 } -func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Commit != nil { - { - size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a +func (m *InfoResponse) GetLastBlockAppHash() []byte { + if m != nil { + return m.LastBlockAppHash } - return len(dAtA) - i, nil + return nil } -func (m *Request_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +type InitChainResponse struct { + ConsensusParams *v1beta3.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` + Validators []v1beta1.ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } -func (m *Request_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ListSnapshots != nil { - { - size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *InitChainResponse) Reset() { *m = InitChainResponse{} } +func (m *InitChainResponse) String() string { return proto.CompactTextString(m) } +func (*InitChainResponse) ProtoMessage() {} +func (*InitChainResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{22} +} +func (m *InitChainResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InitChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InitChainResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x62 + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Request_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *InitChainResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitChainResponse.Merge(m, src) +} +func (m *InitChainResponse) XXX_Size() int { + return m.Size() +} +func (m *InitChainResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InitChainResponse.DiscardUnknown(m) } -func (m *Request_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.OfferSnapshot != nil { - { - size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a +var xxx_messageInfo_InitChainResponse proto.InternalMessageInfo + +func (m *InitChainResponse) GetConsensusParams() *v1beta3.ConsensusParams { + if m != nil { + return m.ConsensusParams } - return len(dAtA) - i, nil + return nil } -func (m *Request_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +func (m *InitChainResponse) GetValidators() []v1beta1.ValidatorUpdate { + if m != nil { + return m.Validators + } + return nil } -func (m *Request_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.LoadSnapshotChunk != nil { - { - size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 +func (m *InitChainResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash } - return len(dAtA) - i, nil + return nil } -func (m *Request_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +type QueryResponse struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + // bytes data = 2; // use "value" instead. + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + ProofOps *v1beta11.ProofOps `protobuf:"bytes,8,opt,name=proof_ops,json=proofOps,proto3" json:"proof_ops,omitempty"` + Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` + Codespace string `protobuf:"bytes,10,opt,name=codespace,proto3" json:"codespace,omitempty"` } -func (m *Request_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ApplySnapshotChunk != nil { - { - size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{23} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x7a + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Request_PrepareProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) } -func (m *Request_PrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PrepareProposal != nil { - { - size, err := m.PrepareProposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetCode() uint32 { + if m != nil { + return m.Code } - return len(dAtA) - i, nil -} -func (m *Request_ProcessProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return 0 } -func (m *Request_ProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ProcessProposal != nil { - { - size, err := m.ProcessProposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a +func (m *QueryResponse) GetLog() string { + if m != nil { + return m.Log } - return len(dAtA) - i, nil -} -func (m *Request_ExtendVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *Request_ExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExtendVote != nil { - { - size, err := m.ExtendVote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 +func (m *QueryResponse) GetInfo() string { + if m != nil { + return m.Info } - return len(dAtA) - i, nil -} -func (m *Request_VerifyVoteExtension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *Request_VerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VerifyVoteExtension != nil { - { - size, err := m.VerifyVoteExtension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a +func (m *QueryResponse) GetIndex() int64 { + if m != nil { + return m.Index } - return len(dAtA) - i, nil -} -func (m *Request_FinalizeBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return 0 } -func (m *Request_FinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.FinalizeBlock != nil { - { - size, err := m.FinalizeBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 +func (m *QueryResponse) GetKey() []byte { + if m != nil { + return m.Key } - return len(dAtA) - i, nil + return nil } -func (m *RequestCheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + +func (m *QueryResponse) GetValue() []byte { + if m != nil { + return m.Value } - return dAtA[:n], nil + return nil } -func (m *RequestCheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryResponse) GetProofOps() *v1beta11.ProofOps { + if m != nil { + return m.ProofOps + } + return nil } -func (m *RequestCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa +func (m *QueryResponse) GetHeight() int64 { + if m != nil { + return m.Height } - return len(dAtA) - i, nil + return 0 } -func (m *RequestPrepareProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryResponse) GetCodespace() string { + if m != nil { + return m.Codespace } - return dAtA[:n], nil + return "" } -func (m *RequestPrepareProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type CheckTxResponse struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` + Events []v1beta2.Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` + Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` } -func (m *RequestPrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x42 +func (m *CheckTxResponse) Reset() { *m = CheckTxResponse{} } +func (m *CheckTxResponse) String() string { return proto.CompactTextString(m) } +func (*CheckTxResponse) ProtoMessage() {} +func (*CheckTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{24} +} +func (m *CheckTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckTxResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x3a +} +func (m *CheckTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckTxResponse.Merge(m, src) +} +func (m *CheckTxResponse) XXX_Size() int { + return m.Size() +} +func (m *CheckTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CheckTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckTxResponse proto.InternalMessageInfo + +func (m *CheckTxResponse) GetCode() uint32 { + if m != nil { + return m.Code } - n17, err17 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err17 != nil { - return 0, err17 + return 0 +} + +func (m *CheckTxResponse) GetData() []byte { + if m != nil { + return m.Data } - i -= n17 - i = encodeVarintTypes(dAtA, i, uint64(n17)) - i-- - dAtA[i] = 0x32 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x28 + return nil +} + +func (m *CheckTxResponse) GetLog() string { + if m != nil { + return m.Log } - if len(m.Misbehavior) > 0 { - for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } + return "" +} + +func (m *CheckTxResponse) GetInfo() string { + if m != nil { + return m.Info } - { - size, err := m.LocalLastCommit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + return "" +} + +func (m *CheckTxResponse) GetGasWanted() int64 { + if m != nil { + return m.GasWanted } - i-- - dAtA[i] = 0x1a - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0x12 - } + return 0 +} + +func (m *CheckTxResponse) GetGasUsed() int64 { + if m != nil { + return m.GasUsed } - if m.MaxTxBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTxBytes)) - i-- - dAtA[i] = 0x8 + return 0 +} + +func (m *CheckTxResponse) GetEvents() []v1beta2.Event { + if m != nil { + return m.Events } - return len(dAtA) - i, nil + return nil } -func (m *RequestProcessProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *CheckTxResponse) GetCodespace() string { + if m != nil { + return m.Codespace } - return dAtA[:n], nil + return "" } -func (m *RequestProcessProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type CommitResponse struct { + RetainHeight int64 `protobuf:"varint,3,opt,name=retain_height,json=retainHeight,proto3" json:"retain_height,omitempty"` } -func (m *RequestProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x3a - } - n19, err19 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err19 != nil { - return 0, err19 - } - i -= n19 - i = encodeVarintTypes(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0x32 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x28 - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if len(m.Misbehavior) > 0 { - for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.ProposedLastCommit.MarshalToSizedBuffer(dAtA[:i]) +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{25} +} +func (m *CommitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa + return nil, err } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *CommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitResponse.Merge(m, src) +} +func (m *CommitResponse) XXX_Size() int { + return m.Size() +} +func (m *CommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CommitResponse.DiscardUnknown(m) } -func (m *RequestExtendVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_CommitResponse proto.InternalMessageInfo + +func (m *CommitResponse) GetRetainHeight() int64 { + if m != nil { + return m.RetainHeight } - return dAtA[:n], nil + return 0 } -func (m *RequestExtendVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ListSnapshotsResponse struct { + Snapshots []*v1beta1.Snapshot `protobuf:"bytes,1,rep,name=snapshots,proto3" json:"snapshots,omitempty"` } -func (m *RequestExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x42 +func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} } +func (m *ListSnapshotsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsResponse) ProtoMessage() {} +func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{26} +} +func (m *ListSnapshotsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListSnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListSnapshotsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x3a +} +func (m *ListSnapshotsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListSnapshotsResponse.Merge(m, src) +} +func (m *ListSnapshotsResponse) XXX_Size() int { + return m.Size() +} +func (m *ListSnapshotsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListSnapshotsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListSnapshotsResponse proto.InternalMessageInfo + +func (m *ListSnapshotsResponse) GetSnapshots() []*v1beta1.Snapshot { + if m != nil { + return m.Snapshots } - if len(m.Misbehavior) > 0 { - for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 + return nil +} + +type OfferSnapshotResponse struct { + Result OfferSnapshotResult `protobuf:"varint,1,opt,name=result,proto3,enum=cometbft.abci.v1beta4.OfferSnapshotResult" json:"result,omitempty"` +} + +func (m *OfferSnapshotResponse) Reset() { *m = OfferSnapshotResponse{} } +func (m *OfferSnapshotResponse) String() string { return proto.CompactTextString(m) } +func (*OfferSnapshotResponse) ProtoMessage() {} +func (*OfferSnapshotResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{27} +} +func (m *OfferSnapshotResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OfferSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OfferSnapshotResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - { - size, err := m.ProposedLastCommit.MarshalToSizedBuffer(dAtA[:i]) +} +func (m *OfferSnapshotResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfferSnapshotResponse.Merge(m, src) +} +func (m *OfferSnapshotResponse) XXX_Size() int { + return m.Size() +} +func (m *OfferSnapshotResponse) XXX_DiscardUnknown() { + xxx_messageInfo_OfferSnapshotResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_OfferSnapshotResponse proto.InternalMessageInfo + +func (m *OfferSnapshotResponse) GetResult() OfferSnapshotResult { + if m != nil { + return m.Result + } + return OFFER_SNAPSHOT_RESULT_UNKNOWN +} + +type LoadSnapshotChunkResponse struct { + Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` +} + +func (m *LoadSnapshotChunkResponse) Reset() { *m = LoadSnapshotChunkResponse{} } +func (m *LoadSnapshotChunkResponse) String() string { return proto.CompactTextString(m) } +func (*LoadSnapshotChunkResponse) ProtoMessage() {} +func (*LoadSnapshotChunkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{28} +} +func (m *LoadSnapshotChunkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoadSnapshotChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoadSnapshotChunkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err + return nil, err } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + return b[:n], nil } - i-- - dAtA[i] = 0x2a - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0x22 - } +} +func (m *LoadSnapshotChunkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadSnapshotChunkResponse.Merge(m, src) +} +func (m *LoadSnapshotChunkResponse) XXX_Size() int { + return m.Size() +} +func (m *LoadSnapshotChunkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LoadSnapshotChunkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LoadSnapshotChunkResponse proto.InternalMessageInfo + +func (m *LoadSnapshotChunkResponse) GetChunk() []byte { + if m != nil { + return m.Chunk } - n22, err22 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err22 != nil { - return 0, err22 + return nil +} + +type ApplySnapshotChunkResponse struct { + Result ApplySnapshotChunkResult `protobuf:"varint,1,opt,name=result,proto3,enum=cometbft.abci.v1beta4.ApplySnapshotChunkResult" json:"result,omitempty"` + RefetchChunks []uint32 `protobuf:"varint,2,rep,packed,name=refetch_chunks,json=refetchChunks,proto3" json:"refetch_chunks,omitempty"` + RejectSenders []string `protobuf:"bytes,3,rep,name=reject_senders,json=rejectSenders,proto3" json:"reject_senders,omitempty"` +} + +func (m *ApplySnapshotChunkResponse) Reset() { *m = ApplySnapshotChunkResponse{} } +func (m *ApplySnapshotChunkResponse) String() string { return proto.CompactTextString(m) } +func (*ApplySnapshotChunkResponse) ProtoMessage() {} +func (*ApplySnapshotChunkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{29} +} +func (m *ApplySnapshotChunkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplySnapshotChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplySnapshotChunkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - i -= n22 - i = encodeVarintTypes(dAtA, i, uint64(n22)) - i-- - dAtA[i] = 0x1a - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 +} +func (m *ApplySnapshotChunkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplySnapshotChunkResponse.Merge(m, src) +} +func (m *ApplySnapshotChunkResponse) XXX_Size() int { + return m.Size() +} +func (m *ApplySnapshotChunkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ApplySnapshotChunkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplySnapshotChunkResponse proto.InternalMessageInfo + +func (m *ApplySnapshotChunkResponse) GetResult() ApplySnapshotChunkResult { + if m != nil { + return m.Result } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa + return APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN +} + +func (m *ApplySnapshotChunkResponse) GetRefetchChunks() []uint32 { + if m != nil { + return m.RefetchChunks } - return len(dAtA) - i, nil + return nil } -func (m *RequestFinalizeBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *ApplySnapshotChunkResponse) GetRejectSenders() []string { + if m != nil { + return m.RejectSenders } - return dAtA[:n], nil + return nil } -func (m *RequestFinalizeBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type PrepareProposalResponse struct { + Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` } -func (m *RequestFinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x3a - } - n23, err23 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err23 != nil { - return 0, err23 - } - i -= n23 - i = encodeVarintTypes(dAtA, i, uint64(n23)) - i-- - dAtA[i] = 0x32 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x28 - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if len(m.Misbehavior) > 0 { - for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.DecidedLastCommit.MarshalToSizedBuffer(dAtA[:i]) +func (m *PrepareProposalResponse) Reset() { *m = PrepareProposalResponse{} } +func (m *PrepareProposalResponse) String() string { return proto.CompactTextString(m) } +func (*PrepareProposalResponse) ProtoMessage() {} +func (*PrepareProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{30} +} +func (m *PrepareProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrepareProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrepareProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa + return nil, err } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *PrepareProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrepareProposalResponse.Merge(m, src) +} +func (m *PrepareProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *PrepareProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PrepareProposalResponse.DiscardUnknown(m) } -func (m *Response) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_PrepareProposalResponse proto.InternalMessageInfo + +func (m *PrepareProposalResponse) GetTxs() [][]byte { + if m != nil { + return m.Txs } - return dAtA[:n], nil + return nil } -func (m *Response) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type ProcessProposalResponse struct { + Status ProcessProposalStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cometbft.abci.v1beta4.ProcessProposalStatus" json:"status,omitempty"` } -func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != nil { - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } +func (m *ProcessProposalResponse) Reset() { *m = ProcessProposalResponse{} } +func (m *ProcessProposalResponse) String() string { return proto.CompactTextString(m) } +func (*ProcessProposalResponse) ProtoMessage() {} +func (*ProcessProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{31} +} +func (m *ProcessProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProcessProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProcessProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - return len(dAtA) - i, nil } - -func (m *Response_Exception) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *ProcessProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessProposalResponse.Merge(m, src) +} +func (m *ProcessProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *ProcessProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessProposalResponse.DiscardUnknown(m) } -func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Exception != nil { - { - size, err := m.Exception.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +var xxx_messageInfo_ProcessProposalResponse proto.InternalMessageInfo + +func (m *ProcessProposalResponse) GetStatus() ProcessProposalStatus { + if m != nil { + return m.Status } - return len(dAtA) - i, nil + return PROCESS_PROPOSAL_STATUS_UNKNOWN } -func (m *Response_Echo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +type ExtendVoteResponse struct { + VoteExtension []byte `protobuf:"bytes,1,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"` } -func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Echo != nil { - { - size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *ExtendVoteResponse) Reset() { *m = ExtendVoteResponse{} } +func (m *ExtendVoteResponse) String() string { return proto.CompactTextString(m) } +func (*ExtendVoteResponse) ProtoMessage() {} +func (*ExtendVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{32} +} +func (m *ExtendVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExtendVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExtendVoteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x12 + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Response_Flush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *ExtendVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendVoteResponse.Merge(m, src) +} +func (m *ExtendVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *ExtendVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendVoteResponse.DiscardUnknown(m) } -func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Flush != nil { - { - size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a +var xxx_messageInfo_ExtendVoteResponse proto.InternalMessageInfo + +func (m *ExtendVoteResponse) GetVoteExtension() []byte { + if m != nil { + return m.VoteExtension } - return len(dAtA) - i, nil + return nil } -func (m *Response_Info) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +type VerifyVoteExtensionResponse struct { + Status VerifyVoteExtensionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cometbft.abci.v1beta4.VerifyVoteExtensionStatus" json:"status,omitempty"` } -func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Info != nil { - { - size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *VerifyVoteExtensionResponse) Reset() { *m = VerifyVoteExtensionResponse{} } +func (m *VerifyVoteExtensionResponse) String() string { return proto.CompactTextString(m) } +func (*VerifyVoteExtensionResponse) ProtoMessage() {} +func (*VerifyVoteExtensionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{33} +} +func (m *VerifyVoteExtensionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VerifyVoteExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VerifyVoteExtensionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x22 + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Response_InitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *VerifyVoteExtensionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerifyVoteExtensionResponse.Merge(m, src) +} +func (m *VerifyVoteExtensionResponse) XXX_Size() int { + return m.Size() +} +func (m *VerifyVoteExtensionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_VerifyVoteExtensionResponse.DiscardUnknown(m) } -func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.InitChain != nil { - { - size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +var xxx_messageInfo_VerifyVoteExtensionResponse proto.InternalMessageInfo + +func (m *VerifyVoteExtensionResponse) GetStatus() VerifyVoteExtensionStatus { + if m != nil { + return m.Status + } + return VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN +} + +type FinalizeBlockResponse struct { + // set of block events emmitted as part of executing the block + Events []v1beta2.Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + // the result of executing each transaction including the events + // the particular transaction emitted. This should match the order + // of the transactions delivered in the block itself + TxResults []*v1beta31.ExecTxResult `protobuf:"bytes,2,rep,name=tx_results,json=txResults,proto3" json:"tx_results,omitempty"` + // a list of updates to the validator set. These will reflect the validator set at current height + 2. + ValidatorUpdates []v1beta1.ValidatorUpdate `protobuf:"bytes,3,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"` + // updates to the consensus params, if any. + ConsensusParamUpdates *v1beta3.ConsensusParams `protobuf:"bytes,4,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` + // app_hash is the hash of the applications' state which is used to confirm + // that execution of the transactions was deterministic. + // It is up to the application to decide which algorithm to use. + AppHash []byte `protobuf:"bytes,5,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +func (m *FinalizeBlockResponse) Reset() { *m = FinalizeBlockResponse{} } +func (m *FinalizeBlockResponse) String() string { return proto.CompactTextString(m) } +func (*FinalizeBlockResponse) ProtoMessage() {} +func (*FinalizeBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{34} +} +func (m *FinalizeBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FinalizeBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FinalizeBlockResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x32 + return b[:n], nil } - return len(dAtA) - i, nil } -func (m *Response_Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *FinalizeBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FinalizeBlockResponse.Merge(m, src) +} +func (m *FinalizeBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *FinalizeBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FinalizeBlockResponse.DiscardUnknown(m) } -func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { +var xxx_messageInfo_FinalizeBlockResponse proto.InternalMessageInfo + +func (m *FinalizeBlockResponse) GetEvents() []v1beta2.Event { + if m != nil { + return m.Events + } + return nil +} + +func (m *FinalizeBlockResponse) GetTxResults() []*v1beta31.ExecTxResult { + if m != nil { + return m.TxResults + } + return nil +} + +func (m *FinalizeBlockResponse) GetValidatorUpdates() []v1beta1.ValidatorUpdate { + if m != nil { + return m.ValidatorUpdates + } + return nil +} + +func (m *FinalizeBlockResponse) GetConsensusParamUpdates() *v1beta3.ConsensusParams { + if m != nil { + return m.ConsensusParamUpdates + } + return nil +} + +func (m *FinalizeBlockResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +type Misbehavior struct { + Type MisbehaviorType `protobuf:"varint,1,opt,name=type,proto3,enum=cometbft.abci.v1beta4.MisbehaviorType" json:"type,omitempty"` + // The offending validator + Validator v1beta1.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` + // The height when the offense occurred + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + // The corresponding time where the offense occurred + Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` +} + +func (m *Misbehavior) Reset() { *m = Misbehavior{} } +func (m *Misbehavior) String() string { return proto.CompactTextString(m) } +func (*Misbehavior) ProtoMessage() {} +func (*Misbehavior) Descriptor() ([]byte, []int) { + return fileDescriptor_120b31222941659d, []int{35} +} +func (m *Misbehavior) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Misbehavior) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Misbehavior.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 *Misbehavior) XXX_Merge(src proto.Message) { + xxx_messageInfo_Misbehavior.Merge(m, src) +} +func (m *Misbehavior) XXX_Size() int { + return m.Size() +} +func (m *Misbehavior) XXX_DiscardUnknown() { + xxx_messageInfo_Misbehavior.DiscardUnknown(m) +} + +var xxx_messageInfo_Misbehavior proto.InternalMessageInfo + +func (m *Misbehavior) GetType() MisbehaviorType { + if m != nil { + return m.Type + } + return MISBEHAVIOR_TYPE_UNKNOWN +} + +func (m *Misbehavior) GetValidator() v1beta1.Validator { + if m != nil { + return m.Validator + } + return v1beta1.Validator{} +} + +func (m *Misbehavior) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Misbehavior) GetTime() time.Time { + if m != nil { + return m.Time + } + return time.Time{} +} + +func (m *Misbehavior) GetTotalVotingPower() int64 { + if m != nil { + return m.TotalVotingPower + } + return 0 +} + +func init() { + proto.RegisterEnum("cometbft.abci.v1beta4.CheckTxType", CheckTxType_name, CheckTxType_value) + proto.RegisterEnum("cometbft.abci.v1beta4.OfferSnapshotResult", OfferSnapshotResult_name, OfferSnapshotResult_value) + proto.RegisterEnum("cometbft.abci.v1beta4.ApplySnapshotChunkResult", ApplySnapshotChunkResult_name, ApplySnapshotChunkResult_value) + proto.RegisterEnum("cometbft.abci.v1beta4.ProcessProposalStatus", ProcessProposalStatus_name, ProcessProposalStatus_value) + proto.RegisterEnum("cometbft.abci.v1beta4.VerifyVoteExtensionStatus", VerifyVoteExtensionStatus_name, VerifyVoteExtensionStatus_value) + proto.RegisterEnum("cometbft.abci.v1beta4.MisbehaviorType", MisbehaviorType_name, MisbehaviorType_value) + proto.RegisterType((*Request)(nil), "cometbft.abci.v1beta4.Request") + proto.RegisterType((*EchoRequest)(nil), "cometbft.abci.v1beta4.EchoRequest") + proto.RegisterType((*FlushRequest)(nil), "cometbft.abci.v1beta4.FlushRequest") + proto.RegisterType((*InfoRequest)(nil), "cometbft.abci.v1beta4.InfoRequest") + proto.RegisterType((*InitChainRequest)(nil), "cometbft.abci.v1beta4.InitChainRequest") + proto.RegisterType((*QueryRequest)(nil), "cometbft.abci.v1beta4.QueryRequest") + proto.RegisterType((*CheckTxRequest)(nil), "cometbft.abci.v1beta4.CheckTxRequest") + proto.RegisterType((*CommitRequest)(nil), "cometbft.abci.v1beta4.CommitRequest") + proto.RegisterType((*ListSnapshotsRequest)(nil), "cometbft.abci.v1beta4.ListSnapshotsRequest") + proto.RegisterType((*OfferSnapshotRequest)(nil), "cometbft.abci.v1beta4.OfferSnapshotRequest") + proto.RegisterType((*LoadSnapshotChunkRequest)(nil), "cometbft.abci.v1beta4.LoadSnapshotChunkRequest") + proto.RegisterType((*ApplySnapshotChunkRequest)(nil), "cometbft.abci.v1beta4.ApplySnapshotChunkRequest") + proto.RegisterType((*PrepareProposalRequest)(nil), "cometbft.abci.v1beta4.PrepareProposalRequest") + proto.RegisterType((*ProcessProposalRequest)(nil), "cometbft.abci.v1beta4.ProcessProposalRequest") + proto.RegisterType((*ExtendVoteRequest)(nil), "cometbft.abci.v1beta4.ExtendVoteRequest") + proto.RegisterType((*VerifyVoteExtensionRequest)(nil), "cometbft.abci.v1beta4.VerifyVoteExtensionRequest") + proto.RegisterType((*FinalizeBlockRequest)(nil), "cometbft.abci.v1beta4.FinalizeBlockRequest") + proto.RegisterType((*Response)(nil), "cometbft.abci.v1beta4.Response") + proto.RegisterType((*ExceptionResponse)(nil), "cometbft.abci.v1beta4.ExceptionResponse") + proto.RegisterType((*EchoResponse)(nil), "cometbft.abci.v1beta4.EchoResponse") + proto.RegisterType((*FlushResponse)(nil), "cometbft.abci.v1beta4.FlushResponse") + proto.RegisterType((*InfoResponse)(nil), "cometbft.abci.v1beta4.InfoResponse") + proto.RegisterType((*InitChainResponse)(nil), "cometbft.abci.v1beta4.InitChainResponse") + proto.RegisterType((*QueryResponse)(nil), "cometbft.abci.v1beta4.QueryResponse") + proto.RegisterType((*CheckTxResponse)(nil), "cometbft.abci.v1beta4.CheckTxResponse") + proto.RegisterType((*CommitResponse)(nil), "cometbft.abci.v1beta4.CommitResponse") + proto.RegisterType((*ListSnapshotsResponse)(nil), "cometbft.abci.v1beta4.ListSnapshotsResponse") + proto.RegisterType((*OfferSnapshotResponse)(nil), "cometbft.abci.v1beta4.OfferSnapshotResponse") + proto.RegisterType((*LoadSnapshotChunkResponse)(nil), "cometbft.abci.v1beta4.LoadSnapshotChunkResponse") + proto.RegisterType((*ApplySnapshotChunkResponse)(nil), "cometbft.abci.v1beta4.ApplySnapshotChunkResponse") + proto.RegisterType((*PrepareProposalResponse)(nil), "cometbft.abci.v1beta4.PrepareProposalResponse") + proto.RegisterType((*ProcessProposalResponse)(nil), "cometbft.abci.v1beta4.ProcessProposalResponse") + proto.RegisterType((*ExtendVoteResponse)(nil), "cometbft.abci.v1beta4.ExtendVoteResponse") + proto.RegisterType((*VerifyVoteExtensionResponse)(nil), "cometbft.abci.v1beta4.VerifyVoteExtensionResponse") + proto.RegisterType((*FinalizeBlockResponse)(nil), "cometbft.abci.v1beta4.FinalizeBlockResponse") + proto.RegisterType((*Misbehavior)(nil), "cometbft.abci.v1beta4.Misbehavior") +} + +func init() { proto.RegisterFile("cometbft/abci/v1beta4/types.proto", fileDescriptor_120b31222941659d) } + +var fileDescriptor_120b31222941659d = []byte{ + // 2803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4b, 0x6f, 0x1b, 0xd7, + 0xd9, 0xd6, 0x90, 0x23, 0x89, 0x7c, 0x49, 0x4a, 0xa3, 0x23, 0xc9, 0xa1, 0x1d, 0x7f, 0x92, 0x3d, + 0x8a, 0x2f, 0xb1, 0x1d, 0x2a, 0x56, 0x3e, 0x04, 0x4d, 0x93, 0xa6, 0xa0, 0x68, 0x3a, 0x92, 0xac, + 0x88, 0xec, 0x90, 0x52, 0xe2, 0x18, 0xe8, 0x74, 0x44, 0x1e, 0x8a, 0x53, 0x93, 0x9c, 0xc9, 0xcc, + 0xa1, 0x42, 0x75, 0x59, 0x74, 0x51, 0x74, 0x13, 0x2f, 0xba, 0x6c, 0xd1, 0x02, 0xed, 0x0f, 0x28, + 0xd0, 0x4d, 0x7f, 0x42, 0x96, 0x59, 0x66, 0x95, 0x16, 0xc9, 0xae, 0xfb, 0x6e, 0x0a, 0x14, 0x28, + 0xce, 0x65, 0x6e, 0xe4, 0x0c, 0x25, 0xc1, 0xe9, 0xa2, 0x40, 0x77, 0x33, 0xe7, 0x3c, 0xef, 0x73, + 0xe6, 0xdc, 0xde, 0xcb, 0x43, 0xc2, 0xcd, 0x96, 0xd5, 0xc7, 0xe4, 0xb8, 0x43, 0x36, 0x8d, 0xe3, + 0x96, 0xb9, 0x79, 0xfa, 0xf0, 0x18, 0x13, 0xe3, 0xff, 0x37, 0xc9, 0x99, 0x8d, 0xdd, 0x92, 0xed, + 0x58, 0xc4, 0x42, 0xab, 0x1e, 0xa4, 0x44, 0x21, 0x25, 0x01, 0xb9, 0x16, 0x6b, 0xf9, 0x30, 0x6c, + 0x19, 0x0f, 0xd9, 0x3a, 0x1f, 0xf2, 0x56, 0x04, 0xb2, 0xe1, 0x43, 0x5a, 0xce, 0x99, 0x4d, 0x2c, + 0x7f, 0x28, 0xdb, 0xb1, 0xac, 0xce, 0x04, 0x88, 0x99, 0xfa, 0x44, 0xb6, 0xe1, 0x18, 0x7d, 0x8f, + 0x69, 0xe5, 0xc4, 0x3a, 0xb1, 0xd8, 0xe3, 0x26, 0x7d, 0x12, 0xad, 0xeb, 0x27, 0x96, 0x75, 0xd2, + 0xc3, 0x9b, 0xec, 0xed, 0x78, 0xd8, 0xd9, 0x24, 0x66, 0x1f, 0xbb, 0xc4, 0xe8, 0xdb, 0x1c, 0xa0, + 0xfe, 0x0e, 0x60, 0x5e, 0xc3, 0x9f, 0x0e, 0xb1, 0x4b, 0xd0, 0xf7, 0x40, 0xc6, 0xad, 0xae, 0x55, + 0x94, 0x6e, 0x48, 0x77, 0x73, 0x5b, 0x6a, 0x29, 0x76, 0x6d, 0x4a, 0xd5, 0x56, 0xd7, 0x12, 0x16, + 0x3b, 0x33, 0x1a, 0xb3, 0x40, 0xef, 0xc2, 0x6c, 0xa7, 0x37, 0x74, 0xbb, 0xc5, 0x14, 0x33, 0xdd, + 0x48, 0x30, 0x7d, 0x4c, 0x31, 0x81, 0x2d, 0xb7, 0xa1, 0xc3, 0x9a, 0x83, 0x8e, 0x55, 0x4c, 0x4f, + 0x1d, 0x76, 0x77, 0xd0, 0x09, 0x0f, 0x4b, 0x2d, 0xd0, 0x0e, 0x80, 0x39, 0x30, 0x89, 0xde, 0xea, + 0x1a, 0xe6, 0xa0, 0x38, 0xcb, 0xec, 0xef, 0x24, 0xda, 0x9b, 0xa4, 0x42, 0x71, 0x01, 0x49, 0xd6, + 0xf4, 0xda, 0xe8, 0x04, 0x3e, 0x1d, 0x62, 0xe7, 0xac, 0x38, 0x37, 0x75, 0x02, 0x3f, 0xa2, 0x98, + 0xd0, 0x04, 0x98, 0x0d, 0xda, 0x86, 0x4c, 0xab, 0x8b, 0x5b, 0xcf, 0x75, 0x32, 0x2a, 0x66, 0x98, + 0xfd, 0xad, 0x04, 0xfb, 0x0a, 0x85, 0x35, 0x47, 0x01, 0xc3, 0x7c, 0x8b, 0xb7, 0xa0, 0xf7, 0x61, + 0xae, 0x65, 0xf5, 0xfb, 0x26, 0x29, 0xe6, 0x18, 0xc3, 0x6b, 0x49, 0x0c, 0x0c, 0x14, 0x10, 0x08, + 0x2b, 0xd4, 0x84, 0x85, 0x9e, 0xe9, 0x12, 0xdd, 0x1d, 0x18, 0xb6, 0xdb, 0xb5, 0x88, 0x5b, 0xcc, + 0x33, 0x9e, 0xfb, 0x09, 0x3c, 0xfb, 0xa6, 0x4b, 0x1a, 0x1e, 0x36, 0xa0, 0x2b, 0xf4, 0xc2, 0xed, + 0x94, 0xd5, 0xea, 0x74, 0xb0, 0xe3, 0xd3, 0x16, 0x0b, 0x53, 0x59, 0x6b, 0x14, 0xec, 0x99, 0x87, + 0x58, 0xad, 0x70, 0x3b, 0x32, 0x60, 0xb9, 0x67, 0x19, 0x6d, 0x9f, 0x54, 0x6f, 0x75, 0x87, 0x83, + 0xe7, 0xc5, 0x05, 0x46, 0xbd, 0x99, 0xf4, 0xc1, 0x96, 0xd1, 0xf6, 0x18, 0x2a, 0x14, 0x1f, 0xd0, + 0x2f, 0xf5, 0xc6, 0xfb, 0x50, 0x1b, 0x56, 0x0c, 0xdb, 0xee, 0x9d, 0x8d, 0x8f, 0xb1, 0xc8, 0xc6, + 0x78, 0x33, 0x61, 0x8c, 0x32, 0x35, 0x49, 0x18, 0x04, 0x19, 0x13, 0x9d, 0xe8, 0x13, 0x50, 0x6c, + 0x07, 0xdb, 0x86, 0x83, 0x75, 0xdb, 0xb1, 0x6c, 0xcb, 0x35, 0x7a, 0x45, 0x85, 0x8d, 0xf0, 0x46, + 0xc2, 0x08, 0x75, 0x0e, 0xaf, 0x0b, 0x74, 0x40, 0xbf, 0x68, 0x47, 0x7b, 0x38, 0xb7, 0xd5, 0xc2, + 0xae, 0x1b, 0x70, 0x2f, 0x9d, 0xc3, 0xcd, 0xe0, 0xb1, 0xdc, 0x91, 0x1e, 0xf4, 0x04, 0x72, 0x78, + 0x44, 0xf0, 0xa0, 0xad, 0x9f, 0x5a, 0x04, 0x17, 0x11, 0xa3, 0xbd, 0x9b, 0x74, 0xdf, 0x19, 0xf2, + 0xc8, 0x22, 0x38, 0x60, 0x04, 0xec, 0x37, 0xa2, 0x13, 0x58, 0x3d, 0xc5, 0x8e, 0xd9, 0x39, 0x63, + 0x64, 0x3a, 0xeb, 0x71, 0x4d, 0x6b, 0x50, 0x5c, 0x66, 0xb4, 0x0f, 0x13, 0x68, 0x8f, 0x98, 0x0d, + 0x65, 0xa8, 0x7a, 0x16, 0x01, 0xff, 0xf2, 0xe9, 0x64, 0x2f, 0x3d, 0x8c, 0x1d, 0x73, 0x60, 0xf4, + 0xcc, 0x9f, 0x61, 0xfd, 0xb8, 0x67, 0xb5, 0x9e, 0x17, 0x57, 0xa6, 0x1e, 0xc6, 0xc7, 0x02, 0xbc, + 0x4d, 0xb1, 0xa1, 0xc3, 0xd8, 0x09, 0xb7, 0x6f, 0xcf, 0xc3, 0xec, 0xa9, 0xd1, 0x1b, 0xe2, 0x3d, + 0x39, 0x23, 0x2b, 0xb3, 0x7b, 0x72, 0x66, 0x5e, 0xc9, 0xec, 0xc9, 0x99, 0xac, 0x02, 0x7b, 0x72, + 0x06, 0x94, 0x9c, 0x7a, 0x07, 0x72, 0x21, 0x97, 0x87, 0x8a, 0x30, 0xdf, 0xc7, 0xae, 0x6b, 0x9c, + 0x60, 0xe6, 0x27, 0xb3, 0x9a, 0xf7, 0xaa, 0x2e, 0x40, 0x3e, 0xec, 0xe0, 0xd4, 0x17, 0x12, 0xe4, + 0x42, 0x5e, 0x8b, 0x5a, 0x9e, 0x62, 0x87, 0x2d, 0x8d, 0xb0, 0x14, 0xaf, 0x68, 0x03, 0x0a, 0x6c, + 0x42, 0xba, 0xd7, 0x4f, 0xdd, 0xa8, 0xac, 0xe5, 0x59, 0xe3, 0x91, 0x00, 0xad, 0x43, 0xce, 0xde, + 0xb2, 0x7d, 0x48, 0x9a, 0x41, 0xc0, 0xde, 0xb2, 0x3d, 0xc0, 0x4d, 0xc8, 0xd3, 0xf9, 0xfb, 0x08, + 0x99, 0x0d, 0x92, 0xa3, 0x6d, 0x02, 0xa2, 0x7e, 0x95, 0x02, 0x65, 0xdc, 0x11, 0x52, 0xff, 0x4b, + 0xa3, 0x82, 0x70, 0xfb, 0xd7, 0x4a, 0x3c, 0x64, 0x94, 0xbc, 0x90, 0x51, 0x6a, 0x7a, 0x21, 0x63, + 0x3b, 0xf3, 0xc5, 0xd7, 0xeb, 0x33, 0x2f, 0xfe, 0xba, 0x2e, 0x69, 0xcc, 0x02, 0x5d, 0xa5, 0x8e, + 0xcf, 0x30, 0x07, 0xba, 0xd9, 0x66, 0x9f, 0x9c, 0xa5, 0xfe, 0xcc, 0x30, 0x07, 0xbb, 0x6d, 0xa4, + 0x81, 0xd2, 0xb2, 0x06, 0x2e, 0x1e, 0xb8, 0x43, 0x57, 0xe7, 0x81, 0x4a, 0x38, 0xf8, 0x90, 0x83, + 0xe6, 0x91, 0x50, 0x84, 0xb3, 0x52, 0xc5, 0xc3, 0xd7, 0x19, 0x5c, 0x5b, 0x6c, 0x45, 0x1b, 0xd0, + 0x3e, 0xc0, 0xa9, 0xd1, 0x33, 0xdb, 0x06, 0xb1, 0x1c, 0xb7, 0x28, 0xdf, 0x48, 0xdf, 0xcd, 0x6d, + 0xdd, 0x8e, 0xdd, 0xfc, 0x87, 0xa5, 0x23, 0x0f, 0x78, 0x68, 0xb7, 0x0d, 0x82, 0xb7, 0x65, 0xfa, + 0xe9, 0x5a, 0xc8, 0x1e, 0xdd, 0x86, 0x45, 0xc3, 0xb6, 0x75, 0x97, 0x18, 0x04, 0xeb, 0xc7, 0x67, + 0x04, 0xbb, 0x2c, 0x82, 0xe4, 0xb5, 0x82, 0x61, 0xdb, 0x0d, 0xda, 0xba, 0x4d, 0x1b, 0xd1, 0x2d, + 0x58, 0xa0, 0x71, 0xc2, 0x34, 0x7a, 0x7a, 0x17, 0x9b, 0x27, 0x5d, 0xc2, 0x62, 0x44, 0x5a, 0x2b, + 0x88, 0xd6, 0x1d, 0xd6, 0xa8, 0xb6, 0x21, 0x1f, 0x8e, 0x0e, 0x08, 0x81, 0xdc, 0x36, 0x88, 0xc1, + 0x56, 0x35, 0xaf, 0xb1, 0x67, 0xda, 0x66, 0x1b, 0xa4, 0x2b, 0xd6, 0x8a, 0x3d, 0xa3, 0x2b, 0x30, + 0x27, 0x68, 0xd3, 0x8c, 0x56, 0xbc, 0xa1, 0x15, 0x98, 0xb5, 0x1d, 0xeb, 0x14, 0xb3, 0x6d, 0xcc, + 0x68, 0xfc, 0x45, 0xfd, 0x31, 0x2c, 0x44, 0x63, 0x08, 0x5a, 0x80, 0x14, 0x19, 0x89, 0x51, 0x52, + 0x64, 0x84, 0xde, 0x06, 0x99, 0x2e, 0x2b, 0x63, 0x5b, 0x48, 0x8c, 0xa6, 0x82, 0xa4, 0x79, 0x66, + 0x63, 0x8d, 0xe1, 0xf7, 0xe4, 0x4c, 0x4a, 0x49, 0xab, 0x8b, 0x50, 0x88, 0x44, 0x18, 0xf5, 0x0a, + 0xac, 0xc4, 0x85, 0x0a, 0x75, 0x00, 0x2b, 0x71, 0xce, 0x1e, 0xbd, 0x0b, 0x19, 0x3f, 0x56, 0xf0, + 0x03, 0xb5, 0x9e, 0xb0, 0x43, 0xbe, 0xa5, 0x6f, 0x40, 0xcf, 0x13, 0xdd, 0x92, 0xae, 0x21, 0x32, + 0x89, 0xbc, 0x36, 0x6f, 0xd8, 0xf6, 0x8e, 0xe1, 0x76, 0xd5, 0x9f, 0x40, 0x31, 0x29, 0x02, 0x84, + 0x96, 0x50, 0x62, 0x97, 0xc2, 0x5b, 0xc2, 0x2b, 0x30, 0xd7, 0xb1, 0x9c, 0xbe, 0x41, 0x18, 0x59, + 0x41, 0x13, 0x6f, 0x74, 0x69, 0x79, 0x34, 0x48, 0xb3, 0x66, 0xfe, 0xa2, 0xea, 0x70, 0x35, 0xd1, + 0xff, 0x53, 0x13, 0x73, 0xd0, 0xc6, 0x7c, 0xa1, 0x0b, 0x1a, 0x7f, 0x09, 0x88, 0xf8, 0xc7, 0xf2, + 0x17, 0x3a, 0xac, 0x8b, 0x07, 0x6d, 0xec, 0x30, 0xfe, 0xac, 0x26, 0xde, 0xd4, 0x3f, 0xa6, 0xe1, + 0x4a, 0xbc, 0xff, 0x47, 0x37, 0x20, 0xdf, 0x37, 0x46, 0x3a, 0x19, 0x89, 0x83, 0x28, 0xb1, 0xa3, + 0x00, 0x7d, 0x63, 0xd4, 0x1c, 0xf1, 0x53, 0xa8, 0x40, 0x9a, 0x8c, 0xdc, 0x62, 0xea, 0x46, 0xfa, + 0x6e, 0x5e, 0xa3, 0x8f, 0xe8, 0x19, 0x2c, 0xf5, 0xac, 0x96, 0xd1, 0xd3, 0x7b, 0x86, 0x4b, 0x74, + 0x91, 0x3c, 0xf0, 0x2b, 0xf6, 0x7a, 0xec, 0x92, 0xbf, 0x25, 0x5c, 0x39, 0x6e, 0xf3, 0x2d, 0xa6, + 0xbe, 0x49, 0xdc, 0x8b, 0x45, 0xc6, 0xb4, 0x6f, 0xb8, 0x84, 0x77, 0xa1, 0x3d, 0xc8, 0xf5, 0x4d, + 0xf7, 0x18, 0x77, 0x8d, 0x53, 0xd3, 0x72, 0xc4, 0x5d, 0x4b, 0x3a, 0x4c, 0x1f, 0x06, 0x48, 0xc1, + 0x17, 0x36, 0x0e, 0x6d, 0xcf, 0x6c, 0xe4, 0x84, 0x7b, 0x7e, 0x67, 0xee, 0xd2, 0x7e, 0xe7, 0x4d, + 0x58, 0x19, 0xe0, 0x11, 0xd1, 0x83, 0xdb, 0xcc, 0xcf, 0xcc, 0x3c, 0xdb, 0x06, 0x44, 0xfb, 0xfc, + 0xfb, 0xef, 0xd2, 0xe3, 0x83, 0x5e, 0x67, 0xd1, 0xd4, 0xb6, 0x5c, 0xec, 0xe8, 0x46, 0xbb, 0xed, + 0x60, 0xd7, 0x65, 0xa9, 0x5a, 0x9e, 0x05, 0x47, 0xd6, 0x5e, 0xe6, 0xcd, 0xea, 0xaf, 0xd9, 0x36, + 0xc5, 0x85, 0x52, 0x6f, 0x13, 0xa4, 0x60, 0x13, 0x9e, 0xc2, 0x8a, 0xb0, 0x6f, 0x47, 0xf6, 0x81, + 0xe7, 0xc1, 0x37, 0x13, 0xf6, 0x61, 0x62, 0xfd, 0x91, 0x47, 0x92, 0xbc, 0x05, 0xe9, 0x97, 0xd9, + 0x02, 0x04, 0x32, 0x5b, 0x20, 0x99, 0x3b, 0x23, 0xfa, 0xfc, 0xdf, 0xb6, 0x2d, 0x9f, 0xa7, 0x61, + 0x69, 0x22, 0x15, 0xf1, 0x27, 0x26, 0xc5, 0x4e, 0x2c, 0x15, 0x3b, 0xb1, 0xf4, 0xa5, 0x27, 0x26, + 0xf6, 0x5d, 0x3e, 0x7f, 0xdf, 0x67, 0xbf, 0xf3, 0x7d, 0x9f, 0x7b, 0x99, 0x7d, 0xff, 0x8f, 0xee, + 0xc8, 0x6f, 0x24, 0xb8, 0x96, 0x9c, 0xc5, 0xc5, 0x6e, 0xcd, 0x7d, 0x58, 0xf2, 0x3f, 0xc5, 0xa7, + 0xe7, 0xce, 0x53, 0xf1, 0x3b, 0x04, 0x7f, 0x62, 0x64, 0xbc, 0x05, 0x0b, 0x63, 0x99, 0x26, 0x3f, + 0xd6, 0x85, 0xd3, 0xf0, 0x67, 0xa8, 0x2f, 0xd2, 0xb0, 0x12, 0x97, 0x02, 0xc6, 0xdc, 0xe2, 0x8f, + 0x60, 0xb9, 0x8d, 0x5b, 0x66, 0xfb, 0xe5, 0x2e, 0xf1, 0x92, 0xe0, 0xf8, 0xdf, 0x1d, 0x4e, 0x3a, + 0x31, 0xff, 0x04, 0xc8, 0x68, 0xd8, 0xb5, 0x69, 0x5e, 0x87, 0x76, 0x20, 0x8b, 0x47, 0x2d, 0x6c, + 0x13, 0x2f, 0x21, 0x9e, 0x56, 0x82, 0x08, 0x9c, 0x67, 0x4c, 0x8b, 0x77, 0xdf, 0x18, 0xbd, 0x23, + 0x74, 0x8b, 0xe9, 0xe2, 0x03, 0x4f, 0xe2, 0x7d, 0x7b, 0x2e, 0x5c, 0xbc, 0xe7, 0x09, 0x17, 0xe9, + 0xa9, 0x55, 0xb7, 0xc8, 0xeb, 0x7d, 0x63, 0xa1, 0x5c, 0xbc, 0x23, 0x94, 0x0b, 0x79, 0xea, 0xc0, + 0xbc, 0x06, 0x08, 0x06, 0x66, 0xd2, 0xc5, 0x6e, 0x44, 0xba, 0x98, 0x9b, 0x3a, 0xfd, 0x50, 0xc6, + 0x1e, 0x4c, 0x3f, 0xd0, 0x2e, 0xde, 0xf3, 0xb4, 0x8b, 0xf9, 0xa9, 0x73, 0x10, 0xd9, 0x69, 0x30, + 0x07, 0x2e, 0x5e, 0x54, 0x42, 0xe2, 0x45, 0x96, 0x11, 0xdc, 0x3e, 0x4f, 0xbc, 0xf0, 0x29, 0x7c, + 0xf5, 0xe2, 0x87, 0xbe, 0x7a, 0x91, 0x9f, 0xae, 0x7f, 0x88, 0xdc, 0xd2, 0x67, 0xf0, 0xe4, 0x8b, + 0xc3, 0x09, 0xf9, 0x82, 0x0b, 0x0d, 0x0f, 0x2e, 0x26, 0x5f, 0xf8, 0x7c, 0x63, 0xfa, 0xc5, 0xe1, + 0x84, 0x7e, 0xb1, 0x30, 0x95, 0x76, 0x2c, 0xa5, 0x0d, 0x68, 0xa3, 0x02, 0xc6, 0x71, 0xbc, 0x80, + 0x31, 0x5d, 0x5c, 0x88, 0x49, 0x5f, 0x7d, 0xfe, 0x18, 0x05, 0x03, 0x27, 0x28, 0x18, 0xca, 0xd4, + 0xaa, 0x3a, 0x2e, 0x83, 0xf5, 0x47, 0x89, 0x93, 0x30, 0x9e, 0xc5, 0x48, 0x18, 0x5c, 0x66, 0x28, + 0x5d, 0x54, 0xc2, 0xf0, 0xf9, 0x27, 0x34, 0x8c, 0x67, 0x31, 0x1a, 0x06, 0x3a, 0x87, 0x7c, 0x2c, + 0xf1, 0x0a, 0x93, 0x47, 0x45, 0x8c, 0xfd, 0xa8, 0x88, 0xb1, 0x3c, 0x25, 0xf3, 0x8d, 0x8a, 0x18, + 0x3e, 0x65, 0x58, 0xc5, 0xe8, 0x26, 0xa9, 0x18, 0x5c, 0x63, 0xd8, 0xba, 0x8c, 0x8a, 0xe1, 0x0f, + 0x10, 0x2b, 0x63, 0x1c, 0x4e, 0xc8, 0x18, 0xab, 0x53, 0xcf, 0xe4, 0x58, 0x0c, 0x0b, 0xce, 0x64, + 0xa2, 0x8e, 0x31, 0xab, 0xcc, 0xed, 0xc9, 0x99, 0x8c, 0x92, 0xe5, 0x0a, 0xc6, 0x9e, 0x9c, 0xc9, + 0x29, 0x79, 0xf5, 0x75, 0x9a, 0x3f, 0x8d, 0xf9, 0x51, 0x5a, 0xc1, 0x60, 0xc7, 0xb1, 0x1c, 0xa1, + 0x48, 0xf0, 0x17, 0xf5, 0x2e, 0xe4, 0xc3, 0xde, 0x72, 0x8a, 0xe6, 0xb1, 0x08, 0x85, 0x88, 0x6f, + 0x54, 0xff, 0x22, 0x41, 0x3e, 0xec, 0xf0, 0x22, 0x75, 0x70, 0x56, 0xd4, 0xc1, 0x21, 0x25, 0x24, + 0x15, 0x55, 0x42, 0xd6, 0x21, 0x47, 0x2b, 0xc0, 0x31, 0x91, 0xc3, 0xb0, 0x7d, 0x91, 0xe3, 0x1e, + 0x2c, 0xb1, 0x10, 0xcd, 0xf5, 0x12, 0x11, 0xfc, 0x64, 0x16, 0xfc, 0x16, 0x69, 0x07, 0x5b, 0x0c, + 0x5e, 0x92, 0xa3, 0x37, 0x60, 0x39, 0x84, 0xf5, 0x2b, 0x4b, 0x5e, 0xe5, 0x2b, 0x3e, 0xba, 0x2c, + 0x4a, 0xcc, 0x2f, 0x25, 0x58, 0x9a, 0x70, 0xb5, 0xb1, 0x42, 0x86, 0xf4, 0x9d, 0x0a, 0x19, 0xa9, + 0x97, 0x14, 0x32, 0xc2, 0x55, 0x73, 0x3a, 0x5a, 0x35, 0xff, 0x4b, 0x82, 0x42, 0xc4, 0xef, 0xd3, + 0xed, 0x68, 0x59, 0x6d, 0x2c, 0xea, 0x58, 0xf6, 0x4c, 0x13, 0xa2, 0x9e, 0x75, 0x22, 0xaa, 0x55, + 0xfa, 0x48, 0x51, 0x7e, 0x60, 0xcb, 0x8a, 0x88, 0xe5, 0x97, 0xc0, 0x3c, 0xd5, 0x10, 0x25, 0xb0, + 0x02, 0xe9, 0xe7, 0x98, 0xcb, 0xe6, 0x79, 0x8d, 0x3e, 0x52, 0x1c, 0x3b, 0x88, 0x22, 0x65, 0xe0, + 0x2f, 0xe8, 0x7d, 0xc8, 0xb2, 0x9f, 0x34, 0x74, 0xcb, 0x76, 0x85, 0x48, 0x1e, 0x4a, 0xac, 0xf8, + 0x8f, 0x1f, 0xfe, 0x9c, 0xeb, 0x14, 0x59, 0xb3, 0x5d, 0x2d, 0x63, 0x8b, 0xa7, 0x50, 0xa6, 0x93, + 0x8d, 0x64, 0x3a, 0xd7, 0x21, 0x4b, 0xe7, 0xe0, 0xda, 0x46, 0x0b, 0x17, 0x81, 0x7d, 0x6e, 0xd0, + 0xa0, 0xfe, 0x29, 0x05, 0x8b, 0x63, 0x61, 0x2b, 0x76, 0x05, 0xbc, 0x43, 0x9a, 0x0a, 0x89, 0x35, + 0x17, 0x5b, 0x95, 0x35, 0x80, 0x13, 0xc3, 0xd5, 0x3f, 0x33, 0x06, 0x04, 0xb7, 0xc5, 0xd2, 0x84, + 0x5a, 0xd0, 0x35, 0xc8, 0xd0, 0xb7, 0xa1, 0x8b, 0xdb, 0x42, 0x37, 0xf2, 0xdf, 0xd1, 0x01, 0xcc, + 0xe1, 0x53, 0x3c, 0x20, 0x6e, 0x71, 0x9e, 0x1d, 0x81, 0xeb, 0xb1, 0x47, 0x60, 0xab, 0x54, 0xa5, + 0xa0, 0xed, 0x22, 0xdd, 0xf8, 0xbf, 0x7f, 0xbd, 0xae, 0x70, 0x9b, 0x07, 0x56, 0xdf, 0x24, 0xb8, + 0x6f, 0x93, 0x33, 0x4d, 0xb0, 0x44, 0xd7, 0x22, 0x33, 0xb6, 0x16, 0x4c, 0xd3, 0xcc, 0x7b, 0x62, + 0x04, 0x5d, 0x59, 0xd3, 0x72, 0x4c, 0x72, 0xa6, 0x15, 0xfa, 0xb8, 0x6f, 0x5b, 0x56, 0x4f, 0xe7, + 0x77, 0xbf, 0x0c, 0x0b, 0xd1, 0x28, 0x8d, 0x36, 0xa0, 0xe0, 0x60, 0x62, 0x98, 0x03, 0x3d, 0x92, + 0x8e, 0xe7, 0x79, 0x23, 0xbf, 0x6b, 0x7b, 0x72, 0x46, 0x52, 0x52, 0x42, 0x44, 0x3a, 0x82, 0xd5, + 0xd8, 0xf8, 0x8c, 0x7e, 0x00, 0xd9, 0x20, 0xc0, 0x4b, 0x6c, 0xce, 0xe7, 0xaa, 0x43, 0x81, 0x85, + 0xfa, 0x0c, 0x56, 0x63, 0x03, 0x34, 0xda, 0x86, 0x39, 0x07, 0xbb, 0xc3, 0x1e, 0x17, 0x80, 0x16, + 0xb6, 0xee, 0x5d, 0x30, 0xbc, 0x0f, 0x7b, 0x44, 0x13, 0x96, 0xea, 0x43, 0xb8, 0x9a, 0x18, 0xa1, + 0x03, 0xa1, 0x47, 0x0a, 0x09, 0x3d, 0xea, 0x9f, 0x25, 0xb8, 0x96, 0x1c, 0x70, 0xd1, 0x07, 0x63, + 0x5f, 0xb5, 0x79, 0x99, 0x98, 0x1d, 0xfa, 0x34, 0x5a, 0xf0, 0x38, 0xb8, 0x83, 0x49, 0xab, 0xcb, + 0x73, 0x00, 0xee, 0x32, 0x0a, 0x5a, 0x41, 0xb4, 0x32, 0x1b, 0x97, 0xc3, 0x7e, 0x8a, 0x5b, 0x44, + 0xe7, 0x7b, 0xec, 0xb2, 0x7a, 0x23, 0x4b, 0x61, 0xb4, 0xb5, 0xc1, 0x1b, 0xd5, 0xfb, 0xf0, 0x4a, + 0x42, 0x08, 0x9f, 0xac, 0x8c, 0x54, 0x9d, 0x82, 0x63, 0x43, 0x32, 0x7a, 0x04, 0x73, 0x2e, 0x31, + 0xc8, 0xd0, 0x15, 0xd3, 0x7b, 0x70, 0xb1, 0x90, 0xde, 0x60, 0x36, 0x9a, 0xb0, 0x55, 0xdf, 0x05, + 0x34, 0x19, 0x9b, 0x63, 0x4a, 0x3c, 0x29, 0xae, 0xc4, 0x3b, 0x81, 0x57, 0xa7, 0x04, 0x60, 0xb4, + 0x33, 0xf6, 0x85, 0x6f, 0x5e, 0x3c, 0x88, 0x8f, 0x7d, 0xe5, 0xcf, 0xd3, 0xb0, 0x1a, 0x1b, 0x87, + 0x43, 0x77, 0x58, 0xfa, 0x4e, 0xee, 0xf0, 0x36, 0x00, 0x19, 0xe9, 0x7c, 0xe3, 0xbd, 0xd0, 0xb0, + 0x91, 0x28, 0xe7, 0xe1, 0x16, 0x73, 0x6c, 0xf4, 0xb0, 0x64, 0x89, 0x78, 0x72, 0xd1, 0xd3, 0x70, + 0x95, 0x3d, 0x64, 0x61, 0xc3, 0x15, 0xb5, 0xe7, 0xe5, 0xa2, 0x4c, 0x50, 0x93, 0xf3, 0x66, 0x17, + 0xe9, 0xf0, 0xca, 0x58, 0x34, 0xf4, 0x07, 0x90, 0x2f, 0x17, 0x14, 0x57, 0xa3, 0x41, 0xd1, 0x1b, + 0x20, 0x1c, 0xcc, 0x66, 0xa3, 0xc1, 0xec, 0xf3, 0x14, 0xe4, 0x42, 0x35, 0x32, 0xfa, 0xbe, 0x50, + 0xba, 0xf9, 0xe6, 0xde, 0x3e, 0xbf, 0xaa, 0x0e, 0xd4, 0x6e, 0xf4, 0x08, 0xb2, 0xfe, 0xdc, 0x44, + 0xdd, 0x78, 0xe3, 0xbc, 0xa5, 0x11, 0x8b, 0x12, 0x18, 0x26, 0x2a, 0x14, 0x5e, 0xf9, 0x2d, 0x5f, + 0xba, 0xfc, 0x7e, 0x00, 0x88, 0x58, 0xc4, 0xe8, 0xd1, 0x2c, 0xd4, 0x1c, 0x9c, 0xe8, 0xb6, 0xf5, + 0x19, 0x76, 0x44, 0x58, 0x51, 0x58, 0xcf, 0x11, 0xeb, 0xa8, 0xd3, 0xf6, 0x7b, 0xc7, 0x90, 0x0b, + 0x09, 0xf9, 0xe8, 0x2a, 0xac, 0x56, 0x76, 0xaa, 0x95, 0x27, 0x7a, 0xf3, 0x63, 0xbd, 0xf9, 0xb4, + 0x5e, 0xd5, 0x0f, 0x0f, 0x9e, 0x1c, 0xd4, 0x3e, 0x3a, 0x50, 0x66, 0x26, 0xbb, 0xb4, 0x2a, 0x7b, + 0x57, 0x24, 0xf4, 0x0a, 0x2c, 0x47, 0xbb, 0x78, 0x47, 0xea, 0x9a, 0xfc, 0xcb, 0x3f, 0xac, 0xcd, + 0xdc, 0xfb, 0x87, 0x04, 0xcb, 0x31, 0x7e, 0x13, 0xdd, 0x84, 0xff, 0xab, 0x3d, 0x7e, 0x5c, 0xd5, + 0xf4, 0xc6, 0x41, 0xb9, 0xde, 0xd8, 0xa9, 0x35, 0x75, 0xad, 0xda, 0x38, 0xdc, 0x6f, 0x86, 0x06, + 0xbd, 0x01, 0xd7, 0xe3, 0x21, 0xe5, 0x4a, 0xa5, 0x5a, 0x6f, 0x2a, 0x12, 0x5a, 0x87, 0x57, 0x13, + 0x10, 0xdb, 0x35, 0xad, 0xa9, 0xa4, 0x92, 0x29, 0xb4, 0xea, 0x5e, 0xb5, 0xd2, 0x54, 0xd2, 0xe8, + 0x0e, 0x6c, 0x4c, 0x43, 0xe8, 0x8f, 0x6b, 0xda, 0x87, 0xe5, 0xa6, 0x22, 0x9f, 0x0b, 0x6c, 0x54, + 0x0f, 0x1e, 0x55, 0x35, 0x65, 0x56, 0xcc, 0xfb, 0xf7, 0x29, 0x28, 0x26, 0x79, 0x66, 0xca, 0x55, + 0xae, 0xd7, 0xf7, 0x9f, 0x06, 0x5c, 0x95, 0x9d, 0xc3, 0x83, 0x27, 0x93, 0x4b, 0x70, 0x1b, 0xd4, + 0x69, 0x40, 0x7f, 0x21, 0x6e, 0xc1, 0xcd, 0xa9, 0x38, 0xb1, 0x1c, 0xe7, 0xc0, 0xb4, 0x6a, 0x53, + 0x7b, 0xaa, 0xa4, 0x51, 0x09, 0xee, 0x9d, 0x0b, 0xf3, 0xfb, 0x14, 0x19, 0x6d, 0xc2, 0xfd, 0xe9, + 0x78, 0xbe, 0x40, 0x9e, 0x81, 0xb7, 0x44, 0xbf, 0x92, 0x60, 0x35, 0xd6, 0xbb, 0xa3, 0x0d, 0x58, + 0xaf, 0x6b, 0xb5, 0x4a, 0xb5, 0xd1, 0xd0, 0xeb, 0x5a, 0xad, 0x5e, 0x6b, 0x94, 0xf7, 0xf5, 0x46, + 0xb3, 0xdc, 0x3c, 0x6c, 0x84, 0xd6, 0x46, 0x85, 0xb5, 0x24, 0x90, 0xbf, 0x2e, 0x53, 0x30, 0xe2, + 0x04, 0x78, 0xe7, 0xf4, 0xb7, 0x12, 0x5c, 0x4d, 0x74, 0xe4, 0xe8, 0x2e, 0xbc, 0x76, 0x54, 0xd5, + 0x76, 0x1f, 0x3f, 0xd5, 0x8f, 0x6a, 0xcd, 0xaa, 0x5e, 0xfd, 0xb8, 0x59, 0x3d, 0x68, 0xec, 0xd6, + 0x0e, 0x26, 0xbf, 0xea, 0x0e, 0x6c, 0x4c, 0x45, 0xfa, 0x9f, 0x76, 0x1e, 0x70, 0xec, 0xfb, 0x7e, + 0x21, 0xc1, 0xe2, 0x98, 0x2f, 0x42, 0xd7, 0xa1, 0xf8, 0xe1, 0x6e, 0x63, 0xbb, 0xba, 0x53, 0x3e, + 0xda, 0xad, 0x69, 0xe3, 0x77, 0x76, 0x03, 0xd6, 0x27, 0x7a, 0x1f, 0x1d, 0xd6, 0xf7, 0x77, 0x2b, + 0xe5, 0x66, 0x95, 0x0d, 0xaa, 0x48, 0x74, 0x62, 0x13, 0xa0, 0xfd, 0xdd, 0x0f, 0x76, 0x9a, 0x7a, + 0x65, 0x7f, 0xb7, 0x7a, 0xd0, 0xd4, 0xcb, 0xcd, 0x66, 0x39, 0xb8, 0xce, 0xdb, 0xf5, 0x2f, 0xbe, + 0x59, 0x93, 0xbe, 0xfc, 0x66, 0x4d, 0xfa, 0xdb, 0x37, 0x6b, 0xd2, 0x8b, 0x6f, 0xd7, 0x66, 0xbe, + 0xfc, 0x76, 0x6d, 0xe6, 0xab, 0x6f, 0xd7, 0x66, 0x3e, 0x79, 0xfb, 0xc4, 0x24, 0xdd, 0xe1, 0x31, + 0xf5, 0x82, 0x9b, 0xc1, 0xbf, 0x92, 0xfc, 0x7f, 0x30, 0xd9, 0xe6, 0x66, 0xec, 0xdf, 0xa9, 0x8e, + 0xe7, 0x98, 0x5b, 0x7b, 0xeb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x53, 0xd4, 0x7d, 0x6e, + 0x25, 0x00, 0x00, +} + +func (m *Request) 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 *Request) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Query != nil { + _ = i + var l int + _ = l + if m.Value != nil { { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x3a } return len(dAtA) - i, nil } -func (m *Response_CheckTx) MarshalTo(dAtA []byte) (int, error) { + +func (m *Request_Echo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.CheckTx != nil { + if m.Echo != nil { { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3239,20 +3183,20 @@ func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *Response_Commit) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_Flush) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Commit != nil { + if m.Flush != nil { { - size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3260,20 +3204,20 @@ func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 + dAtA[i] = 0x12 } return len(dAtA) - i, nil } -func (m *Response_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_Info) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.ListSnapshots != nil { + if m.Info != nil { { - size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3281,20 +3225,20 @@ func (m *Response_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x6a + dAtA[i] = 0x1a } return len(dAtA) - i, nil } -func (m *Response_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_InitChain) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.OfferSnapshot != nil { + if m.InitChain != nil { { - size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3302,20 +3246,20 @@ func (m *Response_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x72 + dAtA[i] = 0x2a } return len(dAtA) - i, nil } -func (m *Response_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_Query) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.LoadSnapshotChunk != nil { + if m.Query != nil { { - size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3323,20 +3267,20 @@ func (m *Response_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, err i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x7a + dAtA[i] = 0x32 } return len(dAtA) - i, nil } -func (m *Response_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_CheckTx) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.ApplySnapshotChunk != nil { + if m.CheckTx != nil { { - size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3344,22 +3288,20 @@ func (m *Response_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, er i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + dAtA[i] = 0x42 } return len(dAtA) - i, nil } -func (m *Response_PrepareProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_Commit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_PrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.PrepareProposal != nil { + if m.Commit != nil { { - size, err := m.PrepareProposal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3367,22 +3309,20 @@ func (m *Response_PrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a + dAtA[i] = 0x5a } return len(dAtA) - i, nil } -func (m *Response_ProcessProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_ProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.ProcessProposal != nil { + if m.ListSnapshots != nil { { - size, err := m.ProcessProposal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3390,22 +3330,20 @@ func (m *Response_ProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + dAtA[i] = 0x62 } return len(dAtA) - i, nil } -func (m *Response_ExtendVote) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_ExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.ExtendVote != nil { + if m.OfferSnapshot != nil { { - size, err := m.ExtendVote.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3413,18 +3351,127 @@ func (m *Response_ExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a + dAtA[i] = 0x6a } return len(dAtA) - i, nil } -func (m *Response_VerifyVoteExtension) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_VerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LoadSnapshotChunk != nil { + { + size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *Request_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ApplySnapshotChunk != nil { + { + size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + return len(dAtA) - i, nil +} +func (m *Request_PrepareProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request_PrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PrepareProposal != nil { + { + size, err := m.PrepareProposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *Request_ProcessProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request_ProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProcessProposal != nil { + { + size, err := m.ProcessProposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *Request_ExtendVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request_ExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExtendVote != nil { + { + size, err := m.ExtendVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *Request_VerifyVoteExtension) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request_VerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.VerifyVoteExtension != nil { { @@ -3438,16 +3485,16 @@ func (m *Response_VerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xa2 + dAtA[i] = 0x9a } return len(dAtA) - i, nil } -func (m *Response_FinalizeBlock) MarshalTo(dAtA []byte) (int, error) { +func (m *Request_FinalizeBlock) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_FinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Request_FinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.FinalizeBlock != nil { { @@ -3461,11 +3508,11 @@ func (m *Response_FinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xaa + dAtA[i] = 0xa2 } return len(dAtA) - i, nil } -func (m *ResponseOfferSnapshot) Marshal() (dAtA []byte, err error) { +func (m *EchoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3475,25 +3522,27 @@ func (m *ResponseOfferSnapshot) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResponseOfferSnapshot) MarshalTo(dAtA []byte) (int, error) { +func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseOfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Result != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Result)) + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ResponseApplySnapshotChunk) Marshal() (dAtA []byte, err error) { +func (m *FlushRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3503,52 +3552,20 @@ func (m *ResponseApplySnapshotChunk) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResponseApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { +func (m *FlushRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *FlushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.RejectSenders) > 0 { - for iNdEx := len(m.RejectSenders) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RejectSenders[iNdEx]) - copy(dAtA[i:], m.RejectSenders[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RejectSenders[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.RefetchChunks) > 0 { - dAtA43 := make([]byte, len(m.RefetchChunks)*10) - var j42 int - for _, num := range m.RefetchChunks { - for num >= 1<<7 { - dAtA43[j42] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j42++ - } - dAtA43[j42] = uint8(num) - j42++ - } - i -= j42 - copy(dAtA[i:], dAtA43[:j42]) - i = encodeVarintTypes(dAtA, i, uint64(j42)) - i-- - dAtA[i] = 0x12 - } - if m.Result != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } -func (m *ResponseProcessProposal) Marshal() (dAtA []byte, err error) { +func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3558,25 +3575,44 @@ func (m *ResponseProcessProposal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResponseProcessProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Status != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + if len(m.AbciVersion) > 0 { + i -= len(m.AbciVersion) + copy(dAtA[i:], m.AbciVersion) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AbciVersion))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x22 + } + if m.P2PVersion != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.P2PVersion)) + i-- + dAtA[i] = 0x18 + } + if m.BlockVersion != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.BlockVersion)) + i-- + dAtA[i] = 0x10 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ResponseVerifyVoteExtension) Marshal() (dAtA []byte, err error) { +func (m *InitChainRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3586,25 +3622,73 @@ func (m *ResponseVerifyVoteExtension) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResponseVerifyVoteExtension) MarshalTo(dAtA []byte) (int, error) { +func (m *InitChainRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseVerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Status != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + if m.InitialHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x30 + } + if len(m.AppStateBytes) > 0 { + i -= len(m.AppStateBytes) + copy(dAtA[i:], m.AppStateBytes) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) + i-- + dAtA[i] = 0x2a + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.ConsensusParams != nil { + { + size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + n18, err18 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err18 != nil { + return 0, err18 } + i -= n18 + i = encodeVarintTypes(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *Misbehavior) Marshal() (dAtA []byte, err error) { +func (m *QueryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3614,748 +3698,5459 @@ func (m *Misbehavior) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Misbehavior) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Misbehavior) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TotalVotingPower != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) + if m.Prove { i-- - dAtA[i] = 0x28 - } - n44, err44 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err44 != nil { - return 0, err44 + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 } - i -= n44 - i = encodeVarintTypes(dAtA, i, uint64(n44)) - i-- - dAtA[i] = 0x22 if m.Height != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.Height)) i-- dAtA[i] = 0x18 } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *CheckTxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *Request) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != nil { - n += m.Value.Size() - } - return n + +func (m *CheckTxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_Echo) Size() (n int) { - if m == nil { - return 0 - } +func (m *CheckTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Echo != nil { - l = m.Echo.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_Flush) Size() (n int) { - if m == nil { - return 0 + if m.Type != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x18 } - var l int - _ = l - if m.Flush != nil { - l = m.Flush.Size() - n += 1 + l + sovTypes(uint64(l)) + if len(m.Tx) > 0 { + i -= len(m.Tx) + copy(dAtA[i:], m.Tx) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *Request_Info) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovTypes(uint64(l)) + +func (m *CommitRequest) 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 n + return dAtA[:n], nil } -func (m *Request_InitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InitChain != nil { - l = m.InitChain.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + +func (m *CommitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_Query) Size() (n int) { - if m == nil { - return 0 - } + +func (m *CommitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *Request_CheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + +func (m *ListSnapshotsRequest) 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 n + return dAtA[:n], nil } -func (m *Request_Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Commit != nil { - l = m.Commit.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + +func (m *ListSnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_ListSnapshots) Size() (n int) { - if m == nil { - return 0 - } + +func (m *ListSnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ListSnapshots != nil { - l = m.ListSnapshots.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *Request_OfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OfferSnapshot != nil { - l = m.OfferSnapshot.Size() - n += 1 + l + sovTypes(uint64(l)) + +func (m *OfferSnapshotRequest) 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 n + return dAtA[:n], nil } -func (m *Request_LoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } + +func (m *OfferSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OfferSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.LoadSnapshotChunk != nil { - l = m.LoadSnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x12 } - return n + if m.Snapshot != nil { + { + size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *Request_ApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 + +func (m *LoadSnapshotChunkRequest) 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 *LoadSnapshotChunkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadSnapshotChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ApplySnapshotChunk != nil { - l = m.ApplySnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) + if m.Chunk != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Chunk)) + i-- + dAtA[i] = 0x18 } - return n -} -func (m *Request_PrepareProposal) Size() (n int) { - if m == nil { - return 0 + if m.Format != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + i-- + dAtA[i] = 0x10 } - var l int - _ = l - if m.PrepareProposal != nil { - l = m.PrepareProposal.Size() - n += 2 + l + sovTypes(uint64(l)) + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *Request_ProcessProposal) Size() (n int) { - if m == nil { - return 0 + +func (m *ApplySnapshotChunkRequest) 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 *ApplySnapshotChunkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplySnapshotChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ProcessProposal != nil { - l = m.ProcessProposal.Size() - n += 2 + l + sovTypes(uint64(l)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a } - return n -} -func (m *Request_ExtendVote) Size() (n int) { - if m == nil { - return 0 + if len(m.Chunk) > 0 { + i -= len(m.Chunk) + copy(dAtA[i:], m.Chunk) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) + i-- + dAtA[i] = 0x12 } - var l int - _ = l - if m.ExtendVote != nil { - l = m.ExtendVote.Size() - n += 2 + l + sovTypes(uint64(l)) + if m.Index != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *Request_VerifyVoteExtension) Size() (n int) { - if m == nil { - return 0 + +func (m *PrepareProposalRequest) 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 *PrepareProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrepareProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.VerifyVoteExtension != nil { - l = m.VerifyVoteExtension.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_FinalizeBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.FinalizeBlock != nil { - l = m.FinalizeBlock.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *RequestCheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 } - return n -} - -func (m *RequestPrepareProposal) Size() (n int) { - if m == nil { - return 0 + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x3a } - var l int - _ = l - if m.MaxTxBytes != 0 { - n += 1 + sovTypes(uint64(m.MaxTxBytes)) + n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err20 != nil { + return 0, err20 } - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } + i -= n20 + i = encodeVarintTypes(dAtA, i, uint64(n20)) + i-- + dAtA[i] = 0x32 + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x28 } - l = m.LocalLastCommit.Size() - n += 1 + l + sovTypes(uint64(l)) if len(m.Misbehavior) > 0 { - for _, e := range m.Misbehavior { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) + for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) + { + size, err := m.LocalLastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + i-- + dAtA[i] = 0x1a + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if m.MaxTxBytes != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MaxTxBytes)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *RequestProcessProposal) Size() (n int) { - if m == nil { - return 0 +func (m *ProcessProposalRequest) 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 *ProcessProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 } - l = m.ProposedLastCommit.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Misbehavior) > 0 { - for _, e := range m.Misbehavior { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x3a } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + n22, err22 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err22 != nil { + return 0, err22 } + i -= n22 + i = encodeVarintTypes(dAtA, i, uint64(n22)) + i-- + dAtA[i] = 0x32 if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x28 } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if len(m.Misbehavior) > 0 { + for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - return n + { + size, err := m.ProposedLastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } -func (m *RequestExtendVote) Size() (n int) { - if m == nil { - return 0 +func (m *ExtendVoteRequest) 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 *ExtendVoteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExtendVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x3a } - l = m.ProposedLastCommit.Size() - n += 1 + l + sovTypes(uint64(l)) if len(m.Misbehavior) > 0 { - for _, e := range m.Misbehavior { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) + for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } } - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestFinalizeBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) + { + size, err := m.ProposedLastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - l = m.DecidedLastCommit.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Misbehavior) > 0 { - for _, e := range m.Misbehavior { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) + i-- + dAtA[i] = 0x2a + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0x22 } } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + n25, err25 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err25 != nil { + return 0, err25 } + i -= n25 + i = encodeVarintTypes(dAtA, i, uint64(n25)) + i-- + dAtA[i] = 0x1a if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *Response) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != nil { - n += m.Value.Size() +func (m *VerifyVoteExtensionRequest) 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 n + return dAtA[:n], nil } -func (m *Response_Exception) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Exception != nil { - l = m.Exception.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n +func (m *VerifyVoteExtensionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_Echo) Size() (n int) { - if m == nil { - return 0 - } + +func (m *VerifyVoteExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Echo != nil { - l = m.Echo.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Flush) Size() (n int) { - if m == nil { - return 0 + if len(m.VoteExtension) > 0 { + i -= len(m.VoteExtension) + copy(dAtA[i:], m.VoteExtension) + i = encodeVarintTypes(dAtA, i, uint64(len(m.VoteExtension))) + i-- + dAtA[i] = 0x22 } - var l int - _ = l - if m.Flush != nil { - l = m.Flush.Size() - n += 1 + l + sovTypes(uint64(l)) + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 } - return n -} -func (m *Response_Info) Size() (n int) { - if m == nil { - return 0 + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 } - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovTypes(uint64(l)) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *Response_InitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InitChain != nil { - l = m.InitChain.Size() - n += 1 + l + sovTypes(uint64(l)) + +func (m *FinalizeBlockRequest) 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 n + return dAtA[:n], nil } -func (m *Response_Query) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + +func (m *FinalizeBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_CheckTx) Size() (n int) { - if m == nil { - return 0 - } + +func (m *FinalizeBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 } - return n -} -func (m *Response_Commit) Size() (n int) { - if m == nil { - return 0 + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x3a } - var l int - _ = l - if m.Commit != nil { - l = m.Commit.Size() - n += 1 + l + sovTypes(uint64(l)) + n26, err26 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err26 != nil { + return 0, err26 } - return n -} -func (m *Response_ListSnapshots) Size() (n int) { - if m == nil { - return 0 + i -= n26 + i = encodeVarintTypes(dAtA, i, uint64(n26)) + i-- + dAtA[i] = 0x32 + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x28 } - var l int - _ = l - if m.ListSnapshots != nil { - l = m.ListSnapshots.Size() - n += 1 + l + sovTypes(uint64(l)) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 } - return n -} -func (m *Response_OfferSnapshot) Size() (n int) { - if m == nil { - return 0 + if len(m.Misbehavior) > 0 { + for iNdEx := len(m.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Misbehavior[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - var l int - _ = l - if m.OfferSnapshot != nil { - l = m.OfferSnapshot.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_LoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 + { + size, err := m.DecidedLastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - var l int - _ = l - if m.LoadSnapshotChunk != nil { - l = m.LoadSnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) + i-- + dAtA[i] = 0x12 + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return n + return len(dAtA) - i, nil } -func (m *Response_ApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ApplySnapshotChunk != nil { - l = m.ApplySnapshotChunk.Size() - n += 2 + l + sovTypes(uint64(l)) + +func (m *Response) 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 n + return dAtA[:n], nil } -func (m *Response_PrepareProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PrepareProposal != nil { - l = m.PrepareProposal.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n + +func (m *Response) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_ProcessProposal) Size() (n int) { - if m == nil { - return 0 - } + +func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ProcessProposal != nil { - l = m.ProcessProposal.Size() - n += 2 + l + sovTypes(uint64(l)) + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return n + return len(dAtA) - i, nil } -func (m *Response_ExtendVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExtendVote != nil { - l = m.ExtendVote.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n + +func (m *Response_Exception) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Response_VerifyVoteExtension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VerifyVoteExtension != nil { - l = m.VerifyVoteExtension.Size() - n += 2 + l + sovTypes(uint64(l)) + +func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Exception != nil { + { + size, err := m.Exception.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *Response_FinalizeBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.FinalizeBlock != nil { - l = m.FinalizeBlock.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n +func (m *Response_Echo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseOfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != 0 { - n += 1 + sovTypes(uint64(m.Result)) + +func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Echo != nil { + { + size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return n + return len(dAtA) - i, nil +} +func (m *Response_Flush) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != 0 { - n += 1 + sovTypes(uint64(m.Result)) - } - if len(m.RefetchChunks) > 0 { - l = 0 - for _, e := range m.RefetchChunks { - l += sovTypes(uint64(e)) +func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Flush != nil { + { + size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - n += 1 + sovTypes(uint64(l)) + l + i-- + dAtA[i] = 0x1a } - if len(m.RejectSenders) > 0 { - for _, s := range m.RejectSenders { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) + return len(dAtA) - i, nil +} +func (m *Response_Info) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Info != nil { + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - return n + return len(dAtA) - i, nil +} +func (m *Response_InitChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseProcessProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != 0 { - n += 1 + sovTypes(uint64(m.Status)) +func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.InitChain != nil { + { + size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - return n + return len(dAtA) - i, nil +} +func (m *Response_Query) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResponseVerifyVoteExtension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != 0 { +func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Query != nil { + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *Response_CheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CheckTx != nil { + { + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *Response_Commit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + return len(dAtA) - i, nil +} +func (m *Response_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListSnapshots != nil { + { + size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + return len(dAtA) - i, nil +} +func (m *Response_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.OfferSnapshot != nil { + { + size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *Response_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LoadSnapshotChunk != nil { + { + size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + return len(dAtA) - i, nil +} +func (m *Response_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ApplySnapshotChunk != nil { + { + size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *Response_PrepareProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_PrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PrepareProposal != nil { + { + size, err := m.PrepareProposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *Response_ProcessProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_ProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProcessProposal != nil { + { + size, err := m.ProcessProposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *Response_ExtendVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_ExtendVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExtendVote != nil { + { + size, err := m.ExtendVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *Response_VerifyVoteExtension) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_VerifyVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.VerifyVoteExtension != nil { + { + size, err := m.VerifyVoteExtension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *Response_FinalizeBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Response_FinalizeBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FinalizeBlock != nil { + { + size, err := m.FinalizeBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *ExceptionResponse) 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 *ExceptionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExceptionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EchoResponse) 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 *EchoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FlushResponse) 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 *FlushResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *InfoResponse) 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 *InfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LastBlockAppHash) > 0 { + i -= len(m.LastBlockAppHash) + copy(dAtA[i:], m.LastBlockAppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LastBlockAppHash))) + i-- + dAtA[i] = 0x2a + } + if m.LastBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LastBlockHeight)) + i-- + dAtA[i] = 0x20 + } + if m.AppVersion != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.AppVersion)) + i-- + dAtA[i] = 0x18 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InitChainResponse) 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 *InitChainResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InitChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.ConsensusParams != nil { + { + size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Codespace) > 0 { + i -= len(m.Codespace) + copy(dAtA[i:], m.Codespace) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) + i-- + dAtA[i] = 0x52 + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x48 + } + if m.ProofOps != nil { + { + size, err := m.ProofOps.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x3a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x32 + } + if m.Index != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x28 + } + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x22 + } + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x1a + } + if m.Code != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CheckTxResponse) 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 *CheckTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Codespace) > 0 { + i -= len(m.Codespace) + copy(dAtA[i:], m.Codespace) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) + i-- + dAtA[i] = 0x42 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.GasUsed != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x30 + } + if m.GasWanted != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.GasWanted)) + i-- + dAtA[i] = 0x28 + } + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x22 + } + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x1a + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CommitResponse) 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 *CommitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RetainHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.RetainHeight)) + i-- + dAtA[i] = 0x18 + } + return len(dAtA) - i, nil +} + +func (m *ListSnapshotsResponse) 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 *ListSnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Snapshots) > 0 { + for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *OfferSnapshotResponse) 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 *OfferSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OfferSnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Result != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LoadSnapshotChunkResponse) 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 *LoadSnapshotChunkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadSnapshotChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chunk) > 0 { + i -= len(m.Chunk) + copy(dAtA[i:], m.Chunk) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ApplySnapshotChunkResponse) 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 *ApplySnapshotChunkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplySnapshotChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RejectSenders) > 0 { + for iNdEx := len(m.RejectSenders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RejectSenders[iNdEx]) + copy(dAtA[i:], m.RejectSenders[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RejectSenders[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.RefetchChunks) > 0 { + dAtA48 := make([]byte, len(m.RefetchChunks)*10) + var j47 int + for _, num := range m.RefetchChunks { + for num >= 1<<7 { + dAtA48[j47] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j47++ + } + dAtA48[j47] = uint8(num) + j47++ + } + i -= j47 + copy(dAtA[i:], dAtA48[:j47]) + i = encodeVarintTypes(dAtA, i, uint64(j47)) + i-- + dAtA[i] = 0x12 + } + if m.Result != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PrepareProposalResponse) 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 *PrepareProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrepareProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ProcessProposalResponse) 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 *ProcessProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ExtendVoteResponse) 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 *ExtendVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExtendVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VoteExtension) > 0 { + i -= len(m.VoteExtension) + copy(dAtA[i:], m.VoteExtension) + i = encodeVarintTypes(dAtA, i, uint64(len(m.VoteExtension))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VerifyVoteExtensionResponse) 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 *VerifyVoteExtensionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VerifyVoteExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FinalizeBlockResponse) 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 *FinalizeBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FinalizeBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x2a + } + if m.ConsensusParamUpdates != nil { + { + size, err := m.ConsensusParamUpdates.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ValidatorUpdates) > 0 { + for iNdEx := len(m.ValidatorUpdates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.TxResults) > 0 { + for iNdEx := len(m.TxResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TxResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Misbehavior) 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 *Misbehavior) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Misbehavior) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalVotingPower != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) + i-- + dAtA[i] = 0x28 + } + n50, err50 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err50 != nil { + return 0, err50 + } + i -= n50 + i = encodeVarintTypes(dAtA, i, uint64(n50)) + i-- + dAtA[i] = 0x22 + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Type != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Request) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + n += m.Value.Size() + } + return n +} + +func (m *Request_Echo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Echo != nil { + l = m.Echo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_Flush) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Flush != nil { + l = m.Flush.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_Info) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_InitChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InitChain != nil { + l = m.InitChain.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_Query) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Query != nil { + l = m.Query.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_CheckTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_Commit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_ListSnapshots) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListSnapshots != nil { + l = m.ListSnapshots.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_OfferSnapshot) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OfferSnapshot != nil { + l = m.OfferSnapshot.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_LoadSnapshotChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LoadSnapshotChunk != nil { + l = m.LoadSnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_ApplySnapshotChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ApplySnapshotChunk != nil { + l = m.ApplySnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_PrepareProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrepareProposal != nil { + l = m.PrepareProposal.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_ProcessProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProcessProposal != nil { + l = m.ProcessProposal.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_ExtendVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExtendVote != nil { + l = m.ExtendVote.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_VerifyVoteExtension) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VerifyVoteExtension != nil { + l = m.VerifyVoteExtension.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Request_FinalizeBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FinalizeBlock != nil { + l = m.FinalizeBlock.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *EchoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *FlushRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *InfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.BlockVersion != 0 { + n += 1 + sovTypes(uint64(m.BlockVersion)) + } + if m.P2PVersion != 0 { + n += 1 + sovTypes(uint64(m.P2PVersion)) + } + l = len(m.AbciVersion) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *InitChainRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.ConsensusParams != nil { + l = m.ConsensusParams.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.AppStateBytes) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.InitialHeight != 0 { + n += 1 + sovTypes(uint64(m.InitialHeight)) + } + return n +} + +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *CheckTxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tx) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovTypes(uint64(m.Type)) + } + return n +} + +func (m *CommitRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListSnapshotsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *OfferSnapshotRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Snapshot != nil { + l = m.Snapshot.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *LoadSnapshotChunkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + if m.Format != 0 { + n += 1 + sovTypes(uint64(m.Format)) + } + if m.Chunk != 0 { + n += 1 + sovTypes(uint64(m.Chunk)) + } + return n +} + +func (m *ApplySnapshotChunkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovTypes(uint64(m.Index)) + } + l = len(m.Chunk) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *PrepareProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxTxBytes != 0 { + n += 1 + sovTypes(uint64(m.MaxTxBytes)) + } + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = m.LocalLastCommit.Size() + n += 1 + l + sovTypes(uint64(l)) + if len(m.Misbehavior) > 0 { + for _, e := range m.Misbehavior { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ProcessProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = m.ProposedLastCommit.Size() + n += 1 + l + sovTypes(uint64(l)) + if len(m.Misbehavior) > 0 { + for _, e := range m.Misbehavior { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ExtendVoteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = m.ProposedLastCommit.Size() + n += 1 + l + sovTypes(uint64(l)) + if len(m.Misbehavior) > 0 { + for _, e := range m.Misbehavior { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *VerifyVoteExtensionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = len(m.VoteExtension) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *FinalizeBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = m.DecidedLastCommit.Size() + n += 1 + l + sovTypes(uint64(l)) + if len(m.Misbehavior) > 0 { + for _, e := range m.Misbehavior { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Response) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + n += m.Value.Size() + } + return n +} + +func (m *Response_Exception) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Exception != nil { + l = m.Exception.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_Echo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Echo != nil { + l = m.Echo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_Flush) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Flush != nil { + l = m.Flush.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_Info) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_InitChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InitChain != nil { + l = m.InitChain.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_Query) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Query != nil { + l = m.Query.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_CheckTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_Commit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_ListSnapshots) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListSnapshots != nil { + l = m.ListSnapshots.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_OfferSnapshot) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OfferSnapshot != nil { + l = m.OfferSnapshot.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_LoadSnapshotChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LoadSnapshotChunk != nil { + l = m.LoadSnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_ApplySnapshotChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ApplySnapshotChunk != nil { + l = m.ApplySnapshotChunk.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_PrepareProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrepareProposal != nil { + l = m.PrepareProposal.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_ProcessProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProcessProposal != nil { + l = m.ProcessProposal.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_ExtendVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExtendVote != nil { + l = m.ExtendVote.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_VerifyVoteExtension) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VerifyVoteExtension != nil { + l = m.VerifyVoteExtension.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Response_FinalizeBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FinalizeBlock != nil { + l = m.FinalizeBlock.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n +} +func (m *ExceptionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *EchoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *FlushResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *InfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.AppVersion != 0 { + n += 1 + sovTypes(uint64(m.AppVersion)) + } + if m.LastBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.LastBlockHeight)) + } + l = len(m.LastBlockAppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *InitChainResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsensusParams != nil { + l = m.ConsensusParams.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Index != 0 { + n += 1 + sovTypes(uint64(m.Index)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.ProofOps != nil { + l = m.ProofOps.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = len(m.Codespace) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *CheckTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.GasWanted != 0 { + n += 1 + sovTypes(uint64(m.GasWanted)) + } + if m.GasUsed != 0 { + n += 1 + sovTypes(uint64(m.GasUsed)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.Codespace) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *CommitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RetainHeight != 0 { + n += 1 + sovTypes(uint64(m.RetainHeight)) + } + return n +} + +func (m *ListSnapshotsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Snapshots) > 0 { + for _, e := range m.Snapshots { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *OfferSnapshotResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result != 0 { + n += 1 + sovTypes(uint64(m.Result)) + } + return n +} + +func (m *LoadSnapshotChunkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Chunk) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ApplySnapshotChunkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result != 0 { + n += 1 + sovTypes(uint64(m.Result)) + } + if len(m.RefetchChunks) > 0 { + l = 0 + for _, e := range m.RefetchChunks { + l += sovTypes(uint64(e)) + } + n += 1 + sovTypes(uint64(l)) + l + } + if len(m.RejectSenders) > 0 { + for _, s := range m.RejectSenders { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *PrepareProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *ProcessProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovTypes(uint64(m.Status)) + } + return n +} + +func (m *ExtendVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.VoteExtension) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *VerifyVoteExtensionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { n += 1 + sovTypes(uint64(m.Status)) } - return n -} + return n +} + +func (m *FinalizeBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.TxResults) > 0 { + for _, e := range m.TxResults { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.ValidatorUpdates) > 0 { + for _, e := range m.ValidatorUpdates { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.ConsensusParamUpdates != nil { + l = m.ConsensusParamUpdates.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Misbehavior) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovTypes(uint64(m.Type)) + } + l = m.Validator.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + if m.TotalVotingPower != 0 { + n += 1 + sovTypes(uint64(m.TotalVotingPower)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Request) 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 ErrIntOverflowTypes + } + 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: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &EchoRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Echo{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FlushRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Flush{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &InfoRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Info{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &InitChainRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_InitChain{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &QueryRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Query{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &CheckTxRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_CheckTx{v} + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &CommitRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Commit{v} + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ListSnapshotsRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_ListSnapshots{v} + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &OfferSnapshotRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_OfferSnapshot{v} + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LoadSnapshotChunkRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_LoadSnapshotChunk{v} + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ApplySnapshotChunkRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_ApplySnapshotChunk{v} + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrepareProposal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &PrepareProposalRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_PrepareProposal{v} + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessProposal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProcessProposalRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_ProcessProposal{v} + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ExtendVoteRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_ExtendVote{v} + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyVoteExtension", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &VerifyVoteExtensionRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_VerifyVoteExtension{v} + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FinalizeBlockRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_FinalizeBlock{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EchoRequest) 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 ErrIntOverflowTypes + } + 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: EchoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlushRequest) 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 ErrIntOverflowTypes + } + 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: FlushRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlushRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoRequest) 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 ErrIntOverflowTypes + } + 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: InfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockVersion", wireType) + } + m.BlockVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockVersion |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field P2PVersion", wireType) + } + m.P2PVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.P2PVersion |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AbciVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AbciVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InitChainRequest) 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 ErrIntOverflowTypes + } + 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: InitChainRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InitChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusParams == nil { + m.ConsensusParams = &v1beta3.ConsensusParams{} + } + if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, v1beta1.ValidatorUpdate{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppStateBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppStateBytes = append(m.AppStateBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AppStateBytes == nil { + m.AppStateBytes = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + } + m.InitialHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InitialHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRequest) 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 ErrIntOverflowTypes + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CheckTxRequest) 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 ErrIntOverflowTypes + } + 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: CheckTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) + if m.Tx == nil { + m.Tx = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= CheckTxType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitRequest) 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 ErrIntOverflowTypes + } + 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: CommitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListSnapshotsRequest) 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 ErrIntOverflowTypes + } + 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: ListSnapshotsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OfferSnapshotRequest) 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 ErrIntOverflowTypes + } + 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: OfferSnapshotRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OfferSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Snapshot == nil { + m.Snapshot = &v1beta1.Snapshot{} + } + if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoadSnapshotChunkRequest) 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 ErrIntOverflowTypes + } + 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: LoadSnapshotChunkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LoadSnapshotChunkRequest: 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + } + m.Format = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Format |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + } + m.Chunk = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Chunk |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApplySnapshotChunkRequest) 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 ErrIntOverflowTypes + } + 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: ApplySnapshotChunkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplySnapshotChunkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) + if m.Chunk == nil { + m.Chunk = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrepareProposalRequest) 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 ErrIntOverflowTypes + } + 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: PrepareProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrepareProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTxBytes", wireType) + } + m.MaxTxBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalLastCommit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LocalLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Misbehavior = append(m.Misbehavior, Misbehavior{}) + if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProcessProposalRequest) 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 ErrIntOverflowTypes + } + 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: ProcessProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessProposalRequest: 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposedLastCommit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProposedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Misbehavior = append(m.Misbehavior, Misbehavior{}) + if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *Misbehavior) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - if m.TotalVotingPower != 0 { - n += 1 + sovTypes(uint64(m.TotalVotingPower)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *Request) Unmarshal(dAtA []byte) error { +func (m *ExtendVoteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4378,15 +9173,68 @@ func (m *Request) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Request: wiretype end group for non-group") + return fmt.Errorf("proto: ExtendVoteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExtendVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4413,15 +9261,45 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestEcho{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Request_Echo{v} iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposedLastCommit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4448,15 +9326,13 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestFlush{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ProposedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Request_Flush{v} iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4483,17 +9359,134 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta2.RequestInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Misbehavior = append(m.Misbehavior, Misbehavior{}) + if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerifyVoteExtensionRequest) 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.Value = &Request_Info{v} - iNdEx = postIndex - case 5: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VerifyVoteExtensionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerifyVoteExtensionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4503,32 +9496,31 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta3.RequestInitChain{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} } - m.Value = &Request_InitChain{v} iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4538,32 +9530,31 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestQuery{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorAddress == nil { + m.ValidatorAddress = []byte{} } - m.Value = &Request_Query{v} iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var msglen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4573,32 +9564,16 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestCheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_CheckTx{v} - iNdEx = postIndex - case 11: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4608,67 +9583,81 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestCommit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.VoteExtension = append(m.VoteExtension[:0], dAtA[iNdEx:postIndex]...) + if m.VoteExtension == nil { + m.VoteExtension = []byte{} } - m.Value = &Request_Commit{v} iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FinalizeBlockRequest) 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 ErrIntOverflowTypes + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestListSnapshots{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.Value = &Request_ListSnapshots{v} - iNdEx = postIndex - case 13: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FinalizeBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FinalizeBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4678,30 +9667,27 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestOfferSnapshot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_OfferSnapshot{v} + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 14: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DecidedLastCommit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4728,15 +9714,13 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestLoadSnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DecidedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Request_LoadSnapshotChunk{v} iNdEx = postIndex - case 15: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4763,17 +9747,16 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.RequestApplySnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Misbehavior = append(m.Misbehavior, Misbehavior{}) + if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Request_ApplySnapshotChunk{v} iNdEx = postIndex - case 16: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrepareProposal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4783,32 +9766,31 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &RequestPrepareProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} } - m.Value = &Request_PrepareProposal{v} iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessProposal", wireType) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var msglen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4818,30 +9800,14 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestProcessProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_ProcessProposal{v} - iNdEx = postIndex - case 18: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendVote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4868,17 +9834,15 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &RequestExtendVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Request_ExtendVote{v} iNdEx = postIndex - case 19: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VerifyVoteExtension", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4888,32 +9852,31 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta3.RequestVerifyVoteExtension{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} } - m.Value = &Request_VerifyVoteExtension{v} iNdEx = postIndex - case 20: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -4923,26 +9886,25 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &RequestFinalizeBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} } - m.Value = &Request_FinalizeBlock{v} iNdEx = postIndex default: iNdEx = preIndex @@ -4965,7 +9927,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { +func (m *Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4988,17 +9950,17 @@ func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestCheckTx: wiretype end group for non-group") + return fmt.Errorf("proto: Response: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestCheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5008,31 +9970,32 @@ func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} + v := &ExceptionResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_Exception{v} iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) } - m.Type = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5042,66 +10005,32 @@ func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= CheckTxType(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestPrepareProposal) 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 ErrIntOverflowTypes + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &EchoResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestPrepareProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestPrepareProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTxBytes", wireType) + m.Value = &Response_Echo{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) } - m.MaxTxBytes = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5111,16 +10040,32 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxTxBytes |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FlushResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_Flush{v} + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5130,27 +10075,30 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + v := &InfoResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_Info{v} iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalLastCommit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5177,13 +10125,15 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LocalLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &InitChainResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_InitChain{v} iNdEx = postIndex - case 4: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5210,16 +10160,17 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Misbehavior = append(m.Misbehavior, Misbehavior{}) - if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &QueryResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Query{v} iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) } - m.Height = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5229,14 +10180,30 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &CheckTxResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_CheckTx{v} + iNdEx = postIndex + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5263,15 +10230,17 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + v := &CommitResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Commit{v} iNdEx = postIndex - case 7: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5281,31 +10250,32 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} + v := &ListSnapshotsResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_ListSnapshots{v} iNdEx = postIndex - case 8: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5315,81 +10285,67 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { + v := &OfferSnapshotResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + m.Value = &Response_OfferSnapshot{v} + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestProcessProposal) 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 ErrIntOverflowTypes + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &LoadSnapshotChunkResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestProcessProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestProcessProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Value = &Response_LoadSnapshotChunk{v} + iNdEx = postIndex + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5399,27 +10355,30 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + v := &ApplySnapshotChunkResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_ApplySnapshotChunk{v} iNdEx = postIndex - case 2: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposedLastCommit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PrepareProposal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5446,13 +10405,15 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ProposedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &PrepareProposalResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_PrepareProposal{v} iNdEx = postIndex - case 3: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProcessProposal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5479,16 +10440,17 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Misbehavior = append(m.Misbehavior, Misbehavior{}) - if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &ProcessProposalResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_ProcessProposal{v} iNdEx = postIndex - case 4: + case 19: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExtendVote", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5498,31 +10460,32 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} + v := &ExtendVoteResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_ExtendVote{v} iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyVoteExtension", wireType) } - m.Height = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5532,14 +10495,30 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &VerifyVoteExtensionResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_VerifyVoteExtension{v} + iNdEx = postIndex + case 21: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlock", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5566,15 +10545,67 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + v := &FinalizeBlockResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_FinalizeBlock{v} iNdEx = postIndex - case 7: + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExceptionResponse) 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 ErrIntOverflowTypes + } + 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: ExceptionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExceptionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5584,31 +10615,79 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EchoResponse) 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 ErrIntOverflowTypes + } + 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: EchoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5618,26 +10697,74 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlushResponse) 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 ErrIntOverflowTypes + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlushResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlushResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -5659,7 +10786,7 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { +func (m *InfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5682,17 +10809,17 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestExtendVote: wiretype end group for non-group") + return fmt.Errorf("proto: InfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestExtendVote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5702,31 +10829,29 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } + m.Data = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Height = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5736,16 +10861,29 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) } - var msglen int + m.AppVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5755,30 +10893,16 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.AppVersion |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockHeight", wireType) } - var byteLen int + m.LastBlockHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5788,29 +10912,16 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.LastBlockHeight |= int64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposedLastCommit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockAppHash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5820,28 +10931,79 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ProposedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.LastBlockAppHash = append(m.LastBlockAppHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastBlockAppHash == nil { + m.LastBlockAppHash = []byte{} } iNdEx = postIndex - case 6: + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InitChainResponse) 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 ErrIntOverflowTypes + } + 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: InitChainResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InitChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5868,16 +11030,18 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Misbehavior = append(m.Misbehavior, Misbehavior{}) - if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ConsensusParams == nil { + m.ConsensusParams = &v1beta3.ConsensusParams{} + } + if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5887,29 +11051,29 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} + m.Validators = append(m.Validators, v1beta1.ValidatorUpdate{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 8: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -5936,9 +11100,9 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} } iNdEx = postIndex default: @@ -5962,7 +11126,7 @@ func (m *RequestExtendVote) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { +func (m *QueryResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5985,17 +11149,36 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestFinalizeBlock: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestFinalizeBlock: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6005,29 +11188,29 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + m.Log = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DecidedLastCommit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6037,30 +11220,48 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DecidedLastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6070,29 +11271,29 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Misbehavior = append(m.Misbehavior, Misbehavior{}) - if err := m.Misbehavior[len(m.Misbehavior)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} } iNdEx = postIndex - case 4: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -6119,33 +11320,14 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} } iNdEx = postIndex - case 5: - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProofOps", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6172,15 +11354,18 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if m.ProofOps == nil { + m.ProofOps = &v1beta11.ProofOps{} + } + if err := m.ProofOps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var byteLen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6190,31 +11375,16 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} - } - iNdEx = postIndex - case 8: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6224,25 +11394,23 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } + m.Codespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6265,7 +11433,7 @@ func (m *RequestFinalizeBlock) Unmarshal(dAtA []byte) error { } return nil } -func (m *Response) Unmarshal(dAtA []byte) error { +func (m *CheckTxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6288,17 +11456,17 @@ func (m *Response) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") + return fmt.Errorf("proto: CheckTxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CheckTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var msglen int + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6308,32 +11476,16 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &v1beta1.ResponseException{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Exception{v} - iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6343,32 +11495,31 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.ResponseEcho{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } - m.Value = &Response_Echo{v} iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6378,137 +11529,29 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.ResponseFlush{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Flush{v} + m.Log = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &v1beta1.ResponseInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Info{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &v1beta3.ResponseInitChain{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_InitChain{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &v1beta1.ResponseQuery{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Query{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) - } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6518,32 +11561,29 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta3.ResponseCheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_CheckTx{v} - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - var msglen int + m.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) + } + m.GasWanted = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6553,30 +11593,33 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.GasWanted |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) } - v := &v1beta3.ResponseCommit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - m.Value = &Response_Commit{v} - iNdEx = postIndex - case 13: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6603,17 +11646,16 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta1.ResponseListSnapshots{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, v1beta2.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_ListSnapshots{v} iNdEx = postIndex - case 14: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6623,32 +11665,79 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseOfferSnapshot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Codespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { return err } - m.Value = &Response_OfferSnapshot{v} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes } - var msglen int + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitResponse) 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 ErrIntOverflowTypes + } + 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: CommitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RetainHeight", wireType) + } + m.RetainHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6658,30 +11747,64 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.RetainHeight |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - v := &v1beta1.ResponseLoadSnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListSnapshotsResponse) 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 ErrIntOverflowTypes } - m.Value = &Response_LoadSnapshotChunk{v} - iNdEx = postIndex - case 16: + 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: ListSnapshotsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListSnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6708,17 +11831,66 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseApplySnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Snapshots = append(m.Snapshots, &v1beta1.Snapshot{}) + if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_ApplySnapshotChunk{v} iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrepareProposal", wireType) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - var msglen int + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OfferSnapshotResponse) 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 ErrIntOverflowTypes + } + 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: OfferSnapshotResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OfferSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + m.Result = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6728,32 +11900,66 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Result |= OfferSnapshotResult(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - v := &v1beta2.ResponsePrepareProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoadSnapshotChunkResponse) 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.Value = &Response_PrepareProposal{v} - iNdEx = postIndex - case 18: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LoadSnapshotChunkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LoadSnapshotChunkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessProposal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6763,32 +11969,81 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseProcessProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) + if m.Chunk == nil { + m.Chunk = []byte{} } - m.Value = &Response_ProcessProposal{v} iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendVote", wireType) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - var msglen int + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApplySnapshotChunkResponse) 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 ErrIntOverflowTypes + } + 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: ApplySnapshotChunkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplySnapshotChunkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + m.Result = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6798,32 +12053,92 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Result |= ApplySnapshotChunkResult(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &v1beta3.ResponseExtendVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + case 2: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RefetchChunks = append(m.RefetchChunks, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.RefetchChunks) == 0 { + m.RefetchChunks = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RefetchChunks = append(m.RefetchChunks, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field RefetchChunks", wireType) } - m.Value = &Response_ExtendVote{v} - iNdEx = postIndex - case 20: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VerifyVoteExtension", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RejectSenders", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6833,32 +12148,79 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseVerifyVoteExtension{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RejectSenders = append(m.RejectSenders, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { return err } - m.Value = &Response_VerifyVoteExtension{v} - iNdEx = postIndex - case 21: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrepareProposalResponse) 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 ErrIntOverflowTypes + } + 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: PrepareProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrepareProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6868,26 +12230,23 @@ func (m *Response) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - v := &v1beta3.ResponseFinalizeBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_FinalizeBlock{v} + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6910,7 +12269,7 @@ func (m *Response) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { +func (m *ProcessProposalResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6933,17 +12292,17 @@ func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseOfferSnapshot: wiretype end group for non-group") + return fmt.Errorf("proto: ProcessProposalResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseOfferSnapshot: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProcessProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - m.Result = 0 + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6953,7 +12312,7 @@ func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= OfferSnapshotResult(b&0x7F) << shift + m.Status |= ProcessProposalStatus(b&0x7F) << shift if b < 0x80 { break } @@ -6979,7 +12338,7 @@ func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { +func (m *ExtendVoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7002,112 +12361,17 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseApplySnapshotChunk: wiretype end group for non-group") + return fmt.Errorf("proto: ExtendVoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseApplySnapshotChunk: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExtendVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= ApplySnapshotChunkResult(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.RefetchChunks) == 0 { - m.RefetchChunks = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field RefetchChunks", wireType) - } - case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectSenders", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -7117,23 +12381,25 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.RejectSenders = append(m.RejectSenders, string(dAtA[iNdEx:postIndex])) + m.VoteExtension = append(m.VoteExtension[:0], dAtA[iNdEx:postIndex]...) + if m.VoteExtension == nil { + m.VoteExtension = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -7156,7 +12422,7 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseProcessProposal) Unmarshal(dAtA []byte) error { +func (m *VerifyVoteExtensionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7179,10 +12445,10 @@ func (m *ResponseProcessProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseProcessProposal: wiretype end group for non-group") + return fmt.Errorf("proto: VerifyVoteExtensionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseProcessProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VerifyVoteExtensionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7199,7 +12465,7 @@ func (m *ResponseProcessProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= ProcessProposalStatus(b&0x7F) << shift + m.Status |= VerifyVoteExtensionStatus(b&0x7F) << shift if b < 0x80 { break } @@ -7225,7 +12491,7 @@ func (m *ResponseProcessProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseVerifyVoteExtension) Unmarshal(dAtA []byte) error { +func (m *FinalizeBlockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7248,17 +12514,17 @@ func (m *ResponseVerifyVoteExtension) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseVerifyVoteExtension: wiretype end group for non-group") + return fmt.Errorf("proto: FinalizeBlockResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseVerifyVoteExtension: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FinalizeBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } - m.Status = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -7268,11 +12534,164 @@ func (m *ResponseVerifyVoteExtension) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= VerifyVoteExtensionStatus(b&0x7F) << shift + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, v1beta2.Event{}) + if err := m.Events[len(m.Events)-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 TxResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxResults = append(m.TxResults, &v1beta31.ExecTxResult{}) + if err := m.TxResults[len(m.TxResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorUpdates = append(m.ValidatorUpdates, v1beta1.ValidatorUpdate{}) + if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParamUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusParamUpdates == nil { + m.ConsensusParamUpdates = &v1beta3.ConsensusParams{} + } + if err := m.ConsensusParamUpdates.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/api/cometbft/crypto/v1beta1/proof.pb.go b/api/cometbft/crypto/v1beta1/proof.pb.go index efd89552d0..2570d2bca0 100644 --- a/api/cometbft/crypto/v1beta1/proof.pb.go +++ b/api/cometbft/crypto/v1beta1/proof.pb.go @@ -206,7 +206,7 @@ func (m *DominoOp) GetOutput() string { } // ProofOp defines an operation used for calculating Merkle root -// The data could be arbitrary format, providing necessary data +// The data could be arbitrary format, providing nessecary data // for example neighbouring node hash type ProofOp struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` diff --git a/api/cometbft/services/block_results/v1beta1/block_results.pb.go b/api/cometbft/services/block_results/v1beta1/block_results.pb.go index 3ac94f7ca2..ecd8ce74ba 100644 --- a/api/cometbft/services/block_results/v1beta1/block_results.pb.go +++ b/api/cometbft/services/block_results/v1beta1/block_results.pb.go @@ -108,7 +108,7 @@ var xxx_messageInfo_GetLatestBlockResultsRequest proto.InternalMessageInfo type GetBlockResultsResponse struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - TxsResults []*v1beta3.ExecTxResult `protobuf:"bytes,2,rep,name=txs_results,json=txsResults,proto3" json:"txs_results,omitempty"` + TxResults []*v1beta3.ExecTxResult `protobuf:"bytes,2,rep,name=tx_results,json=txResults,proto3" json:"tx_results,omitempty"` FinalizeBlockEvents []*v1beta2.Event `protobuf:"bytes,3,rep,name=finalize_block_events,json=finalizeBlockEvents,proto3" json:"finalize_block_events,omitempty"` ValidatorUpdates []*v1beta1.ValidatorUpdate `protobuf:"bytes,4,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates,omitempty"` ConsensusParamUpdates *v1beta31.ConsensusParams `protobuf:"bytes,5,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` @@ -155,9 +155,9 @@ func (m *GetBlockResultsResponse) GetHeight() int64 { return 0 } -func (m *GetBlockResultsResponse) GetTxsResults() []*v1beta3.ExecTxResult { +func (m *GetBlockResultsResponse) GetTxResults() []*v1beta3.ExecTxResult { if m != nil { - return m.TxsResults + return m.TxResults } return nil } @@ -190,10 +190,95 @@ func (m *GetBlockResultsResponse) GetAppHash() []byte { return nil } +type GetLatestBlockResultsResponse struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + TxResults []*v1beta3.ExecTxResult `protobuf:"bytes,2,rep,name=tx_results,json=txResults,proto3" json:"tx_results,omitempty"` + FinalizeBlockEvents []*v1beta2.Event `protobuf:"bytes,3,rep,name=finalize_block_events,json=finalizeBlockEvents,proto3" json:"finalize_block_events,omitempty"` + ValidatorUpdates []*v1beta1.ValidatorUpdate `protobuf:"bytes,4,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates,omitempty"` + ConsensusParamUpdates *v1beta31.ConsensusParams `protobuf:"bytes,5,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` + AppHash []byte `protobuf:"bytes,6,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +func (m *GetLatestBlockResultsResponse) Reset() { *m = GetLatestBlockResultsResponse{} } +func (m *GetLatestBlockResultsResponse) String() string { return proto.CompactTextString(m) } +func (*GetLatestBlockResultsResponse) ProtoMessage() {} +func (*GetLatestBlockResultsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12a641024ad7106e, []int{3} +} +func (m *GetLatestBlockResultsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetLatestBlockResultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetLatestBlockResultsResponse.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 *GetLatestBlockResultsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestBlockResultsResponse.Merge(m, src) +} +func (m *GetLatestBlockResultsResponse) XXX_Size() int { + return m.Size() +} +func (m *GetLatestBlockResultsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestBlockResultsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestBlockResultsResponse proto.InternalMessageInfo + +func (m *GetLatestBlockResultsResponse) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *GetLatestBlockResultsResponse) GetTxResults() []*v1beta3.ExecTxResult { + if m != nil { + return m.TxResults + } + return nil +} + +func (m *GetLatestBlockResultsResponse) GetFinalizeBlockEvents() []*v1beta2.Event { + if m != nil { + return m.FinalizeBlockEvents + } + return nil +} + +func (m *GetLatestBlockResultsResponse) GetValidatorUpdates() []*v1beta1.ValidatorUpdate { + if m != nil { + return m.ValidatorUpdates + } + return nil +} + +func (m *GetLatestBlockResultsResponse) GetConsensusParamUpdates() *v1beta31.ConsensusParams { + if m != nil { + return m.ConsensusParamUpdates + } + return nil +} + +func (m *GetLatestBlockResultsResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + func init() { proto.RegisterType((*GetBlockResultsRequest)(nil), "cometbft.services.block_results.v1beta1.GetBlockResultsRequest") proto.RegisterType((*GetLatestBlockResultsRequest)(nil), "cometbft.services.block_results.v1beta1.GetLatestBlockResultsRequest") proto.RegisterType((*GetBlockResultsResponse)(nil), "cometbft.services.block_results.v1beta1.GetBlockResultsResponse") + proto.RegisterType((*GetLatestBlockResultsResponse)(nil), "cometbft.services.block_results.v1beta1.GetLatestBlockResultsResponse") } func init() { @@ -201,34 +286,35 @@ func init() { } var fileDescriptor_12a641024ad7106e = []byte{ - // 428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xbf, 0x6e, 0xd4, 0x40, - 0x10, 0xc6, 0xcf, 0x1c, 0x1c, 0x68, 0x8f, 0x02, 0x8c, 0x92, 0x18, 0x14, 0x59, 0xc7, 0x45, 0x22, - 0x57, 0xd9, 0xdc, 0x5d, 0x49, 0x17, 0x88, 0x92, 0x82, 0x22, 0x5a, 0xfe, 0x14, 0x34, 0xd6, 0xda, - 0x99, 0xc4, 0x2b, 0x1c, 0x7b, 0xf1, 0x8c, 0x2d, 0xc3, 0x53, 0x50, 0xf3, 0x44, 0x94, 0x29, 0x29, - 0xd1, 0xdd, 0x8b, 0x20, 0xaf, 0xbd, 0x8e, 0x2c, 0x8c, 0x48, 0xe9, 0xd1, 0xf7, 0xfd, 0x66, 0xe7, - 0x9b, 0x31, 0x7b, 0x15, 0x65, 0x57, 0x40, 0xe1, 0x05, 0xf9, 0x08, 0x79, 0x29, 0x23, 0x40, 0x3f, - 0x4c, 0xb2, 0xe8, 0x73, 0x90, 0x03, 0x16, 0x09, 0xa1, 0x5f, 0x2e, 0x43, 0x20, 0xb1, 0xec, 0x57, - 0x3d, 0x95, 0x67, 0x94, 0xd9, 0x87, 0xc6, 0xec, 0x19, 0xb3, 0xd7, 0x97, 0xb5, 0xe6, 0x67, 0xcf, - 0xbb, 0x2e, 0x22, 0x8c, 0x64, 0xc7, 0xa4, 0xaf, 0x0a, 0x5a, 0xd6, 0xb0, 0x64, 0xf5, 0x7f, 0xc9, - 0xba, 0x27, 0x39, 0xe8, 0x24, 0xba, 0xda, 0x69, 0x94, 0xc8, 0xc5, 0x55, 0x2b, 0x9a, 0xbf, 0x64, - 0xbb, 0x27, 0x40, 0x47, 0xf5, 0x4b, 0x79, 0xf3, 0x50, 0x0e, 0x5f, 0x0a, 0x40, 0xb2, 0x77, 0xd9, - 0x24, 0x06, 0x79, 0x19, 0x93, 0x63, 0xcd, 0xac, 0xc5, 0x98, 0xb7, 0x5f, 0x73, 0x97, 0xed, 0x9f, - 0x00, 0xbd, 0x15, 0x04, 0x38, 0xe4, 0x9b, 0xff, 0x18, 0xb3, 0xbd, 0xbf, 0x90, 0xa8, 0xb2, 0x14, - 0xe1, 0x5f, 0x4c, 0xfb, 0x0d, 0x9b, 0x52, 0x85, 0x26, 0x2a, 0xe7, 0xce, 0x6c, 0xbc, 0x98, 0xae, - 0x0e, 0xbc, 0x2e, 0xd2, 0x7a, 0xc6, 0x36, 0xc0, 0xb5, 0x77, 0x5c, 0x41, 0xf4, 0xbe, 0x6a, 0xd0, - 0x9c, 0x51, 0x85, 0x6d, 0x17, 0xfb, 0x8c, 0xed, 0x5c, 0xc8, 0x54, 0x24, 0xf2, 0x1b, 0x04, 0x4d, - 0xf6, 0x50, 0x42, 0x4a, 0xe8, 0x8c, 0x35, 0x6f, 0x7f, 0x90, 0xb7, 0xf2, 0x8e, 0x6b, 0x11, 0x7f, - 0x62, 0xac, 0xfa, 0xe1, 0xba, 0x86, 0xf6, 0x3b, 0xf6, 0xb8, 0x14, 0x89, 0x3c, 0x17, 0x94, 0xe5, - 0x41, 0xa1, 0xce, 0xeb, 0xa1, 0x9d, 0xbb, 0x9a, 0xf6, 0x62, 0x90, 0xb6, 0xf4, 0x3e, 0x1a, 0xfd, - 0x07, 0x2d, 0xe7, 0x8f, 0xca, 0x7e, 0x01, 0xed, 0x80, 0xed, 0x45, 0x75, 0x1a, 0x29, 0x16, 0x18, - 0xe8, 0x65, 0x74, 0xe8, 0x7b, 0x33, 0x6b, 0x31, 0x5d, 0x1d, 0xde, 0xa0, 0x9b, 0x7d, 0x9a, 0xc9, - 0x5f, 0x1b, 0xdb, 0x99, 0x5e, 0x21, 0xdf, 0x89, 0x7a, 0x05, 0xd3, 0xe0, 0x29, 0x7b, 0x20, 0x94, - 0x0a, 0x62, 0x81, 0xb1, 0x33, 0x99, 0x59, 0x8b, 0x87, 0xfc, 0xbe, 0x50, 0xea, 0x54, 0x60, 0x7c, - 0x14, 0xfe, 0xdc, 0xb8, 0xd6, 0xf5, 0xc6, 0xb5, 0x7e, 0x6f, 0x5c, 0xeb, 0xfb, 0xd6, 0x1d, 0x5d, - 0x6f, 0xdd, 0xd1, 0xaf, 0xad, 0x3b, 0xfa, 0x74, 0x7a, 0x29, 0x29, 0x2e, 0xc2, 0xba, 0xb5, 0xdf, - 0x1d, 0xce, 0xcd, 0x91, 0x29, 0xe9, 0xdf, 0xf2, 0xef, 0x08, 0x27, 0xfa, 0xb2, 0xd6, 0x7f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x0e, 0xd8, 0x93, 0x1d, 0x4f, 0x03, 0x00, 0x00, + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0xbf, 0x6e, 0xd4, 0x40, + 0x10, 0xc6, 0xcf, 0x18, 0x0e, 0xd8, 0x50, 0x80, 0x51, 0x12, 0x83, 0x82, 0x75, 0x5c, 0x24, 0x72, + 0x95, 0xcd, 0xdd, 0x95, 0x74, 0x87, 0xa2, 0xa4, 0xa0, 0x88, 0x96, 0x3f, 0x05, 0x8d, 0xb5, 0x76, + 0x26, 0xf1, 0x8a, 0x8b, 0xbd, 0x78, 0xc6, 0xd6, 0xc1, 0x53, 0x50, 0x52, 0xf1, 0x3c, 0x94, 0x29, + 0x29, 0xd1, 0xdd, 0x8b, 0x20, 0xaf, 0xbd, 0x8e, 0x2c, 0x1c, 0x41, 0x49, 0x41, 0x67, 0x8f, 0xbe, + 0xef, 0xb7, 0x33, 0xf3, 0x69, 0x97, 0xbd, 0x88, 0xb3, 0x0b, 0xa0, 0xe8, 0x8c, 0x02, 0x84, 0xbc, + 0x94, 0x31, 0x60, 0x10, 0x2d, 0xb3, 0xf8, 0x43, 0x98, 0x03, 0x16, 0x4b, 0xc2, 0xa0, 0x9c, 0x46, + 0x40, 0x62, 0xda, 0xad, 0xfa, 0x2a, 0xcf, 0x28, 0x73, 0x0e, 0x8c, 0xd9, 0x37, 0x66, 0xbf, 0x2b, + 0x6b, 0xcc, 0x8f, 0x9f, 0xb6, 0xa7, 0x88, 0x28, 0x96, 0x2d, 0x93, 0x3e, 0x29, 0x68, 0x58, 0xfd, + 0x92, 0xd9, 0x9f, 0x25, 0xf3, 0x8e, 0x64, 0xbf, 0x95, 0xe8, 0x6a, 0xab, 0x51, 0x22, 0x17, 0x17, + 0x8d, 0x68, 0xfc, 0x9c, 0xed, 0x1c, 0x01, 0x2d, 0xaa, 0x4e, 0x79, 0xdd, 0x28, 0x87, 0x8f, 0x05, + 0x20, 0x39, 0x3b, 0x6c, 0x98, 0x80, 0x3c, 0x4f, 0xc8, 0xb5, 0x46, 0xd6, 0xc4, 0xe6, 0xcd, 0xdf, + 0xd8, 0x63, 0x7b, 0x47, 0x40, 0xaf, 0x04, 0x01, 0xf6, 0xf9, 0xc6, 0x5f, 0x6d, 0xb6, 0xfb, 0x1b, + 0x12, 0x55, 0x96, 0x22, 0x5c, 0xc7, 0x74, 0x16, 0x8c, 0xd1, 0xca, 0x6c, 0xca, 0xbd, 0x31, 0xb2, + 0x27, 0x5b, 0xb3, 0x7d, 0xbf, 0xdd, 0x68, 0x35, 0x62, 0xb3, 0xbf, 0xb9, 0x7f, 0xb8, 0x82, 0xf8, + 0xcd, 0xaa, 0x26, 0xf3, 0xbb, 0xd4, 0x7c, 0xa1, 0x73, 0xc2, 0xb6, 0xcf, 0x64, 0x2a, 0x96, 0xf2, + 0x33, 0x84, 0xf5, 0xe6, 0xa1, 0x84, 0x94, 0xd0, 0xb5, 0x35, 0x6e, 0xaf, 0x17, 0x37, 0xf3, 0x0f, + 0x2b, 0x11, 0x7f, 0x68, 0xac, 0xba, 0x6d, 0x5d, 0x43, 0xe7, 0x35, 0x7b, 0x50, 0x8a, 0xa5, 0x3c, + 0x15, 0x94, 0xe5, 0x61, 0xa1, 0x4e, 0xab, 0x91, 0xdd, 0x9b, 0x9a, 0xf6, 0xac, 0x97, 0x36, 0xf5, + 0xdf, 0x19, 0xfd, 0x5b, 0x2d, 0xe7, 0xf7, 0xcb, 0x6e, 0x01, 0x9d, 0x90, 0xed, 0xc6, 0xd5, 0x2e, + 0x52, 0x2c, 0x30, 0xd4, 0x51, 0xb4, 0xe8, 0x5b, 0x23, 0x6b, 0xb2, 0x35, 0x3b, 0xb8, 0x42, 0xd7, + 0x69, 0x9a, 0xc1, 0x5f, 0x1a, 0xdb, 0x89, 0x0e, 0x90, 0x6f, 0xc7, 0x9d, 0x82, 0x39, 0xe0, 0x11, + 0xbb, 0x23, 0x94, 0x0a, 0x13, 0x81, 0x89, 0x3b, 0x1c, 0x59, 0x93, 0x7b, 0xfc, 0xb6, 0x50, 0xea, + 0x58, 0x60, 0x32, 0xfe, 0x66, 0xb3, 0x27, 0xd7, 0x64, 0xf7, 0x3f, 0xa0, 0x7f, 0x20, 0xa0, 0x45, + 0xf4, 0x7d, 0xed, 0x59, 0x97, 0x6b, 0xcf, 0xfa, 0xb9, 0xf6, 0xac, 0x2f, 0x1b, 0x6f, 0x70, 0xb9, + 0xf1, 0x06, 0x3f, 0x36, 0xde, 0xe0, 0xfd, 0xf1, 0xb9, 0xa4, 0xa4, 0x88, 0xaa, 0xa3, 0x83, 0xf6, + 0x5e, 0x5f, 0xbd, 0x01, 0x4a, 0x06, 0x7f, 0xf9, 0x78, 0x45, 0x43, 0x7d, 0xf1, 0xe7, 0xbf, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xc3, 0xe2, 0x59, 0xb2, 0xee, 0x04, 0x00, 0x00, } func (m *GetBlockResultsRequest) Marshal() (dAtA []byte, err error) { @@ -349,10 +435,99 @@ func (m *GetBlockResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0x1a } } - if len(m.TxsResults) > 0 { - for iNdEx := len(m.TxsResults) - 1; iNdEx >= 0; iNdEx-- { + if len(m.TxResults) > 0 { + for iNdEx := len(m.TxResults) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxsResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TxResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBlockResults(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Height != 0 { + i = encodeVarintBlockResults(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetLatestBlockResultsResponse) 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 *GetLatestBlockResultsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatestBlockResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintBlockResults(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x32 + } + if m.ConsensusParamUpdates != nil { + { + size, err := m.ConsensusParamUpdates.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBlockResults(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ValidatorUpdates) > 0 { + for iNdEx := len(m.ValidatorUpdates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBlockResults(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.FinalizeBlockEvents) > 0 { + for iNdEx := len(m.FinalizeBlockEvents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FinalizeBlockEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBlockResults(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.TxResults) > 0 { + for iNdEx := len(m.TxResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TxResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -412,8 +587,46 @@ func (m *GetBlockResultsResponse) Size() (n int) { if m.Height != 0 { n += 1 + sovBlockResults(uint64(m.Height)) } - if len(m.TxsResults) > 0 { - for _, e := range m.TxsResults { + if len(m.TxResults) > 0 { + for _, e := range m.TxResults { + l = e.Size() + n += 1 + l + sovBlockResults(uint64(l)) + } + } + if len(m.FinalizeBlockEvents) > 0 { + for _, e := range m.FinalizeBlockEvents { + l = e.Size() + n += 1 + l + sovBlockResults(uint64(l)) + } + } + if len(m.ValidatorUpdates) > 0 { + for _, e := range m.ValidatorUpdates { + l = e.Size() + n += 1 + l + sovBlockResults(uint64(l)) + } + } + if m.ConsensusParamUpdates != nil { + l = m.ConsensusParamUpdates.Size() + n += 1 + l + sovBlockResults(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovBlockResults(uint64(l)) + } + return n +} + +func (m *GetLatestBlockResultsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovBlockResults(uint64(m.Height)) + } + if len(m.TxResults) > 0 { + for _, e := range m.TxResults { l = e.Size() n += 1 + l + sovBlockResults(uint64(l)) } @@ -616,7 +829,248 @@ func (m *GetBlockResultsResponse) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxsResults", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TxResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockResults + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlockResults + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBlockResults + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxResults = append(m.TxResults, &v1beta3.ExecTxResult{}) + if err := m.TxResults[len(m.TxResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlockEvents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockResults + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlockResults + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBlockResults + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizeBlockEvents = append(m.FinalizeBlockEvents, &v1beta2.Event{}) + if err := m.FinalizeBlockEvents[len(m.FinalizeBlockEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockResults + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlockResults + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBlockResults + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorUpdates = append(m.ValidatorUpdates, &v1beta1.ValidatorUpdate{}) + if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParamUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockResults + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlockResults + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBlockResults + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusParamUpdates == nil { + m.ConsensusParamUpdates = &v1beta31.ConsensusParams{} + } + if err := m.ConsensusParamUpdates.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockResults + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlockResults + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthBlockResults + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlockResults(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlockResults + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetLatestBlockResultsResponse) 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 ErrIntOverflowBlockResults + } + 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: GetLatestBlockResultsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetLatestBlockResultsResponse: 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 ErrIntOverflowBlockResults + } + 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 TxResults", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -643,8 +1097,8 @@ func (m *GetBlockResultsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TxsResults = append(m.TxsResults, &v1beta3.ExecTxResult{}) - if err := m.TxsResults[len(m.TxsResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TxResults = append(m.TxResults, &v1beta3.ExecTxResult{}) + if err := m.TxResults[len(m.TxResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/api/cometbft/services/block_results/v1beta1/block_results_service.pb.go b/api/cometbft/services/block_results/v1beta1/block_results_service.pb.go index 9637470506..f31a1483a3 100644 --- a/api/cometbft/services/block_results/v1beta1/block_results_service.pb.go +++ b/api/cometbft/services/block_results/v1beta1/block_results_service.pb.go @@ -30,22 +30,22 @@ func init() { } var fileDescriptor_a4571c8aaff4088b = []byte{ - // 225 bytes of a gzipped FileDescriptorProto + // 231 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4e, 0xce, 0xcf, 0x4d, 0x2d, 0x49, 0x4a, 0x2b, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x8e, 0x2f, 0x4a, 0x2d, 0x2e, 0xcd, 0x29, 0x29, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x15, 0x8d, 0x87, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x87, 0x19, 0xa2, 0x07, 0x33, 0x44, 0x0f, 0x45, 0xb9, 0x1e, 0xd4, 0x10, 0x29, 0x6b, 0xb2, 0x6c, - 0x83, 0xd8, 0x62, 0x74, 0x9e, 0x89, 0x4b, 0xd8, 0x09, 0x24, 0x1e, 0x04, 0x11, 0x0e, 0x86, 0x18, + 0x83, 0xd8, 0x62, 0x74, 0x95, 0x89, 0x4b, 0xd8, 0x09, 0x24, 0x1e, 0x04, 0x11, 0x0e, 0x86, 0x18, 0x21, 0x34, 0x85, 0x91, 0x8b, 0xdf, 0x3d, 0xb5, 0x04, 0x59, 0x4a, 0xc8, 0x5e, 0x8f, 0x48, 0x27, 0xe9, 0xa1, 0xe9, 0x0c, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x91, 0x72, 0x20, 0xdf, 0x80, 0xe2, - 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa1, 0x05, 0x8c, 0x5c, 0xa2, 0xee, 0xa9, 0x25, 0x3e, 0x89, 0x25, - 0xa9, 0xc5, 0xa8, 0x8e, 0x73, 0x25, 0xc5, 0x6c, 0x4c, 0xfd, 0x54, 0x73, 0xa2, 0x53, 0xd2, 0x89, - 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x79, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, - 0x81, 0x6c, 0xd0, 0x87, 0xc7, 0x19, 0x9c, 0x91, 0x58, 0x90, 0xa9, 0x4f, 0x64, 0x4c, 0x26, 0xb1, - 0x81, 0x23, 0xcf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xb5, 0xba, 0x7e, 0x69, 0x02, 0x00, - 0x00, + 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa1, 0x65, 0x8c, 0x5c, 0xa2, 0xee, 0xa9, 0x25, 0x3e, 0x89, 0x25, + 0xa9, 0xc5, 0xa8, 0x8e, 0x73, 0x25, 0xc5, 0x6c, 0x4c, 0xfd, 0x30, 0x27, 0xba, 0x51, 0x6a, 0x0c, + 0xc4, 0xa1, 0x4e, 0x49, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, + 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xe5, 0x91, + 0x9e, 0x59, 0x92, 0x51, 0x9a, 0x04, 0xb2, 0x47, 0x1f, 0x1e, 0x73, 0x70, 0x46, 0x62, 0x41, 0xa6, + 0x3e, 0x91, 0xf1, 0x99, 0xc4, 0x06, 0x8e, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, + 0x70, 0x07, 0x09, 0x6f, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -63,7 +63,7 @@ type BlockResultsServiceClient interface { // GetBlockResults returns the BlockResults of the requested height. GetBlockResults(ctx context.Context, in *GetBlockResultsRequest, opts ...grpc.CallOption) (*GetBlockResultsResponse, error) // GetLatestBlockResults returns the BlockResults of the latest committed height. - GetLatestBlockResults(ctx context.Context, in *GetLatestBlockResultsRequest, opts ...grpc.CallOption) (*GetBlockResultsResponse, error) + GetLatestBlockResults(ctx context.Context, in *GetLatestBlockResultsRequest, opts ...grpc.CallOption) (*GetLatestBlockResultsResponse, error) } type blockResultsServiceClient struct { @@ -83,8 +83,8 @@ func (c *blockResultsServiceClient) GetBlockResults(ctx context.Context, in *Get return out, nil } -func (c *blockResultsServiceClient) GetLatestBlockResults(ctx context.Context, in *GetLatestBlockResultsRequest, opts ...grpc.CallOption) (*GetBlockResultsResponse, error) { - out := new(GetBlockResultsResponse) +func (c *blockResultsServiceClient) GetLatestBlockResults(ctx context.Context, in *GetLatestBlockResultsRequest, opts ...grpc.CallOption) (*GetLatestBlockResultsResponse, error) { + out := new(GetLatestBlockResultsResponse) err := c.cc.Invoke(ctx, "/cometbft.services.block_results.v1beta1.BlockResultsService/GetLatestBlockResults", in, out, opts...) if err != nil { return nil, err @@ -97,7 +97,7 @@ type BlockResultsServiceServer interface { // GetBlockResults returns the BlockResults of the requested height. GetBlockResults(context.Context, *GetBlockResultsRequest) (*GetBlockResultsResponse, error) // GetLatestBlockResults returns the BlockResults of the latest committed height. - GetLatestBlockResults(context.Context, *GetLatestBlockResultsRequest) (*GetBlockResultsResponse, error) + GetLatestBlockResults(context.Context, *GetLatestBlockResultsRequest) (*GetLatestBlockResultsResponse, error) } // UnimplementedBlockResultsServiceServer can be embedded to have forward compatible implementations. @@ -107,7 +107,7 @@ type UnimplementedBlockResultsServiceServer struct { func (*UnimplementedBlockResultsServiceServer) GetBlockResults(ctx context.Context, req *GetBlockResultsRequest) (*GetBlockResultsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlockResults not implemented") } -func (*UnimplementedBlockResultsServiceServer) GetLatestBlockResults(ctx context.Context, req *GetLatestBlockResultsRequest) (*GetBlockResultsResponse, error) { +func (*UnimplementedBlockResultsServiceServer) GetLatestBlockResults(ctx context.Context, req *GetLatestBlockResultsRequest) (*GetLatestBlockResultsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestBlockResults not implemented") } diff --git a/api/cometbft/state/types.go b/api/cometbft/state/types.go index 8e06042dbd..6d9a199fa6 100644 --- a/api/cometbft/state/types.go +++ b/api/cometbft/state/types.go @@ -3,10 +3,11 @@ package state import ( "github.com/cometbft/cometbft/api/cometbft/state/v1beta1" "github.com/cometbft/cometbft/api/cometbft/state/v1beta3" + "github.com/cometbft/cometbft/api/cometbft/state/v1beta4" ) type ( - ABCIResponsesInfo = v1beta3.ABCIResponsesInfo + ABCIResponsesInfo = v1beta4.ABCIResponsesInfo ConsensusParamsInfo = v1beta3.ConsensusParamsInfo LegacyABCIResponses = v1beta3.LegacyABCIResponses ResponseBeginBlock = v1beta3.ResponseBeginBlock diff --git a/api/cometbft/state/v1beta4/types.pb.go b/api/cometbft/state/v1beta4/types.pb.go new file mode 100644 index 0000000000..bf1d554385 --- /dev/null +++ b/api/cometbft/state/v1beta4/types.pb.go @@ -0,0 +1,430 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cometbft/state/v1beta4/types.proto + +package v1beta4 + +import ( + fmt "fmt" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta3 "github.com/cometbft/cometbft/api/cometbft/state/v1beta3" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ABCIResponsesInfo struct { + // Retains the responses of the legacy ABCI calls during block processing. + LegacyAbciResponses *v1beta3.LegacyABCIResponses `protobuf:"bytes,1,opt,name=legacy_abci_responses,json=legacyAbciResponses,proto3" json:"legacy_abci_responses,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + FinalizeBlock *v1beta4.FinalizeBlockResponse `protobuf:"bytes,3,opt,name=finalize_block,json=finalizeBlock,proto3" json:"finalize_block,omitempty"` +} + +func (m *ABCIResponsesInfo) Reset() { *m = ABCIResponsesInfo{} } +func (m *ABCIResponsesInfo) String() string { return proto.CompactTextString(m) } +func (*ABCIResponsesInfo) ProtoMessage() {} +func (*ABCIResponsesInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7bf3b618853be1fa, []int{0} +} +func (m *ABCIResponsesInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ABCIResponsesInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ABCIResponsesInfo.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 *ABCIResponsesInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABCIResponsesInfo.Merge(m, src) +} +func (m *ABCIResponsesInfo) XXX_Size() int { + return m.Size() +} +func (m *ABCIResponsesInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ABCIResponsesInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ABCIResponsesInfo proto.InternalMessageInfo + +func (m *ABCIResponsesInfo) GetLegacyAbciResponses() *v1beta3.LegacyABCIResponses { + if m != nil { + return m.LegacyAbciResponses + } + return nil +} + +func (m *ABCIResponsesInfo) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *ABCIResponsesInfo) GetFinalizeBlock() *v1beta4.FinalizeBlockResponse { + if m != nil { + return m.FinalizeBlock + } + return nil +} + +func init() { + proto.RegisterType((*ABCIResponsesInfo)(nil), "cometbft.state.v1beta4.ABCIResponsesInfo") +} + +func init() { + proto.RegisterFile("cometbft/state/v1beta4/types.proto", fileDescriptor_7bf3b618853be1fa) +} + +var fileDescriptor_7bf3b618853be1fa = []byte{ + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, + 0x2d, 0x49, 0x4a, 0x2b, 0xd1, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x83, 0xa9, 0xd1, 0x03, 0xab, 0xd1, 0x83, 0xaa, 0x91, 0x52, 0x84, 0xeb, 0x4d, 0x4c, 0x4a, 0xce, + 0xc4, 0xa6, 0x55, 0x0a, 0xbb, 0xf1, 0xc6, 0xc8, 0x6a, 0x94, 0x1e, 0x32, 0x72, 0x09, 0x3a, 0x3a, + 0x39, 0x7b, 0x06, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x16, 0x7b, 0xe6, 0xa5, 0xe5, 0x0b, + 0xc5, 0x73, 0x89, 0xe6, 0xa4, 0xa6, 0x27, 0x26, 0x57, 0xc6, 0x83, 0x0c, 0x8f, 0x2f, 0x82, 0x49, + 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x69, 0xeb, 0x61, 0x75, 0x94, 0xb1, 0x9e, 0x0f, 0x58, + 0x13, 0x8a, 0x79, 0x41, 0xc2, 0x10, 0x93, 0x1c, 0x93, 0x92, 0x33, 0xe1, 0x82, 0x42, 0x62, 0x5c, + 0x6c, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x50, 0x9e, + 0x50, 0x30, 0x17, 0x5f, 0x5a, 0x66, 0x5e, 0x62, 0x4e, 0x66, 0x55, 0x6a, 0x7c, 0x52, 0x4e, 0x7e, + 0x72, 0xb6, 0x04, 0x33, 0xd8, 0x46, 0x1d, 0x84, 0x8d, 0x20, 0x17, 0xc1, 0x42, 0x41, 0xcf, 0x0d, + 0xaa, 0xd8, 0x09, 0xa4, 0x16, 0x66, 0x7c, 0x10, 0x6f, 0x1a, 0xb2, 0xb0, 0x53, 0xe0, 0x89, 0x47, + 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, + 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0x81, + 0x0c, 0xd7, 0x87, 0x07, 0x16, 0x22, 0x60, 0x0b, 0x32, 0xf5, 0xb1, 0xc7, 0x50, 0x12, 0x1b, 0x38, + 0xf4, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0xb2, 0x4c, 0x85, 0xc2, 0x01, 0x00, 0x00, +} + +func (m *ABCIResponsesInfo) 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 *ABCIResponsesInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ABCIResponsesInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FinalizeBlock != nil { + { + size, err := m.FinalizeBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if m.LegacyAbciResponses != nil { + { + size, err := m.LegacyAbciResponses.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ABCIResponsesInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LegacyAbciResponses != nil { + l = m.LegacyAbciResponses.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + if m.FinalizeBlock != nil { + l = m.FinalizeBlock.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ABCIResponsesInfo) 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 ErrIntOverflowTypes + } + 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: ABCIResponsesInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ABCIResponsesInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LegacyAbciResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LegacyAbciResponses == nil { + m.LegacyAbciResponses = &v1beta3.LegacyABCIResponses{} + } + if err := m.LegacyAbciResponses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizeBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalizeBlock == nil { + m.FinalizeBlock = &v1beta4.FinalizeBlockResponse{} + } + if err := m.FinalizeBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/cmd/cometbft/commands/reindex_event_test.go b/cmd/cometbft/commands/reindex_event_test.go index 2fc684ef57..5f5c56ed39 100644 --- a/cmd/cometbft/commands/reindex_event_test.go +++ b/cmd/cometbft/commands/reindex_event_test.go @@ -139,7 +139,7 @@ func TestReIndexEvent(t *testing.T) { On("LoadBlock", base).Return(&types.Block{Data: types.Data{Txs: types.Txs{make(types.Tx, 1)}}}). On("LoadBlock", height).Return(&types.Block{Data: types.Data{Txs: types.Txs{make(types.Tx, 1)}}}) - abciResp := &abcitypes.ResponseFinalizeBlock{ + abciResp := &abcitypes.FinalizeBlockResponse{ TxResults: []*abcitypes.ExecTxResult{ {Code: 1}, }, diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 22726a24b5..32e3de4474 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -60,7 +60,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0o700) // dir for wal app := appFunc() vals := types.TM2PB.ValidatorUpdates(state.Validators) - _, err := app.InitChain(context.Background(), &abci.RequestInitChain{Validators: vals}) + _, err := app.InitChain(context.Background(), &abci.InitChainRequest{Validators: vals}) require.NoError(t, err) blockDB := dbm.NewMemDB() diff --git a/consensus/common_test.go b/consensus/common_test.go index 77dd16117c..8121fbf9e1 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -144,7 +144,6 @@ func signVote(vs *validatorStub, voteType types.SignedMsgType, hash []byte, head } } v, err := vs.signVote(voteType, hash, header, ext, extEnabled) - if err != nil { panic(fmt.Errorf("failed to sign vote: %v", err)) } @@ -468,6 +467,7 @@ func randStateWithAppWithHeight( c.ABCI.VoteExtensionsEnableHeight = height return randStateWithAppImpl(nValidators, app, c) } + func randStateWithApp(nValidators int, app abci.Application) (*State, []*validatorStub) { c := test.ConsensusParams() return randStateWithAppImpl(nValidators, app, c) @@ -763,7 +763,8 @@ func consensusLogger() log.Logger { } func randConsensusNet(t *testing.T, nValidators int, testName string, tickerFunc func() TimeoutTicker, - appFunc func() abci.Application, configOpts ...func(*cfg.Config)) ([]*State, cleanupFunc) { + appFunc func() abci.Application, configOpts ...func(*cfg.Config), +) ([]*State, cleanupFunc) { t.Helper() genDoc, privVals := randGenesisDoc(nValidators, false, 30, nil) css := make([]*State, nValidators) @@ -783,7 +784,7 @@ func randConsensusNet(t *testing.T, nValidators int, testName string, tickerFunc ensureDir(filepath.Dir(thisConfig.Consensus.WalFile()), 0o700) // dir for wal app := appFunc() vals := types.TM2PB.ValidatorUpdates(state.Validators) - _, err := app.InitChain(context.Background(), &abci.RequestInitChain{Validators: vals}) + _, err := app.InitChain(context.Background(), &abci.InitChainRequest{Validators: vals}) require.NoError(t, err) css[i] = newStateWithConfigAndBlockStore(thisConfig, state, privVals[i], app, stateDB) @@ -847,7 +848,7 @@ func randConsensusNetWithPeers( // simulate handshake, receive app version. If don't do this, replay test will fail state.Version.Consensus.App = kvstore.AppVersion } - _, err := app.InitChain(context.Background(), &abci.RequestInitChain{Validators: vals}) + _, err := app.InitChain(context.Background(), &abci.InitChainRequest{Validators: vals}) require.NoError(t, err) css[i] = newStateWithConfig(thisConfig, state, privVal, app) diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index fdf2376a44..50457ef9d7 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -31,7 +31,7 @@ func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) { config.Consensus.CreateEmptyBlocks = false state, privVals := randGenesisState(1, false, 10, nil) app := kvstore.NewInMemoryApplication() - resp, err := app.Info(context.Background(), proxy.RequestInfo) + resp, err := app.Info(context.Background(), proxy.InfoRequest) require.NoError(t, err) state.AppHash = resp.LastBlockAppHash cs := newStateWithConfig(config, state, privVals[0], app) @@ -55,7 +55,7 @@ func TestMempoolProgressAfterCreateEmptyBlocksInterval(t *testing.T) { config.Consensus.CreateEmptyBlocksInterval = ensureTimeout state, privVals := randGenesisState(1, false, 10, nil) app := kvstore.NewInMemoryApplication() - resp, err := app.Info(context.Background(), proxy.RequestInfo) + resp, err := app.Info(context.Background(), proxy.InfoRequest) require.NoError(t, err) state.AppHash = resp.LastBlockAppHash cs := newStateWithConfig(config, state, privVals[0], app) @@ -152,12 +152,12 @@ func TestMempoolRmBadTx(t *testing.T) { // increment the counter by 1 txBytes := kvstore.NewTx("key", "value") - res, err := app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Txs: [][]byte{txBytes}}) + res, err := app.FinalizeBlock(context.Background(), &abci.FinalizeBlockRequest{Txs: [][]byte{txBytes}}) require.NoError(t, err) assert.False(t, res.TxResults[0].IsErr()) assert.True(t, len(res.AppHash) > 0) - _, err = app.Commit(context.Background(), &abci.RequestCommit{}) + _, err = app.Commit(context.Background(), &abci.CommitRequest{}) require.NoError(t, err) emptyMempoolCh := make(chan struct{}) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 5a3b73b63b..29aea75add 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -145,7 +145,7 @@ func TestReactorWithEvidence(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0o700) // dir for wal app := appFunc() vals := types.TM2PB.ValidatorUpdates(state.Validators) - _, err := app.InitChain(context.Background(), &abci.RequestInitChain{Validators: vals}) + _, err := app.InitChain(context.Background(), &abci.InitChainRequest{Validators: vals}) require.NoError(t, err) pv := privVals[i] diff --git a/consensus/replay.go b/consensus/replay.go index ef94cf51ea..9732589b4e 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -92,7 +92,6 @@ func (cs *State) readReplayMessage(msg *TimedWALMessage, newStepSub types.Subscr // Replay only those messages since the last block. `timeoutRoutine` should // run concurrently to read off tickChan. func (cs *State) catchupReplay(csHeight int64) error { - // Set replayMode to true so we don't log signing errors. cs.replayMode = true defer func() { cs.replayMode = false }() @@ -210,8 +209,8 @@ type Handshaker struct { } func NewHandshaker(stateStore sm.Store, state sm.State, - store sm.BlockStore, genDoc *types.GenesisDoc) *Handshaker { - + store sm.BlockStore, genDoc *types.GenesisDoc, +) *Handshaker { return &Handshaker{ stateStore: stateStore, initialState: state, @@ -240,9 +239,8 @@ func (h *Handshaker) NBlocks() int { // TODO: retry the handshake/replay if it fails ? func (h *Handshaker) Handshake(ctx context.Context, proxyApp proxy.AppConns) error { - // Handshake is done via ABCI Info on the query conn. - res, err := proxyApp.Query().Info(ctx, proxy.RequestInfo) + res, err := proxyApp.Query().Info(ctx, proxy.InfoRequest) if err != nil { return fmt.Errorf("error calling Info: %v", err) } @@ -310,7 +308,7 @@ func (h *Handshaker) ReplayBlocks( validatorSet := types.NewValidatorSet(validators) nextVals := types.TM2PB.ValidatorUpdates(validatorSet) pbparams := h.genDoc.ConsensusParams.ToProto() - req := &abci.RequestInitChain{ + req := &abci.InitChainRequest{ Time: h.genDoc.GenesisTime, ChainId: h.genDoc.ChainID, InitialHeight: h.genDoc.InitialHeight, @@ -393,13 +391,11 @@ func (h *Handshaker) ReplayBlocks( if appBlockHeight < storeBlockHeight { // the app is behind, so replay blocks, but no need to go through WAL (state is already synced to store) return h.replayBlocks(ctx, state, proxyApp, appBlockHeight, storeBlockHeight, false) - } else if appBlockHeight == storeBlockHeight { // We're good! assertAppHashEqualsOneFromState(appHash, state) return appHash, nil } - } else if storeBlockHeight == stateBlockHeight+1 { // We saved the block in the store but haven't updated the state, // so we'll need to replay a block using the WAL. @@ -436,7 +432,6 @@ func (h *Handshaker) ReplayBlocks( state, err = h.replayBlock(state, storeBlockHeight, mockApp) return state.AppHash, err } - } panic(fmt.Sprintf("uncovered case! appHeight: %d, storeHeight: %d, stateHeight: %d", @@ -449,7 +444,8 @@ func (h *Handshaker) replayBlocks( proxyApp proxy.AppConns, appBlockHeight, storeBlockHeight int64, - mutateState bool) ([]byte, error) { + mutateState bool, +) ([]byte, error) { // App is further behind than it should be, so we need to replay blocks. // We replay all blocks from appBlockHeight+1. // diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index 3f614a9437..aac35ed669 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -60,7 +60,7 @@ func (emptyMempool) CloseWAL() {} // Useful because we don't want to call Commit() twice for the same block on // the real app. -func newMockProxyApp(finalizeBlockResponse *abci.ResponseFinalizeBlock) proxy.AppConnConsensus { +func newMockProxyApp(finalizeBlockResponse *abci.FinalizeBlockResponse) proxy.AppConnConsensus { clientCreator := proxy.NewLocalClientCreator(&mockProxyApp{ finalizeBlockResponse: finalizeBlockResponse, }) @@ -74,9 +74,9 @@ func newMockProxyApp(finalizeBlockResponse *abci.ResponseFinalizeBlock) proxy.Ap type mockProxyApp struct { abci.BaseApplication - finalizeBlockResponse *abci.ResponseFinalizeBlock + finalizeBlockResponse *abci.FinalizeBlockResponse } -func (mock *mockProxyApp) FinalizeBlock(context.Context, *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { +func (mock *mockProxyApp) FinalizeBlock(context.Context, *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error) { return mock.finalizeBlockResponse, nil } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 73f936efa4..af006af998 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -734,7 +734,7 @@ func testHandshakeReplay(t *testing.T, config *cfg.Config, nBlocks int, mode uin require.NoError(t, err) // get the latest app hash from the app - res, err := proxyApp.Query().Info(context.Background(), proxy.RequestInfo) + res, err := proxyApp.Query().Info(context.Background(), proxy.InfoRequest) require.NoError(t, err) // block store and app height should be in sync @@ -789,7 +789,7 @@ func buildAppStateFromChain(t *testing.T, proxyApp proxy.AppConns, stateStore sm state.Version.Consensus.App = kvstore.AppVersion // simulate handshake, receive app version validators := types.TM2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChain(context.Background(), &abci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChain(context.Background(), &abci.InitChainRequest{ Validators: validators, }); err != nil { panic(err) @@ -846,7 +846,7 @@ func buildTMStateFromChain( state.Version.Consensus.App = kvstore.AppVersion // simulate handshake, receive app version validators := types.TM2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChain(context.Background(), &abci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChain(context.Background(), &abci.InitChainRequest{ Validators: validators, }); err != nil { panic(err) @@ -875,7 +875,7 @@ func buildTMStateFromChain( vals, _ := stateStore.LoadValidators(penultimateHeight) dummyStateStore.On("LoadValidators", penultimateHeight).Return(vals, nil) dummyStateStore.On("Save", mock.Anything).Return(nil) - dummyStateStore.On("SaveFinalizeBlockResponse", lastHeight, mock.MatchedBy(func(response *abci.ResponseFinalizeBlock) bool { + dummyStateStore.On("SaveFinalizeBlockResponse", lastHeight, mock.MatchedBy(func(response *abci.FinalizeBlockResponse) bool { require.NoError(t, stateStore.SaveFinalizeBlockResponse(lastHeight, response)) return true })).Return(nil) @@ -996,15 +996,15 @@ type badApp struct { onlyLastHashIsWrong bool } -func (app *badApp) FinalizeBlock(context.Context, *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { +func (app *badApp) FinalizeBlock(context.Context, *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error) { app.height++ if app.onlyLastHashIsWrong { if app.height == app.numBlocks { - return &abci.ResponseFinalizeBlock{AppHash: cmtrand.Bytes(8)}, nil + return &abci.FinalizeBlockResponse{AppHash: cmtrand.Bytes(8)}, nil } - return &abci.ResponseFinalizeBlock{AppHash: []byte{app.height}}, nil + return &abci.FinalizeBlockResponse{AppHash: []byte{app.height}}, nil } else if app.allHashesAreWrong { - return &abci.ResponseFinalizeBlock{AppHash: cmtrand.Bytes(8)}, nil + return &abci.FinalizeBlockResponse{AppHash: cmtrand.Bytes(8)}, nil } panic("either allHashesAreWrong or onlyLastHashIsWrong must be set") @@ -1242,10 +1242,10 @@ func TestHandshakeUpdatesValidators(t *testing.T) { val, _ := types.RandValidator(true, 10) vals := types.NewValidatorSet([]*types.Validator{val}) app := &mocks.Application{} - app.On("Info", mock.Anything, mock.Anything).Return(&abci.ResponseInfo{ + app.On("Info", mock.Anything, mock.Anything).Return(&abci.InfoResponse{ LastBlockHeight: 0, }, nil) - app.On("InitChain", mock.Anything, mock.Anything).Return(&abci.ResponseInitChain{ + app.On("InitChain", mock.Anything, mock.Anything).Return(&abci.InitChainResponse{ Validators: types.TM2PB.ValidatorUpdates(vals), }, nil) clientCreator := proxy.NewLocalClientCreator(app) diff --git a/consensus/state_test.go b/consensus/state_test.go index 4a36017581..d9d3d7fae6 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -1993,8 +1993,8 @@ func TestProcessProposalAccept(t *testing.T) { if testCase.accept { status = abci.PROCESS_PROPOSAL_STATUS_ACCEPT } - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{Status: status}, nil) - m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil).Maybe() + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{Status: status}, nil) + m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil).Maybe() cs1, _ := randStateWithApp(4, m) height, round := cs1.Height, cs1.Round @@ -2037,18 +2037,18 @@ func TestExtendVoteCalledWhenEnabled(t *testing.T) { } { t.Run(testCase.name, func(t *testing.T) { m := abcimocks.NewApplication(t) - m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) + m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil) + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) if testCase.enabled { - m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ResponseExtendVote{ + m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ExtendVoteResponse{ VoteExtension: []byte("extension"), }, nil) - m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{ + m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil) } - m.On("Commit", mock.Anything, mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() - m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.ResponseFinalizeBlock{}, nil).Maybe() + m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe() + m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.FinalizeBlockResponse{}, nil).Maybe() height := int64(1) if !testCase.enabled { height = 0 @@ -2082,7 +2082,7 @@ func TestExtendVoteCalledWhenEnabled(t *testing.T) { ensurePrecommit(voteCh, height, round) if testCase.enabled { - m.AssertCalled(t, "ExtendVote", context.TODO(), &abci.RequestExtendVote{ + m.AssertCalled(t, "ExtendVote", context.TODO(), &abci.ExtendVoteRequest{ Height: height, Hash: blockID.Hash, Time: rs.ProposalBlock.Time, @@ -2107,7 +2107,7 @@ func TestExtendVoteCalledWhenEnabled(t *testing.T) { require.NoError(t, err) addr := pv.Address() if testCase.enabled { - m.AssertCalled(t, "VerifyVoteExtension", context.TODO(), &abci.RequestVerifyVoteExtension{ + m.AssertCalled(t, "VerifyVoteExtension", context.TODO(), &abci.VerifyVoteExtensionRequest{ Hash: blockID.Hash, ValidatorAddress: addr, Height: height, @@ -2125,16 +2125,16 @@ func TestExtendVoteCalledWhenEnabled(t *testing.T) { // method is not called for a validator's vote that is never delivered. func TestVerifyVoteExtensionNotCalledOnAbsentPrecommit(t *testing.T) { m := abcimocks.NewApplication(t) - m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) - m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ResponseExtendVote{ + m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil) + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) + m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ExtendVoteResponse{ VoteExtension: []byte("extension"), }, nil) - m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{ + m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil) - m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.ResponseFinalizeBlock{}, nil).Maybe() - m.On("Commit", mock.Anything, mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() + m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.FinalizeBlockResponse{}, nil).Maybe() + m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe() cs1, vss := randStateWithApp(4, m) height, round := cs1.Height, cs1.Round cs1.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = cs1.Height @@ -2160,7 +2160,7 @@ func TestVerifyVoteExtensionNotCalledOnAbsentPrecommit(t *testing.T) { ensurePrecommit(voteCh, height, round) - m.AssertCalled(t, "ExtendVote", context.TODO(), &abci.RequestExtendVote{ + m.AssertCalled(t, "ExtendVote", context.TODO(), &abci.ExtendVoteRequest{ Height: height, Hash: blockID.Hash, Time: rs.ProposalBlock.Time, @@ -2181,7 +2181,7 @@ func TestVerifyVoteExtensionNotCalledOnAbsentPrecommit(t *testing.T) { require.NoError(t, err) addr = pv.Address() - m.AssertNotCalled(t, "VerifyVoteExtension", context.TODO(), &abci.RequestVerifyVoteExtension{ + m.AssertNotCalled(t, "VerifyVoteExtension", context.TODO(), &abci.VerifyVoteExtensionRequest{ Hash: blockID.Hash, ValidatorAddress: addr, Height: height, @@ -2205,21 +2205,21 @@ func TestPrepareProposalReceivesVoteExtensions(t *testing.T) { } m := abcimocks.NewApplication(t) - m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ResponseExtendVote{ + m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ExtendVoteResponse{ VoteExtension: voteExtensions[0], }, nil) - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) // capture the prepare proposal request. - rpp := &abci.RequestPrepareProposal{} - m.On("PrepareProposal", mock.Anything, mock.MatchedBy(func(r *abci.RequestPrepareProposal) bool { + rpp := &abci.PrepareProposalRequest{} + m.On("PrepareProposal", mock.Anything, mock.MatchedBy(func(r *abci.PrepareProposalRequest) bool { rpp = r return true - })).Return(&abci.ResponsePrepareProposal{}, nil) + })).Return(&abci.PrepareProposalResponse{}, nil) - m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT}, nil) - m.On("Commit", mock.Anything, mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() - m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.ResponseFinalizeBlock{}, nil) + m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.VerifyVoteExtensionResponse{Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT}, nil) + m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe() + m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.FinalizeBlockResponse{}, nil) cs1, vss := randStateWithApp(4, m) height, round := cs1.Height, cs1.Round @@ -2307,21 +2307,21 @@ func TestFinalizeBlockCalled(t *testing.T) { } { t.Run(testCase.name, func(t *testing.T) { m := abcimocks.NewApplication(t) - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{ + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{ Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT, }, nil) - m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) + m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil) // We only expect VerifyVoteExtension to be called on non-nil precommits. // https://github.com/tendermint/tendermint/issues/8487 if !testCase.voteNil { - m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ResponseExtendVote{}, nil) - m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{ + m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ExtendVoteResponse{}, nil) + m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil) } - r := &abci.ResponseFinalizeBlock{AppHash: []byte("the_hash")} + r := &abci.FinalizeBlockResponse{AppHash: []byte("the_hash")} m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(r, nil).Maybe() - m.On("Commit", mock.Anything, mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() + m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe() cs1, vss := randStateWithApp(4, m) height, round := cs1.Height, cs1.Round @@ -2424,20 +2424,20 @@ func TestVoteExtensionEnableHeight(t *testing.T) { t.Run(testCase.name, func(t *testing.T) { numValidators := 3 m := abcimocks.NewApplication(t) - m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{ + m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{ Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT, }, nil) - m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) + m.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil) if testCase.expectExtendCalled { - m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ResponseExtendVote{}, nil) + m.On("ExtendVote", mock.Anything, mock.Anything).Return(&abci.ExtendVoteResponse{}, nil) } if testCase.expectVerifyCalled { - m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{ + m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil).Times(numValidators - 1) } - m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.ResponseFinalizeBlock{}, nil).Maybe() - m.On("Commit", mock.Anything, mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() + m.On("FinalizeBlock", mock.Anything, mock.Anything).Return(&abci.FinalizeBlockResponse{}, nil).Maybe() + m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe() cs1, vss := randStateWithAppWithHeight(numValidators, m, testCase.enableHeight) cs1.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testCase.enableHeight height, round := cs1.Height, cs1.Round diff --git a/docs/app-dev/indexing-transactions.md b/docs/app-dev/indexing-transactions.md index a2ca5a5b18..c6e33aa66b 100644 --- a/docs/app-dev/indexing-transactions.md +++ b/docs/app-dev/indexing-transactions.md @@ -5,8 +5,8 @@ order: 6 # Indexing Transactions CometBFT allows you to index transactions and blocks and later query or -subscribe to their results. Transactions are indexed by `ResponseFinalizeBlock.tx_results.events` and -blocks are indexed by `ResponseFinalizeBlock.events`. However, transactions +subscribe to their results. Transactions are indexed by `FinalizeBlockResponse.tx_results.events` and +blocks are indexed by `FinalizeBlockResponse.events`. However, transactions are also indexed by a primary key which includes the transaction hash and maps to and stores the corresponding transaction results. Blocks are indexed by a primary key which includes the block height and maps to and stores the block height, i.e. @@ -175,7 +175,7 @@ UTF-8 encoded strings (e.g. "transfer.sender": "Bob", "transfer.recipient": Example: ```go -func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { +func (app *Application) FinalizeBlock(_ context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { //... tx_results[0] := &types.ExecTxResult{ @@ -219,7 +219,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinal }, }, } - return &types.ResponseFinalizeBlock{TxResults: tx_results, Events: block_events} + return &types.FinalizeBlockResponse{TxResults: tx_results, Events: block_events} } ``` diff --git a/docs/guides/go-built-in.md b/docs/guides/go-built-in.md index 19e313e9f8..c3f1bcb8a0 100644 --- a/docs/guides/go-built-in.md +++ b/docs/guides/go-built-in.md @@ -114,7 +114,7 @@ go build CometBFT communicates with the application through the Application BlockChain Interface (ABCI). The messages exchanged through the interface are defined in the ABCI [protobuf -file](https://github.com/cometbft/cometbft/blob/main/proto/cometbft/abci/v3/types.proto). +file](https://github.com/cometbft/cometbft/blob/main/proto/cometbft/abci/v1beta4/types.proto). We begin by creating the basic scaffolding for an ABCI application by creating a new type, `KVStoreApplication`, which implements the @@ -137,60 +137,60 @@ func NewKVStoreApplication() *KVStoreApplication { return &KVStoreApplication{} } -func (app *KVStoreApplication) Info(_ context.Context, info *abcitypes.RequestInfo) (*abcitypes.ResponseInfo, error) { - return &abcitypes.ResponseInfo{}, nil +func (app *KVStoreApplication) Info(_ context.Context, info *abcitypes.InfoRequest) (*abcitypes.InfoResponse, error) { + return &abcitypes.InfoResponse{}, nil } -func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.RequestQuery) (*abcitypes.ResponseQuery, error) { - return &abcitypes.ResponseQuery{} +func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.QueryRequest) (*abcitypes.QueryResponse, error) { + return &abcitypes.QueryResponse{} } -func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { - return &abcitypes.ResponseCheckTx{}, nil +func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.CheckTxRequest) (*abcitypes.CheckTxResponse, error) { + return &abcitypes.CheckTxResponse{}, nil } -func (app *KVStoreApplication) InitChain(_ context.Context, chain *abcitypes.RequestInitChain) (*abcitypes.ResponseInitChain, error) { - return &abcitypes.ResponseInitChain{}, nil +func (app *KVStoreApplication) InitChain(_ context.Context, chain *abcitypes.InitChainRequest) (*abcitypes.InitChainResponse, error) { + return &abcitypes.InitChainResponse{}, nil } -func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.RequestPrepareProposal) (*abcitypes.ResponsePrepareProposal, error) { - return &abcitypes.ResponsePrepareProposal{}, nil +func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.PrepareProposalRequest) (*abcitypes.PrepareProposalResponse, error) { + return &abcitypes.PrepareProposalResponse{}, nil } -func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.RequestProcessProposal) (*abcitypes.ResponseProcessProposal, error) { - return &abcitypes.ResponseProcessProposal{}, nil +func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.ProcessProposalRequest) (*abcitypes.ProcessProposalResponse, error) { + return &abcitypes.ProcessProposalResponse{}, nil } -func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.RequestFinalizeBlock) (*abcitypes.ResponseFinalizeBlock, error) { - return &abcitypes.ResponseFinalizeBlock{}, nil +func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.FinalizeBlockRequest) (*abcitypes.FinalizeBlockResponse, error) { + return &abcitypes.FinalizeBlockResponse{}, nil } -func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.RequestCommit) (*abcitypes.ResponseCommit, error) { - return &abcitypes.ResponseCommit{}, nil +func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.CommitRequest) (*abcitypes.CommitResponse, error) { + return &abcitypes.CommitResponse{}, nil } -func (app *KVStoreApplication) ListSnapshots(_ context.Context, snapshots *abcitypes.RequestListSnapshots) (*abcitypes.ResponseListSnapshots, error) { - return &abcitypes.ResponseListSnapshots{}, nil +func (app *KVStoreApplication) ListSnapshots(_ context.Context, snapshots *abcitypes.ListSnapshotsRequest) (*abcitypes.ListSnapshotsResponse, error) { + return &abcitypes.ListSnapshotsResponse{}, nil } -func (app *KVStoreApplication) OfferSnapshot(_ context.Context, snapshot *abcitypes.RequestOfferSnapshot) (*abcitypes.ResponseOfferSnapshot, error) { - return &abcitypes.ResponseOfferSnapshot{}, nil +func (app *KVStoreApplication) OfferSnapshot(_ context.Context, snapshot *abcitypes.OfferSnapshotRequest) (*abcitypes.OfferSnapshotResponse, error) { + return &abcitypes.OfferSnapshotResponse{}, nil } -func (app *KVStoreApplication) LoadSnapshotChunk(_ context.Context, chunk *abcitypes.RequestLoadSnapshotChunk) (*abcitypes.ResponseLoadSnapshotChunk, error) { - return &abcitypes.ResponseLoadSnapshotChunk{}, nil +func (app *KVStoreApplication) LoadSnapshotChunk(_ context.Context, chunk *abcitypes.LoadSnapshotChunkRequest) (*abcitypes.LoadSnapshotChunkResponse, error) { + return &abcitypes.LoadSnapshotChunkResponse{}, nil } -func (app *KVStoreApplication) ApplySnapshotChunk(_ context.Context, chunk *abcitypes.RequestApplySnapshotChunk) (*abcitypes.ResponseApplySnapshotChunk, error) { - return &abcitypes.ResponseApplySnapshotChunk{Result: abcitypes.ResponseApplySnapshotChunk_ACCEPT}, nil +func (app *KVStoreApplication) ApplySnapshotChunk(_ context.Context, chunk *abcitypes.ApplySnapshotChunkRequest) (*abcitypes.ApplySnapshotChunkResponse, error) { + return &abcitypes.ApplySnapshotChunkResponse{Result: abcitypes.ApplySnapshotChunkResponse_ACCEPT}, nil } -func (app KVStoreApplication) ExtendVote(_ context.Context, extend *abcitypes.RequestExtendVote) (*abcitypes.ResponseExtendVote, error) { - return &abcitypes.ResponseExtendVote{}, nil +func (app KVStoreApplication) ExtendVote(_ context.Context, extend *abcitypes.ExtendVoteRequest) (*abcitypes.ExtendVoteResponse, error) { + return &abcitypes.ExtendVoteResponse{}, nil } -func (app *KVStoreApplication) VerifyVoteExtension(_ context.Context, verify *abcitypes.RequestVerifyVoteExtension) (*abcitypes.ResponseVerifyVoteExtension, error) { - return &abcitypes.ResponseVerifyVoteExtension{}, nil +func (app *KVStoreApplication) VerifyVoteExtension(_ context.Context, verify *abcitypes.VerifyVoteExtensionRequest) (*abcitypes.VerifyVoteExtensionResponse, error) { + return &abcitypes.VerifyVoteExtensionResponse{}, nil } ``` @@ -288,9 +288,9 @@ func (app *KVStoreApplication) isValid(tx []byte) uint32 { Now you can rewrite the `CheckTx` method to use the helper function: ```go -func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { +func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.CheckTxRequest) (*abcitypes.CheckTxResponse, error) { code := app.isValid(check.Tx) - return &abcitypes.ResponseCheckTx{Code: code}, nil + return &abcitypes.CheckTxResponse{Code: code}, nil } ``` @@ -329,19 +329,19 @@ application via `FinalizeBlock`. This method is responsible for executing the block and returning a response to the consensus engine. Providing a single `FinalizeBlock` method to signal the finalization of a block simplifies the ABCI interface and increases flexibility in the execution pipeline. -The `FinalizeBlock` method executes the block, including any necessary transaction processing and state updates, and returns a `ResponseFinalizeBlock` object which contains any necessary information about the executed block. +The `FinalizeBlock` method executes the block, including any necessary transaction processing and state updates, and returns a `FinalizeBlockResponse` object which contains any necessary information about the executed block. **Note:** `FinalizeBlock` only prepares the update to be made and does not change the state of the application. The state change is actually committed in a later stage i.e. in `commit` phase. Note that, to implement these calls in our application we're going to make use of Badger's transaction mechanism. We will always refer to these as Badger transactions, not to confuse them with the transactions included in the blocks delivered by CometBFT, the _application transactions_. First, let's create a new Badger transaction during `FinalizeBlock`. All application transactions in the current block will be executed within this Badger transaction. -Next, let's modify `FinalizeBlock` to add the `key` and `value` to the Badger transaction every time our application processes a new application transaction from the list received through `RequestFinalizeBlock`. +Next, let's modify `FinalizeBlock` to add the `key` and `value` to the Badger transaction every time our application processes a new application transaction from the list received through `FinalizeBlockRequest`. Note that we check the validity of the transaction _again_ during `FinalizeBlock`. ```go -func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.RequestFinalizeBlock) (*abcitypes.ResponseFinalizeBlock, error) { +func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.FinalizeBlockRequest) (*abcitypes.FinalizeBlockResponse, error) { var txs = make([]*abcitypes.ExecTxResult, len(req.Txs)) app.onGoingBlock = app.db.NewTransaction(true) @@ -364,7 +364,7 @@ func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.R } } - return &abcitypes.ResponseFinalizeBlock{ + return &abcitypes.FinalizeBlockResponse{ TxResults: txs, }, nil } @@ -385,8 +385,8 @@ Let's update the method to terminate the pending Badger transaction and persist the resulting state: ```go -func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.RequestCommit) (*abcitypes.ResponseCommit, error) { - return &abcitypes.ResponseCommit{}, app.onGoingBlock.Commit() +func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.CommitRequest) (*abcitypes.CommitResponse, error) { + return &abcitypes.CommitResponse{}, app.onGoingBlock.Commit() } ``` @@ -415,8 +415,8 @@ When a client tries to read some information from the `kvstore`, the request wil handled in the `Query` method. To do this, let's rewrite the `Query` method in `app.go`: ```go -func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.RequestQuery) (*abcitypes.ResponseQuery, error) { - resp := abcitypes.ResponseQuery{Key: req.Data} +func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.QueryRequest) (*abcitypes.QueryResponse, error) { + resp := abcitypes.QueryResponse{Key: req.Data} dbErr := app.db.View(func(txn *badger.Txn) error { item, err := txn.Get(req.Data) @@ -454,13 +454,13 @@ included in blocks, it groups some of these transactions and then gives the appl to modify the group by invoking `PrepareProposal`. The application is free to modify the group before returning from the call, as long as the resulting set -does not use more bytes than `RequestPrepareProposal.max_tx_bytes` +does not use more bytes than `PrepareProposalRequest.max_tx_bytes` For example, the application may reorder, add, or even remove transactions from the group to improve the execution of the block once accepted. In the following code, the application simply returns the unmodified group of transactions: ```go - func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.RequestPrepareProposal) (*abcitypes.ResponsePrepareProposal, error) { + func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.PrepareProposalRequest) (*abcitypes.PrepareProposalResponse, error) { totalBytes := int64(0) txs := make([]byte, 0) @@ -473,13 +473,13 @@ In the following code, the application simply returns the unmodified group of tr } } - return &abcitypes.ResponsePrepareProposal{Txs: proposal.Txs}, nil + return &abcitypes.PrepareProposalResponse{Txs: proposal.Txs}, nil } ``` - This code snippet iterates through the proposed transactions and calculates the `total bytes`. If the `total bytes` exceeds the `MaxTxBytes` specified in the `RequestPrepareProposal` struct, the loop breaks and the transactions processed so far are returned. + This code snippet iterates through the proposed transactions and calculates the `total bytes`. If the `total bytes` exceeds the `MaxTxBytes` specified in the `PrepareProposalRequest` struct, the loop breaks and the transactions processed so far are returned. - Note: It is the responsibility of the application to ensure that the `total bytes` of transactions returned does not exceed the `RequestPrepareProposal.max_tx_bytes` limit. + Note: It is the responsibility of the application to ensure that the `total bytes` of transactions returned does not exceed the `PrepareProposalRequest.max_tx_bytes` limit. Once a proposed block is received by a node, the proposal is passed to the application to give its blessing before voting to accept the proposal. @@ -490,8 +490,8 @@ In the following code, the application simply returns the unmodified group of tr The following code simply accepts all proposals: ```go -func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.RequestProcessProposal) (*abcitypes.ResponseProcessProposal, error) { - return &abcitypes.ResponseProcessProposal{Status: abcitypes.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil +func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.ProcessProposalRequest) (*abcitypes.ProcessProposalResponse, error) { + return &abcitypes.ProcessProposalResponse{Status: abcitypes.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } ``` diff --git a/docs/guides/go.md b/docs/guides/go.md index 3d7513999c..58a377bfa2 100644 --- a/docs/guides/go.md +++ b/docs/guides/go.md @@ -114,7 +114,7 @@ go build CometBFT communicates with the application through the Application BlockChain Interface (ABCI). The messages exchanged through the interface are defined in the ABCI [protobuf -file](https://github.com/cometbft/cometbft/blob/main/proto/cometbft/abci/v3/types.proto). +file](https://github.com/cometbft/cometbft/blob/main/proto/cometbft/abci/v1beta4/types.proto). We begin by creating the basic scaffolding for an ABCI application by creating a new type, `KVStoreApplication`, which implements the @@ -137,61 +137,61 @@ func NewKVStoreApplication() *KVStoreApplication { return &KVStoreApplication{} } -func (app *KVStoreApplication) Info(_ context.Context, info *abcitypes.RequestInfo) (*abcitypes.ResponseInfo, error) { - return &abcitypes.ResponseInfo{}, nil +func (app *KVStoreApplication) Info(_ context.Context, info *abcitypes.InfoRequest) (*abcitypes.InfoResponse, error) { + return &abcitypes.InfoResponse{}, nil } -func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.RequestQuery) (*abcitypes.ResponseQuery, error) { - return &abcitypes.ResponseQuery{}, nil +func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.QueryRequest) (*abcitypes.QueryResponse, error) { + return &abcitypes.QueryResponse{}, nil } -func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { - return &abcitypes.ResponseCheckTx{Code: code}, nil +func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.CheckTxRequest) (*abcitypes.CheckTxResponse, error) { + return &abcitypes.CheckTxResponse{Code: code}, nil } -func (app *KVStoreApplication) InitChain(_ context.Context, chain *abcitypes.RequestInitChain) (*abcitypes.ResponseInitChain, error) { - return &abcitypes.ResponseInitChain{}, nil +func (app *KVStoreApplication) InitChain(_ context.Context, chain *abcitypes.InitChainRequest) (*abcitypes.InitChainResponse, error) { + return &abcitypes.InitChainResponse{}, nil } -func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.RequestPrepareProposal) (*abcitypes.ResponsePrepareProposal, error) { - return &abcitypes.ResponsePrepareProposal{}, nil +func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.PrepareProposalRequest) (*abcitypes.PrepareProposalResponse, error) { + return &abcitypes.PrepareProposalResponse{}, nil } -func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.RequestProcessProposal) (*abcitypes.ResponseProcessProposal, error) { - return &abcitypes.ResponseProcessProposal{}, nil +func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.ProcessProposalRequest) (*abcitypes.ProcessProposalResponse, error) { + return &abcitypes.ProcessProposalResponse{}, nil } -func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.RequestFinalizeBlock) (*abcitypes.ResponseFinalizeBlock, error) { - return &abcitypes.ResponseFinalizeBlock{}, nil +func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.FinalizeBlockRequest) (*abcitypes.FinalizeBlockResponse, error) { + return &abcitypes.FinalizeBlockResponse{}, nil } -func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.RequestCommit) (*abcitypes.ResponseCommit, error) { - return &abcitypes.ResponseCommit{}, nil +func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.CommitRequest) (*abcitypes.CommitResponse, error) { + return &abcitypes.CommitResponse{}, nil } -func (app *KVStoreApplication) ListSnapshots(_ context.Context, snapshots *abcitypes.RequestListSnapshots) (*abcitypes.ResponseListSnapshots, error) { - return &abcitypes.ResponseListSnapshots{}, nil +func (app *KVStoreApplication) ListSnapshots(_ context.Context, snapshots *abcitypes.ListSnapshotsRequest) (*abcitypes.ListSnapshotsResponse, error) { + return &abcitypes.ListSnapshotsResponse{}, nil } -func (app *KVStoreApplication) OfferSnapshot(_ context.Context, snapshot *abcitypes.RequestOfferSnapshot) (*abcitypes.ResponseOfferSnapshot, error) { - return &abcitypes.ResponseOfferSnapshot{}, nil +func (app *KVStoreApplication) OfferSnapshot(_ context.Context, snapshot *abcitypes.OfferSnapshotRequest) (*abcitypes.OfferSnapshotResponse, error) { + return &abcitypes.OfferSnapshotResponse{}, nil } -func (app *KVStoreApplication) LoadSnapshotChunk(_ context.Context, chunk *abcitypes.RequestLoadSnapshotChunk) (*abcitypes.ResponseLoadSnapshotChunk, error) { - return &abcitypes.ResponseLoadSnapshotChunk{}, nil +func (app *KVStoreApplication) LoadSnapshotChunk(_ context.Context, chunk *abcitypes.LoadSnapshotChunkRequest) (*abcitypes.LoadSnapshotChunkResponse, error) { + return &abcitypes.LoadSnapshotChunkResponse{}, nil } -func (app *KVStoreApplication) ApplySnapshotChunk(_ context.Context, chunk *abcitypes.RequestApplySnapshotChunk) (*abcitypes.ResponseApplySnapshotChunk, error) { +func (app *KVStoreApplication) ApplySnapshotChunk(_ context.Context, chunk *abcitypes.ApplySnapshotChunkRequest) (*abcitypes.ApplySnapshotChunkResponse, error) { - return &abcitypes.ResponseApplySnapshotChunk{Result: abcitypes.ResponseApplySnapshotChunk_ACCEPT}, nil + return &abcitypes.ApplySnapshotChunkResponse{Result: abcitypes.ApplySnapshotChunkResponse_ACCEPT}, nil } -func (app KVStoreApplication) ExtendVote(_ context.Context, extend *abcitypes.RequestExtendVote) (*abcitypes.ResponseExtendVote, error) { - return &abcitypes.ResponseExtendVote{}, nil +func (app KVStoreApplication) ExtendVote(_ context.Context, extend *abcitypes.ExtendVoteRequest) (*abcitypes.ExtendVoteResponse, error) { + return &abcitypes.ExtendVoteResponse{}, nil } -func (app *KVStoreApplication) VerifyVoteExtension(_ context.Context, verify *abcitypes.RequestVerifyVoteExtension) (*abcitypes.ResponseVerifyVoteExtension, error) { - return &abcitypes.ResponseVerifyVoteExtension{}, nil +func (app *KVStoreApplication) VerifyVoteExtension(_ context.Context, verify *abcitypes.VerifyVoteExtensionRequest) (*abcitypes.VerifyVoteExtensionResponse, error) { + return &abcitypes.VerifyVoteExtensionResponse{}, nil } ``` @@ -288,9 +288,9 @@ func (app *KVStoreApplication) isValid(tx []byte) uint32 { Now you can rewrite the `CheckTx` method to use the helper function: ```go -func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error) { +func (app *KVStoreApplication) CheckTx(_ context.Context, check *abcitypes.CheckTxRequest) (*abcitypes.CheckTxResponse, error) { code := app.isValid(check.Tx) - return &abcitypes.ResponseCheckTx{Code: code}, nil + return &abcitypes.CheckTxResponse{Code: code}, nil } ``` @@ -330,19 +330,19 @@ application via the `FinalizeBlock` method. This method is responsible for executing the block and returning a response to the consensus engine. Providing a single `FinalizeBlock` method to signal the finalization of a block simplifies the ABCI interface and increases flexibility in the execution pipeline. -The `FinalizeBlock` method executes the block, including any necessary transaction processing and state updates, and returns a `ResponseFinalizeBlock` object which contains any necessary information about the executed block. +The `FinalizeBlock` method executes the block, including any necessary transaction processing and state updates, and returns a `FinalizeBlockResponse` object which contains any necessary information about the executed block. **Note:** `FinalizeBlock` only prepares the update to be made and does not change the state of the application. The state change is actually committed in a later stage i.e. in `commit` phase. Note that, to implement these calls in our application we're going to make use of Badger's transaction mechanism. We will always refer to these as Badger transactions, not to confuse them with the transactions included in the blocks delivered by CometBFT, the _application transactions_. First, let's create a new Badger transaction during `FinalizeBlock`. All application transactions in the current block will be executed within this Badger transaction. -Next, let's modify `FinalizeBlock` to add the `key` and `value` to the database transaction every time our application processes a new application transaction from the list received through `RequestFinalizeBlock`. +Next, let's modify `FinalizeBlock` to add the `key` and `value` to the database transaction every time our application processes a new application transaction from the list received through `FinalizeBlockRequest`. Note that we check the validity of the transaction _again_ during `FinalizeBlock`. ```go -func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.RequestFinalizeBlock) (*abcitypes.ResponseFinalizeBlock, error) { +func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.FinalizeBlockRequest) (*abcitypes.FinalizeBlockResponse, error) { var txs = make([]*abcitypes.ExecTxResult, len(req.Txs)) app.onGoingBlock = app.db.NewTransaction(true) @@ -364,7 +364,7 @@ func (app *KVStoreApplication) FinalizeBlock(_ context.Context, req *abcitypes.R } } - return &abcitypes.ResponseFinalizeBlock{ + return &abcitypes.FinalizeBlockResponse{ TxResults: txs, }, nil } @@ -382,8 +382,8 @@ The `Commit` method tells the application to make permanent the effects of the a Let's update the method to terminate the pending Badger transaction and persist the resulting state: ```go -func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.RequestCommit) (*abcitypes.ResponseCommit, error) { - return &abcitypes.ResponseCommit{}, app.onGoingBlock.Commit() +func (app KVStoreApplication) Commit(_ context.Context, commit *abcitypes.CommitRequest) (*abcitypes.CommitResponse, error) { + return &abcitypes.CommitResponse{}, app.onGoingBlock.Commit() } ``` @@ -410,8 +410,8 @@ When a client tries to read some information from the `kvstore`, the request wil handled in the `Query` method. To do this, let's rewrite the `Query` method in `app.go`: ```go -func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.RequestQuery) (*abcitypes.ResponseQuery, error) { - resp := abcitypes.ResponseQuery{Key: req.Data} +func (app *KVStoreApplication) Query(_ context.Context, req *abcitypes.QueryRequest) (*abcitypes.QueryResponse, error) { + resp := abcitypes.QueryResponse{Key: req.Data} dbErr := app.db.View(func(txn *badger.Txn) error { item, err := txn.Get(req.Data) @@ -449,13 +449,13 @@ included in blocks, it groups some of these transactions and then gives the appl to modify the group by invoking `PrepareProposal`. The application is free to modify the group before returning from the call, as long as the resulting set -does not use more bytes than `RequestPrepareProposal.max_tx_bytes' +does not use more bytes than `PrepareProposalRequest.max_tx_bytes' For example, the application may reorder, add, or even remove transactions from the group to improve the execution of the block once accepted. In the following code, the application simply returns the unmodified group of transactions: ```go -func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.RequestPrepareProposal) (*abcitypes.ResponsePrepareProposal, error) { +func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abcitypes.PrepareProposalRequest) (*abcitypes.PrepareProposalResponse, error) { totalBytes := int64(0) txs := make([]byte, 0) @@ -468,13 +468,13 @@ func (app *KVStoreApplication) PrepareProposal(_ context.Context, proposal *abci } } - return &abcitypes.ResponsePrepareProposal{Txs: proposal.Txs}, nil + return &abcitypes.PrepareProposalResponse{Txs: proposal.Txs}, nil } ``` -This code snippet iterates through the proposed transactions and calculates the `total bytes`. If the `total bytes` exceeds the `MaxTxBytes` specified in the `RequestPrepareProposal` struct, the loop breaks and the transactions processed so far are returned. +This code snippet iterates through the proposed transactions and calculates the `total bytes`. If the `total bytes` exceeds the `MaxTxBytes` specified in the `PrepareProposalRequest` struct, the loop breaks and the transactions processed so far are returned. -Note: It is the responsibility of the application to ensure that the `total bytes` of transactions returned does not exceed the `RequestPrepareProposal.max_tx_bytes` limit. +Note: It is the responsibility of the application to ensure that the `total bytes` of transactions returned does not exceed the `PrepareProposalRequest.max_tx_bytes` limit. Once a proposed block is received by a node, the proposal is passed to the application to determine its validity before voting to accept the proposal. @@ -484,8 +484,8 @@ by malicious nodes, in which case the block should not be considered valid. The following code simply accepts all proposals: ```go -func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.RequestProcessProposal) (*abcitypes.ResponseProcessProposal, error) { - return &abcitypes.ResponseProcessProposal{Status: abcitypes.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil +func (app *KVStoreApplication) ProcessProposal(_ context.Context, proposal *abcitypes.ProcessProposalRequest) (*abcitypes.ProcessProposalResponse, error) { + return &abcitypes.ProcessProposalResponse{Status: abcitypes.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } ``` diff --git a/inspect/inspect_test.go b/inspect/inspect_test.go index d9b353c0ab..c732030baa 100644 --- a/inspect/inspect_test.go +++ b/inspect/inspect_test.go @@ -259,7 +259,7 @@ func TestBlockResults(t *testing.T) { stateStoreMock := &statemocks.Store{} stateStoreMock.On("Close").Return(nil) // cmtstate "github.com/cometbft/cometbft/api/cometbft/state" - stateStoreMock.On("LoadFinalizeBlockResponse", testHeight).Return(&abcitypes.ResponseFinalizeBlock{ + stateStoreMock.On("LoadFinalizeBlockResponse", testHeight).Return(&abcitypes.FinalizeBlockResponse{ TxResults: []*abcitypes.ExecTxResult{ { GasUsed: testGasUsed, @@ -294,7 +294,7 @@ func TestBlockResults(t *testing.T) { require.NoError(t, err) res, err := cli.BlockResults(context.Background(), &testHeight) require.NoError(t, err) - require.Equal(t, res.TxsResults[0].GasUsed, testGasUsed) + require.Equal(t, res.TxResults[0].GasUsed, testGasUsed) cancel() wg.Wait() diff --git a/light/rpc/client.go b/light/rpc/client.go index ec8d5a426a..42a539592d 100644 --- a/light/rpc/client.go +++ b/light/rpc/client.go @@ -130,8 +130,8 @@ func (c *Client) ABCIQuery(ctx context.Context, path string, data cmtbytes.HexBy // ABCIQueryWithOptions returns an error if opts.Prove is false. func (c *Client) ABCIQueryWithOptions(ctx context.Context, path string, data cmtbytes.HexBytes, - opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) { - + opts rpcclient.ABCIQueryOptions, +) (*ctypes.ResultABCIQuery, error) { // always request the proof opts.Prove = true @@ -411,7 +411,7 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul } // Build a Merkle tree out of the above 3 binary slices. - rH := state.TxResultsHash(res.TxsResults) + rH := state.TxResultsHash(res.TxResults) // Verify block results. if !bytes.Equal(rH, trustedBlock.LastResultsHash) { @@ -518,7 +518,6 @@ func (c *Client) Validators( height *int64, pagePtr, perPagePtr *int, ) (*ctypes.ResultValidators, error) { - // Update the light client if we're behind and retrieve the light block at the // requested height or at the latest height if no height is provided. l, err := c.updateLightClientIfNeededTo(ctx, height) @@ -540,7 +539,8 @@ func (c *Client) Validators( BlockHeight: l.Height, Validators: v, Count: len(v), - Total: totalCount}, nil + Total: totalCount, + }, nil } func (c *Client) BroadcastEvidence(ctx context.Context, ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error) { @@ -548,7 +548,8 @@ func (c *Client) BroadcastEvidence(ctx context.Context, ev types.Evidence) (*cty } func (c *Client) Subscribe(ctx context.Context, subscriber, query string, - outCapacity ...int) (out <-chan ctypes.ResultEvent, err error) { + outCapacity ...int, +) (out <-chan ctypes.ResultEvent, err error) { return c.next.Subscribe(ctx, subscriber, query, outCapacity...) } diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index 3ad75bafa2..a0238141eb 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -284,7 +284,7 @@ func (mem *CListMempool) CheckTx(tx types.Tx) (*abcicli.ReqRes, error) { return nil, ErrTxInCache } - reqRes, err := mem.proxyAppConn.CheckTxAsync(context.TODO(), &abci.RequestCheckTx{ + reqRes, err := mem.proxyAppConn.CheckTxAsync(context.TODO(), &abci.CheckTxRequest{ Tx: tx, Type: abci.CHECK_TX_TYPE_CHECK, }) @@ -663,7 +663,7 @@ func (mem *CListMempool) recheckTxs() { // NOTE: globalCb may be called concurrently. for e := mem.txs.Front(); e != nil; e = e.Next() { memTx := e.Value.(*mempoolTx) - _, err := mem.proxyAppConn.CheckTxAsync(context.TODO(), &abci.RequestCheckTx{ + _, err := mem.proxyAppConn.CheckTxAsync(context.TODO(), &abci.CheckTxRequest{ Tx: memTx.tx, Type: abci.CHECK_TX_TYPE_RECHECK, }) diff --git a/mempool/clist_mempool_test.go b/mempool/clist_mempool_test.go index d2509e304d..6d57316c31 100644 --- a/mempool/clist_mempool_test.go +++ b/mempool/clist_mempool_test.go @@ -184,7 +184,7 @@ func TestMempoolFilters(t *testing.T) { emptyTxArr := []types.Tx{[]byte{}} nopPreFilter := func(tx types.Tx) error { return nil } - nopPostFilter := func(tx types.Tx, res *abci.ResponseCheckTx) error { return nil } + nopPostFilter := func(tx types.Tx, res *abci.CheckTxResponse) error { return nil } // each table driven test creates numTxsToCreate txs with checkTx, and at the end clears all remaining txs. // each tx has 20 bytes @@ -272,8 +272,8 @@ func TestMempoolUpdateDoesNotPanicWhenApplicationMissedTx(t *testing.T) { // Add 4 transactions to the mempool by calling the mempool's `CheckTx` on each of them. txs := []types.Tx{[]byte{0x01}, []byte{0x02}, []byte{0x03}, []byte{0x04}} for _, tx := range txs { - reqRes := abciclient.NewReqRes(abci.ToRequestCheckTx(&abci.RequestCheckTx{Tx: tx, Type: abci.CHECK_TX_TYPE_CHECK})) - reqRes.Response = abci.ToResponseCheckTx(&abci.ResponseCheckTx{Code: abci.CodeTypeOK}) + reqRes := abciclient.NewReqRes(abci.ToCheckTxRequest(&abci.CheckTxRequest{Tx: tx, Type: abci.CHECK_TX_TYPE_CHECK})) + reqRes.Response = abci.ToCheckTxResponse(&abci.CheckTxResponse{Code: abci.CodeTypeOK}) mockClient.On("CheckTxAsync", mock.Anything, mock.Anything).Return(reqRes, nil) _, err := mp.CheckTx(tx) @@ -294,12 +294,12 @@ func TestMempoolUpdateDoesNotPanicWhenApplicationMissedTx(t *testing.T) { // This simulates the client dropping the second request. // Previous versions of this code panicked when the ABCI application missed // a recheck-tx request. - resp := &abci.ResponseCheckTx{Code: abci.CodeTypeOK} - req := &abci.RequestCheckTx{Tx: txs[1], Type: abci.CHECK_TX_TYPE_CHECK} - callback(abci.ToRequestCheckTx(req), abci.ToResponseCheckTx(resp)) + resp := &abci.CheckTxResponse{Code: abci.CodeTypeOK} + req := &abci.CheckTxRequest{Tx: txs[1], Type: abci.CHECK_TX_TYPE_CHECK} + callback(abci.ToCheckTxRequest(req), abci.ToCheckTxResponse(resp)) - req = &abci.RequestCheckTx{Tx: txs[3], Type: abci.CHECK_TX_TYPE_CHECK} - callback(abci.ToRequestCheckTx(req), abci.ToResponseCheckTx(resp)) + req = &abci.CheckTxRequest{Tx: txs[3], Type: abci.CHECK_TX_TYPE_CHECK} + callback(abci.ToCheckTxRequest(req), abci.ToCheckTxResponse(resp)) mockClient.AssertExpectations(t) } @@ -323,7 +323,7 @@ func TestMempool_KeepInvalidTxsInCache(t *testing.T) { require.NoError(t, err) // simulate new block - _, err = app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{ + _, err = app.FinalizeBlock(context.Background(), &abci.FinalizeBlockRequest{ Txs: [][]byte{a, b}, }) require.NoError(t, err) @@ -455,7 +455,7 @@ func TestSerialReap(t *testing.T) { txs[i-start] = kvstore.NewTx(fmt.Sprintf("%d", i), "true") } - res, err := appConnCon.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Txs: txs}) + res, err := appConnCon.FinalizeBlock(context.Background(), &abci.FinalizeBlockRequest{Txs: txs}) if err != nil { t.Errorf("client error committing tx: %v", err) } @@ -469,7 +469,7 @@ func TestSerialReap(t *testing.T) { t.Errorf("error committing. Hash:%X", res.AppHash) } - _, err = appConnCon.Commit(context.Background(), &abci.RequestCommit{}) + _, err = appConnCon.Commit(context.Background(), &abci.CommitRequest{}) if err != nil { t.Errorf("client error committing: %v", err) } @@ -623,12 +623,12 @@ func TestMempoolTxsBytes(t *testing.T) { } }) - res, err := appConnCon.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Txs: [][]byte{txBytes}}) + res, err := appConnCon.FinalizeBlock(context.Background(), &abci.FinalizeBlockRequest{Txs: [][]byte{txBytes}}) require.NoError(t, err) require.EqualValues(t, 0, res.TxResults[0].Code) require.NotEmpty(t, res.AppHash) - _, err = appConnCon.Commit(context.Background(), &abci.RequestCommit{}) + _, err = appConnCon.Commit(context.Background(), &abci.CommitRequest{}) require.NoError(t, err) // Pretend like we committed nothing so txBytes gets rechecked and removed. @@ -752,7 +752,7 @@ func abciResponses(n int, code uint32) []*abci.ExecTxResult { } func doCommit(t require.TestingT, mp Mempool, app abci.Application, txs types.Txs, height int64) { - rfb := &abci.RequestFinalizeBlock{Txs: make([][]byte, len(txs))} + rfb := &abci.FinalizeBlockRequest{Txs: make([][]byte, len(txs))} for i, tx := range txs { rfb.Txs[i] = tx } @@ -761,7 +761,7 @@ func doCommit(t require.TestingT, mp Mempool, app abci.Application, txs types.Tx mp.Lock() e = mp.FlushAppConn() require.True(t, e == nil) - _, e = app.Commit(context.Background(), &abci.RequestCommit{}) + _, e = app.Commit(context.Background(), &abci.CommitRequest{}) require.True(t, e == nil) e = mp.Update(height, txs, abciResponses(txs.Len(), abci.CodeTypeOK), nil, nil) require.True(t, e == nil) diff --git a/mempool/mempool.go b/mempool/mempool.go index c974400a93..6a2cb14711 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -106,7 +106,7 @@ type PreCheckFunc func(types.Tx) error // PostCheckFunc is an optional filter executed after CheckTx and rejects // transaction if false is returned. An example would be to ensure a // transaction doesn't require more gas than available for the block. -type PostCheckFunc func(types.Tx, *abci.ResponseCheckTx) error +type PostCheckFunc func(types.Tx, *abci.CheckTxResponse) error // PreCheckMaxBytes checks that the size of the transaction is smaller or equal // to the expected maxBytes. @@ -125,7 +125,7 @@ func PreCheckMaxBytes(maxBytes int64) PreCheckFunc { // PostCheckMaxGas checks that the wanted gas is smaller or equal to the passed // maxGas. Returns nil if maxGas is -1. func PostCheckMaxGas(maxGas int64) PostCheckFunc { - return func(tx types.Tx, res *abci.ResponseCheckTx) error { + return func(tx types.Tx, res *abci.CheckTxResponse) error { if maxGas == -1 { return nil } diff --git a/mempool/mocks/mempool.go b/mempool/mocks/mempool.go index 89ce927425..b6e876a735 100644 --- a/mempool/mocks/mempool.go +++ b/mempool/mocks/mempool.go @@ -10,7 +10,7 @@ import ( types "github.com/cometbft/cometbft/types" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" + v1beta3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" ) // Mempool is an autogenerated mock type for the Mempool type @@ -174,11 +174,11 @@ func (_m *Mempool) Unlock() { } // Update provides a mock function with given fields: blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn -func (_m *Mempool) Update(blockHeight int64, blockTxs types.Txs, deliverTxResponses []*v3.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc) error { +func (_m *Mempool) Update(blockHeight int64, blockTxs types.Txs, deliverTxResponses []*v1beta3.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc) error { ret := _m.Called(blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn) var r0 error - if rf, ok := ret.Get(0).(func(int64, types.Txs, []*v3.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc) error); ok { + if rf, ok := ret.Get(0).(func(int64, types.Txs, []*v1beta3.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc) error); ok { r0 = rf(blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn) } else { r0 = ret.Error(0) diff --git a/node/setup.go b/node/setup.go index 864ca283d3..262879981c 100644 --- a/node/setup.go +++ b/node/setup.go @@ -374,7 +374,7 @@ func createTransport( connFilters, // ABCI query for address filtering. func(_ p2p.ConnSet, c net.Conn, _ []net.IP) error { - res, err := proxyApp.Query().Query(context.TODO(), &abci.RequestQuery{ + res, err := proxyApp.Query().Query(context.TODO(), &abci.QueryRequest{ Path: fmt.Sprintf("/p2p/filter/addr/%s", c.RemoteAddr().String()), }) if err != nil { @@ -392,7 +392,7 @@ func createTransport( peerFilters, // ABCI query for ID filtering. func(_ p2p.IPeerSet, p p2p.Peer) error { - res, err := proxyApp.Query().Query(context.TODO(), &abci.RequestQuery{ + res, err := proxyApp.Query().Query(context.TODO(), &abci.QueryRequest{ Path: fmt.Sprintf("/p2p/filter/id/%s", p.ID()), }) if err != nil { @@ -554,8 +554,10 @@ func startStateSync( //------------------------------------------------------------------------------ -var genesisDocKey = []byte("genesisDoc") -var genesisDocHashKey = []byte("genesisDocHash") +var ( + genesisDocKey = []byte("genesisDoc") + genesisDocHashKey = []byte("genesisDocHash") +) // LoadStateFromDBOrGenesisDocProvider attempts to load the state from the // database, or creates one using the given genesisDocProvider. On success this also diff --git a/proto/buf.yaml b/proto/buf.yaml index 6ae6e034a6..a7fd3482ee 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -6,10 +6,7 @@ breaking: - FILE lint: use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE + - DEFAULT ignore_only: ENUM_VALUE_PREFIX: - tendermint @@ -21,4 +18,33 @@ lint: - cometbft/abci/v1beta1 - cometbft/abci/v1beta2 - cometbft/abci/v1beta3 + PACKAGE_VERSION_SUFFIX: + - tendermint + - cometbft/abci/v1beta1 + - cometbft/abci/v1beta2 + - cometbft/abci/v1beta3 + RPC_REQUEST_RESPONSE_UNIQUE: + - tendermint + - cometbft/abci/v1beta1 + - cometbft/abci/v1beta2 + - cometbft/abci/v1beta3 + - cometbft/rpc/grpc + RPC_REQUEST_STANDARD_NAME: + - tendermint + - cometbft/abci/v1beta1 + - cometbft/abci/v1beta2 + - cometbft/abci/v1beta3 + - cometbft/rpc/grpc + RPC_RESPONSE_STANDARD_NAME: + - tendermint + - cometbft/abci/v1beta1 + - cometbft/abci/v1beta2 + - cometbft/abci/v1beta3 + - cometbft/rpc/grpc + SERVICE_SUFFIX: + - tendermint + - cometbft/abci/v1beta1 + - cometbft/abci/v1beta2 + - cometbft/abci/v1beta3 + - cometbft/rpc/grpc enum_zero_value_suffix: _UNKNOWN diff --git a/proto/cometbft/abci/v1beta4/service.proto b/proto/cometbft/abci/v1beta4/service.proto new file mode 100644 index 0000000000..df06e4b892 --- /dev/null +++ b/proto/cometbft/abci/v1beta4/service.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cometbft.abci.v1beta4; + +import "cometbft/abci/v1beta4/types.proto"; + +option go_package = "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4"; + +service ABCIService { + rpc Echo(EchoRequest) returns (EchoResponse); + rpc Flush(FlushRequest) returns (FlushResponse); + rpc Info(InfoRequest) returns (InfoResponse); + rpc CheckTx(CheckTxRequest) returns (CheckTxResponse); + rpc Query(QueryRequest) returns (QueryResponse); + rpc Commit(CommitRequest) returns (CommitResponse); + rpc InitChain(InitChainRequest) returns (InitChainResponse); + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse); + rpc OfferSnapshot(OfferSnapshotRequest) returns (OfferSnapshotResponse); + rpc LoadSnapshotChunk(LoadSnapshotChunkRequest) returns (LoadSnapshotChunkResponse); + rpc ApplySnapshotChunk(ApplySnapshotChunkRequest) returns (ApplySnapshotChunkResponse); + rpc PrepareProposal(PrepareProposalRequest) returns (PrepareProposalResponse); + rpc ProcessProposal(ProcessProposalRequest) returns (ProcessProposalResponse); + rpc ExtendVote(ExtendVoteRequest) returns (ExtendVoteResponse); + rpc VerifyVoteExtension(VerifyVoteExtensionRequest) returns (VerifyVoteExtensionResponse); + rpc FinalizeBlock(FinalizeBlockRequest) returns (FinalizeBlockResponse); +} diff --git a/proto/cometbft/abci/v1beta4/types.proto b/proto/cometbft/abci/v1beta4/types.proto index 250c0bb9ba..c49278ec84 100644 --- a/proto/cometbft/abci/v1beta4/types.proto +++ b/proto/cometbft/abci/v1beta4/types.proto @@ -4,55 +4,70 @@ package cometbft.abci.v1beta4; import "cometbft/abci/v1beta1/types.proto"; import "cometbft/abci/v1beta2/types.proto"; import "cometbft/abci/v1beta3/types.proto"; +import "cometbft/crypto/v1beta1/proof.proto"; +import "cometbft/types/v1beta3/params.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; option go_package = "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4"; -service ABCI { - rpc Echo(v1beta1.RequestEcho) returns (v1beta1.ResponseEcho); - rpc Flush(v1beta1.RequestFlush) returns (v1beta1.ResponseFlush); - rpc Info(v1beta2.RequestInfo) returns (v1beta1.ResponseInfo); - rpc CheckTx(RequestCheckTx) returns (v1beta3.ResponseCheckTx); - rpc Query(v1beta1.RequestQuery) returns (v1beta1.ResponseQuery); - rpc Commit(v1beta1.RequestCommit) returns (v1beta3.ResponseCommit); - rpc InitChain(v1beta3.RequestInitChain) returns (v1beta3.ResponseInitChain); - rpc ListSnapshots(v1beta1.RequestListSnapshots) returns (v1beta1.ResponseListSnapshots); - rpc OfferSnapshot(v1beta1.RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(v1beta1.RequestLoadSnapshotChunk) returns (v1beta1.ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(v1beta1.RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); - rpc PrepareProposal(RequestPrepareProposal) returns (v1beta2.ResponsePrepareProposal); - rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); - rpc ExtendVote(RequestExtendVote) returns (v1beta3.ResponseExtendVote); - rpc VerifyVoteExtension(v1beta3.RequestVerifyVoteExtension) returns (ResponseVerifyVoteExtension); - rpc FinalizeBlock(RequestFinalizeBlock) returns (v1beta3.ResponseFinalizeBlock); -} - //---------------------------------------- // Request types message Request { oneof value { - v1beta1.RequestEcho echo = 1; - v1beta1.RequestFlush flush = 2; - v1beta2.RequestInfo info = 3; - v1beta3.RequestInitChain init_chain = 5; - v1beta1.RequestQuery query = 6; - RequestCheckTx check_tx = 8; - v1beta1.RequestCommit commit = 11; - v1beta1.RequestListSnapshots list_snapshots = 12; - v1beta1.RequestOfferSnapshot offer_snapshot = 13; - v1beta1.RequestLoadSnapshotChunk load_snapshot_chunk = 14; - v1beta1.RequestApplySnapshotChunk apply_snapshot_chunk = 15; - RequestPrepareProposal prepare_proposal = 16; - RequestProcessProposal process_proposal = 17; - RequestExtendVote extend_vote = 18; - v1beta3.RequestVerifyVoteExtension verify_vote_extension = 19; - RequestFinalizeBlock finalize_block = 20; + EchoRequest echo = 1; + FlushRequest flush = 2; + InfoRequest info = 3; + InitChainRequest init_chain = 5; + QueryRequest query = 6; + CheckTxRequest check_tx = 8; + CommitRequest commit = 11; + ListSnapshotsRequest list_snapshots = 12; + OfferSnapshotRequest offer_snapshot = 13; + LoadSnapshotChunkRequest load_snapshot_chunk = 14; + ApplySnapshotChunkRequest apply_snapshot_chunk = 15; + PrepareProposalRequest prepare_proposal = 16; + ProcessProposalRequest process_proposal = 17; + ExtendVoteRequest extend_vote = 18; + VerifyVoteExtensionRequest verify_vote_extension = 19; + FinalizeBlockRequest finalize_block = 20; } reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock } +message EchoRequest { + string message = 1; +} + +message FlushRequest {} + +message InfoRequest { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; + string abci_version = 4; +} + +message InitChainRequest { + google.protobuf.Timestamp time = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + string chain_id = 2; + cometbft.types.v1beta3.ConsensusParams consensus_params = 3; + repeated v1beta1.ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; +} + +message QueryRequest { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + // Type of the transaction check request. // // This enumeration is incompatible with the CheckTxType definition in @@ -66,13 +81,38 @@ enum CheckTxType { CHECK_TX_TYPE_CHECK = 2; } -message RequestCheckTx { +message CheckTxRequest { bytes tx = 1; CheckTxType type = 3; reserved 2; // v1beta1.CheckTxType type } -message RequestPrepareProposal { +message CommitRequest {} + +// Request to list available snapshots +message ListSnapshotsRequest {} + +// Request offering a snapshot to the application +message OfferSnapshotRequest { + v1beta1.Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height +} + +// Request to load a snapshot chunk +message LoadSnapshotChunkRequest { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Request to apply a snapshot chunk +message ApplySnapshotChunkRequest { + uint32 index = 1; + bytes chunk = 2; + string sender = 3; +} + +message PrepareProposalRequest { // the modified transactions cannot exceed this size. int64 max_tx_bytes = 1; // txs is an array of transactions that will be included in a block, @@ -90,7 +130,7 @@ message RequestPrepareProposal { bytes proposer_address = 8; } -message RequestProcessProposal { +message ProcessProposalRequest { repeated bytes txs = 1; v1beta3.CommitInfo proposed_last_commit = 2 [(gogoproto.nullable) = false]; repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; @@ -107,22 +147,35 @@ message RequestProcessProposal { } // Extends a vote with application-injected data -message RequestExtendVote { +message ExtendVoteRequest { // the hash of the block that this vote may be referring to bytes hash = 1; // the height of the extended vote int64 height = 2; // info of the block that this vote may be referring to - google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - repeated bytes txs = 4; - v1beta3.CommitInfo proposed_last_commit = 5 [(gogoproto.nullable) = false]; - repeated Misbehavior misbehavior = 6 [(gogoproto.nullable) = false]; - bytes next_validators_hash = 7; + google.protobuf.Timestamp time = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + repeated bytes txs = 4; + v1beta3.CommitInfo proposed_last_commit = 5 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 6 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 7; // address of the public key of the original proposer of the block. bytes proposer_address = 8; } -message RequestFinalizeBlock { +// Request to verify a vote extension +message VerifyVoteExtensionRequest { + // the hash of the block that this received vote corresponds to + bytes hash = 1; + // the validator that signed the vote extension + bytes validator_address = 2; + int64 height = 3; + bytes vote_extension = 4; +} + +message FinalizeBlockRequest { repeated bytes txs = 1; v1beta3.CommitInfo decided_last_commit = 2 [(gogoproto.nullable) = false]; repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; @@ -143,28 +196,96 @@ message RequestFinalizeBlock { message Response { oneof value { - v1beta1.ResponseException exception = 1; - v1beta1.ResponseEcho echo = 2; - v1beta1.ResponseFlush flush = 3; - v1beta1.ResponseInfo info = 4; - v1beta3.ResponseInitChain init_chain = 6; - v1beta1.ResponseQuery query = 7; - v1beta3.ResponseCheckTx check_tx = 9; - v1beta3.ResponseCommit commit = 12; - v1beta1.ResponseListSnapshots list_snapshots = 13; - ResponseOfferSnapshot offer_snapshot = 14; - v1beta1.ResponseLoadSnapshotChunk load_snapshot_chunk = 15; - ResponseApplySnapshotChunk apply_snapshot_chunk = 16; - v1beta2.ResponsePrepareProposal prepare_proposal = 17; - ResponseProcessProposal process_proposal = 18; - v1beta3.ResponseExtendVote extend_vote = 19; - ResponseVerifyVoteExtension verify_vote_extension = 20; - v1beta3.ResponseFinalizeBlock finalize_block = 21; + ExceptionResponse exception = 1; + EchoResponse echo = 2; + FlushResponse flush = 3; + InfoResponse info = 4; + InitChainResponse init_chain = 6; + QueryResponse query = 7; + CheckTxResponse check_tx = 9; + CommitResponse commit = 12; + ListSnapshotsResponse list_snapshots = 13; + OfferSnapshotResponse offer_snapshot = 14; + LoadSnapshotChunkResponse load_snapshot_chunk = 15; + ApplySnapshotChunkResponse apply_snapshot_chunk = 16; + PrepareProposalResponse prepare_proposal = 17; + ProcessProposalResponse process_proposal = 18; + ExtendVoteResponse extend_vote = 19; + VerifyVoteExtensionResponse verify_vote_extension = 20; + FinalizeBlockResponse finalize_block = 21; } reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock } -message ResponseOfferSnapshot { +// nondeterministic +message ExceptionResponse { + string error = 1; +} + +message EchoResponse { + string message = 1; +} + +message FlushResponse {} + +message InfoResponse { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +message InitChainResponse { + cometbft.types.v1beta3.ConsensusParams consensus_params = 1; + repeated v1beta1.ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; +} + +message QueryResponse { + uint32 code = 1; + // bytes data = 2; // use "value" instead. + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + cometbft.crypto.v1beta1.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message CheckTxResponse { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated v1beta2.Event events = 7 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "events,omitempty" + ]; + string codespace = 8; + + // These reserved fields were used till v0.37 by the priority mempool (now + // removed). + reserved 9 to 11; + reserved "sender", "priority", "mempool_error"; +} + +message CommitResponse { + reserved 1, 2; // data was previously returned here + int64 retain_height = 3; +} + +message ListSnapshotsResponse { + repeated v1beta1.Snapshot snapshots = 1; +} + +message OfferSnapshotResponse { OfferSnapshotResult result = 1; } @@ -179,7 +300,11 @@ enum OfferSnapshotResult { OFFER_SNAPSHOT_RESULT_REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } -message ResponseApplySnapshotChunk { +message LoadSnapshotChunkResponse { + bytes chunk = 1; +} + +message ApplySnapshotChunkResponse { ApplySnapshotChunkResult result = 1; repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply repeated string reject_senders = 3; // Chunk senders to reject and ban @@ -196,7 +321,11 @@ enum ApplySnapshotChunkResult { APPLY_SNAPSHOT_CHUNK_RESULT_REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } -message ResponseProcessProposal { +message PrepareProposalResponse { + repeated bytes txs = 1; +} + +message ProcessProposalResponse { ProcessProposalStatus status = 1; } @@ -208,7 +337,11 @@ enum ProcessProposalStatus { PROCESS_PROPOSAL_STATUS_REJECT = 2; } -message ResponseVerifyVoteExtension { +message ExtendVoteResponse { + bytes vote_extension = 1; +} + +message VerifyVoteExtensionResponse { VerifyVoteExtensionStatus status = 1; } @@ -224,6 +357,26 @@ enum VerifyVoteExtensionStatus { VERIFY_VOTE_EXTENSION_STATUS_REJECT = 2; } +message FinalizeBlockResponse { + // set of block events emmitted as part of executing the block + repeated v1beta2.Event events = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "events,omitempty" + ]; + // the result of executing each transaction including the events + // the particular transaction emitted. This should match the order + // of the transactions delivered in the block itself + repeated v1beta3.ExecTxResult tx_results = 2; + // a list of updates to the validator set. These will reflect the validator set at current height + 2. + repeated v1beta1.ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; + // updates to the consensus params, if any. + cometbft.types.v1beta3.ConsensusParams consensus_param_updates = 4; + // app_hash is the hash of the applications' state which is used to confirm + // that execution of the transactions was deterministic. + // It is up to the application to decide which algorithm to use. + bytes app_hash = 5; +} + //---------------------------------------- // Blockchain Types diff --git a/proto/cometbft/services/block_results/v1beta1/block_results.proto b/proto/cometbft/services/block_results/v1beta1/block_results.proto index 0316cc67c4..62cb158fbd 100644 --- a/proto/cometbft/services/block_results/v1beta1/block_results.proto +++ b/proto/cometbft/services/block_results/v1beta1/block_results.proto @@ -12,14 +12,22 @@ message GetBlockResultsRequest { int64 height = 1; } -message GetLatestBlockResultsRequest { -} +message GetLatestBlockResultsRequest {} message GetBlockResultsResponse { - int64 height = 1; - repeated cometbft.abci.v1beta3.ExecTxResult txs_results = 2; - repeated cometbft.abci.v1beta2.Event finalize_block_events = 3; - repeated cometbft.abci.v1beta1.ValidatorUpdate validator_updates = 4; - cometbft.types.v1beta3.ConsensusParams consensus_param_updates = 5; - bytes app_hash = 6; + int64 height = 1; + repeated cometbft.abci.v1beta3.ExecTxResult tx_results = 2; + repeated cometbft.abci.v1beta2.Event finalize_block_events = 3; + repeated cometbft.abci.v1beta1.ValidatorUpdate validator_updates = 4; + cometbft.types.v1beta3.ConsensusParams consensus_param_updates = 5; + bytes app_hash = 6; +} + +message GetLatestBlockResultsResponse { + int64 height = 1; + repeated cometbft.abci.v1beta3.ExecTxResult tx_results = 2; + repeated cometbft.abci.v1beta2.Event finalize_block_events = 3; + repeated cometbft.abci.v1beta1.ValidatorUpdate validator_updates = 4; + cometbft.types.v1beta3.ConsensusParams consensus_param_updates = 5; + bytes app_hash = 6; } diff --git a/proto/cometbft/services/block_results/v1beta1/block_results_service.proto b/proto/cometbft/services/block_results/v1beta1/block_results_service.proto index b0308efce8..b0430c0347 100644 --- a/proto/cometbft/services/block_results/v1beta1/block_results_service.proto +++ b/proto/cometbft/services/block_results/v1beta1/block_results_service.proto @@ -13,5 +13,5 @@ service BlockResultsService { rpc GetBlockResults(GetBlockResultsRequest) returns (GetBlockResultsResponse); // GetLatestBlockResults returns the BlockResults of the latest committed height. - rpc GetLatestBlockResults(GetLatestBlockResultsRequest) returns (GetBlockResultsResponse); + rpc GetLatestBlockResults(GetLatestBlockResultsRequest) returns (GetLatestBlockResultsResponse); } diff --git a/proto/cometbft/state/v1beta4/types.proto b/proto/cometbft/state/v1beta4/types.proto new file mode 100644 index 0000000000..b45db748e1 --- /dev/null +++ b/proto/cometbft/state/v1beta4/types.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package cometbft.state.v1beta4; + +import "cometbft/abci/v1beta4/types.proto"; +import "cometbft/state/v1beta3/types.proto"; + +option go_package = "github.com/cometbft/cometbft/api/cometbft/state/v1beta4"; + +message ABCIResponsesInfo { + // Retains the responses of the legacy ABCI calls during block processing. + v1beta3.LegacyABCIResponses legacy_abci_responses = 1; + int64 height = 2; + cometbft.abci.v1beta4.FinalizeBlockResponse finalize_block = 3; +} diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 4e9544cf24..4ff3f744ed 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -17,39 +17,39 @@ import ( type AppConnConsensus interface { Error() error - InitChain(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error) - PrepareProposal(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) - ProcessProposal(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) - ExtendVote(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error) - VerifyVoteExtension(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) - FinalizeBlock(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) - Commit(context.Context) (*types.ResponseCommit, error) + InitChain(context.Context, *types.InitChainRequest) (*types.InitChainResponse, error) + PrepareProposal(context.Context, *types.PrepareProposalRequest) (*types.PrepareProposalResponse, error) + ProcessProposal(context.Context, *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) + ExtendVote(context.Context, *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) + VerifyVoteExtension(context.Context, *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) + FinalizeBlock(context.Context, *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) + Commit(context.Context) (*types.CommitResponse, error) } type AppConnMempool interface { SetResponseCallback(abcicli.Callback) Error() error - CheckTx(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error) - CheckTxAsync(context.Context, *types.RequestCheckTx) (*abcicli.ReqRes, error) + CheckTx(context.Context, *types.CheckTxRequest) (*types.CheckTxResponse, error) + CheckTxAsync(context.Context, *types.CheckTxRequest) (*abcicli.ReqRes, error) Flush(context.Context) error } type AppConnQuery interface { Error() error - Echo(context.Context, string) (*types.ResponseEcho, error) - Info(context.Context, *types.RequestInfo) (*types.ResponseInfo, error) - Query(context.Context, *types.RequestQuery) (*types.ResponseQuery, error) + Echo(context.Context, string) (*types.EchoResponse, error) + Info(context.Context, *types.InfoRequest) (*types.InfoResponse, error) + Query(context.Context, *types.QueryRequest) (*types.QueryResponse, error) } type AppConnSnapshot interface { Error() error - ListSnapshots(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) - OfferSnapshot(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) - LoadSnapshotChunk(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunk(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) + ListSnapshots(context.Context, *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) + OfferSnapshot(context.Context, *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) + LoadSnapshotChunk(context.Context, *types.LoadSnapshotChunkRequest) (*types.LoadSnapshotChunkResponse, error) + ApplySnapshotChunk(context.Context, *types.ApplySnapshotChunkRequest) (*types.ApplySnapshotChunkResponse, error) } //----------------------------------------------------------------------------------------- @@ -73,40 +73,41 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *appConnConsensus) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "init_chain", "type", "sync"))() return app.appConn.InitChain(ctx, req) } func (app *appConnConsensus) PrepareProposal(ctx context.Context, - req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { + req *types.PrepareProposalRequest, +) (*types.PrepareProposalResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "prepare_proposal", "type", "sync"))() return app.appConn.PrepareProposal(ctx, req) } -func (app *appConnConsensus) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { +func (app *appConnConsensus) ProcessProposal(ctx context.Context, req *types.ProcessProposalRequest) (*types.ProcessProposalResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "process_proposal", "type", "sync"))() return app.appConn.ProcessProposal(ctx, req) } -func (app *appConnConsensus) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) { +func (app *appConnConsensus) ExtendVote(ctx context.Context, req *types.ExtendVoteRequest) (*types.ExtendVoteResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "extend_vote", "type", "sync"))() return app.appConn.ExtendVote(ctx, req) } -func (app *appConnConsensus) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { +func (app *appConnConsensus) VerifyVoteExtension(ctx context.Context, req *types.VerifyVoteExtensionRequest) (*types.VerifyVoteExtensionResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "verify_vote_extension", "type", "sync"))() return app.appConn.VerifyVoteExtension(ctx, req) } -func (app *appConnConsensus) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { +func (app *appConnConsensus) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "finalize_block", "type", "sync"))() return app.appConn.FinalizeBlock(ctx, req) } -func (app *appConnConsensus) Commit(ctx context.Context) (*types.ResponseCommit, error) { +func (app *appConnConsensus) Commit(ctx context.Context) (*types.CommitResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "commit", "type", "sync"))() - return app.appConn.Commit(ctx, &types.RequestCommit{}) + return app.appConn.Commit(ctx, &types.CommitRequest{}) } //------------------------------------------------ @@ -137,12 +138,12 @@ func (app *appConnMempool) Flush(ctx context.Context) error { return app.appConn.Flush(ctx) } -func (app *appConnMempool) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *appConnMempool) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "check_tx", "type", "sync"))() return app.appConn.CheckTx(ctx, req) } -func (app *appConnMempool) CheckTxAsync(ctx context.Context, req *types.RequestCheckTx) (*abcicli.ReqRes, error) { +func (app *appConnMempool) CheckTxAsync(ctx context.Context, req *types.CheckTxRequest) (*abcicli.ReqRes, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "check_tx", "type", "async"))() return app.appConn.CheckTxAsync(ctx, req) } @@ -166,17 +167,17 @@ func (app *appConnQuery) Error() error { return app.appConn.Error() } -func (app *appConnQuery) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) { +func (app *appConnQuery) Echo(ctx context.Context, msg string) (*types.EchoResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "echo", "type", "sync"))() return app.appConn.Echo(ctx, msg) } -func (app *appConnQuery) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { +func (app *appConnQuery) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "info", "type", "sync"))() return app.appConn.Info(ctx, req) } -func (app *appConnQuery) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { +func (app *appConnQuery) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "query", "type", "sync"))() return app.appConn.Query(ctx, req) } @@ -200,22 +201,22 @@ func (app *appConnSnapshot) Error() error { return app.appConn.Error() } -func (app *appConnSnapshot) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (app *appConnSnapshot) ListSnapshots(ctx context.Context, req *types.ListSnapshotsRequest) (*types.ListSnapshotsResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "list_snapshots", "type", "sync"))() return app.appConn.ListSnapshots(ctx, req) } -func (app *appConnSnapshot) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (app *appConnSnapshot) OfferSnapshot(ctx context.Context, req *types.OfferSnapshotRequest) (*types.OfferSnapshotResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "offer_snapshot", "type", "sync"))() return app.appConn.OfferSnapshot(ctx, req) } -func (app *appConnSnapshot) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { +func (app *appConnSnapshot) LoadSnapshotChunk(ctx context.Context, req *types.LoadSnapshotChunkRequest) (*types.LoadSnapshotChunkResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "load_snapshot_chunk", "type", "sync"))() return app.appConn.LoadSnapshotChunk(ctx, req) } -func (app *appConnSnapshot) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { +func (app *appConnSnapshot) ApplySnapshotChunk(ctx context.Context, req *types.ApplySnapshotChunkRequest) (*types.ApplySnapshotChunkResponse, error) { defer addTimeSample(app.metrics.MethodTimingSeconds.With("method", "apply_snapshot_chunk", "type", "sync"))() return app.appConn.ApplySnapshotChunk(ctx, req) } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index 4fed078c50..8d76722fa3 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -44,7 +44,7 @@ func TestEcho(t *testing.T) { t.Log("Connected") for i := 0; i < 1000; i++ { - _, err = proxy.CheckTx(context.Background(), &abci.RequestCheckTx{ + _, err = proxy.CheckTx(context.Background(), &abci.CheckTxRequest{ Tx: []byte(fmt.Sprintf("echo-%v", i)), Type: abci.CHECK_TX_TYPE_CHECK, }) @@ -89,7 +89,7 @@ func BenchmarkEcho(b *testing.B) { b.StartTimer() // Start benchmarking tests for i := 0; i < b.N; i++ { - _, err = proxy.CheckTx(context.Background(), &abci.RequestCheckTx{ + _, err = proxy.CheckTx(context.Background(), &abci.CheckTxRequest{ Tx: []byte("hello"), Type: abci.CHECK_TX_TYPE_CHECK, }) diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index 8f56d46d25..3cb02fc5d3 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -7,9 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v2 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta2" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" - v4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // AppConnConsensus is an autogenerated mock type for the AppConnConsensus type @@ -18,19 +16,19 @@ type AppConnConsensus struct { } // Commit provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) Commit(_a0 context.Context) (*v3.ResponseCommit, error) { +func (_m *AppConnConsensus) Commit(_a0 context.Context) (*v1beta4.CommitResponse, error) { ret := _m.Called(_a0) - var r0 *v3.ResponseCommit + var r0 *v1beta4.CommitResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*v3.ResponseCommit, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) (*v1beta4.CommitResponse, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(context.Context) *v3.ResponseCommit); ok { + if rf, ok := ret.Get(0).(func(context.Context) *v1beta4.CommitResponse); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCommit) + r0 = ret.Get(0).(*v1beta4.CommitResponse) } } @@ -58,23 +56,23 @@ func (_m *AppConnConsensus) Error() error { } // ExtendVote provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) ExtendVote(_a0 context.Context, _a1 *v4.RequestExtendVote) (*v3.ResponseExtendVote, error) { +func (_m *AppConnConsensus) ExtendVote(_a0 context.Context, _a1 *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseExtendVote + var r0 *v1beta4.ExtendVoteResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) (*v3.ResponseExtendVote, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) (*v1beta4.ExtendVoteResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestExtendVote) *v3.ResponseExtendVote); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ExtendVoteRequest) *v1beta4.ExtendVoteResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseExtendVote) + r0 = ret.Get(0).(*v1beta4.ExtendVoteResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestExtendVote) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ExtendVoteRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -84,23 +82,23 @@ func (_m *AppConnConsensus) ExtendVote(_a0 context.Context, _a1 *v4.RequestExten } // FinalizeBlock provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) FinalizeBlock(_a0 context.Context, _a1 *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error) { +func (_m *AppConnConsensus) FinalizeBlock(_a0 context.Context, _a1 *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseFinalizeBlock + var r0 *v1beta4.FinalizeBlockResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) (*v3.ResponseFinalizeBlock, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) (*v1beta4.FinalizeBlockResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestFinalizeBlock) *v3.ResponseFinalizeBlock); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.FinalizeBlockRequest) *v1beta4.FinalizeBlockResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseFinalizeBlock) + r0 = ret.Get(0).(*v1beta4.FinalizeBlockResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestFinalizeBlock) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.FinalizeBlockRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -110,23 +108,23 @@ func (_m *AppConnConsensus) FinalizeBlock(_a0 context.Context, _a1 *v4.RequestFi } // InitChain provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) InitChain(_a0 context.Context, _a1 *v3.RequestInitChain) (*v3.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChain(_a0 context.Context, _a1 *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseInitChain + var r0 *v1beta4.InitChainResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) (*v3.ResponseInitChain, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) (*v1beta4.InitChainResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestInitChain) *v3.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InitChainRequest) *v1beta4.InitChainResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseInitChain) + r0 = ret.Get(0).(*v1beta4.InitChainResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InitChainRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -136,23 +134,23 @@ func (_m *AppConnConsensus) InitChain(_a0 context.Context, _a1 *v3.RequestInitCh } // PrepareProposal provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) PrepareProposal(_a0 context.Context, _a1 *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error) { +func (_m *AppConnConsensus) PrepareProposal(_a0 context.Context, _a1 *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v2.ResponsePrepareProposal + var r0 *v1beta4.PrepareProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) (*v2.ResponsePrepareProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) (*v1beta4.PrepareProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestPrepareProposal) *v2.ResponsePrepareProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.PrepareProposalRequest) *v1beta4.PrepareProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v2.ResponsePrepareProposal) + r0 = ret.Get(0).(*v1beta4.PrepareProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestPrepareProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.PrepareProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -162,23 +160,23 @@ func (_m *AppConnConsensus) PrepareProposal(_a0 context.Context, _a1 *v4.Request } // ProcessProposal provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) ProcessProposal(_a0 context.Context, _a1 *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error) { +func (_m *AppConnConsensus) ProcessProposal(_a0 context.Context, _a1 *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseProcessProposal + var r0 *v1beta4.ProcessProposalResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) (*v4.ResponseProcessProposal, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) (*v1beta4.ProcessProposalResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestProcessProposal) *v4.ResponseProcessProposal); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ProcessProposalRequest) *v1beta4.ProcessProposalResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseProcessProposal) + r0 = ret.Get(0).(*v1beta4.ProcessProposalResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestProcessProposal) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ProcessProposalRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -188,23 +186,23 @@ func (_m *AppConnConsensus) ProcessProposal(_a0 context.Context, _a1 *v4.Request } // VerifyVoteExtension provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) VerifyVoteExtension(_a0 context.Context, _a1 *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error) { +func (_m *AppConnConsensus) VerifyVoteExtension(_a0 context.Context, _a1 *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseVerifyVoteExtension + var r0 *v1beta4.VerifyVoteExtensionResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) (*v4.ResponseVerifyVoteExtension, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) (*v1beta4.VerifyVoteExtensionResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v3.RequestVerifyVoteExtension) *v4.ResponseVerifyVoteExtension); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) *v1beta4.VerifyVoteExtensionResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseVerifyVoteExtension) + r0 = ret.Get(0).(*v1beta4.VerifyVoteExtensionResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v3.RequestVerifyVoteExtension) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.VerifyVoteExtensionRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_mempool.go b/proxy/mocks/app_conn_mempool.go index d80367ef67..690e236c47 100644 --- a/proxy/mocks/app_conn_mempool.go +++ b/proxy/mocks/app_conn_mempool.go @@ -9,8 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" - v4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // AppConnMempool is an autogenerated mock type for the AppConnMempool type @@ -19,23 +18,23 @@ type AppConnMempool struct { } // CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) (*v3.ResponseCheckTx, error) { +func (_m *AppConnMempool) CheckTx(_a0 context.Context, _a1 *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v3.ResponseCheckTx + var r0 *v1beta4.CheckTxResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) (*v3.ResponseCheckTx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) (*v1beta4.CheckTxResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) *v3.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) *v1beta4.CheckTxResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseCheckTx) + r0 = ret.Get(0).(*v1beta4.CheckTxResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CheckTxRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -45,15 +44,15 @@ func (_m *AppConnMempool) CheckTx(_a0 context.Context, _a1 *v4.RequestCheckTx) ( } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTxAsync(_a0 context.Context, _a1 *v4.RequestCheckTx) (*abcicli.ReqRes, error) { +func (_m *AppConnMempool) CheckTxAsync(_a0 context.Context, _a1 *v1beta4.CheckTxRequest) (*abcicli.ReqRes, error) { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) (*abcicli.ReqRes, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) (*abcicli.ReqRes, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v4.RequestCheckTx) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.CheckTxRequest) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -61,7 +60,7 @@ func (_m *AppConnMempool) CheckTxAsync(_a0 context.Context, _a1 *v4.RequestCheck } } - if rf, ok := ret.Get(1).(func(context.Context, *v4.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.CheckTxRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_query.go b/proxy/mocks/app_conn_query.go index cfda005491..809855fd65 100644 --- a/proxy/mocks/app_conn_query.go +++ b/proxy/mocks/app_conn_query.go @@ -7,8 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta1" - v2 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta2" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // AppConnQuery is an autogenerated mock type for the AppConnQuery type @@ -17,19 +16,19 @@ type AppConnQuery struct { } // Echo provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Echo(_a0 context.Context, _a1 string) (*v1.ResponseEcho, error) { +func (_m *AppConnQuery) Echo(_a0 context.Context, _a1 string) (*v1beta4.EchoResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseEcho + var r0 *v1beta4.EchoResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1.ResponseEcho, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1beta4.EchoResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1.ResponseEcho); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) *v1beta4.EchoResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseEcho) + r0 = ret.Get(0).(*v1beta4.EchoResponse) } } @@ -57,23 +56,23 @@ func (_m *AppConnQuery) Error() error { } // Info provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.ResponseInfo, error) { +func (_m *AppConnQuery) Info(_a0 context.Context, _a1 *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseInfo + var r0 *v1beta4.InfoResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) (*v1.ResponseInfo, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) (*v1beta4.InfoResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v2.RequestInfo) *v1.ResponseInfo); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.InfoRequest) *v1beta4.InfoResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseInfo) + r0 = ret.Get(0).(*v1beta4.InfoResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v2.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.InfoRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -83,23 +82,23 @@ func (_m *AppConnQuery) Info(_a0 context.Context, _a1 *v2.RequestInfo) (*v1.Resp } // Query provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Query(_a0 context.Context, _a1 *v1.RequestQuery) (*v1.ResponseQuery, error) { +func (_m *AppConnQuery) Query(_a0 context.Context, _a1 *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseQuery + var r0 *v1beta4.QueryResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) (*v1.ResponseQuery, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) (*v1beta4.QueryResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestQuery) *v1.ResponseQuery); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryRequest) *v1beta4.QueryResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseQuery) + r0 = ret.Get(0).(*v1beta4.QueryResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_snapshot.go b/proxy/mocks/app_conn_snapshot.go index a708625e59..221b27d5a0 100644 --- a/proxy/mocks/app_conn_snapshot.go +++ b/proxy/mocks/app_conn_snapshot.go @@ -7,8 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta1" - v4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // AppConnSnapshot is an autogenerated mock type for the AppConnSnapshot type @@ -17,23 +16,23 @@ type AppConnSnapshot struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) ApplySnapshotChunk(_a0 context.Context, _a1 *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error) { +func (_m *AppConnSnapshot) ApplySnapshotChunk(_a0 context.Context, _a1 *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseApplySnapshotChunk + var r0 *v1beta4.ApplySnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) (*v4.ResponseApplySnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) (*v1beta4.ApplySnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestApplySnapshotChunk) *v4.ResponseApplySnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) *v1beta4.ApplySnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*v1beta4.ApplySnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ApplySnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -57,23 +56,23 @@ func (_m *AppConnSnapshot) Error() error { } // ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) ListSnapshots(_a0 context.Context, _a1 *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error) { +func (_m *AppConnSnapshot) ListSnapshots(_a0 context.Context, _a1 *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseListSnapshots + var r0 *v1beta4.ListSnapshotsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) (*v1.ResponseListSnapshots, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) (*v1beta4.ListSnapshotsResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestListSnapshots) *v1.ResponseListSnapshots); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.ListSnapshotsRequest) *v1beta4.ListSnapshotsResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseListSnapshots) + r0 = ret.Get(0).(*v1beta4.ListSnapshotsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.ListSnapshotsRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -83,23 +82,23 @@ func (_m *AppConnSnapshot) ListSnapshots(_a0 context.Context, _a1 *v1.RequestLis } // LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error) { +func (_m *AppConnSnapshot) LoadSnapshotChunk(_a0 context.Context, _a1 *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v1.ResponseLoadSnapshotChunk + var r0 *v1beta4.LoadSnapshotChunkResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) (*v1.ResponseLoadSnapshotChunk, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) (*v1beta4.LoadSnapshotChunkResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestLoadSnapshotChunk) *v1.ResponseLoadSnapshotChunk); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) *v1beta4.LoadSnapshotChunkResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*v1beta4.LoadSnapshotChunkResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.LoadSnapshotChunkRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -109,23 +108,23 @@ func (_m *AppConnSnapshot) LoadSnapshotChunk(_a0 context.Context, _a1 *v1.Reques } // OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) OfferSnapshot(_a0 context.Context, _a1 *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error) { +func (_m *AppConnSnapshot) OfferSnapshot(_a0 context.Context, _a1 *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error) { ret := _m.Called(_a0, _a1) - var r0 *v4.ResponseOfferSnapshot + var r0 *v1beta4.OfferSnapshotResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) (*v4.ResponseOfferSnapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) (*v1beta4.OfferSnapshotResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *v1.RequestOfferSnapshot) *v4.ResponseOfferSnapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.OfferSnapshotRequest) *v1beta4.OfferSnapshotResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v4.ResponseOfferSnapshot) + r0 = ret.Get(0).(*v1beta4.OfferSnapshotResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *v1.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.OfferSnapshotRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/proxy/version.go b/proxy/version.go index 134dfc4aea..9a2fe4e252 100644 --- a/proxy/version.go +++ b/proxy/version.go @@ -5,10 +5,10 @@ import ( "github.com/cometbft/cometbft/version" ) -// RequestInfo contains all the information for sending -// the abci.RequestInfo message during handshake with the app. +// InfoRequest contains all the information for sending +// the abci.InfoRequest message during handshake with the app. // It contains only compile-time version information. -var RequestInfo = &abci.RequestInfo{ +var InfoRequest = &abci.InfoRequest{ Version: version.TMCoreSemVer, BlockVersion: version.BlockProtocol, P2PVersion: version.P2PProtocol, diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index c3825361f1..9375df010f 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -27,9 +27,7 @@ import ( "github.com/cometbft/cometbft/types" ) -var ( - ctx = context.Background() -) +var ctx = context.Background() func getHTTPClient() *rpchttp.HTTP { rpcAddr := rpctest.GetConfig().RPC.ListenAddress @@ -297,9 +295,9 @@ func TestAppCalls(t *testing.T) { blockResults, err := c.BlockResults(context.Background(), &txh) require.Nil(err, "%d: %+v", i, err) assert.Equal(txh, blockResults.Height) - if assert.Equal(1, len(blockResults.TxsResults)) { + if assert.Equal(1, len(blockResults.TxResults)) { // check success code - assert.EqualValues(0, blockResults.TxsResults[0].Code) + assert.EqualValues(0, blockResults.TxResults[0].Code) } // check blockchain info, now that we know there is info @@ -376,7 +374,7 @@ func TestBroadcastTxCommit(t *testing.T) { func TestUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.ResponseCheckTx, 1) + ch := make(chan *abci.CheckTxResponse, 1) mempool := node.Mempool() reqRes, err := mempool.CheckTx(tx) require.NoError(t, err) @@ -407,7 +405,7 @@ func TestUnconfirmedTxs(t *testing.T) { func TestNumUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.ResponseCheckTx, 1) + ch := make(chan *abci.CheckTxResponse, 1) mempool := node.Mempool() reqRes, err := mempool.CheckTx(tx) require.NoError(t, err) @@ -540,8 +538,8 @@ func TestBlockSearch(t *testing.T) { // otherwise it is 0 require.Equal(t, blockCount, 0) - } + func TestTxSearch(t *testing.T) { c := getHTTPClient() diff --git a/rpc/core/abci.go b/rpc/core/abci.go index cdf7fad22c..84e1d35a9f 100644 --- a/rpc/core/abci.go +++ b/rpc/core/abci.go @@ -19,7 +19,7 @@ func (env *Environment) ABCIQuery( height int64, prove bool, ) (*ctypes.ResultABCIQuery, error) { - resQuery, err := env.ProxyAppQuery.Query(context.TODO(), &abci.RequestQuery{ + resQuery, err := env.ProxyAppQuery.Query(context.TODO(), &abci.QueryRequest{ Path: path, Data: data, Height: height, @@ -35,7 +35,7 @@ func (env *Environment) ABCIQuery( // ABCIInfo gets some info about the application. // More: https://docs.cometbft.com/main/rpc/#/ABCI/abci_info func (env *Environment) ABCIInfo(_ *rpctypes.Context) (*ctypes.ResultABCIInfo, error) { - resInfo, err := env.ProxyAppQuery.Info(context.TODO(), proxy.RequestInfo) + resInfo, err := env.ProxyAppQuery.Info(context.TODO(), proxy.InfoRequest) if err != nil { return nil, err } diff --git a/rpc/core/blocks.go b/rpc/core/blocks.go index a29680b798..b1aa148aad 100644 --- a/rpc/core/blocks.go +++ b/rpc/core/blocks.go @@ -194,7 +194,7 @@ func (env *Environment) BlockResults(_ *rpctypes.Context, heightPtr *int64) (*ct return &ctypes.ResultBlockResults{ Height: height, - TxsResults: results.TxResults, + TxResults: results.TxResults, FinalizeBlockEvents: results.Events, ValidatorUpdates: results.ValidatorUpdates, ConsensusParamUpdates: results.ConsensusParamUpdates, diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 88bf57ceb4..b6ab389d2b 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -68,7 +68,7 @@ func TestBlockchainInfo(t *testing.T) { } func TestBlockResults(t *testing.T) { - results := &abci.ResponseFinalizeBlock{ + results := &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Code: 0, Data: []byte{0x01}, Log: "ok"}, {Code: 0, Data: []byte{0x02}, Log: "ok"}, @@ -97,7 +97,7 @@ func TestBlockResults(t *testing.T) { {101, true, nil}, {100, false, &ctypes.ResultBlockResults{ Height: 100, - TxsResults: results.TxResults, + TxResults: results.TxResults, FinalizeBlockEvents: results.Events, ValidatorUpdates: results.ValidatorUpdates, ConsensusParamUpdates: results.ConsensusParamUpdates, diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 24c1897ccb..3c38678dfb 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -39,7 +39,7 @@ func (env *Environment) BroadcastTxSync(ctx *rpctypes.Context, tx types.Tx) (*ct return nil, ErrEndpointClosedCatchingUp } - resCh := make(chan *abci.ResponseCheckTx, 1) + resCh := make(chan *abci.CheckTxResponse, 1) reqRes, err := env.Mempool.CheckTx(tx) if err != nil { return nil, err @@ -96,7 +96,7 @@ func (env *Environment) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (* }() // Broadcast tx and wait for CheckTx result - checkTxResCh := make(chan *abci.ResponseCheckTx, 1) + checkTxResCh := make(chan *abci.CheckTxResponse, 1) reqRes, err := env.Mempool.CheckTx(tx) if err != nil { env.Logger.Error("Error on broadcastTxCommit", "err", err) @@ -186,9 +186,9 @@ func (env *Environment) NumUnconfirmedTxs(*rpctypes.Context) (*ctypes.ResultUnco // be added to the mempool either. // More: https://docs.cometbft.com/main/rpc/#/Tx/check_tx func (env *Environment) CheckTx(_ *rpctypes.Context, tx types.Tx) (*ctypes.ResultCheckTx, error) { - res, err := env.ProxyAppMempool.CheckTx(context.TODO(), &abci.RequestCheckTx{Tx: tx, Type: abci.CHECK_TX_TYPE_CHECK}) + res, err := env.ProxyAppMempool.CheckTx(context.TODO(), &abci.CheckTxRequest{Tx: tx, Type: abci.CHECK_TX_TYPE_CHECK}) if err != nil { return nil, err } - return &ctypes.ResultCheckTx{ResponseCheckTx: *res}, nil + return &ctypes.ResultCheckTx{CheckTxResponse: *res}, nil } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index bdc7b5da95..9e92e9341c 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -53,7 +53,7 @@ type ResultCommit struct { // ABCI results from a block type ResultBlockResults struct { Height int64 `json:"height"` - TxsResults []*abci.ExecTxResult `json:"txs_results"` + TxResults []*abci.ExecTxResult `json:"txs_results"` FinalizeBlockEvents []abci.Event `json:"finalize_block_events"` ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"` ConsensusParamUpdates *cmtproto.ConsensusParams `json:"consensus_param_updates"` @@ -63,8 +63,8 @@ type ResultBlockResults struct { // NewResultCommit is a helper to initialize the ResultCommit with // the embedded struct func NewResultCommit(header *types.Header, commit *types.Commit, - canonical bool) *ResultCommit { - + canonical bool, +) *ResultCommit { return &ResultCommit{ SignedHeader: types.SignedHeader{ Header: header, @@ -183,15 +183,15 @@ type ResultBroadcastTx struct { // CheckTx and ExecTx results type ResultBroadcastTxCommit struct { - CheckTx abci.ResponseCheckTx `json:"check_tx"` + CheckTx abci.CheckTxResponse `json:"check_tx"` TxResult abci.ExecTxResult `json:"tx_result"` Hash bytes.HexBytes `json:"hash"` Height int64 `json:"height"` } -// ResultCheckTx wraps abci.ResponseCheckTx. +// ResultCheckTx wraps abci.CheckTxResponse. type ResultCheckTx struct { - abci.ResponseCheckTx + abci.CheckTxResponse } // Result of querying for a tx @@ -226,12 +226,12 @@ type ResultUnconfirmedTxs struct { // Info abci msg type ResultABCIInfo struct { - Response abci.ResponseInfo `json:"response"` + Response abci.InfoResponse `json:"response"` } // Query abci msg type ResultABCIQuery struct { - Response abci.ResponseQuery `json:"response"` + Response abci.QueryResponse `json:"response"` } // Result of broadcasting evidence diff --git a/rpc/grpc/client/block_results_service.go b/rpc/grpc/client/block_results_service.go index 3e5f6cb358..a0bb1219cb 100644 --- a/rpc/grpc/client/block_results_service.go +++ b/rpc/grpc/client/block_results_service.go @@ -14,7 +14,7 @@ import ( type BlockResults struct { Height int64 `json:"height"` - TxsResults []*abci.ExecTxResult `json:"txs_results"` + TxResults []*abci.ExecTxResult `json:"txs_results"` FinalizeBlockEvents []*abci.Event `json:"finalize_block_events"` ValidatorUpdates []*abci.ValidatorUpdate `json:"validator_updates"` ConsensusParamUpdates *cmtproto.ConsensusParams `json:"consensus_param_updates"` @@ -39,7 +39,7 @@ func (b blockResultServiceClient) GetBlockResults(ctx context.Context, height in return &BlockResults{ Height: res.Height, - TxsResults: res.TxsResults, + TxResults: res.TxResults, FinalizeBlockEvents: res.FinalizeBlockEvents, ValidatorUpdates: res.ValidatorUpdates, ConsensusParamUpdates: res.ConsensusParamUpdates, @@ -55,7 +55,7 @@ func (b blockResultServiceClient) GetLatestBlockResults(ctx context.Context) (*B return &BlockResults{ Height: res.Height, - TxsResults: res.TxsResults, + TxResults: res.TxResults, FinalizeBlockEvents: res.FinalizeBlockEvents, ValidatorUpdates: res.ValidatorUpdates, ConsensusParamUpdates: res.ConsensusParamUpdates, diff --git a/rpc/grpc/server/services/blockresultservice/service.go b/rpc/grpc/server/services/blockresultservice/service.go index 638d719663..c8cdb7753d 100644 --- a/rpc/grpc/server/services/blockresultservice/service.go +++ b/rpc/grpc/server/services/blockresultservice/service.go @@ -48,7 +48,7 @@ func (s *blockResultsService) GetBlockResults(_ context.Context, req *brs.GetBlo return &brs.GetBlockResultsResponse{ Height: req.Height, - TxsResults: res.TxResults, + TxResults: res.TxResults, FinalizeBlockEvents: formatProtoToRef(res.Events), ValidatorUpdates: formatProtoToRef(res.ValidatorUpdates), AppHash: res.AppHash, @@ -56,7 +56,7 @@ func (s *blockResultsService) GetBlockResults(_ context.Context, req *brs.GetBlo } // GetLatest BlockResults returns the block results of the last committed height. -func (s *blockResultsService) GetLatestBlockResults(_ context.Context, _ *brs.GetLatestBlockResultsRequest) (*brs.GetBlockResultsResponse, error) { +func (s *blockResultsService) GetLatestBlockResults(_ context.Context, _ *brs.GetLatestBlockResultsRequest) (*brs.GetLatestBlockResultsResponse, error) { logger := s.logger.With("endpoint", "GetBlockResults") ss, err := s.stateStore.Load() if err != nil { @@ -70,9 +70,9 @@ func (s *blockResultsService) GetLatestBlockResults(_ context.Context, _ *brs.Ge return nil, status.Error(codes.Internal, "Internal server error") } - return &brs.GetBlockResultsResponse{ + return &brs.GetLatestBlockResultsResponse{ Height: ss.LastBlockHeight, - TxsResults: res.TxResults, + TxResults: res.TxResults, FinalizeBlockEvents: formatProtoToRef(res.Events), ValidatorUpdates: formatProtoToRef(res.ValidatorUpdates), AppHash: res.AppHash, diff --git a/spec/abci/abci++_app_requirements.md b/spec/abci/abci++_app_requirements.md index 4055fcf7b9..01facca3c3 100644 --- a/spec/abci/abci++_app_requirements.md +++ b/spec/abci/abci++_app_requirements.md @@ -46,10 +46,10 @@ proposer. Let *sp,h-1* be *p*'s Application's state committed for height *h-1*. Let *vp* (resp. *vq*) be the block that *p*'s (resp. *q*'s) CometBFT passes on to the Application -via `RequestPrepareProposal` as proposer of round *rp* (resp *rq*), height *h*, +via `PrepareProposalRequest` as proposer of round *rp* (resp *rq*), height *h*, also known as the raw proposal. Let *up* (resp. *uq*) the possibly modified block *p*'s (resp. *q*'s) Application -returns via `ResponsePrepareProposal` to CometBFT, also known as the prepared proposal. +returns via `PrepareProposalResponse` to CometBFT, also known as the prepared proposal. Process *p*'s prepared proposal can differ in two different rounds where *p* is the proposer. @@ -66,21 +66,21 @@ compromise liveness because even though `TimeoutPropose` is used as the initial value for proposal timeouts, CometBFT will be dynamically adjust these timeouts such that they will eventually be enough for completing `PrepareProposal`. -* Requirement 2 [`PrepareProposal`, tx-size]: When *p*'s Application calls `ResponsePrepareProposal`, the - total size in bytes of the transactions returned does not exceed `RequestPrepareProposal.max_tx_bytes`. +* Requirement 2 [`PrepareProposal`, tx-size]: When *p*'s Application calls `PrepareProposal`, the + total size in bytes of the transactions returned does not exceed `PrepareProposalRequest.max_tx_bytes`. Busy blockchains might seek to gain full visibility into transactions in CometBFT's mempool, rather than having visibility only on *a* subset of those transactions that fit in a block. The application can do so by setting `ConsensusParams.Block.MaxBytes` to -1. This instructs CometBFT (a) to enforce the maximum possible value for `MaxBytes` (100 MB) at CometBFT level, -and (b) to provide *all* transactions in the mempool when calling `RequestPrepareProposal`. -Under these settings, the aggregated size of all transactions may exceed `RequestPrepareProposal.max_tx_bytes`. +and (b) to provide *all* transactions in the mempool when calling `PrepareProposal`. +Under these settings, the aggregated size of all transactions may exceed `PrepareProposalRequest.max_tx_bytes`. Hence, Requirement 2 ensures that the size in bytes of the transaction list returned by the application will never cause the resulting block to go beyond its byte size limit. * Requirement 3 [`PrepareProposal`, `ProcessProposal`, coherence]: For any two correct processes *p* and *q*, - if *q*'s CometBFT calls `RequestProcessProposal` on *up*, - *q*'s Application returns Accept in `ResponseProcessProposal`. + if *q*'s CometBFT calls `ProcessProposal` on *up*, + *q*'s Application returns Accept in `ProcessProposalResponse`. Requirement 3 makes sure that blocks proposed by correct processes *always* pass the correct receiving process's `ProcessProposal` check. @@ -93,12 +93,12 @@ target for extensive testing and automated verification. * Requirement 4 [`ProcessProposal`, determinism-1]: `ProcessProposal` is a (deterministic) function of the current state and the block that is about to be applied. In other words, for any correct process *p*, and any arbitrary block *u*, - if *p*'s CometBFT calls `RequestProcessProposal` on *u* at height *h*, + if *p*'s CometBFT calls `ProcessProposal` on *u* at height *h*, then *p*'s Application's acceptance or rejection **exclusively** depends on *u* and *sp,h-1*. * Requirement 5 [`ProcessProposal`, determinism-2]: For any two correct processes *p* and *q*, and any arbitrary block *u*, - if *p*'s (resp. *q*'s) CometBFT calls `RequestProcessProposal` on *u* at height *h*, + if *p*'s (resp. *q*'s) CometBFT calls `ProcessProposal` on *u* at height *h*, then *p*'s Application accepts *u* if and only if *q*'s Application accepts *u*. Note that this requirement follows from Requirement 4 and the Agreement property of consensus. @@ -115,18 +115,18 @@ of `ProcessProposal`. As a general rule `ProcessProposal` SHOULD always accept t According to the Tendermint consensus algorithm, currently adopted in CometBFT, a correct process can broadcast at most one precommit message in round *r*, height *h*. -Since, as stated in the [Methods](./abci++_methods.md#extendvote) section, `ResponseExtendVote` +Since, as stated in the [Methods](./abci++_methods.md#extendvote) section, `ExtendVote` is only called when the consensus algorithm is about to broadcast a non-`nil` precommit message, a correct process can only produce one vote extension in round *r*, height *h*. Let *erp* be the vote extension that the Application of a correct process *p* returns via -`ResponseExtendVote` in round *r*, height *h*. -Let *wrp* be the proposed block that *p*'s CometBFT passes to the Application via `RequestExtendVote` +`ExtendVoteResponse` in round *r*, height *h*. +Let *wrp* be the proposed block that *p*'s CometBFT passes to the Application via `ExtendVoteRequest` in round *r*, height *h*. * Requirement 6 [`ExtendVote`, `VerifyVoteExtension`, coherence]: For any two different correct processes *p* and *q*, if *q* receives *erp* from *p* in height *h*, *q*'s - Application returns Accept in `ResponseVerifyVoteExtension`. + Application returns Accept in `VerifyVoteExtensionResponse`. Requirement 6 constrains the creation and handling of vote extensions in a similar way as Requirement 3 constrains the creation and handling of proposed blocks. @@ -139,12 +139,12 @@ extensions will be discarded. * Requirement 7 [`VerifyVoteExtension`, determinism-1]: `VerifyVoteExtension` is a (deterministic) function of the current state, the vote extension received, and the prepared proposal that the extension refers to. In other words, for any correct process *p*, and any arbitrary vote extension *e*, and any arbitrary - block *w*, if *p*'s (resp. *q*'s) CometBFT calls `RequestVerifyVoteExtension` on *e* and *w* at height *h*, + block *w*, if *p*'s (resp. *q*'s) CometBFT calls `VerifyVoteExtension` on *e* and *w* at height *h*, then *p*'s Application's acceptance or rejection **exclusively** depends on *e*, *w* and *sp,h-1*. * Requirement 8 [`VerifyVoteExtension`, determinism-2]: For any two correct processes *p* and *q*, and any arbitrary vote extension *e*, and any arbitrary block *w*, - if *p*'s (resp. *q*'s) CometBFT calls `RequestVerifyVoteExtension` on *e* and *w* at height *h*, + if *p*'s (resp. *q*'s) CometBFT calls `VerifyVoteExtension` on *e* and *w* at height *h*, then *p*'s Application accepts *e* if and only if *q*'s Application accepts *e*. Note that this requirement follows from Requirement 7 and the Agreement property of consensus. @@ -157,16 +157,15 @@ Requirements 7 and 8 can be violated by a bug inducing non-determinism in Extra care should be put in the implementation of `ExtendVote` and `VerifyVoteExtension`. As a general rule, `VerifyVoteExtension` SHOULD always accept the vote extension. -* Requirement 9 [*all*, no-side-effects]: *p*'s calls to `RequestPrepareProposal`, - `RequestProcessProposal`, `RequestExtendVote`, and `RequestVerifyVoteExtension` at height *h* do +* Requirement 9 [*all*, no-side-effects]: *p*'s calls to `PrepareProposal`, + `ProcessProposal`, `ExtendVote`, and `VerifyVoteExtension` at height *h* do not modify *sp,h-1*. - * Requirement 10 [`ExtendVote`, `FinalizeBlock`, non-dependency]: for any correct process *p*, and any vote extension *e* that *p* received at height *h*, the computation of *sp,h* does not depend on *e*. -The call to correct process *p*'s `RequestFinalizeBlock` at height *h*, with block *vp,h* +The call to correct process *p*'s `FinalizeBlock` at height *h*, with block *vp,h* passed as parameter, creates state *sp,h*. Additionally, *p*'s `FinalizeBlock` creates a set of transaction results *Tp,h*. @@ -196,13 +195,13 @@ Likewise, `ExtendVote` can also be non-deterministic: ### Mempool Connection Requirements Let *CheckTxCodestx,p,h* denote the set of result codes returned by *p*'s Application, -via `ResponseCheckTx`, -to successive calls to `RequestCheckTx` occurring while the Application is at height *h* +via `CheckTxResponse`, +to successive calls to `CheckTx` occurring while the Application is at height *h* and having transaction *tx* as parameter. *CheckTxCodestx,p,h* is a set since *p*'s Application may return different result codes during height *h*. If *CheckTxCodestx,p,h* is a singleton set, i.e. the Application always returned -the same result code in `ResponseCheckTx` while at height *h*, +the same result code in `CheckTxResponse` while at height *h*, we define *CheckTxCodetx,p,h* as the singleton value of *CheckTxCodestx,p,h*. If *CheckTxCodestx,p,h* is not a singleton set, *CheckTxCodetx,p,h* is undefined. Let predicate *OK(CheckTxCodetx,p,h)* denote whether *CheckTxCodetx,p,h* is `SUCCESS`. @@ -372,9 +371,9 @@ responded to and no new ones can begin. After the `Commit` call returns, while still holding the mempool lock, `CheckTx` is run again on all transactions that remain in the node's local mempool after filtering those included in the block. -Parameter `Type` in `RequestCheckTx` -indicates whether an incoming transaction is new (`CheckTxType_New`), or a -recheck (`CheckTxType_Recheck`). +Parameter `Type` in `CheckTxRequest` +indicates whether an incoming transaction is new (`CHECK_TX_TYPE_NEW`), or a +recheck (`CHECK_TX_TYPE_RECHECK`). Finally, after re-checking transactions in the mempool, CometBFT will unlock the mempool connection. New transactions are once again able to be processed through `CheckTx`. @@ -424,11 +423,11 @@ For more information, see Section [State Sync](#state-sync). The Application is expected to return a list of [`ExecTxResult`](./abci%2B%2B_methods.md#exectxresult) in -[`ResponseFinalizeBlock`](./abci%2B%2B_methods.md#finalizeblock). The list of transaction +[`FinalizeBlockResponse`](./abci%2B%2B_methods.md#finalizeblock). The list of transaction results MUST respect the same order as the list of transactions delivered via -[`RequestFinalizeBlock`](./abci%2B%2B_methods.md#finalizeblock). +[`FinalizeBlockRequest`](./abci%2B%2B_methods.md#finalizeblock). This section discusses the fields inside this structure, along with the fields in -[`ResponseCheckTx`](./abci%2B%2B_methods.md#checktx), +[`CheckTxResponse`](./abci%2B%2B_methods.md#checktx), whose semantics are similar. The `Info` and `Log` fields are @@ -483,7 +482,7 @@ we have: The `GasUsed` field is ignored by CometBFT. -#### Specifics of `ResponseCheckTx` +#### Specifics of `CheckTxResponse` If `Code != 0`, it will be rejected from the mempool and hence not broadcasted to other peers and not included in a proposal block. @@ -492,9 +491,9 @@ not broadcasted to other peers and not included in a proposal block. deterministic since, given a transaction, nodes' Applications might have a different *CheckTxState* values when they receive it and check their validity via `CheckTx`. -CometBFT ignores this value in `ResponseCheckTx`. +CometBFT ignores this value in `CheckTxResponse`. -From v0.34.x on, there is a `Priority` field in `ResponseCheckTx` that can be +From v0.34.x on, there is a `Priority` field in `CheckTxResponse` that can be used to explicitly prioritize transactions in the mempool for inclusion in a block proposal. @@ -791,7 +790,7 @@ value to be updated to the default. ##### `InitChain` -`ResponseInitChain` includes a `ConsensusParams` parameter. +`InitChainResponse` includes a `ConsensusParams` parameter. If `ConsensusParams` is `nil`, CometBFT will use the params loaded in the genesis file. If `ConsensusParams` is not `nil`, CometBFT will use it. This way the application can determine the initial consensus parameters for the @@ -799,7 +798,7 @@ blockchain. ##### `FinalizeBlock`, `PrepareProposal`/`ProcessProposal` -`ResponseFinalizeBlock` accepts a `ConsensusParams` parameter. +`FinalizeBlockResponse` accepts a `ConsensusParams` parameter. If `ConsensusParams` is `nil`, CometBFT will do nothing. If `ConsensusParams` is not `nil`, CometBFT will use it. This way the application can update the consensus parameters over time. @@ -843,8 +842,8 @@ ABCI applications can take advantage of more efficient light-client proofs for their state as follows: * return the Merkle root of the deterministic application state in - `ResponseFinalizeBlock.Data`. This Merkle root will be included as the `AppHash` in the next block. -* return efficient Merkle proofs about that application state in `ResponseQuery.Proof` + `FinalizeBlockResponse.Data`. This Merkle root will be included as the `AppHash` in the next block. +* return efficient Merkle proofs about that application state in `QueryResponse.Proof` that can be verified using the `AppHash` of the corresponding block. For instance, this allows an application's light-client to verify proofs of @@ -852,7 +851,7 @@ absence in the application state, something which is much less efficient to do u Some applications (eg. Ethereum, Cosmos-SDK) have multiple "levels" of Merkle trees, where the leaves of one tree are the root hashes of others. To support this, and -the general variability in Merkle proofs, the `ResponseQuery.Proof` has some minimal structure: +the general variability in Merkle proofs, the `QueryResponse.Proof` has some minimal structure: ```protobuf message ProofOps { @@ -1096,7 +1095,7 @@ from the genesis file and light client RPC servers. It also calls `Info` to veri * that the app hash from the snapshot it has delivered to the Application matches the apphash stored in the next height's block -* that the version that the Application returns in `ResponseInfo` matches the version in the +* that the version that the Application returns in `InfoResponse` matches the version in the current height's block header Once the state machine has been restored and CometBFT has gathered this additional diff --git a/spec/abci/abci++_basic_concepts.md b/spec/abci/abci++_basic_concepts.md index 4185585c65..c99e0496ae 100644 --- a/spec/abci/abci++_basic_concepts.md +++ b/spec/abci/abci++_basic_concepts.md @@ -78,11 +78,10 @@ call sequences of these methods. every time CometBFT is about to broadcast a Proposal message and _validValue_ is `nil`. CometBFT gathers outstanding transactions from the mempool, generates a block header, and uses them to create a block to propose. Then, it calls - `RequestPrepareProposal` with the newly created proposal, called *raw proposal*. The Application + `PrepareProposal` with the newly created proposal, called *raw proposal*. The Application can make changes to the raw proposal, such as modifying the set of transactions or the order in which they appear, and returns the - (potentially) modified proposal, called *prepared proposal* in the `ResponsePrepareProposal` - call. + (potentially) modified proposal, called *prepared proposal* in the `PrepareProposalResponse`. The logic modifying the raw proposal MAY be non-deterministic. - [**ProcessProposal:**](./abci++_methods.md#processproposal) It allows a validator to @@ -117,20 +116,20 @@ call sequences of these methods. many (+2/3) validators send precommit votes for that block. Thus, `VerifyVoteExtension` should be used with special care. As a general rule, an Application that detects an invalid vote extension SHOULD - accept it in `ResponseVerifyVoteExtension` and ignore it in its own logic. CometBFT calls it when + accept it in `VerifyVoteExtensionResponse` and ignore it in its own logic. CometBFT calls it when a process receives a precommit message with a (possibly empty) vote extension. The logic in `VerifyVoteExtension` MUST be deterministic. - [**FinalizeBlock:**](./abci++_methods.md#finalizeblock) It delivers a decided block to the Application. The Application must execute the transactions in the block deterministically and update its state accordingly. Cryptographic commitments to the block and transaction results, - returned via the corresponding parameters in `ResponseFinalizeBlock`, are included in the header + returned via the corresponding parameters in `FinalizeBlockResponse`, are included in the header of the next block. CometBFT calls it when a new block is decided. - [**Commit:**](./abci++_methods.md#commit) Instructs the Application to persist its state. It is a fundamental part of CometBFT's crash-recovery mechanism that ensures the synchronization between CometBFT and the Application upon recovery. CometBFT calls it just after - having persisted the data returned by calls to `ResponseFinalizeBlock`. The Application can now discard + having persisted the data returned by calls to `FinalizeBlockResponse`. The Application can now discard any state or data except the one resulting from executing the transactions in the decided block. ### Mempool methods @@ -250,7 +249,7 @@ The same is true to Applications that quickly accept blocks and execute the bloc Additionally, vote extensions or the validation thereof (via `ExtendVote` or `VerifyVoteExtension`) must *never* have side effects on the current state. -They can only be used when their data is provided in a `RequestPrepareProposal` call. +They can only be used when their data is provided in a `PrepareProposal` call. If there is some non-determinism in the state machine, consensus will eventually fail as nodes disagree over the correct values for the block header. The @@ -326,7 +325,7 @@ message EventAttribute { Example: ```go - abci.ResponseFinalizeBlock{ + abci.FinalizeBlockResponse{ // ... Events: []abci.Event{ { @@ -414,18 +413,18 @@ The handling of non-zero response codes by CometBFT is described below. ### `CheckTx` -When CometBFT receives a `ResponseCheckTx` with a non-zero `Code`, the associated +When CometBFT receives a `CheckTxResponse` with a non-zero `Code`, the associated transaction will not be added to CometBFT's mempool or it will be removed if it is already included. ### `ExecTxResult` (as part of `FinalizeBlock`) The `ExecTxResult` type delivers transaction results from the Application to CometBFT. When -CometBFT receives a `ResponseFinalizeBlock` containing an `ExecTxResult` with a non-zero `Code`, +CometBFT receives a `FinalizeBlockResponse` containing an `ExecTxResult` with a non-zero `Code`, the response code is logged. Past `Code` values can be queried by clients. As the transaction was part of a decided block, the `Code` does not influence consensus. ### `Query` -When CometBFT receives a `ResponseQuery` with a non-zero `Code`, this code is +When CometBFT receives a `QueryResponse` with a non-zero `Code`, this code is returned directly to the client that initiated the query. diff --git a/spec/abci/abci++_comet_expected_behavior.md b/spec/abci/abci++_comet_expected_behavior.md index d7f15e1cb6..83a8806685 100644 --- a/spec/abci/abci++_comet_expected_behavior.md +++ b/spec/abci/abci++_comet_expected_behavior.md @@ -220,19 +220,18 @@ to undergo any changes in their implementation. As for the new methods: * `PrepareProposal` must create a list of [transactions](./abci++_methods.md#prepareproposal) - by copying over the transaction list passed in `RequestPrepareProposal.txs`, in the same order. - + by copying over the transaction list passed in `PrepareProposalRequest.txs`, in the same order. The Application must check whether the size of all transactions exceeds the byte limit - (`RequestPrepareProposal.max_tx_bytes`). If so, the Application must remove transactions at the + (`PrepareProposalRequest.max_tx_bytes`). If so, the Application must remove transactions at the end of the list until the total byte size is at or below the limit. -* `ProcessProposal` must set `ResponseProcessProposal.status` to _accept_ and return. -* `ExtendVote` is to set `ResponseExtendVote.extension` to an empty byte array and return. -* `VerifyVoteExtension` must set `ResponseVerifyVoteExtension.accept` to _true_ if the extension is +* `ProcessProposal` must set `ProcessProposalResponse.status` to _accept_ and return. +* `ExtendVote` is to set `ExtendVoteResponse.extension` to an empty byte array and return. +* `VerifyVoteExtension` must set `VerifyVoteExtensionResponse.accept` to _true_ if the extension is an empty byte array and _false_ otherwise, then return. * `FinalizeBlock` is to coalesce the implementation of methods `BeginBlock`, `DeliverTx`, and `EndBlock`. Legacy applications looking to reuse old code that implemented `DeliverTx` should wrap the legacy `DeliverTx` logic in a loop that executes one transaction iteration per - transaction in `RequestFinalizeBlock.tx`. + transaction in `FinalizeBlockRequest.tx`. Finally, `Commit`, which is kept in ABCI++, no longer returns the `AppHash`. It is now up to `FinalizeBlock` to do so. Thus, a slight refactoring of the old `Commit` implementation will be diff --git a/spec/abci/abci++_methods.md b/spec/abci/abci++_methods.md index f1ed284a92..95023f569b 100644 --- a/spec/abci/abci++_methods.md +++ b/spec/abci/abci++_methods.md @@ -79,14 +79,14 @@ title: Methods * **Usage**: * Called once upon genesis. - * If `ResponseInitChain.Validators` is empty, the initial validator set will be the `RequestInitChain.Validators` - * If `ResponseInitChain.Validators` is not empty, it will be the initial - validator set (regardless of what is in `RequestInitChain.Validators`). + * If `InitChainResponse.Validators` is empty, the initial validator set will be the `InitChainRequest.Validators` + * If `InitChainResponse.Validators` is not empty, it will be the initial + validator set (regardless of what is in `InitChainRequest.Validators`). * This allows the app to decide if it wants to accept the initial validator set proposed by CometBFT (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application specific information in the genesis file). - * Both `RequestInitChain.Validators` and `ResponseInitChain.Validators` are [ValidatorUpdate](#validatorupdate) structs. + * Both `InitChainRequest.Validators` and `InitChainResponse.Validators` are [ValidatorUpdate](#validatorupdate) structs. So, technically, they both are _updating_ the set of validators from the empty set. ### Query @@ -149,7 +149,7 @@ title: Methods * `CheckTx` validates the transaction against the current state of the application, for example, checking signatures and account balances, but does not apply any of the state changes described in the transaction. - * Transactions where `ResponseCheckTx.Code != 0` will be rejected - they will not be broadcast + * Transactions where `CheckTxResponse.Code != 0` will be rejected - they will not be broadcast to other nodes or included in a proposal block. CometBFT attributes no other value to the response code. @@ -173,8 +173,8 @@ title: Methods * **Usage**: * Signal the Application to persist the application state. - Application is expected to persist its state at the end of this call, before calling `ResponseCommit`. - * Use `ResponseCommit.retain_height` with caution! If all nodes in the network remove historical + Application is expected to persist its state at the end of this call, before calling `Commit`. + * Use `CommitResponse.retain_height` with caution! If all nodes in the network remove historical blocks then this data is permanently lost, and no new nodes will be able to join the network and bootstrap, unless state sync is enabled on the chain. Historical blocks may also be required for other purposes, e.g. auditing, replay of non-persisted heights, light client verification, and so on. @@ -325,23 +325,23 @@ title: Methods | txs | repeated bytes | Possibly modified list of transactions that have been picked as part of the proposed block. | 2 | * **Usage**: - * `RequestPrepareProposal`'s parameters `txs`, `misbehavior`, `height`, `time`, - `next_validators_hash`, and `proposer_address` are the same as in `RequestProcessProposal` - and `RequestFinalizeBlock`. - * `RequestPrepareProposal.local_last_commit` is a set of the precommit votes that allowed the + * `PrepareProposalRequest`'s fields `txs`, `misbehavior`, `height`, `time`, + `next_validators_hash`, and `proposer_address` are the same as in `ProcessProposalRequest` + and `FinalizeBlockRequest`. + * `PrepareProposalRequest.local_last_commit` is a set of the precommit votes that allowed the decision of the previous block, together with their corresponding vote extensions. * The `height`, `time`, and `proposer_address` values match the values from the header of the proposed block. - * `RequestPrepareProposal` contains a preliminary set of transactions `txs` that CometBFT + * `PrepareProposalRequest` contains a preliminary set of transactions `txs` that CometBFT retrieved from the mempool, called _raw proposal_. The Application can modify this - set and return a modified set of transactions via `ResponsePrepareProposal.txs` . + set and return a modified set of transactions via `PrepareProposalResponse.txs` . * The Application _can_ modify the raw proposal: it can reorder, remove or add transactions. - Let `tx` be a transaction in `txs` (set of transactions within `RequestPrepareProposal`): + Let `tx` be a transaction in `txs` (set of transactions within `PrepareProposalRequest`): * If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in - `ResponsePrepareProposal.txs`. However, this will not remove `tx` from the mempool. + `PrepareProposalResponse.txs`. However, this will not remove `tx` from the mempool. * If the Application wants to add a new transaction to the proposed block, then the - Application includes it in `ResponsePrepareProposal.txs`. CometBFT will not add + Application includes it in `PrepareProposalResponse.txs`. CometBFT will not add the transaction to the mempool. * The Application should be aware that removing and adding transactions may compromise _traceability_. @@ -355,26 +355,26 @@ title: Methods traceability, it is its responsibility's to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. - * The Application MAY configure CometBFT to include a list of transactions in `RequestPrepareProposal.txs` - whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. + * The Application MAY configure CometBFT to include a list of transactions in `PrepareProposalRequest.txs` + whose total size in bytes exceeds `PrepareProposalRequest.max_tx_bytes`. If the Application sets `ConsensusParams.Block.MaxBytes` to -1, CometBFT - will include _all_ transactions currently in the mempool in `RequestPrepareProposal.txs`, - which may not fit in `RequestPrepareProposal.max_tx_bytes`. - Therefore, if the size of `RequestPrepareProposal.txs` is greater than - `RequestPrepareProposal.max_tx_bytes`, the Application MUST remove transactions to ensure - that the `RequestPrepareProposal.max_tx_bytes` limit is respected by those transactions - returned in `ResponsePrepareProposal.txs`. + will include _all_ transactions currently in the mempool in `PrepareProposalRequest.txs`, + which may not fit in `PrepareProposalRequest.max_tx_bytes`. + Therefore, if the size of `PrepareProposalRequest.txs` is greater than + `PrepareProposalRequest.max_tx_bytes`, the Application MUST remove transactions to ensure + that the `PrepareProposalRequest.max_tx_bytes` limit is respected by those transactions + returned in `PrepareProposalResponse.txs`. This is specified in [Requirement 2](./abci%2B%2B_app_requirements.md). * As a result of executing the prepared proposal, the Application may produce block events or transaction events. The Application must keep those events until a block is decided and then pass them on to CometBFT via - `ResponseFinalizeBlock`. + `FinalizeBlockResponse`. * CometBFT does NOT provide any additional validity checks (such as checking for duplicate transactions). - * If CometBFT fails to validate the `ResponsePrepareProposal`, CometBFT will assume the + * If CometBFT fails to validate the `PrepareProposalResponse`, CometBFT will assume the Application is faulty and crash. * The implementation of `PrepareProposal` can be non-deterministic. @@ -388,7 +388,7 @@ and _p_'s _validValue_ is `nil`: 1. CometBFT collects outstanding transactions from _p_'s mempool * the transactions will be collected in order of priority * _p_'s CometBFT creates a block header. -2. _p_'s CometBFT calls `RequestPrepareProposal` with the newly generated block, the local +2. _p_'s CometBFT calls `PrepareProposal` with the newly generated block, the local commit of the previous height (with vote extensions), and any outstanding evidence of misbehavior. The call is synchronous: CometBFT's execution will block until the Application returns from the call. @@ -399,7 +399,7 @@ and _p_'s _validValue_ is `nil`: * leave transactions untouched * add new transactions (not present initially) to the proposal * remove transactions from the proposal (but not from the mempool thus effectively _delaying_ them) - the - Application does not include the transaction in `ResponsePrepareProposal.txs`. + Application does not include the transaction in `PrepareProposalResponse.txs`. * modify transactions (e.g. aggregate them). As explained above, this compromises client traceability, unless it is implemented at the Application level. * reorder transactions - the Application reorders transactions in the list @@ -408,7 +408,7 @@ and _p_'s _validValue_ is `nil`: 5. _p_ uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. Note that, if _p_ has a non-`nil` _validValue_ in round _r_, height _h_, -the consensus algorithm will use it as proposal and will not call `RequestPrepareProposal`. +the consensus algorithm will use it as proposal and will not call `PrepareProposal`. ### ProcessProposal @@ -436,24 +436,24 @@ the consensus algorithm will use it as proposal and will not call `RequestPrepar * **Usage**: * Contains all information on the proposed block needed to fully execute it. * The Application may fully execute the block as though it was handling - `RequestFinalizeBlock`. + `FinalizeBlock`. * However, any resulting state changes must be kept as _candidate state_, and the Application should be ready to discard it in case another block is decided. - * `RequestProcessProposal` is also called at the proposer of a round. - Normally the call to `RequestProcessProposal` occurs right after the call to `RequestPrepareProposal` and - `RequestProcessProposal` matches the block produced based on `ResponsePrepareProposal` (i.e., - `RequestPrepareProposal.txs` equals `RequestProcessProposal.txs`). - However, no such guarantee is made since, in the presence of failures, `RequestProcessProposal` may match - `ResponsePrepareProposal` from an earlier invocation or `ProcessProposal` may not be invoked at all. + * `ProcessProposal` is also called at the proposer of a round. + Normally the call to `ProcessProposal` occurs right after the call to `PrepareProposal` and + `ProcessProposalRequest` matches the block produced based on `PrepareProposalResponse` (i.e., + `PrepareProposalRequest.txs` equals `ProcessProposalRequest.txs`). + However, no such guarantee is made since, in the presence of failures, `ProcessProposalRequest` may match + `PrepareProposalResponse` from an earlier invocation or `ProcessProposal` may not be invoked at all. * The height and time values match the values from the header of the proposed block. - * If `ResponseProcessProposal.status` is `REJECT`, consensus assumes the proposal received + * If `ProcessProposalResponse.status` is `REJECT`, consensus assumes the proposal received is not valid. * The Application MAY fully execute the block — immediate execution * The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of - `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in - the call to `RequestProcessProposal`, and the last committed Application state + `ProcessProposalResponse.status` MUST **exclusively** depend on the parameters passed in + the `ProcessProposalRequest`, and the last committed Application state (see [Requirements](./abci++_app_requirements.md) section). - * Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, + * Moreover, application implementors SHOULD always set `ProcessProposalResponse.status` to `ACCEPT`, unless they _really_ know what the potential liveness implications of returning `REJECT` are. #### When does CometBFT call "ProcessProposal" ? @@ -468,10 +468,10 @@ When a node _p_ enters consensus round _r_, height _h_, in which _q_ is the prop from _q_, _p_ follows the validators' algorithm to check whether it should prevote for the proposed block, or `nil`. 5. If the validators' consensus algorithm indicates _p_ should prevote non-nil: - 1. CometBFT calls `RequestProcessProposal` with the block. The call is synchronous. + 1. CometBFT calls `ProcessProposal` with the block. The call is synchronous. 2. The Application checks/processes the proposed block, which is read-only, and returns - `ACCEPT` or `REJECT` in the `ResponseProcessProposal.status` field. - * The Application, depending on its needs, may call `ResponseProcessProposal` + `ACCEPT` or `REJECT` in the `ProcessProposalResponse.status` field. + * The Application, depending on its needs, may call `ProcessProposal` * either after it has completely processed the block (immediate execution), * or after doing some basic checks, and process the block asynchronously. In this case the Application will not be able to reject the block, or force prevote/precommit `nil` @@ -506,13 +506,13 @@ When a node _p_ enters consensus round _r_, height _h_, in which _q_ is the prop | vote_extension | bytes | Information signed by by CometBFT. Can have 0 length. | 1 | * **Usage**: - * `ResponseExtendVote.vote_extension` is application-generated information that will be signed + * `ExtendVoteResponse.vote_extension` is application-generated information that will be signed by CometBFT and attached to the Precommit message. * The Application may choose to use an empty vote extension (0 length). - * The contents of `RequestExtendVote` correspond to the proposed block on which the consensus algorithm + * The contents of `ExtendVoteRequest` correspond to the proposed block on which the consensus algorithm will send the Precommit message. - * `ResponseExtendVote.vote_extension` will only be attached to a non-`nil` Precommit message. If the consensus algorithm is to - precommit `nil`, it will not call `RequestExtendVote`. + * `ExtendVoteResponse.vote_extension` will only be attached to a non-`nil` Precommit message. If the consensus algorithm is to + precommit `nil`, it will not call `ExtendVote`. * The Application logic that creates the extension can be non-deterministic. #### When does CometBFT call `ExtendVote`? @@ -525,9 +525,9 @@ When a validator _p_ is in consensus state _prevote_ of round _r_, height _h_, i then _p_ locks _v_ and sends a Precommit message in the following way 1. _p_ sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ -2. _p_'s CometBFT calls `RequestExtendVote` with _v_ (`RequestExtendVote`). The call is synchronous. -3. The Application returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by the consensus algorithm. -4. _p_ sets `ResponseExtendVote.extension` as the value of the `extension` field of type +2. _p_'s CometBFT calls `ExtendVote` with _v_ (in `ExtendVoteRequest`). The call is synchronous. +3. The Application returns an array of bytes, `ExtendVoteResponse.extension`, which is not interpreted by the consensus algorithm. +4. _p_ sets `ExtendVoteResponse.extension` as the value of the `extension` field of type [CanonicalVoteExtension](../core/data_structures.md#canonicalvoteextension), populates the other fields in [CanonicalVoteExtension](../core/data_structures.md#canonicalvoteextension), and signs the populated data structure. @@ -538,7 +538,7 @@ then _p_ locks _v_ and sends a Precommit message in the following way 7. _p_ broadcasts the Precommit message. In the cases when _p_ is to broadcast `precommit nil` messages (either _2f+1_ `prevote nil` messages received, -or _timeoutPrevote_ triggered), _p_'s CometBFT does **not** call `RequestExtendVote` and will not include +or _timeoutPrevote_ triggered), _p_'s CometBFT does **not** call `ExtendVote` and will not include a [CanonicalVoteExtension](../core/data_structures.md#canonicalvoteextension) field in the `precommit nil` message. ### VerifyVoteExtension @@ -561,21 +561,21 @@ a [CanonicalVoteExtension](../core/data_structures.md#canonicalvoteextension) fi | status | [VerifyStatus](#verifystatus) | `enum` signaling if the application accepts the vote extension | 1 | * **Usage**: - * `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's + * `VerifyVoteExtensionRequest.vote_extension` can be an empty byte array. The Application's interpretation of it should be that the Application running at the process that sent the vote chose not to extend it. - CometBFT will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. - * `RequestVerifyVoteExtension` is not called for precommit votes sent by the local process. - * `RequestVerifyVoteExtension.hash` refers to a proposed block. There is not guarantee that + CometBFT will always call `VerifyVoteExtension`, even for 0 length vote extensions. + * `VerifyVoteExtension` is not called for precommit votes sent by the local process. + * `VerifyVoteExtensionRequest.hash` refers to a proposed block. There is not guarantee that this proposed block has previously been exposed to the Application via `ProcessProposal`. - * If `ResponseVerifyVoteExtension.status` is `REJECT`, the consensus algorithm will reject the whole received vote. + * If `VerifyVoteExtensionResponse.status` is `REJECT`, the consensus algorithm will reject the whole received vote. See the [Requirements](./abci++_app_requirements.md) section to understand the potential liveness implications of this. * The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of - `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in - the call to `RequestVerifyVoteExtension`, and the last committed Application state + `VerifyVoteExtensionResponse.status` MUST **exclusively** depend on the parameters passed in + the `VerifyVoteExtensionRequest`, and the last committed Application state (see [Requirements](./abci++_app_requirements.md) section). - * Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, + * Moreover, application implementers SHOULD always set `VerifyVoteExtensionResponse.status` to `ACCEPT`, unless they _really_ know what the potential liveness implications of returning `REJECT` are. #### When does CometBFT call `VerifyVoteExtension`? @@ -586,12 +586,12 @@ message for round _r_, height _h_ from validator _q_ (_q_ ≠ _p_): 1. If the Precommit message does not contain a vote extension with a valid signature, _p_ discards the Precommit message as invalid. * a 0-length vote extension is valid as long as its accompanying signature is also valid. -2. Else, _p_'s CometBFT calls `RequestVerifyVoteExtension`. -3. The Application returns `ACCEPT` or `REJECT` via `ResponseVerifyVoteExtension.status`. +2. Else, _p_'s CometBFT calls `VerifyVoteExtension`. +3. The Application returns `ACCEPT` or `REJECT` via `VerifyVoteExtensionResponse.status`. 4. If the Application returns * `ACCEPT`, _p_ will keep the received vote, together with its corresponding vote extension in its internal data structures. It will be used to populate the [ExtendedCommitInfo](#extendedcommitinfo) - structure in calls to `RequestPrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. + structure in calls to `PrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. * `REJECT`, _p_ will deem the Precommit message invalid and discard it. ### FinalizeBlock @@ -626,40 +626,40 @@ message for round _r_, height _h_ from validator _q_ (_q_ ≠ _p_): * This method is equivalent to the call sequence `BeginBlock`, [`DeliverTx`], and `EndBlock` in the previous version of ABCI. * The height and time values match the values from the header of the proposed block. - * The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.misbehavior` + * The Application can use `FinalizeBlockRequest.decided_last_commit` and `FinalizeBlockRequest.misbehavior` to determine rewards and punishments for the validators. - * The Application executes the transactions in `RequestFinalizeBlock.txs` deterministically, + * The Application executes the transactions in `FinalizeBlockRequest.txs` deterministically, according to the rules set up by the Application, before returning control to CometBFT. Alternatively, it can apply the candidate state corresponding to the same block previously executed via `PrepareProposal` or `ProcessProposal`. - * `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. - * The Application must provide values for `ResponseFinalizeBlock.app_hash`, - `ResponseFinalizeBlock.tx_results`, `ResponseFinalizeBlock.validator_updates`, and - `ResponseFinalizeBlock.consensus_param_updates` as a result of executing the block. - * The values for `ResponseFinalizeBlock.validator_updates`, or - `ResponseFinalizeBlock.consensus_param_updates` may be empty. In this case, CometBFT will keep + * `FinalizeBlockResponse.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. + * The Application must provide values for `FinalizeBlockResponse.app_hash`, + `FinalizeBlockResponse.tx_results`, `FinalizeBlockResponse.validator_updates`, and + `FinalizeBlockResponse.consensus_param_updates` as a result of executing the block. + * The values for `FinalizeBlockResponse.validator_updates`, or + `FinalizeBlockResponse.consensus_param_updates` may be empty. In this case, CometBFT will keep the current values. - * `ResponseFinalizeBlock.validator_updates`, triggered by block `H`, affect validation + * `FinalizeBlockResponse.validator_updates`, triggered by block `H`, affect validation for blocks `H+1`, `H+2`, and `H+3`. Heights following a validator update are affected in the following way: * Height `H+1`: `NextValidatorsHash` includes the new `validator_updates` value. * Height `H+2`: The validator set change takes effect and `ValidatorsHash` is updated. * Height `H+3`: `*_last_commit` fields in `PrepareProposal`, `ProcessProposal`, and `FinalizeBlock` now include the altered validator set. - * `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus + * `FinalizeBlockResponse.consensus_param_updates` returned for block `H` apply to the consensus params for block `H+1`. For more information on the consensus parameters, see the [consensus parameters](./abci%2B%2B_app_requirements.md#consensus-parameters) section. - * `ResponseFinalizeBlock.app_hash` contains an (optional) Merkle root hash of the application state. - * `ResponseFinalizeBlock.app_hash` is included as the `Header.AppHash` in the next block. - * `ResponseFinalizeBlock.app_hash` may also be empty or hard-coded, but MUST be + * `FinalizeBlockResponse.app_hash` contains an (optional) Merkle root hash of the application state. + * `FinalizeBlockResponse.app_hash` is included as the `Header.AppHash` in the next block. + * `FinalizeBlockResponse.app_hash` may also be empty or hard-coded, but MUST be **deterministic** - it must not be a function of anything that did not come from the parameters - of `RequestFinalizeBlock` and the previous committed state. + of `FinalizeBlockRequest` and the previous committed state. * Later calls to `Query` can return proofs about the application state anchored in this Merkle root hash. * The implementation of `FinalizeBlock` MUST be deterministic, since it is making the Application's state evolve in the context of state machine replication. - * Currently, CometBFT will fill up all fields in `RequestFinalizeBlock`, even if they were - already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. + * Currently, CometBFT will fill up all fields in `FinalizeBlockRequest`, even if they were + already passed on to the Application via `PrepareProposalRequest` or `ProcessProposalRequest`. #### When does CometBFT call `FinalizeBlock`? @@ -673,14 +673,14 @@ When a node _p_ is in consensus height _h_, and _p_ receives then _p_ decides block _v_ and finalizes consensus for height _h_ in the following way 1. _p_ persists _v_ as the decision for height _h_. -2. _p_'s CometBFT calls `RequestFinalizeBlock` with _v_'s data. The call is synchronous. +2. _p_'s CometBFT calls `FinalizeBlock` with _v_'s data. The call is synchronous. 3. _p_'s Application executes block _v_. 4. _p_'s Application calculates and returns the _AppHash_, along with a list containing the outputs of each of the transactions executed. 5. _p_'s CometBFT hashes all the transaction outputs and stores it in _ResultHash_. 6. _p_'s CometBFT persists the transaction outputs, _AppHash_, and _ResultsHash_. 7. _p_'s CometBFT locks the mempool — no calls to `CheckTx` on new transactions. -8. _p_'s CometBFT calls `RequestCommit` to instruct the Application to persist its state. +8. _p_'s CometBFT calls `Commit` to instruct the Application to persist its state. 9. _p_'s CometBFT, optionally, re-checks all outstanding transactions in the mempool against the newly persisted Application state. 10. _p_'s CometBFT unlocks the mempool — newly received transactions can now be checked. diff --git a/spec/consensus/creating-proposal.md b/spec/consensus/creating-proposal.md index feeb8e5966..3280093a91 100644 --- a/spec/consensus/creating-proposal.md +++ b/spec/consensus/creating-proposal.md @@ -36,7 +36,7 @@ Once the transactions have been reaped from the mempool according to the rules d CometBFT calls `PrepareProposal` to the application with the transaction list that has just been reaped. As part of this call the application can remove, add, or reorder transactions in the transaction list. -The `RequestPrepareProposal` contains two important fields: +The `PrepareProposalRequest` contains two important fields: * `MaxTxBytes`, which contains the value returned by `MaxDataBytes` described above. The application MUST NOT return a list of transactions whose size exceeds this number. diff --git a/spec/core/data_structures.md b/spec/core/data_structures.md index 1c2fe23ab7..03e47a4880 100644 --- a/spec/core/data_structures.md +++ b/spec/core/data_structures.md @@ -131,8 +131,8 @@ the data in the current block, the previous block, and the results returned by t | ValidatorHash | slice of bytes (`[]byte`) | MerkleRoot of the current validator set. The validators are first sorted by voting power (descending), then by address (ascending) prior to computing the MerkleRoot. | Must be of length 32 | | NextValidatorHash | slice of bytes (`[]byte`) | MerkleRoot of the next validator set. The validators are first sorted by voting power (descending), then by address (ascending) prior to computing the MerkleRoot. | Must be of length 32 | | ConsensusHash | slice of bytes (`[]byte`) | Hash of the protobuf encoded consensus parameters. | Must be of length 32 | -| AppHash | slice of bytes (`[]byte`) | Arbitrary byte array returned by the application after executing and committing the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. The first block's `block.Header.AppHash` is given by `ResponseInitChain.app_hash`. | This hash is determined by the application, CometBFT can not perform validation on it. | -| LastResultHash | slice of bytes (`[]byte`) | `LastResultsHash` is the root hash of a Merkle tree built from `ResponseDeliverTx` responses (`Log`,`Info`, `Codespace` and `Events` fields are ignored). | Must be of length 32. The first block has `block.Header.ResultsHash == MerkleRoot(nil)`, i.e. the hash of an empty input, for RFC-6962 conformance. | +| AppHash | slice of bytes (`[]byte`) | Arbitrary byte array returned by the application after executing and committing the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. The first block's `block.Header.AppHash` is given by `InitChainResponse.app_hash`. | This hash is determined by the application, CometBFT can not perform validation on it. | +| LastResultHash | slice of bytes (`[]byte`) | `LastResultsHash` is the root hash of a Merkle tree built from `DeliverTxResponse` responses (`Log`,`Info`, `Codespace` and `Events` fields are ignored). | Must be of length 32. The first block has `block.Header.ResultsHash == MerkleRoot(nil)`, i.e. the hash of an empty input, for RFC-6962 conformance. | | EvidenceHash | slice of bytes (`[]byte`) | MerkleRoot of the evidence of Byzantine behavior included in this block. | Must be of length 32 | | ProposerAddress | slice of bytes (`[]byte`) | Address of the original proposer of the block. Validator must be in the current validatorSet. | Must be of length 20 | diff --git a/spec/core/state.md b/spec/core/state.md index c19d0096ca..4b7aa44a9e 100644 --- a/spec/core/state.md +++ b/spec/core/state.md @@ -51,11 +51,11 @@ be found in [data structures](./data_structures.md) ## Execution -State gets updated at the end of executing a block. Of specific interest is `ResponseEndBlock` and -`ResponseCommit` +State gets updated at the end of executing a block. Of specific interest is `EndBlockResponse` and +`CommitResponse` ```go -type ResponseEndBlock struct { +type EndBlockResponse struct { ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"` ConsensusParamUpdates *types1.ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` Events []Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"` @@ -74,7 +74,7 @@ type ValidatorUpdate struct { and ```go -type ResponseCommit struct { +type CommitResponse struct { // reserve 1 Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` RetainHeight int64 `protobuf:"varint,3,opt,name=retain_height,json=retainHeight,proto3" json:"retain_height,omitempty"` @@ -84,7 +84,7 @@ type ResponseCommit struct { `ValidatorUpdates` are used to add and remove validators to the current set as well as update validator power. Setting validator power to 0 in `ValidatorUpdate` will cause the validator to be removed. `ConsensusParams` are safely copied across (i.e. if a field is nil it gets ignored) and the -`Data` from the `ResponseCommit` is used as the `AppHash` +`Data` from the `CommitResponse` is used as the `AppHash` ## Version @@ -107,8 +107,8 @@ otherwise. The Application may set `ConsensusParams.Block.MaxBytes` to -1. In that case, the actual block limit is set to 100 MB, and CometBFT will provide all transactions in the mempool as part of `PrepareProposal`. -The application has to be careful to return a list of transactions in `ResponsePrepareProposal` -whose size is less than or equal to `RequestPrepareProposal.MaxTxBytes`. +The application has to be careful to return a list of transactions in `PrepareProposalResponse` +whose size is less than or equal to `PrepareProposalRequest.MaxTxBytes`. Blocks should additionally be limited by the amount of "gas" consumed by the transactions in the block, though this is not yet implemented. @@ -127,5 +127,5 @@ implemented to mitigate spam attacks. ## Validator -Validators from genesis file and `ResponseEndBlock` must have pubkeys of type ∈ +Validators from genesis file and `EndBlockResponse` must have pubkeys of type ∈ `ConsensusParams.Validator.PubKeyTypes`. diff --git a/state/execution.go b/state/execution.go index b2468bbc2a..9edecb6c2f 100644 --- a/state/execution.go +++ b/state/execution.go @@ -135,7 +135,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock( block := state.MakeBlock(height, txs, commit, evidence, proposerAddr) rpp, err := blockExec.proxyApp.PrepareProposal( ctx, - &abci.RequestPrepareProposal{ + &abci.PrepareProposalRequest{ MaxTxBytes: maxDataBytes, Txs: block.Txs.ToSliceOfBytes(), LocalLastCommit: buildExtendedCommitInfoFromStore(lastExtCommit, blockExec.store, state.InitialHeight, state.ConsensusParams.ABCI), @@ -170,7 +170,7 @@ func (blockExec *BlockExecutor) ProcessProposal( block *types.Block, state State, ) (bool, error) { - resp, err := blockExec.proxyApp.ProcessProposal(context.TODO(), &abci.RequestProcessProposal{ + resp, err := blockExec.proxyApp.ProcessProposal(context.TODO(), &abci.ProcessProposalRequest{ Hash: block.Header.Hash(), Height: block.Header.Height, Time: block.Header.Time, @@ -216,7 +216,7 @@ func (blockExec *BlockExecutor) ApplyBlock( } startTime := time.Now().UnixNano() - abciResponse, err := blockExec.proxyApp.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{ + abciResponse, err := blockExec.proxyApp.FinalizeBlock(context.TODO(), &abci.FinalizeBlockRequest{ Hash: block.Hash(), NextValidatorsHash: block.NextValidatorsHash, ProposerAddress: block.ProposerAddress, @@ -327,8 +327,7 @@ func (blockExec *BlockExecutor) ExtendVote( if vote.Height != block.Height { panic(fmt.Sprintf("vote's and block's heights do not match %d!=%d", block.Height, vote.Height)) } - - req := abci.RequestExtendVote{ + req := abci.ExtendVoteRequest{ Hash: vote.BlockID.Hash, Height: vote.Height, Time: block.Time, @@ -347,7 +346,7 @@ func (blockExec *BlockExecutor) ExtendVote( } func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error { - req := abci.RequestVerifyVoteExtension{ + req := abci.VerifyVoteExtensionRequest{ Hash: vote.BlockID.Hash, ValidatorAddress: vote.ValidatorAddress, Height: vote.Height, @@ -380,7 +379,7 @@ func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *t func (blockExec *BlockExecutor) Commit( state State, block *types.Block, - abciResponse *abci.ResponseFinalizeBlock, + abciResponse *abci.FinalizeBlockResponse, ) (int64, error) { blockExec.mempool.Lock() defer blockExec.mempool.Unlock() @@ -588,7 +587,7 @@ func updateState( state State, blockID types.BlockID, header *types.Header, - abciResponse *abci.ResponseFinalizeBlock, + abciResponse *abci.FinalizeBlockResponse, validatorUpdates []*types.Validator, ) (State, error) { // Copy the valset so we can apply changes from EndBlock @@ -661,7 +660,7 @@ func fireEvents( eventBus types.BlockEventPublisher, block *types.Block, blockID types.BlockID, - abciResponse *abci.ResponseFinalizeBlock, + abciResponse *abci.FinalizeBlockResponse, validatorUpdates []*types.Validator, ) { if err := eventBus.PublishEventNewBlock(types.EventDataNewBlock{ @@ -730,7 +729,7 @@ func ExecCommitBlock( ) ([]byte, error) { commitInfo := buildLastCommitInfoFromStore(block, store, initialHeight) - resp, err := appConnConsensus.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{ + resp, err := appConnConsensus.FinalizeBlock(context.TODO(), &abci.FinalizeBlockRequest{ Hash: block.Hash(), NextValidatorsHash: block.NextValidatorsHash, ProposerAddress: block.ProposerAddress, diff --git a/state/execution_test.go b/state/execution_test.go index 7c0dd2b803..12cf2df051 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -368,7 +368,7 @@ func TestProcessProposal(t *testing.T) { logger := log.NewNopLogger() app := &abcimocks.Application{} - app.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) + app.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil) cc := proxy.NewLocalClientCreator(app) proxyApp := proxy.NewAppConns(cc, proxy.NopMetrics()) @@ -424,7 +424,7 @@ func TestProcessProposal(t *testing.T) { block1.Txs = txs - expectedRpp := &abci.RequestProcessProposal{ + expectedRpp := &abci.ProcessProposalRequest{ Txs: block1.Txs.ToSliceOfBytes(), Hash: block1.Hash(), Height: block1.Header.Height, @@ -769,7 +769,7 @@ func TestPrepareProposalTxsAllIncluded(t *testing.T) { mp.On("ReapMaxBytesMaxGas", mock.Anything, mock.Anything).Return(txs[2:]) app := &abcimocks.Application{} - app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{ + app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{ Txs: txs.ToSliceOfBytes(), }, nil) cc := proxy.NewLocalClientCreator(app) @@ -823,7 +823,7 @@ func TestPrepareProposalReorderTxs(t *testing.T) { txs = append(txs[len(txs)/2:], txs[:len(txs)/2]...) app := &abcimocks.Application{} - app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{ + app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{ Txs: txs.ToSliceOfBytes(), }, nil) @@ -879,7 +879,7 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { mp.On("ReapMaxBytesMaxGas", mock.Anything, mock.Anything).Return(txs) app := &abcimocks.Application{} - app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{ + app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{ Txs: txs.ToSliceOfBytes(), }, nil) @@ -1007,7 +1007,7 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) { app := abcimocks.NewApplication(t) if !testCase.expectPanic { - app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) + app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.PrepareProposalResponse{}, nil) } cc := proxy.NewLocalClientCreator(app) proxyApp := proxy.NewAppConns(cc, proxy.NopMetrics()) diff --git a/state/export_test.go b/state/export_test.go index aa2085bea4..b22a139390 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -26,7 +26,7 @@ func UpdateState( state State, blockID types.BlockID, header *types.Header, - resp *abci.ResponseFinalizeBlock, + resp *abci.FinalizeBlockResponse, validatorUpdates []*types.Validator, ) (State, error) { return updateState(state, blockID, header, resp, validatorUpdates) diff --git a/state/helpers_test.go b/state/helpers_test.go index 26a8f4d9d5..117d01bfcc 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -170,9 +170,9 @@ func genValSet(size int) *types.ValidatorSet { func makeHeaderPartsResponsesValPubKeyChange( state sm.State, pubkey crypto.PubKey, -) (types.Header, types.BlockID, *abci.ResponseFinalizeBlock) { +) (types.Header, types.BlockID, *abci.FinalizeBlockResponse) { block := makeBlock(state, state.LastBlockHeight+1, new(types.Commit)) - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { @@ -188,9 +188,9 @@ func makeHeaderPartsResponsesValPubKeyChange( func makeHeaderPartsResponsesValPowerChange( state sm.State, power int64, -) (types.Header, types.BlockID, *abci.ResponseFinalizeBlock) { +) (types.Header, types.BlockID, *abci.FinalizeBlockResponse) { block := makeBlock(state, state.LastBlockHeight+1, new(types.Commit)) - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) @@ -206,9 +206,9 @@ func makeHeaderPartsResponsesValPowerChange( func makeHeaderPartsResponsesParams( state sm.State, params cmtproto.ConsensusParams, -) (types.Header, types.BlockID, *abci.ResponseFinalizeBlock) { +) (types.Header, types.BlockID, *abci.FinalizeBlockResponse) { block := makeBlock(state, state.LastBlockHeight+1, new(types.Commit)) - abciResponses := &abci.ResponseFinalizeBlock{ + abciResponses := &abci.FinalizeBlockResponse{ ConsensusParamUpdates: ¶ms, } return block.Header, types.BlockID{Hash: block.Hash(), PartSetHeader: types.PartSetHeader{}}, abciResponses @@ -245,7 +245,7 @@ type testApp struct { var _ abci.Application = (*testApp)(nil) -func (app *testApp) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { +func (app *testApp) FinalizeBlock(_ context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error) { app.CommitVotes = req.DecidedLastCommit.Votes app.Misbehavior = req.Misbehavior app.LastTime = req.Time @@ -256,7 +256,7 @@ func (app *testApp) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBl } } - return &abci.ResponseFinalizeBlock{ + return &abci.FinalizeBlockResponse{ ValidatorUpdates: app.ValidatorUpdates, ConsensusParamUpdates: &cmtproto.ConsensusParams{ Version: &cmtproto.VersionParams{ @@ -268,14 +268,14 @@ func (app *testApp) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBl }, nil } -func (app *testApp) Commit(_ context.Context, _ *abci.RequestCommit) (*abci.ResponseCommit, error) { - return &abci.ResponseCommit{RetainHeight: 1}, nil +func (app *testApp) Commit(_ context.Context, _ *abci.CommitRequest) (*abci.CommitResponse, error) { + return &abci.CommitResponse{RetainHeight: 1}, nil } func (app *testApp) PrepareProposal( _ context.Context, - req *abci.RequestPrepareProposal, -) (*abci.ResponsePrepareProposal, error) { + req *abci.PrepareProposalRequest, +) (*abci.PrepareProposalResponse, error) { txs := make([][]byte, 0, len(req.Txs)) var totalBytes int64 for _, tx := range req.Txs { @@ -288,17 +288,17 @@ func (app *testApp) PrepareProposal( } txs = append(txs, tx) } - return &abci.ResponsePrepareProposal{Txs: txs}, nil + return &abci.PrepareProposalResponse{Txs: txs}, nil } func (app *testApp) ProcessProposal( _ context.Context, - req *abci.RequestProcessProposal, -) (*abci.ResponseProcessProposal, error) { + req *abci.ProcessProposalRequest, +) (*abci.ProcessProposalResponse, error) { for _, tx := range req.Txs { if len(tx) == 0 { - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil } } - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } diff --git a/state/mocks/store.go b/state/mocks/store.go index bacd306006..f8fafa3d96 100644 --- a/state/mocks/store.go +++ b/state/mocks/store.go @@ -8,7 +8,7 @@ import ( types "github.com/cometbft/cometbft/types" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" + v1beta4 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta4" ) // Store is an autogenerated mock type for the Store type @@ -189,19 +189,19 @@ func (_m *Store) LoadConsensusParams(height int64) (types.ConsensusParams, error } // LoadFinalizeBlockResponse provides a mock function with given fields: height -func (_m *Store) LoadFinalizeBlockResponse(height int64) (*v3.ResponseFinalizeBlock, error) { +func (_m *Store) LoadFinalizeBlockResponse(height int64) (*v1beta4.FinalizeBlockResponse, error) { ret := _m.Called(height) - var r0 *v3.ResponseFinalizeBlock + var r0 *v1beta4.FinalizeBlockResponse var r1 error - if rf, ok := ret.Get(0).(func(int64) (*v3.ResponseFinalizeBlock, error)); ok { + if rf, ok := ret.Get(0).(func(int64) (*v1beta4.FinalizeBlockResponse, error)); ok { return rf(height) } - if rf, ok := ret.Get(0).(func(int64) *v3.ResponseFinalizeBlock); ok { + if rf, ok := ret.Get(0).(func(int64) *v1beta4.FinalizeBlockResponse); ok { r0 = rf(height) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseFinalizeBlock) + r0 = ret.Get(0).(*v1beta4.FinalizeBlockResponse) } } @@ -263,19 +263,19 @@ func (_m *Store) LoadFromDBOrGenesisFile(_a0 string) (state.State, error) { } // LoadLastFinalizeBlockResponse provides a mock function with given fields: height -func (_m *Store) LoadLastFinalizeBlockResponse(height int64) (*v3.ResponseFinalizeBlock, error) { +func (_m *Store) LoadLastFinalizeBlockResponse(height int64) (*v1beta4.FinalizeBlockResponse, error) { ret := _m.Called(height) - var r0 *v3.ResponseFinalizeBlock + var r0 *v1beta4.FinalizeBlockResponse var r1 error - if rf, ok := ret.Get(0).(func(int64) (*v3.ResponseFinalizeBlock, error)); ok { + if rf, ok := ret.Get(0).(func(int64) (*v1beta4.FinalizeBlockResponse, error)); ok { return rf(height) } - if rf, ok := ret.Get(0).(func(int64) *v3.ResponseFinalizeBlock); ok { + if rf, ok := ret.Get(0).(func(int64) *v1beta4.FinalizeBlockResponse); ok { r0 = rf(height) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.ResponseFinalizeBlock) + r0 = ret.Get(0).(*v1beta4.FinalizeBlockResponse) } } @@ -416,11 +416,11 @@ func (_m *Store) SaveCompanionBlockRetainHeight(height int64) error { } // SaveFinalizeBlockResponse provides a mock function with given fields: height, res -func (_m *Store) SaveFinalizeBlockResponse(height int64, res *v3.ResponseFinalizeBlock) error { +func (_m *Store) SaveFinalizeBlockResponse(height int64, res *v1beta4.FinalizeBlockResponse) error { ret := _m.Called(height, res) var r0 error - if rf, ok := ret.Get(0).(func(int64, *v3.ResponseFinalizeBlock) error); ok { + if rf, ok := ret.Get(0).(func(int64, *v1beta4.FinalizeBlockResponse) error); ok { r0 = rf(height, res) } else { r0 = ret.Error(0) diff --git a/state/state_test.go b/state/state_test.go index 69e5f33ae3..e100dfdc8f 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -107,7 +107,7 @@ func TestFinalizeBlockResponsesSaveLoad1(t *testing.T) { // Build mock responses. block := makeBlock(state, 2, new(types.Commit)) - abciResponses := new(abci.ResponseFinalizeBlock) + abciResponses := new(abci.FinalizeBlockResponse) dtxs := make([]*abci.ExecTxResult, 2) abciResponses.TxResults = dtxs @@ -191,7 +191,7 @@ func TestFinalizeBlockResponsesSaveLoad2(t *testing.T) { // Add all cases. for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save - responses := &abci.ResponseFinalizeBlock{ + responses := &abci.FinalizeBlockResponse{ TxResults: tc.added, AppHash: []byte(fmt.Sprintf("%d", h)), } @@ -205,7 +205,7 @@ func TestFinalizeBlockResponsesSaveLoad2(t *testing.T) { res, err := stateStore.LoadFinalizeBlockResponse(h) if assert.NoError(err, "%d", i) { t.Log(res) - responses := &abci.ResponseFinalizeBlock{ + responses := &abci.FinalizeBlockResponse{ TxResults: tc.expected, AppHash: []byte(fmt.Sprintf("%d", h)), } @@ -454,7 +454,7 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { bps, err := block.MakePartSet(testPartSize) require.NoError(t, err) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: bps.Header()} - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err := types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) updatedState, err := sm.UpdateState(state, blockID, &block.Header, abciResponses, validatorUpdates) @@ -568,7 +568,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { require.NoError(t, err) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: bps.Header()} // no updates: - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err := types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) @@ -668,7 +668,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // no changes in voting power and both validators have same voting power // -> proposers should alternate: oldState := updatedState3 - abciResponses = &abci.ResponseFinalizeBlock{} + abciResponses = &abci.FinalizeBlockResponse{} validatorUpdates, err = types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) @@ -681,7 +681,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { for i := 0; i < 1000; i++ { // no validator updates: - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err = types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) @@ -736,7 +736,7 @@ func TestLargeGenesisValidator(t *testing.T) { oldState := state for i := 0; i < 10; i++ { // no updates: - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err := types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) @@ -767,7 +767,7 @@ func TestLargeGenesisValidator(t *testing.T) { firstAddedVal := abci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} validatorUpdates, err := types.PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) - abciResponses := &abci.ResponseFinalizeBlock{ + abciResponses := &abci.FinalizeBlockResponse{ ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}, } block := makeBlock(oldState, oldState.LastBlockHeight+1, new(types.Commit)) @@ -782,7 +782,7 @@ func TestLargeGenesisValidator(t *testing.T) { lastState := updatedState for i := 0; i < 200; i++ { // no updates: - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err := types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) @@ -819,7 +819,7 @@ func TestLargeGenesisValidator(t *testing.T) { validatorUpdates, err := types.PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{addedVal}) assert.NoError(t, err) - abciResponses := &abci.ResponseFinalizeBlock{ + abciResponses := &abci.FinalizeBlockResponse{ ValidatorUpdates: []abci.ValidatorUpdate{addedVal}, } block := makeBlock(oldState, oldState.LastBlockHeight+1, new(types.Commit)) @@ -836,7 +836,7 @@ func TestLargeGenesisValidator(t *testing.T) { gp, err := cryptoenc.PubKeyToProto(genesisPubKey) require.NoError(t, err) removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} - abciResponses = &abci.ResponseFinalizeBlock{ + abciResponses = &abci.FinalizeBlockResponse{ ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}, } @@ -860,7 +860,7 @@ func TestLargeGenesisValidator(t *testing.T) { count := 0 isProposerUnchanged := true for isProposerUnchanged { - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err = types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) block = makeBlock(curState, curState.LastBlockHeight+1, new(types.Commit)) @@ -885,7 +885,7 @@ func TestLargeGenesisValidator(t *testing.T) { proposers := make([]*types.Validator, numVals) for i := 0; i < 100; i++ { // no updates: - abciResponses := &abci.ResponseFinalizeBlock{} + abciResponses := &abci.FinalizeBlockResponse{} validatorUpdates, err := types.PB2TM.ValidatorUpdates(abciResponses.ValidatorUpdates) require.NoError(t, err) diff --git a/state/store.go b/state/store.go index 8f56402d48..229b134f78 100644 --- a/state/store.go +++ b/state/store.go @@ -70,15 +70,15 @@ type Store interface { // LoadValidators loads the validator set at a given height LoadValidators(height int64) (*types.ValidatorSet, error) // LoadFinalizeBlockResponse loads the abciResponse for a given height - LoadFinalizeBlockResponse(height int64) (*abci.ResponseFinalizeBlock, error) + LoadFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) // LoadLastABCIResponse loads the last abciResponse for a given height - LoadLastFinalizeBlockResponse(height int64) (*abci.ResponseFinalizeBlock, error) + LoadLastFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) // LoadConsensusParams loads the consensus params for a given height LoadConsensusParams(height int64) (types.ConsensusParams, error) // Save overwrites the previous state with the updated one Save(state State) error // SaveFinalizeBlockResponse saves ABCIResponses for a given height - SaveFinalizeBlockResponse(height int64, res *abci.ResponseFinalizeBlock) error + SaveFinalizeBlockResponse(height int64, res *abci.FinalizeBlockResponse) error // Bootstrap is used for bootstrapping state when not starting from a initial height. Bootstrap(state State) error // PruneStates takes the height from which to start pruning and which height stop at @@ -460,7 +460,7 @@ func TxResultsHash(txResults []*abci.ExecTxResult) []byte { // LoadFinalizeBlockResponse loads the DiscardABCIResponses for the given height from the // database. If the node has D set to true, ErrABCIResponsesNotPersisted // is persisted. If not found, ErrNoABCIResponsesForHeight is returned. -func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.ResponseFinalizeBlock, error) { +func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) { if store.DiscardABCIResponses { return nil, ErrFinalizeBlockResponsesNotPersisted } @@ -473,7 +473,7 @@ func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.ResponseFina return nil, ErrNoABCIResponsesForHeight{height} } - resp := new(abci.ResponseFinalizeBlock) + resp := new(abci.FinalizeBlockResponse) err = resp.Unmarshal(buf) if err != nil { // The data might be of the legacy ABCI response type, so @@ -486,7 +486,7 @@ func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.ResponseFina changed: %v\n`, err)) } // The state store contains the old format. Migrate to - // the new ResponseFinalizeBlock format. Note that the + // the new FinalizeBlockResponse format. Note that the // new struct expects the AppHash which we don't have. return responseFinalizeBlockFromLegacy(legacyResp), nil } @@ -502,7 +502,7 @@ func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.ResponseFina // // This method is used for recovering in the case that we called the Commit ABCI // method on the application but crashed before persisting the results. -func (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.ResponseFinalizeBlock, error) { +func (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) { bz, err := store.db.Get(lastABCIResponseKey) if err != nil { return nil, err @@ -525,9 +525,9 @@ func (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.Response } // It is possible if this is called directly after an upgrade that - // ResponseFinalizeBlock is nil. In which case we use the legacy + // FinalizeBlockResponse is nil. In which case we use the legacy // ABCI responses - if info.ResponseFinalizeBlock == nil { + if info.FinalizeBlock == nil { // sanity check if info.LegacyAbciResponses == nil { panic("state store contains last abci response but it is empty") @@ -535,16 +535,16 @@ func (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.Response return responseFinalizeBlockFromLegacy(info.LegacyAbciResponses), nil } - return info.ResponseFinalizeBlock, nil + return info.FinalizeBlock, nil } -// SaveFinalizeBlockResponse persists the ResponseFinalizeBlock to the database. +// SaveFinalizeBlockResponse persists the FinalizeBlockResponse to the database. // This is useful in case we crash after app.Commit and before s.Save(). // Responses are indexed by height so they can also be loaded later to produce // Merkle proofs. // // CONTRACT: height must be monotonically increasing every time this is called. -func (store dbStore) SaveFinalizeBlockResponse(height int64, resp *abci.ResponseFinalizeBlock) error { +func (store dbStore) SaveFinalizeBlockResponse(height int64, resp *abci.FinalizeBlockResponse) error { var dtxs []*abci.ExecTxResult // strip nil values, for _, tx := range resp.TxResults { @@ -569,8 +569,8 @@ func (store dbStore) SaveFinalizeBlockResponse(height int64, resp *abci.Response // We always save the last ABCI response for crash recovery. // This overwrites the previous saved ABCI Response. response := &cmtstate.ABCIResponsesInfo{ - ResponseFinalizeBlock: resp, - Height: height, + FinalizeBlock: resp, + Height: height, } bz, err := response.Marshal() if err != nil { @@ -888,8 +888,8 @@ func min(a int64, b int64) int64 { // responseFinalizeBlockFromLegacy is a convenience function that takes the old abci responses and morphs // it to the finalize block response. Note that the app hash is missing -func responseFinalizeBlockFromLegacy(legacyResp *cmtstate.LegacyABCIResponses) *abci.ResponseFinalizeBlock { - return &abci.ResponseFinalizeBlock{ +func responseFinalizeBlockFromLegacy(legacyResp *cmtstate.LegacyABCIResponses) *abci.FinalizeBlockResponse { + return &abci.FinalizeBlockResponse{ TxResults: legacyResp.DeliverTxs, ValidatorUpdates: legacyResp.EndBlock.ValidatorUpdates, ConsensusParamUpdates: legacyResp.EndBlock.ConsensusParamUpdates, diff --git a/state/store_test.go b/state/store_test.go index 379ad88a57..25fa0235d6 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -169,7 +169,7 @@ func TestPruneStates(t *testing.T) { err := stateStore.Save(state) require.NoError(t, err) - err = stateStore.SaveFinalizeBlockResponse(h, &abci.ResponseFinalizeBlock{ + err = stateStore.SaveFinalizeBlockResponse(h, &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Data: []byte{1}}, {Data: []byte{2}}, @@ -282,7 +282,7 @@ func initStateStoreRetainHeights(stateStore sm.Store, appBlockRH, dcBlockRH, dcB return nil } -func fillStore(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.ResponseFinalizeBlock) { +func fillStore(t *testing.T, height int64, stateStore sm.Store, bs *store.BlockStore, state sm.State, response1 *abci.FinalizeBlockResponse) { if response1 != nil { for h := int64(1); h <= height; h++ { err := stateStore.SaveFinalizeBlockResponse(h, response1) @@ -362,7 +362,7 @@ func TestABCIResPruningStandalone(t *testing.T) { require.Error(t, err) require.Nil(t, responses) // stub the abciresponses. - response1 := &abci.ResponseFinalizeBlock{ + response1 := &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, @@ -455,7 +455,7 @@ func TestFinalizeBlockResponsePruning(t *testing.T) { require.Error(t, err) require.Nil(t, responses) // stub the abciresponses. - response1 := &abci.ResponseFinalizeBlock{ + response1 := &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, @@ -513,7 +513,7 @@ func TestLastFinalizeBlockResponses(t *testing.T) { require.Error(t, err) require.Nil(t, responses) // stub the abciresponses. - response1 := &abci.ResponseFinalizeBlock{ + response1 := &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, @@ -543,7 +543,7 @@ func TestLastFinalizeBlockResponses(t *testing.T) { stateDB := dbm.NewMemDB() height := int64(10) // stub the second abciresponse. - response2 := &abci.ResponseFinalizeBlock{ + response2 := &abci.FinalizeBlockResponse{ TxResults: []*abci.ExecTxResult{ {Code: 44, Data: []byte("Hello again"), Log: "????"}, }, diff --git a/state/txindex/mocks/tx_indexer.go b/state/txindex/mocks/tx_indexer.go index 0990d9a4d8..a4750cc403 100644 --- a/state/txindex/mocks/tx_indexer.go +++ b/state/txindex/mocks/tx_indexer.go @@ -12,7 +12,7 @@ import ( txindex "github.com/cometbft/cometbft/state/txindex" - v3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" + v1beta3 "github.com/cometbft/cometbft/api/cometbft/abci/v1beta3" ) // TxIndexer is an autogenerated mock type for the TxIndexer type @@ -35,19 +35,19 @@ func (_m *TxIndexer) AddBatch(b *txindex.Batch) error { } // Get provides a mock function with given fields: hash -func (_m *TxIndexer) Get(hash []byte) (*v3.TxResult, error) { +func (_m *TxIndexer) Get(hash []byte) (*v1beta3.TxResult, error) { ret := _m.Called(hash) - var r0 *v3.TxResult + var r0 *v1beta3.TxResult var r1 error - if rf, ok := ret.Get(0).(func([]byte) (*v3.TxResult, error)); ok { + if rf, ok := ret.Get(0).(func([]byte) (*v1beta3.TxResult, error)); ok { return rf(hash) } - if rf, ok := ret.Get(0).(func([]byte) *v3.TxResult); ok { + if rf, ok := ret.Get(0).(func([]byte) *v1beta3.TxResult); ok { r0 = rf(hash) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*v3.TxResult) + r0 = ret.Get(0).(*v1beta3.TxResult) } } @@ -85,11 +85,11 @@ func (_m *TxIndexer) GetRetainHeight() (int64, error) { } // Index provides a mock function with given fields: result -func (_m *TxIndexer) Index(result *v3.TxResult) error { +func (_m *TxIndexer) Index(result *v1beta3.TxResult) error { ret := _m.Called(result) var r0 error - if rf, ok := ret.Get(0).(func(*v3.TxResult) error); ok { + if rf, ok := ret.Get(0).(func(*v1beta3.TxResult) error); ok { r0 = rf(result) } else { r0 = ret.Error(0) @@ -130,19 +130,19 @@ func (_m *TxIndexer) Prune(retainHeight int64) (int64, int64, error) { } // Search provides a mock function with given fields: ctx, q -func (_m *TxIndexer) Search(ctx context.Context, q *query.Query) ([]*v3.TxResult, error) { +func (_m *TxIndexer) Search(ctx context.Context, q *query.Query) ([]*v1beta3.TxResult, error) { ret := _m.Called(ctx, q) - var r0 []*v3.TxResult + var r0 []*v1beta3.TxResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*v3.TxResult, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*v1beta3.TxResult, error)); ok { return rf(ctx, q) } - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*v3.TxResult); ok { + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*v1beta3.TxResult); ok { r0 = rf(ctx, q) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*v3.TxResult) + r0 = ret.Get(0).([]*v1beta3.TxResult) } } diff --git a/statesync/reactor.go b/statesync/reactor.go index 285c6a522d..571b82b493 100644 --- a/statesync/reactor.go +++ b/statesync/reactor.go @@ -171,7 +171,7 @@ func (r *Reactor) Receive(e p2p.Envelope) { case *ssproto.ChunkRequest: r.Logger.Debug("Received chunk request", "height", msg.Height, "format", msg.Format, "chunk", msg.Index, "peer", e.Src.ID()) - resp, err := r.conn.LoadSnapshotChunk(context.TODO(), &abci.RequestLoadSnapshotChunk{ + resp, err := r.conn.LoadSnapshotChunk(context.TODO(), &abci.LoadSnapshotChunkRequest{ Height: msg.Height, Format: msg.Format, Chunk: msg.Index, @@ -227,7 +227,7 @@ func (r *Reactor) Receive(e p2p.Envelope) { // recentSnapshots fetches the n most recent snapshots from the app func (r *Reactor) recentSnapshots(n uint32) ([]*snapshot, error) { - resp, err := r.conn.ListSnapshots(context.TODO(), &abci.RequestListSnapshots{}) + resp, err := r.conn.ListSnapshots(context.TODO(), &abci.ListSnapshotsRequest{}) if err != nil { return nil, err } diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 64725183d8..1919147dcd 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -45,11 +45,11 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("LoadSnapshotChunk", mock.Anything, &abci.RequestLoadSnapshotChunk{ + conn.On("LoadSnapshotChunk", mock.Anything, &abci.LoadSnapshotChunkRequest{ Height: tc.request.Height, Format: tc.request.Format, Chunk: tc.request.Index, - }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) + }).Return(&abci.LoadSnapshotChunkResponse{Chunk: tc.chunk}, nil) // Mock peer to store response, if found peer := &p2pmocks.Peer{} @@ -137,7 +137,7 @@ func TestReactor_Receive_SnapshotsRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("ListSnapshots", mock.Anything, &abci.RequestListSnapshots{}).Return(&abci.ResponseListSnapshots{ + conn.On("ListSnapshots", mock.Anything, &abci.ListSnapshotsRequest{}).Return(&abci.ListSnapshotsResponse{ Snapshots: tc.snapshots, }, nil) diff --git a/statesync/syncer.go b/statesync/syncer.go index 27ce1b89ea..2550c56eca 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -321,7 +321,7 @@ func (s *syncer) Sync(snapshot *snapshot, chunks *chunkQueue) (sm.State, *types. func (s *syncer) offerSnapshot(snapshot *snapshot) error { s.logger.Info("Offering snapshot to ABCI app", "height", snapshot.Height, "format", snapshot.Format, "hash", log.NewLazySprintf("%X", snapshot.Hash)) - resp, err := s.conn.OfferSnapshot(context.TODO(), &abci.RequestOfferSnapshot{ + resp, err := s.conn.OfferSnapshot(context.TODO(), &abci.OfferSnapshotRequest{ Snapshot: &abci.Snapshot{ Height: snapshot.Height, Format: snapshot.Format, @@ -363,7 +363,7 @@ func (s *syncer) applyChunks(chunks *chunkQueue) error { return fmt.Errorf("failed to fetch chunk: %w", err) } - resp, err := s.conn.ApplySnapshotChunk(context.TODO(), &abci.RequestApplySnapshotChunk{ + resp, err := s.conn.ApplySnapshotChunk(context.TODO(), &abci.ApplySnapshotChunkRequest{ Index: chunk.Index, Chunk: chunk.Chunk, Sender: string(chunk.Sender), @@ -482,7 +482,7 @@ func (s *syncer) requestChunk(snapshot *snapshot, chunk uint32) { // verifyApp verifies the sync, checking the app hash, last block height and app version func (s *syncer) verifyApp(snapshot *snapshot, appVersion uint64) error { - resp, err := s.connQuery.Info(context.TODO(), proxy.RequestInfo) + resp, err := s.connQuery.Info(context.TODO(), proxy.InfoRequest) if err != nil { return fmt.Errorf("failed to query ABCI app for appHash: %w", err) } diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index add77c8fb5..dbb52dba60 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -138,7 +138,7 @@ func TestSyncer_SyncAny(t *testing.T) { // We start a sync, with peers sending back chunks when requested. We first reject the snapshot // with height 2 format 2, and accept the snapshot at height 1. - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: &abci.Snapshot{ Height: 2, Format: 2, @@ -146,8 +146,8 @@ func TestSyncer_SyncAny(t *testing.T) { Hash: []byte{1}, }, AppHash: []byte("app_hash_2"), - }).Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + }).Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_FORMAT}, nil) + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: &abci.Snapshot{ Height: s.Height, Format: s.Format, @@ -156,7 +156,7 @@ func TestSyncer_SyncAny(t *testing.T) { Metadata: s.Metadata, }, AppHash: []byte("app_hash"), - }).Times(2).Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_ACCEPT}, nil) + }).Times(2).Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_ACCEPT}, nil) chunkRequests := make(map[uint32]int) chunkRequestsMtx := cmtsync.Mutex{} @@ -188,24 +188,24 @@ func TestSyncer_SyncAny(t *testing.T) { // The first time we're applying chunk 2 we tell it to retry the snapshot and discard chunk 1, // which should cause it to keep the existing chunk 0 and 2, and restart restoration from // beginning. We also wait for a little while, to exercise the retry logic in fetchChunks(). - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 2, Chunk: []byte{1, 1, 2}, }).Once().Run(func(args mock.Arguments) { time.Sleep(2 * time.Second) }).Return( - &abci.ResponseApplySnapshotChunk{ + &abci.ApplySnapshotChunkResponse{ Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_RETRY_SNAPSHOT, RefetchChunks: []uint32{1}, }, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 0, Chunk: []byte{1, 1, 0}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Times(2).Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 1, Chunk: []byte{1, 1, 1}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Times(2).Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 2, Chunk: []byte{1, 1, 2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connQuery.On("Info", mock.Anything, proxy.RequestInfo).Return(&abci.ResponseInfo{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connQuery.On("Info", mock.Anything, proxy.InfoRequest).Return(&abci.InfoResponse{ AppVersion: testAppVersion, LastBlockHeight: 1, LastBlockAppHash: []byte("app_hash"), @@ -243,9 +243,9 @@ func TestSyncer_SyncAny_abort(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_ABORT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_ABORT}, nil) _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -266,17 +266,17 @@ func TestSyncer_SyncAny_reject(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s12), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -297,13 +297,13 @@ func TestSyncer_SyncAny_reject_format(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_FORMAT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_ABORT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_ABORT}, nil) _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -335,13 +335,13 @@ func TestSyncer_SyncAny_reject_sender(t *testing.T) { _, err = syncer.AddSnapshot(peerC, sbc) require.NoError(t, err) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(sbc), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_SENDER}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT_SENDER}, nil) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(sa), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) + }).Once().Return(&abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil) _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -355,7 +355,7 @@ func TestSyncer_SyncAny_abciError(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), }).Once().Return(nil, errBoom) @@ -387,10 +387,10 @@ func TestSyncer_offerSnapshot(t *testing.T) { t.Run(name, func(t *testing.T) { syncer, connSnapshot := setupOfferSyncer() s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} - connSnapshot.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshot", mock.Anything, &abci.OfferSnapshotRequest{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Return(&abci.ResponseOfferSnapshot{Result: tc.result}, tc.err) + }).Return(&abci.OfferSnapshotResponse{Result: tc.result}, tc.err) err := syncer.offerSnapshot(s) if tc.expectErr == unknownErr { require.Error(t, err) @@ -440,13 +440,13 @@ func TestSyncer_applyChunks_Results(t *testing.T) { _, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: body}) require.NoError(t, err) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: tc.result}, tc.err) if tc.result == abci.APPLY_SNAPSHOT_CHUNK_RESULT_RETRY { - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{ Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT, }, nil) } @@ -501,15 +501,15 @@ func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for 1 to be refetched - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 0, Chunk: []byte{0}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 1, Chunk: []byte{1}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 2, Chunk: []byte{2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{ Result: tc.result, RefetchChunks: []uint32{1}, }, nil) @@ -587,24 +587,24 @@ func TestSyncer_applyChunks_RejectSenders(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for b sender to be rejected - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 0, Chunk: []byte{0}, Sender: "a", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 1, Chunk: []byte{1}, Sender: "b", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&abci.ResponseApplySnapshotChunk{ + }).Once().Return(&abci.ApplySnapshotChunkResponse{ Result: tc.result, RejectSenders: []string{string(peerB.ID())}, }, nil) // On retry, the last chunk will be tried again, so we just accept it then. if tc.result == abci.APPLY_SNAPSHOT_CHUNK_RESULT_RETRY { - connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunk", mock.Anything, &abci.ApplySnapshotChunkRequest{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) + }).Once().Return(&abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil) } // We don't really care about the result of applyChunks, since it has separate test. @@ -639,26 +639,26 @@ func TestSyncer_verifyApp(t *testing.T) { s := &snapshot{Height: 3, Format: 1, Chunks: 5, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} testcases := map[string]struct { - response *abci.ResponseInfo + response *abci.InfoResponse err error expectErr error }{ - "verified": {&abci.ResponseInfo{ + "verified": {&abci.InfoResponse{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, nil}, - "invalid app version": {&abci.ResponseInfo{ + "invalid app version": {&abci.InfoResponse{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: 2, }, nil, appVersionMismatchErr}, - "invalid height": {&abci.ResponseInfo{ + "invalid height": {&abci.InfoResponse{ LastBlockHeight: 5, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, errVerifyFailed}, - "invalid hash": {&abci.ResponseInfo{ + "invalid hash": {&abci.InfoResponse{ LastBlockHeight: 3, LastBlockAppHash: []byte("xxx"), AppVersion: appVersion, @@ -675,7 +675,7 @@ func TestSyncer_verifyApp(t *testing.T) { cfg := config.DefaultStateSyncConfig() syncer := newSyncer(*cfg, log.NewNopLogger(), connSnapshot, connQuery, stateProvider, "") - connQuery.On("Info", mock.Anything, proxy.RequestInfo).Return(tc.response, tc.err) + connQuery.On("Info", mock.Anything, proxy.InfoRequest).Return(tc.response, tc.err) err := syncer.verifyApp(s, appVersion) unwrapped := errors.Unwrap(err) if unwrapped != nil { diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index b829d4ef32..c76f4bd086 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -130,9 +130,9 @@ func NewApplication(cfg *Config) (*Application, error) { } // Info implements ABCI. -func (app *Application) Info(context.Context, *abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *Application) Info(context.Context, *abci.InfoRequest) (*abci.InfoResponse, error) { height, hash := app.state.Info() - return &abci.ResponseInfo{ + return &abci.InfoResponse{ Version: version.ABCIVersion, AppVersion: appVersion, LastBlockHeight: int64(height), @@ -141,7 +141,7 @@ func (app *Application) Info(context.Context, *abci.RequestInfo) (*abci.Response } // Info implements ABCI. -func (app *Application) InitChain(_ context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *Application) InitChain(_ context.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error) { var err error app.state.initialHeight = uint64(req.InitialHeight) if len(req.AppStateBytes) > 0 { @@ -165,7 +165,7 @@ func (app *Application) InitChain(_ context.Context, req *abci.RequestInitChain) } } } - resp := &abci.ResponseInitChain{ + resp := &abci.InitChainResponse{ AppHash: app.state.GetHash(), } if resp.Validators, err = app.validatorUpdates(0); err != nil { @@ -175,10 +175,10 @@ func (app *Application) InitChain(_ context.Context, req *abci.RequestInitChain) } // CheckTx implements ABCI. -func (app *Application) CheckTx(_ context.Context, req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) { +func (app *Application) CheckTx(_ context.Context, req *abci.CheckTxRequest) (*abci.CheckTxResponse, error) { key, _, err := parseTx(req.Tx) if err != nil || key == prefixReservedKey { - return &abci.ResponseCheckTx{ + return &abci.CheckTxResponse{ Code: kvstore.CodeTypeEncodingError, Log: err.Error(), }, nil @@ -188,11 +188,11 @@ func (app *Application) CheckTx(_ context.Context, req *abci.RequestCheckTx) (*a time.Sleep(app.cfg.CheckTxDelay) } - return &abci.ResponseCheckTx{Code: kvstore.CodeTypeOK, GasWanted: 1}, nil + return &abci.CheckTxResponse{Code: kvstore.CodeTypeOK, GasWanted: 1}, nil } // FinalizeBlock implements ABCI. -func (app *Application) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { +func (app *Application) FinalizeBlock(_ context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error) { txs := make([]*abci.ExecTxResult, len(req.Txs)) for i, tx := range req.Txs { @@ -217,7 +217,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *abci.RequestFinali time.Sleep(app.cfg.FinalizeBlockDelay) } - return &abci.ResponseFinalizeBlock{ + return &abci.FinalizeBlockResponse{ TxResults: txs, ValidatorUpdates: valUpdates, AppHash: app.state.Finalize(), @@ -240,7 +240,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *abci.RequestFinali } // Commit implements ABCI. -func (app *Application) Commit(_ context.Context, _ *abci.RequestCommit) (*abci.ResponseCommit, error) { +func (app *Application) Commit(_ context.Context, _ *abci.CommitRequest) (*abci.CommitResponse, error) { height, err := app.state.Commit() if err != nil { panic(err) @@ -260,15 +260,15 @@ func (app *Application) Commit(_ context.Context, _ *abci.RequestCommit) (*abci. if app.cfg.RetainBlocks > 0 { retainHeight = int64(height - app.cfg.RetainBlocks + 1) } - return &abci.ResponseCommit{ + return &abci.CommitResponse{ RetainHeight: retainHeight, }, nil } // Query implements ABCI. -func (app *Application) Query(_ context.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) { +func (app *Application) Query(_ context.Context, req *abci.QueryRequest) (*abci.QueryResponse, error) { value, height := app.state.Query(string(req.Data)) - return &abci.ResponseQuery{ + return &abci.QueryResponse{ Height: int64(height), Key: req.Data, Value: []byte(value), @@ -276,35 +276,35 @@ func (app *Application) Query(_ context.Context, req *abci.RequestQuery) (*abci. } // ListSnapshots implements ABCI. -func (app *Application) ListSnapshots(context.Context, *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (app *Application) ListSnapshots(context.Context, *abci.ListSnapshotsRequest) (*abci.ListSnapshotsResponse, error) { snapshots, err := app.snapshots.List() if err != nil { panic(err) } - return &abci.ResponseListSnapshots{Snapshots: snapshots}, nil + return &abci.ListSnapshotsResponse{Snapshots: snapshots}, nil } // LoadSnapshotChunk implements ABCI. -func (app *Application) LoadSnapshotChunk(_ context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { +func (app *Application) LoadSnapshotChunk(_ context.Context, req *abci.LoadSnapshotChunkRequest) (*abci.LoadSnapshotChunkResponse, error) { chunk, err := app.snapshots.LoadChunk(req.Height, req.Format, req.Chunk) if err != nil { panic(err) } - return &abci.ResponseLoadSnapshotChunk{Chunk: chunk}, nil + return &abci.LoadSnapshotChunkResponse{Chunk: chunk}, nil } // OfferSnapshot implements ABCI. -func (app *Application) OfferSnapshot(_ context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (app *Application) OfferSnapshot(_ context.Context, req *abci.OfferSnapshotRequest) (*abci.OfferSnapshotResponse, error) { if app.restoreSnapshot != nil { panic("A snapshot is already being restored") } app.restoreSnapshot = req.Snapshot app.restoreChunks = [][]byte{} - return &abci.ResponseOfferSnapshot{Result: abci.OFFER_SNAPSHOT_RESULT_ACCEPT}, nil + return &abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_ACCEPT}, nil } // ApplySnapshotChunk implements ABCI. -func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { +func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.ApplySnapshotChunkRequest) (*abci.ApplySnapshotChunkResponse, error) { if app.restoreSnapshot == nil { panic("No restore in progress") } @@ -321,7 +321,7 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA app.restoreSnapshot = nil app.restoreChunks = nil } - return &abci.ResponseApplySnapshotChunk{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil + return &abci.ApplySnapshotChunkResponse{Result: abci.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT}, nil } // PrepareProposal will take the given transactions and attempt to prepare a @@ -345,8 +345,8 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA // The special vote extension-generated transaction must fit within an empty block // and takes precedence over all other transactions coming from the mempool. func (app *Application) PrepareProposal( - _ context.Context, req *abci.RequestPrepareProposal, -) (*abci.ResponsePrepareProposal, error) { + _ context.Context, req *abci.PrepareProposalRequest, +) (*abci.PrepareProposalResponse, error) { _, areExtensionsEnabled := app.checkHeightAndExtensions(true, req.Height, "PrepareProposal") txs := make([][]byte, 0, len(req.Txs)+1) @@ -397,32 +397,32 @@ func (app *Application) PrepareProposal( time.Sleep(app.cfg.PrepareProposalDelay) } - return &abci.ResponsePrepareProposal{Txs: txs}, nil + return &abci.PrepareProposalResponse{Txs: txs}, nil } // ProcessProposal implements part of the Application interface. // It accepts any proposal that does not contain a malformed transaction. // NOTE It is up to real Applications to effect punitive behavior in the cases ProcessProposal // returns PROCESS_PROPOSAL_STATUS_REJECT, as it is evidence of misbehavior. -func (app *Application) ProcessProposal(_ context.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { +func (app *Application) ProcessProposal(_ context.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error) { _, areExtensionsEnabled := app.checkHeightAndExtensions(true, req.Height, "ProcessProposal") for _, tx := range req.Txs { k, v, err := parseTx(tx) if err != nil { app.logger.Error("malformed transaction in ProcessProposal", "tx", tx, "err", err) - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil } switch { case areExtensionsEnabled && k == voteExtensionKey: // Additional check for vote extension-related txs if err := app.verifyExtensionTx(req.Height, v); err != nil { app.logger.Error("vote extension transaction failed verification, rejecting proposal", k, v, "err", err) - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil } case strings.HasPrefix(k, prefixReservedKey): app.logger.Error("key prefix %q is reserved and cannot be used in transactions, rejecting proposal", k) - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil } } @@ -430,7 +430,7 @@ func (app *Application) ProcessProposal(_ context.Context, req *abci.RequestProc time.Sleep(app.cfg.ProcessProposalDelay) } - return &abci.ResponseProcessProposal{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil + return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil } // ExtendVote will produce vote extensions in the form of random numbers to @@ -440,7 +440,7 @@ func (app *Application) ProcessProposal(_ context.Context, req *abci.RequestProc // a new transaction will be proposed that updates a special value in the // key/value store ("extensionSum") with the sum of all of the numbers collected // from the vote extensions. -func (app *Application) ExtendVote(_ context.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { +func (app *Application) ExtendVote(_ context.Context, req *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error) { appHeight, areExtensionsEnabled := app.checkHeightAndExtensions(false, req.Height, "ExtendVote") if !areExtensionsEnabled { panic(fmt.Errorf("received call to ExtendVote at height %d, when vote extensions are disabled", appHeight)) @@ -468,7 +468,7 @@ func (app *Application) ExtendVote(_ context.Context, req *abci.RequestExtendVot } app.logger.Info("generated vote extension", "height", appHeight, "vote_extension", fmt.Sprintf("%x", ext[:4]), "len", extLen) - return &abci.ResponseExtendVote{ + return &abci.ExtendVoteResponse{ VoteExtension: ext[:extLen], }, nil } @@ -476,7 +476,7 @@ func (app *Application) ExtendVote(_ context.Context, req *abci.RequestExtendVot // VerifyVoteExtension simply validates vote extensions from other validators // without doing anything about them. In this case, it just makes sure that the // vote extension is a well-formed integer value. -func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { +func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error) { appHeight, areExtensionsEnabled := app.checkHeightAndExtensions(false, req.Height, "VerifyVoteExtension") if !areExtensionsEnabled { panic(fmt.Errorf("received call to VerifyVoteExtension at height %d, when vote extensions are disabled", appHeight)) @@ -484,7 +484,7 @@ func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.Request // We don't allow vote extensions to be optional if len(req.VoteExtension) == 0 { app.logger.Error("received empty vote extension") - return &abci.ResponseVerifyVoteExtension{ + return &abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_REJECT, }, nil } @@ -492,7 +492,7 @@ func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.Request num, err := parseVoteExtension(app.cfg, req.VoteExtension) if err != nil { app.logger.Error("failed to parse vote extension", "vote_extension", fmt.Sprintf("%x", req.VoteExtension[:4]), "err", err) - return &abci.ResponseVerifyVoteExtension{ + return &abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_REJECT, }, nil } @@ -502,7 +502,7 @@ func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.Request } app.logger.Info("verified vote extension value", "height", req.Height, "vote_extension", fmt.Sprintf("%x", req.VoteExtension[:4]), "num", num) - return &abci.ResponseVerifyVoteExtension{ + return &abci.VerifyVoteExtensionResponse{ Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT, }, nil } diff --git a/types/event_bus_test.go b/types/event_bus_test.go index 8b04f9fd24..0d6205bae2 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -75,7 +75,7 @@ func TestEventBusPublishEventNewBlock(t *testing.T) { }) block := MakeBlock(0, []Tx{}, nil, []Evidence{}) - resultFinalizeBlock := abci.ResponseFinalizeBlock{ + resultFinalizeBlock := abci.FinalizeBlockResponse{ Events: []abci.Event{ {Type: "testType", Attributes: []abci.EventAttribute{{Key: "baz", Value: "1"}}}, }, diff --git a/types/events.go b/types/events.go index 23afad06e9..c69cec7aa6 100644 --- a/types/events.go +++ b/types/events.go @@ -66,7 +66,7 @@ func init() { type EventDataNewBlock struct { Block *Block `json:"block"` BlockID BlockID `json:"block_id"` - ResultFinalizeBlock abci.ResponseFinalizeBlock `json:"result_finalize_block"` + ResultFinalizeBlock abci.FinalizeBlockResponse `json:"result_finalize_block"` } type EventDataNewBlockHeader struct {