Skip to content

Validate config keys against known set in config set #6

Description

@smypmsa

Problem

pumpfun config set rpcc https://... (typo) is silently stored. There is no validation against known config keys, so typos go unnoticed and the intended config never gets set.

Fix

Add validation in src/pumpfun_cli/commands/config.py config_set() against known keys:

KNOWN_KEYS = {"rpc", "keyfile", "priority_fee", "compute_units"}

if key not in KNOWN_KEYS:
    error(
        f"Unknown config key: {key}",
        hint=f"Valid keys: {', '.join(sorted(KNOWN_KEYS))}",
    )

Files to change

  • src/pumpfun_cli/commands/config.py — add key validation
  • tests/test_commands/test_config_cmd.py — add test for unknown key

How to test

uv run pytest tests/test_commands/test_config_cmd.py -v

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