Joystream / Joystream/joystream

Unit tests for @joystream/types

Open
#1,851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

joystream/types
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

After updating types package for a new runtime by following steps in https://github.com/Joystream/joystream/issues/1835
it is not possible to know if the implementation was done correctly.

We lack is a set of unit tests with 100% coverage of the types that can read state from chain and look for warnings from the polkadot-api library that can detect if the custom defined types are defined correctly.

At one point there was a debug feature in the polkadot-js library that would display a warning in console when it detects a discrepancy between how a custom defined type gets encoded to raw bytes vs how it was read from chain

Maybe there is a way to write some rust utility that can construct the runtime types and compare their encoding with how the types library encodes them to find discrepancies.

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 locating the @joystream/types package and its runtime type definitions. Review how the polkadot-api or polkadot-js library reads chain state and reports type warnings, then assess whether the proposed Rust utility can compare runtime and library encodings. Done should include a defined test strategy covering the types and detecting encoding discrepancies.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
blockchain, 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.