Merge PR #6667: codec: remove unused, untested and expensive MarshalIndentFromJSON
This commit is contained in:
parent
03fdc9d744
commit
2da1a63288
|
@ -2,7 +2,6 @@ package codec
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
|
||||
|
@ -10,19 +9,6 @@ import (
|
|||
"github.com/gogo/protobuf/proto"
|
||||
)
|
||||
|
||||
// MarshalIndentFromJSON returns indented JSON-encoded bytes from already encoded
|
||||
// JSON bytes. The output encoding will adhere to the original input's encoding
|
||||
// (e.g. Proto3).
|
||||
func MarshalIndentFromJSON(bz []byte) ([]byte, error) {
|
||||
var generic interface{}
|
||||
|
||||
if err := json.Unmarshal(bz, &generic); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return json.MarshalIndent(generic, "", " ")
|
||||
}
|
||||
|
||||
// ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded
|
||||
// bytes of a message.
|
||||
func ProtoMarshalJSON(msg proto.Message) ([]byte, error) {
|
||||
|
|
Loading…
Reference in New Issue