From 5e0fc6d72fe77f1c1646b5a289a4e38eca7edb0d Mon Sep 17 00:00:00 2001 From: Emilian Harastasan Date: Mon, 3 Oct 2022 12:16:28 +0300 Subject: [PATCH] feat: context on simulate error --- 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 7de6291c85d2..137761c4cd51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [#13435](https://github.com/cosmos/cosmos-sdk/pull/13435) extend error context when a simulation fails. * [#13298](https://github.com/cosmos/cosmos-sdk/pull/13298) Add `AddGenesisAccount` helper func in x/auth module which helps adding accounts to genesis state. * (cli) [#13353](https://github.com/cosmos/cosmos-sdk/pull/13353) Add `tx group draft-proposal` command for generating group proposal JSONs (skeleton). * (cli) [#13304](https://github.com/cosmos/cosmos-sdk/pull/13304) Add `tx gov draft-proposal` command for generating proposal JSONs (skeleton). diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index c25837cadf26..8f72205a20f7 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -129,7 +129,7 @@ func (s txServer) Simulate(ctx context.Context, req *txtypes.SimulateRequest) (* gasInfo, result, err := s.simulate(txBytes) if err != nil { - return nil, err + return nil, status.Errorf(codes.Unknown, "%v With gas wanted: '%d' and gas used: '%d' ", err, gasInfo.GasWanted, gasInfo.GasUsed) } return &txtypes.SimulateResponse{