mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-17 12:46:16 +00:00
Replace uses of libs/json with encoding/json. (#7534)
Where possible, replace uses of the custom JSON library with the standard library. The custom library treats interface and unnamed lteral types differently, so this change avoids those even where it would probably be safe to switch them.
This commit is contained in:
+2
-2
@@ -2,6 +2,7 @@ package types
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -10,7 +11,6 @@ import (
|
||||
"github.com/tendermint/tendermint/crypto/merkle"
|
||||
"github.com/tendermint/tendermint/libs/bits"
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
tmjson "github.com/tendermint/tendermint/libs/json"
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
)
|
||||
@@ -365,7 +365,7 @@ func (ps *PartSet) MarshalJSON() ([]byte, error) {
|
||||
ps.mtx.Lock()
|
||||
defer ps.mtx.Unlock()
|
||||
|
||||
return tmjson.Marshal(struct {
|
||||
return json.Marshal(struct {
|
||||
CountTotal string `json:"count/total"`
|
||||
PartsBitArray *bits.BitArray `json:"parts_bit_array"`
|
||||
}{
|
||||
|
||||
+2
-2
@@ -2,12 +2,12 @@ package types
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/tendermint/tendermint/libs/bits"
|
||||
tmjson "github.com/tendermint/tendermint/libs/json"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
)
|
||||
|
||||
@@ -495,7 +495,7 @@ func (voteSet *VoteSet) StringIndented(indent string) string {
|
||||
func (voteSet *VoteSet) MarshalJSON() ([]byte, error) {
|
||||
voteSet.mtx.Lock()
|
||||
defer voteSet.mtx.Unlock()
|
||||
return tmjson.Marshal(VoteSetJSON{
|
||||
return json.Marshal(VoteSetJSON{
|
||||
voteSet.voteStrings(),
|
||||
voteSet.bitArrayString(),
|
||||
voteSet.peerMaj23s,
|
||||
|
||||
Reference in New Issue
Block a user