paritytech / paritytech/frame-decode

Add tests

Open
#2 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
8
Forks
2
PR merge metrics
No merged PRs in 30d

Description

This library has no tests currently. This isn't quite as bad as it seems because it's been tested fairly extensively via https://github.com/jsdw/polkadot-historic-decoding-example (so we can see that it succeeds in decoding extrinsics and storage entries across a bunch of runtimes and blocks) and via its integration PR into Subxt (https://github.com/paritytech/subxt/pull/1785), both of which are helping to turn up any issues.

That said, it would be good to add some tests! A couple of options:

  • Store more extrinsic hex's in artifacts with the corresponding metadatas, and manually ensure that they decode as expected (same with storage entries). This is fairly verbose and doesn't cover as much ground as the historic decoding example, but helps prevent us from breaking things in isolation going forwards.
  • Have some more E2E thing or integrate a simple version of the historic decode stuff to point at some RPC node and try decoding some set of blocks? Easier than the above in the sense that we don't need to save a bunch of offline data, but more brittle if RPC servers have issues and requires pulling an RPC server etc in.
  • Manually build extrinsics via sp_core etc?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the historic decoding example and the Subxt integration PR linked in the issue to understand the existing decoding coverage. Compare the proposed offline artifacts, RPC-based E2E checks, and manually built extrinsics, then establish a concrete test scope. Done means the library has a repeatable test suite covering extrinsic and storage-entry decoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.