fix: rosetta tendermint errors as internal (#14285)

This commit is contained in:
Julián Toledano 2022-12-13 20:41:53 +01:00 committed by GitHub
parent 13b3062e72
commit e1bbe37429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#14272](https://github.com/cosmos/cosmos-sdk/pull/14272) Use `coinbase/rosetta-sdk-go/types` packages instead of comsos fork.
### Bug Fixes
* [#14285](https://github.com/cosmos/cosmos-sdk/pull/14285) Sets tendermint errors status codes to 500
## v0.2.0 2022-12-07
### Improvements

View File

@ -5,6 +5,7 @@ package errors
import (
"fmt"
"net/http"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
@ -83,7 +84,7 @@ func ToRosetta(err error) *types.Error {
// fromTendermintToRosettaError converts a tendermint jsonrpc error to rosetta error
func fromTendermintToRosettaError(err *tmtypes.RPCError) *Error {
return &Error{rosErr: &types.Error{
Code: int32(err.Code),
Code: http.StatusInternalServerError,
Message: err.Message,
Details: map[string]interface{}{
"info": err.Data,