@@ -27,14 +27,14 @@ import (
2727 "github.com/cometbft/cometbft/abci/types"
2828)
2929
30- func (app * App ) Info (ctx context.Context , req * types.RequestInfo ) (* types.ResponseInfo , error ) {
30+ func (app * App ) Info (ctx context.Context , req * types.InfoRequest ) (* types.InfoResponse , error ) {
3131 if fn := app .OnInfo ; fn != nil {
3232 return fn (ctx , req )
3333 }
3434 return app .BaseApplication .Info (ctx , req )
3535}
3636
37- func (app * App ) InitChain (_ context.Context , req * types.RequestInitChain ) (* types.ResponseInitChain , error ) {
37+ func (app * App ) InitChain (_ context.Context , req * types.InitChainRequest ) (* types.InitChainResponse , error ) {
3838 _ , err := LoadGenesisState (req .AppStateBytes )
3939 if err != nil {
4040 panic (err )
@@ -43,7 +43,7 @@ func (app *App) InitChain(_ context.Context, req *types.RequestInitChain) (*type
4343 if fn := app .OnInitChain ; fn != nil {
4444 return fn (req )
4545 }
46- return & types.ResponseInitChain {}, nil
46+ return & types.InitChainResponse {}, nil
4747}
4848
4949func (app * App ) GetTx (tx []byte ) (Tx , error ) {
@@ -53,7 +53,7 @@ func (app *App) GetTx(tx []byte) (Tx, error) {
5353
5454// PrepareProposal will take the given transactions from the mempool and attempts to prepare a
5555// proposal from them when it's our turn to do so while keeping the size, gas, pow, and spam constraints.
56- func (app * App ) PrepareProposal (_ context.Context , req * types.RequestPrepareProposal ) (* types.ResponsePrepareProposal , error ) {
56+ func (app * App ) PrepareProposal (_ context.Context , req * types.PrepareProposalRequest ) (* types.PrepareProposalResponse , error ) {
5757 txs := make ([]Tx , 0 , len (req .Txs ))
5858 rawTxs := make ([][]byte , 0 , len (req .Txs ))
5959 for _ , v := range req .Txs {
@@ -71,47 +71,47 @@ func (app *App) PrepareProposal(_ context.Context, req *types.RequestPrepareProp
7171 }
7272
7373 // let the application decide on the order and the number of transactions it wants to pick up for this block
74- res := & types.ResponsePrepareProposal {Txs : app .OnPrepareProposal (uint64 (req .Height ), txs , rawTxs )}
74+ res := & types.PrepareProposalResponse {Txs : app .OnPrepareProposal (uint64 (req .Height ), txs , rawTxs )}
7575 return res , nil
7676}
7777
7878// ProcessProposal implements part of the Application interface.
7979// It accepts any proposal that does not contain a malformed transaction.
8080// NB: processProposal will not be called if the node is fast-sync-ing so no state change is allowed here!!!.
81- func (app * App ) ProcessProposal (_ context.Context , req * types.RequestProcessProposal ) (* types.ResponseProcessProposal , error ) {
81+ func (app * App ) ProcessProposal (_ context.Context , req * types.ProcessProposalRequest ) (* types.ProcessProposalResponse , error ) {
8282 // check transaction signatures if any is wrong, reject the block
8383 txs := make ([]Tx , 0 , len (req .Txs ))
8484 for _ , v := range req .Txs {
8585 tx , _ , err := app .getTx (v )
8686 if err != nil {
8787 // if there's a transaction we can't decode or verify, reject it
88- return & types.ResponseProcessProposal {Status : types .ResponseProcessProposal_REJECT }, err
88+ return & types.ProcessProposalResponse {Status : types .PROCESS_PROPOSAL_STATUS_REJECT }, err
8989 }
9090 // if there's no handler for a transaction, reject it
9191 if _ , ok := app .deliverTxs [tx .Command ()]; ! ok {
92- return & types.ResponseProcessProposal {Status : types .ResponseProcessProposal_REJECT }, nil
92+ return & types.ProcessProposalResponse {Status : types .PROCESS_PROPOSAL_STATUS_REJECT }, nil
9393 }
9494 txs = append (txs , tx )
9595 }
9696 // let the application verify the block
9797 if ! app .OnProcessProposal (uint64 (req .Height ), txs ) {
98- return & types.ResponseProcessProposal {Status : types .ResponseProcessProposal_REJECT }, nil
98+ return & types.ProcessProposalResponse {Status : types .PROCESS_PROPOSAL_STATUS_REJECT }, nil
9999 }
100- return & types.ResponseProcessProposal {Status : types .ResponseProcessProposal_ACCEPT }, nil
100+ return & types.ProcessProposalResponse {Status : types .PROCESS_PROPOSAL_STATUS_ACCEPT }, nil
101101}
102102
103- func (app * App ) Commit (_ context.Context , req * types.RequestCommit ) (* types.ResponseCommit , error ) {
103+ func (app * App ) Commit (_ context.Context , req * types.CommitRequest ) (* types.CommitResponse , error ) {
104104 if fn := app .OnCommit ; fn != nil {
105105 return fn ()
106106 }
107- return & types.ResponseCommit {}, nil
107+ return & types.CommitResponse {}, nil
108108}
109109
110- func (app * App ) CheckTx (_ context.Context , req * types.RequestCheckTx ) (* types.ResponseCheckTx , error ) {
110+ func (app * App ) CheckTx (_ context.Context , req * types.CheckTxRequest ) (* types.CheckTxResponse , error ) {
111111 // first, only decode the transaction but don't validate
112112 tx , code , err := app .getTx (req .GetTx ())
113113
114- var resp * types.ResponseCheckTx
114+ var resp * types.CheckTxResponse
115115 if err != nil {
116116 // TODO I think we need to return error in this case as now the API allows for it
117117 // return blockchain.NewResponseCheckTxError(code, err), err
@@ -150,7 +150,7 @@ func (app *App) CheckTx(_ context.Context, req *types.RequestCheckTx) (*types.Re
150150}
151151
152152// FinalizeBlock lets the application process a whole block end to end.
153- func (app * App ) FinalizeBlock (_ context.Context , req * types.RequestFinalizeBlock ) (* types.ResponseFinalizeBlock , error ) {
153+ func (app * App ) FinalizeBlock (_ context.Context , req * types.FinalizeBlockRequest ) (* types.FinalizeBlockResponse , error ) {
154154 blockHeight := uint64 (req .Height )
155155 blockTime := req .Time
156156
@@ -205,7 +205,7 @@ func (app *App) FinalizeBlock(_ context.Context, req *types.RequestFinalizeBlock
205205 )
206206
207207 hash := app .OnFinalize ()
208- return & types.ResponseFinalizeBlock {
208+ return & types.FinalizeBlockResponse {
209209 TxResults : results ,
210210 ValidatorUpdates : valUpdates ,
211211 ConsensusParamUpdates : & consensusUpdates ,
@@ -214,35 +214,35 @@ func (app *App) FinalizeBlock(_ context.Context, req *types.RequestFinalizeBlock
214214 }, nil
215215}
216216
217- func (app * App ) ListSnapshots (ctx context.Context , req * types.RequestListSnapshots ) (* types.ResponseListSnapshots , error ) {
217+ func (app * App ) ListSnapshots (ctx context.Context , req * types.ListSnapshotsRequest ) (* types.ListSnapshotsResponse , error ) {
218218 if app .OnListSnapshots != nil {
219219 return app .OnListSnapshots (ctx , req )
220220 }
221- return & types.ResponseListSnapshots {}, nil
221+ return & types.ListSnapshotsResponse {}, nil
222222}
223223
224- func (app * App ) OfferSnapshot (ctx context.Context , req * types.RequestOfferSnapshot ) (* types.ResponseOfferSnapshot , error ) {
224+ func (app * App ) OfferSnapshot (ctx context.Context , req * types.OfferSnapshotRequest ) (* types.OfferSnapshotResponse , error ) {
225225 if app .OnOfferSnapshot != nil {
226226 return app .OnOfferSnapshot (ctx , req )
227227 }
228- return & types.ResponseOfferSnapshot {}, nil
228+ return & types.OfferSnapshotResponse {}, nil
229229}
230230
231- func (app * App ) LoadSnapshotChunk (ctx context.Context , req * types.RequestLoadSnapshotChunk ) (* types.ResponseLoadSnapshotChunk , error ) {
231+ func (app * App ) LoadSnapshotChunk (ctx context.Context , req * types.LoadSnapshotChunkRequest ) (* types.LoadSnapshotChunkResponse , error ) {
232232 if app .OnLoadSnapshotChunk != nil {
233233 return app .OnLoadSnapshotChunk (ctx , req )
234234 }
235- return & types.ResponseLoadSnapshotChunk {}, nil
235+ return & types.LoadSnapshotChunkResponse {}, nil
236236}
237237
238- func (app * App ) ApplySnapshotChunk (_ context.Context , req * types.RequestApplySnapshotChunk ) (* types.ResponseApplySnapshotChunk , error ) {
238+ func (app * App ) ApplySnapshotChunk (_ context.Context , req * types.ApplySnapshotChunkRequest ) (* types.ApplySnapshotChunkResponse , error ) {
239239 if app .OnApplySnapshotChunk != nil {
240240 return app .OnApplySnapshotChunk (app .ctx , req )
241241 }
242- return & types.ResponseApplySnapshotChunk {}, nil
242+ return & types.ApplySnapshotChunkResponse {}, nil
243243}
244244
245- func AddCommonCheckTxEvents (resp * types.ResponseCheckTx , tx Tx ) * types.ResponseCheckTx {
245+ func AddCommonCheckTxEvents (resp * types.CheckTxResponse , tx Tx ) * types.CheckTxResponse {
246246 resp .Events = getBaseTxEvents (tx )
247247 return resp
248248}
0 commit comments