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
@dandanlen dandanlen force-pushed the feat/dynamic-events-rpc branch from ced0a52 to 1de7392 Compare June 10, 2024 12:39
@dandanlen dandanlen force-pushed the feat/scale-json-decoder branch from d9e8d36 to 0977d32 Compare June 28, 2024 10:51
@dandanlen dandanlen force-pushed the feat/scale-json-decoder branch from 0977d32 to ecfcac1 Compare July 9, 2024 16:20
@dandanlen dandanlen force-pushed the feat/dynamic-events-rpc branch from 9ad2124 to a96b395 Compare July 9, 2024 16:27
Base automatically changed from feat/scale-json-decoder to main July 9, 2024 17:30
@dandanlen dandanlen force-pushed the feat/dynamic-events-rpc branch from a96b395 to 602e798 Compare July 10, 2024 07:55
@dandanlen dandanlen force-pushed the feat/dynamic-events-rpc branch from 602e798 to a19d5fe Compare September 19, 2024 14:57
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.

@dandanlen dandanlen force-pushed the feat/dynamic-events-rpc branch from a19d5fe to 4334afb Compare October 17, 2024 08:14
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