oasisprotocol / oasisprotocol/explorer

[Bug]: No type safety around different types of addresses

Open
#711 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
13
Forks
13
Avg merge
58m
Merged PRs (30d)
2

Description

Is there an existing issue for this?
  • I have searched the existing issues
SUMMARY

Internally in the code, we are using different address formats, but everything is a string

STEPS TO REPRODUCE

In our codebase, we are working with multiple types of addresses; most importantly Oasis addresses and ETH addresses. The problem is that both are represented using the string type, and so there is no type safety about using them the wrong way, therefore we can easily supply an ETH address where on Oasis address is expected, or vica versa.

Ideally, we should represent (wrap?) the different address types using different types, so that it would be impossible to use the wrong one everywhere.

EXPECTED BEHAVIOR

No response

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

The issue names no files, tests, or entry points. Start by locating the TypeScript uses of string values for Oasis and ETH addresses, then trace where each address type enters and is passed through the application. Done means the two address kinds are represented distinctly so they cannot be supplied interchangeably throughout the affected code.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.