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

feat: cf_events_dynamic rpc #4905

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

Conversation

dandanlen
Copy link
Collaborator

Pull Request

Next step in PRO-1246

This adds a cf_dynamic_events rpc to the node.

The rpc call returns json-encoded events (see #4889).

To test it out, run a localnet and use curl:

curl 'http://localhost:9944/' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  --data-raw '{"jsonrpc":"2.0","method":"cf_dynamic_events","params":[],"id":1}' | jq

Gives (for example):

{
  "jsonrpc": "2.0",
  "result": [
    {
      "event": {
        "System": {
          "ExtrinsicSuccess": {
            "dispatch_info": {
              "class": "Mandatory",
              "pays_fee": "Yes",
              "weight": {
                "proof_size": "0x0",
                "ref_time": "0xc015570"
              }
            }
          }
        }
      },
      "phase": {
        "ApplyExtrinsic": 0
      },
      "topics": []
    },
    {
      "event": {
        "PolkadotChainTracking": {
          "ChainStateUpdated": {
            "new_chain_state": {
              "block_height": 83,
              "tracked_data": {
                "median_tip": "0x0",
                "runtime_version": {
                  "spec_version": 10000,
                  "transaction_version": 25
                }
              }
            }
          }
        }
      },
      "phase": {
        "ApplyExtrinsic": 1
      },
      "topics": []
    },
    {
      "event": {
        "Witnesser": {
          "CallDispatched": {
            "call_hash": "0xaec0e769dc26b0e062f88f1cbe6a30e13452375ac740565cdeb9b2cde9e65e88"
          }
        }
      },
      "phase": {
        "ApplyExtrinsic": 1
      },
      "topics": []
    },
    // ...
  ]
}

@dandanlen dandanlen mentioned this pull request May 30, 2024
2 tasks
Base automatically changed from feat/scale-json-decoder to main July 9, 2024 17:30
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 74 lines in your changes missing coverage. Please review.

Project coverage is 71%. Comparing base (73b2773) to head (4334afb).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
state-chain/custom-rpc/src/dynamic_events.rs 0% 55 Missing ⚠️
state-chain/node/src/service.rs 0% 12 Missing ⚠️
state-chain/custom-rpc/src/lib.rs 0% 6 Missing ⚠️
utilities/src/with_std/dynamic_events.rs 0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #4905    +/-   ##
======================================
- Coverage     71%     71%    -0%     
======================================
  Files        490     491     +1     
  Lines      85156   85136    -20     
  Branches   85156   85136    -20     
======================================
- Hits       60608   60467   -141     
- Misses     21843   21955   +112     
- Partials    2705    2714     +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant