mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
rpc: use go-json
This commit is contained in:
parent
5b79f4d2da
commit
ec880b1737
1 changed files with 4 additions and 2 deletions
|
|
@ -27,6 +27,8 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
gojson "github.com/goccy/go-json"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -308,7 +310,7 @@ func isBatch(raw json.RawMessage) bool {
|
|||
// given types. It returns the parsed values or an error when the args could not be
|
||||
// parsed. Missing optional arguments are returned as reflect.Zero values.
|
||||
func parsePositionalArguments(rawArgs json.RawMessage, types []reflect.Type) ([]reflect.Value, error) {
|
||||
dec := json.NewDecoder(bytes.NewReader(rawArgs))
|
||||
dec := gojson.NewDecoder(bytes.NewReader(rawArgs))
|
||||
var args []reflect.Value
|
||||
tok, err := dec.Token()
|
||||
switch {
|
||||
|
|
@ -335,7 +337,7 @@ func parsePositionalArguments(rawArgs json.RawMessage, types []reflect.Type) ([]
|
|||
return args, nil
|
||||
}
|
||||
|
||||
func parseArgumentArray(dec *json.Decoder, types []reflect.Type) ([]reflect.Value, error) {
|
||||
func parseArgumentArray(dec *gojson.Decoder, types []reflect.Type) ([]reflect.Value, error) {
|
||||
args := make([]reflect.Value, 0, len(types))
|
||||
for i := 0; dec.More(); i++ {
|
||||
if i >= len(types) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue