MCPcopy Create free account
hub / github.com/CPChain/chain / ParseRequestArguments

Method ParseRequestArguments

api/rpc/json.go:275–281  ·  view source on GitHub ↗

ParseRequestArguments tries to parse the given params (json.RawMessage) with the given types. It returns the parsed values or an error when the parsing failed.

(argTypes []reflect.Type, params interface{})

Source from the content-addressed store, hash-verified

273// ParseRequestArguments tries to parse the given params (json.RawMessage) with the given
274// types. It returns the parsed values or an error when the parsing failed.
275func (c *jsonCodec) ParseRequestArguments(argTypes []reflect.Type, params interface{}) ([]reflect.Value, Error) {
276 if args, ok := params.(json.RawMessage); !ok {
277 return nil, &invalidParamsError{"Invalid params supplied"}
278 } else {
279 return parsePositionalArguments(args, argTypes)
280 }
281}
282
283// parsePositionalArguments tries to parse the given args to an array of values with the
284// given types. It returns the parsed values or an error when the args could not be

Callers 1

Calls 1

parsePositionalArgumentsFunction · 0.85

Tested by 1