Skip to content

Fix oasis network show [entity id hash] #707

Description

@martintomazic

Fix

func prettyPrintEntityNodes(ctx context.Context, npa *common.NPASelection, stakingConn staking.Backend, registryConn registry.Backend, beaconConn api.Backend, entity *entity.Entity, height int64) error {

For additional context see #706 (comment).

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:
    fmt.Println(" Node is not active")
  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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions