Skip to content

Setting "max-fee" in a profile doesn't work #2074

@barretodavid

Description

@barretodavid

I was able to predefine a lot of flags for the Protostar CLI using profiles in protostar.toml like this:

[profile.testnet.project]
account-address = "0x011088d3cbe4289bc6750ee3a9cf35e52f4fa4e0ac9f42fb0b62e983139e135a"
private-key-path = ".pkey"
network = "testnet"

And then running the command with the profile works

protostar -p testnet invoke \
  --contract-address 0x03c308e8ed89a258d1c5398d81d11fcc2b008b7dc4f7e74fe07d9768d95bb9ef \
  --function "increase_balance" \
  --inputs 10 \
  --max-fee auto

However, if I try to move the max-fee flag to the profile the command fails with the error could not convert string to float: 'auto'

Protostar version

Name Version
Protostar 0.13.0
Cairo-lang 0.11.1.1
Git 2.39.2

Current Behavior

If I move all the flags, including max-fee to the profile like this

[profile.testnet.project]
account-address = "0x011088d3cbe4289bc6750ee3a9cf35e52f4fa4e0ac9f42fb0b62e983139e135a"
private-key-path = ".pkey"
network = "testnet"
max-fee = "auto"

And then try to execute this command

protostar -p testnet invoke \
  --contract-address 0x03c308e8ed89a258d1c5398d81d11fcc2b008b7dc4f7e74fe07d9768d95bb9ef \
  --function "increase_balance" \ 
  --inputs 10

I get the following error in the terminal:

Traceback (most recent call last):                                                                                           
  File "binary_entrypoint.py", line 85, in <module>
  File "binary_entrypoint.py", line 24, in init
  File "protostar/start.py", line 19, in main
  File "protostar/composition_root.py", line 273, in build_di_container
  File "protostar/argument_parser/argument_parser_facade.py", line 74, in __init__
  File "protostar/argument_parser/argument_parser_facade.py", line 156, in _setup_parser
  File "protostar/argument_parser/argument_parser_facade.py", line 173, in _add_command
  File "protostar/argument_parser/argument_parser_facade.py", line 212, in _set_value_from_external_source
  File "protostar/argument_parser/argument_parser_facade.py", line 212, in <listcomp>
  File "protostar/cli/protostar_arg_type.py", line 56, in parse_wei_arg_type
ValueError: could not convert string to float: 'auto'
[21975] Failed to execute script 'binary_entrypoint' due to unhandled exception!

Expected Behavior

The command should be able to execute using all the flags defined in the profile including max-fee

Steps to Reproduce

  1. Create a project with protostar init
  2. Create a profile for testnet that sets max-fee = "auto"
  3. Try to use the CLI for invoke, declare or deploy that expects --max-fee

Possible Solution

I don't know

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