Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy: add a global boolean to enable tracing on policy matching #54

Draft
wants to merge 1 commit into
base: v1
Choose a base branch
from

Conversation

MichaelMure
Copy link
Collaborator

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``` 

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.

2 participants