paritytech / paritytech/subxt

Provide implementations of `Permill`, `Perbill` etc in Subxt?

Open
#1,170 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs thought
Dominant language
Rust
Stars
489
Forks
293
Avg merge
18h 35m
Merged PRs (30d)
3

Description

We fixed decoding into the generated Permill etc types a short while ago, but the types also have a bunch of custom logic and such. Currently, to work with them properly, one would have to pull in sp_arithmetic and convert the decoded parts into the proper types manually.

Perhaps we could either:

  • Pull in sp-arithmetic and just substitute for the "proper" types. (sp-arithmetic doesn't look like it depends on much, so I think this would be fairly doable), or
  • Make some concise implementations of the types ourselves in Subxt if pulling in the above is a pain for some reason. (I think we'd rather not do this)
  • Leave things as they are and people will have to manually convert the types to use them.

Types are defined here: https://github.com/paritytech/polkadot-sdk/blob/master/substrate/primitives/arithmetic/src/per_things.rs#L1864

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 reading the referenced per_things.rs definitions and comparing them with Subxt's generated Permill and Perbill decoding. Determine whether the intended outcome is adopting sp-arithmetic or maintaining concise Subxt implementations; done means the chosen types expose the needed custom logic without manual conversion.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
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.