Skip to content

state CLI panics when given the wrong address kind #5279

Description

@FlashWayne

Version: main (3b16e0d)

parseAddressFromString in nodebuilder/state/cmd/state.go returns either an account or a validator address, but the state subcommands then take the kind they need with an unchecked type assertion (addr.Address.(state.ValAddress) / .(state.AccAddress)). Passing the other kind panics the CLI:

celestia state withdraw-delegator-reward celestia1...
panic: interface conversion: types.Address is types.AccAddress, not types.ValAddress

Same for transfer with a celestiavaloper1... address and the other commands that use these assertions (delegate, undelegate, begin-redelegate, cancel-unbonding-delegation, get-delegation, get-unbonding, get-redelegations, grant-fee, revoke-grant-fee, ...).

Expected: a normal error saying which address kind is expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions