oasisprotocol / oasisprotocol/cli

Fix oasis network show [entity id hash]

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

Nobody has claimed this yet.

Dominant language
Go
Stars
80
Forks
23
Avg merge
9h 43m
Merged PRs (30d)
3

Description

Fix https://github.com/oasisprotocol/cli/blob/7e8b7e032cecb47a2f3f00b0b23cae0b92a40dd3/cmd/network/show.go#L46

For additional context see https://github.com/oasisprotocol/cli/pull/706#discussion_r3544676120.

Problems

  1. Status / pretty print should never return eagerly as they are used for debugging.
  2. Misleading output as error can also happen because of other reasons: https://github.com/oasisprotocol/cli/blob/7e8b7e032cecb47a2f3f00b0b23cae0b92a40dd3/cmd/network/show.go#L98
  3. registry.Backend.GetNode return registry.NoSuchError as soon as the node descriptor has expired, however descriptor actually stays, just like registry.Backend.GetNodeStatus still returns until debonding period expires.

Solution

Probably best to use switch for both statuses and print them independently (currently we mix them).

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 in cmd/network/show.go at the referenced status and pretty-print handling, then read the registry.Backend.GetNode and GetNodeStatus behavior. Exercise the network show entry point with an expired node descriptor and other lookup errors; done means both statuses are reported independently without misleading early returns or error output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
blockchain, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.