Skip to content

Commit 65b56ec

Browse files
committed
good rabbit
1 parent 8daaa0f commit 65b56ec

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

server/v2/cometbft/abci.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (c *consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) (
179179

180180
switch path[0] {
181181
case QueryPathApp:
182-
resp, err = c.handlerQueryApp(ctx, path, req)
182+
resp, err = c.handleQueryApp(ctx, path, req)
183183

184184
case QueryPathStore:
185185
resp, err = c.handleQueryStore(path, req)
@@ -240,7 +240,7 @@ func (c *consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq
240240

241241
txResult, _, err := c.app.Simulate(ctx, tx)
242242
if err != nil {
243-
return nil, true, fmt.Errorf("%w with gas used: '%d'", err, txResult.GasUsed)
243+
return nil, true, fmt.Errorf("failed with gas used: '%d': %w", txResult.GasUsed, err)
244244
}
245245

246246
msgResponses := make([]*codectypes.Any, 0, len(txResult.Resp))

server/v2/cometbft/grpc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"cosmossdk.io/core/server"
1616
corestore "cosmossdk.io/core/store"
1717
"cosmossdk.io/core/transaction"
18-
errorsmod "cosmossdk.io/errors/v2"
1918

2019
"github.com/cosmos/cosmos-sdk/client"
2120
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
@@ -145,7 +144,7 @@ func (t txServer[T]) Simulate(ctx context.Context, req *txtypes.SimulateRequest)
145144

146145
tx, err := t.txCodec.Decode(txBytes)
147146
if err != nil {
148-
return nil, errorsmod.Wrap(err, "failed to decode tx")
147+
return nil, status.Errorf(codes.InvalidArgument, "failed to decode tx: %v", err)
149148
}
150149

151150
txResult, _, err := t.app.Simulate(ctx, tx)

server/v2/cometbft/query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ func (c *consensus[T]) handleQueryP2P(path []string) (*abci.QueryResponse, error
3434
return nil, errorsmod.Wrap(cometerrors.ErrUnknownRequest, "expected second parameter to be 'filter'")
3535
}
3636

37-
// handlerQueryApp handles the query requests for the application.
37+
// handleQueryApp handles the query requests for the application.
3838
// It expects the path parameter to have at least two elements.
3939
// The second element of the path can be either 'simulate' or 'version'.
4040
// If the second element is 'simulate', it decodes the request data into a transaction,
4141
// simulates the transaction using the application, and returns the simulation result.
4242
// If the second element is 'version', it returns the version of the application.
4343
// If the second element is neither 'simulate' nor 'version', it returns an error indicating an unknown query.
44-
func (c *consensus[T]) handlerQueryApp(ctx context.Context, path []string, req *abci.QueryRequest) (*abci.QueryResponse, error) {
44+
func (c *consensus[T]) handleQueryApp(ctx context.Context, path []string, req *abci.QueryRequest) (*abci.QueryResponse, error) {
4545
if len(path) < 2 {
4646
return nil, errorsmod.Wrap(
4747
cometerrors.ErrUnknownRequest,

0 commit comments

Comments
 (0)