From e0b1675f2cbe2f89bd4b62d35d135c14f02dd7d7 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 18 Dec 2023 17:40:48 +0800 Subject: [PATCH] fix(x/auth): remove misleading gas wanted value from tx simulation failure response (#18772) Co-authored-by: Aleksandr Bezobchuk --- CHANGELOG.md | 1 + x/auth/tx/service.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bba783f92b97..68df353191e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (crypto/keys) [#18026](https://github.com/cosmos/cosmos-sdk/pull/18026) Made public key generation constant time on `secp256k1` * (crypto | x/auth) [#14372](https://github.com/cosmos/cosmos-sdk/pull/18194) Key checks on signatures antehandle. * (staking) [#18506](https://github.com/cosmos/cosmos-sdk/pull/18506) Detect the length of the ed25519 pubkey in CreateValidator to prevent panic. +* (tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log. ### Bug Fixes diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 67dbf3fa591f..e0b6bb79e2be 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -98,7 +98,7 @@ func (s txServer) Simulate(ctx context.Context, req *txtypes.SimulateRequest) (* gasInfo, result, err := s.simulate(txBytes) if err != nil { - return nil, status.Errorf(codes.Unknown, "%v With gas wanted: '%d' and gas used: '%d' ", err, gasInfo.GasWanted, gasInfo.GasUsed) + return nil, status.Errorf(codes.Unknown, "%v with gas used: '%d'", err, gasInfo.GasUsed) } return &txtypes.SimulateResponse{