Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make defaults contextful #269

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

debjit-bw
Copy link

@debjit-bw debjit-bw commented Feb 6, 2025

What I did
Make "amount" contextful. Chains like Gnosis have different default values and different scaling constants for amounts. Added a field called prompt_marker to the callback so that it is aware of what command it is for. Modified the get_default function so it fetches the default from chain settings. Added ctx.params as an input to the validate_deposit_amount function as a keyword argument a scaling factor. The default amounts and scaling parameters are defined in the chain settings. These default values also added to helper text through a new get_amount_prompt_from_template function.

These changes allow the deposit cli to process chain-specific deviations from the standard defaults in a generalized way.

Related issue
Makes command defaults/values contextful. Not related to an existing issue.

@debjit-bw debjit-bw marked this pull request as ready for review February 6, 2025 14:05
@debjit-bw debjit-bw changed the title Deb/feat/make defaults contextful make defaults contextful Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants