paritytech / paritytech/dotns

[Feat]: Read the network TLD from the registry in tests instead of a literal

Open Beginner friendly
#248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2
Dominant language
Solidity
Stars
4
Forks
2
Avg merge
1d 18h
Merged PRs (30d)
24

Description

Component

Other

Priority

P2

Summary

The test suite hardcodes the TLD as the literal .dot in roughly 36 places, for example string.concat(label, ".dot"). The TLD is per network and read live from the protocol registry, and the fixture already exposes it through protocolRegistry.tld(), derived from the single TLD_LABEL constant in BaseDotns. The literals drift from the configured TLD, so a change to TLD_LABEL would not flow through these assertions.

Proposal
  • Replace string.concat(label, ".dot") and similar literals with string.concat(label, protocolRegistry.tld()).
  • Keep TLD_LABEL as the single value the fixture initialises the registry with, so every derivation follows from one place.
Acceptance criteria
  • No test hardcodes the TLD as a literal; full names derive from protocolRegistry.tld().
  • Changing TLD_LABEL flows through every affected assertion with no other edits.

Contributor guide

Open the contributing guide

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

Search the test suite for hardcoded .dot literals such as string.concat(label, ".dot"), then inspect how protocolRegistry.tld() is exposed and initialized from TLD_LABEL in BaseDotns. Replace the affected literals so full names derive from the registry, and verify that changing TLD_LABEL updates every assertion without other edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, testing
Issue type
Refactor
Difficulty
2/5
Estimated time
Half a day
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.