Skip to content

Conversation

@MichaelMure
Copy link
Member

I find that quite convenient, but not sure it has a place in the final code.

=== RUN   TestJsonRpc
=== RUN   TestJsonRpc/or_on_method,_not_matching
match ["==", ".jsonrpc.method", "eth_getCode"] --> False
match ["==", ".jsonrpc.method", "eth_getBalance"] --> False
match ["==", ".jsonrpc.method", "eth_call"] --> False
match ["==", ".jsonrpc.method", "eth_blockNumber"] --> False
match ["or", [
  ["==", ".jsonrpc.method", "eth_getCode"],
  ["==", ".jsonrpc.method", "eth_getBalance"],
  ["==", ".jsonrpc.method", "eth_call"],
  ["==", ".jsonrpc.method", "eth_blockNumber"]]]
 --> False
--- PASS: TestJsonRpc/or_on_method,_not_matching (0.00s)
=== RUN   TestJsonRpc/or_on_method,_matching
match ["==", ".jsonrpc.method", "eth_getCode"] --> False
match ["==", ".jsonrpc.method", "eth_getBalance"] --> False
match ["==", ".jsonrpc.method", "eth_call"] --> True
match ["or", [
  ["==", ".jsonrpc.method", "eth_getCode"],
  ["==", ".jsonrpc.method", "eth_getBalance"],
  ["==", ".jsonrpc.method", "eth_call"],
  ["==", ".jsonrpc.method", "eth_blockNumber"]]]
 --> True
--- PASS: TestJsonRpc/or_on_method,_matching (0.00s)
=== RUN   TestJsonRpc/complex,_optional_parameter,_matching
match ["==", ".jsonrpc.method", "debug_traceCall"] --> True
match ["==", ".jsonrpc.params[3]?", "callTracer"] --> True
match ["or", [
  ["==", ".jsonrpc.params[3]?", "callTracer"],
  ["==", ".jsonrpc.params[3]?", "prestateTracer"]]]
 --> True
--- PASS: TestJsonRpc/complex,_optional_parameter,_matching (0.00s)
=== RUN   TestJsonRpc/complex,_optional_parameter,_missing_parameter
match ["==", ".jsonrpc.method", "debug_traceCall"] --> True
match ["==", ".jsonrpc.params[3]?", "callTracer"] --> OptionalNoData
match ["or", [
  ["==", ".jsonrpc.params[3]?", "callTracer"],
  ["==", ".jsonrpc.params[3]?", "prestateTracer"]]]
 --> OptionalNoData
--- PASS: TestJsonRpc/complex,_optional_parameter,_missing_parameter (0.00s)
=== RUN   TestJsonRpc/complex,_parameter_not_matching
match ["==", ".jsonrpc.method", "debug_traceCall"] --> True
match ["==", ".jsonrpc.params[3]?", "callTracer"] --> False
match ["==", ".jsonrpc.params[3]?", "prestateTracer"] --> False
match ["or", [
  ["==", ".jsonrpc.params[3]?", "callTracer"],
  ["==", ".jsonrpc.params[3]?", "prestateTracer"]]]
 --> False
--- PASS: TestJsonRpc/complex,_parameter_not_matching (0.00s)
--- PASS: TestJsonRpc (0.00s)
PASS``` 

@MichaelMure MichaelMure force-pushed the v1 branch 2 times, most recently from 0e3869c to c577d73 Compare November 12, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants