2021-12-04 16:42:11 +00:00

15 lines
318 B
Go

package jsonrpc
import "github.com/intel-go/fastjson"
// Unmarshal decodes JSON-RPC params.
func Unmarshal(params *fastjson.RawMessage, dst interface{}) *Error {
if params == nil {
return ErrInvalidParams()
}
if err := fastjson.Unmarshal(*params, dst); err != nil {
return ErrInvalidParams()
}
return nil
}