kopia lustrzana https://github.com/bugout-dev/moonworm
CLIs generated by "moonworm generate-brownie" now handle byte args
rodzic
7d475e8a84
commit
4f5e9650d1
|
@ -587,6 +587,13 @@ def generate_cli_generator(
|
|||
value=cst.parse_expression("boolean_argument_type"),
|
||||
),
|
||||
)
|
||||
elif param["type"] == "bytes":
|
||||
call_args.append(
|
||||
cst.Arg(
|
||||
keyword=cst.Name(value="type"),
|
||||
value=cst.parse_expression("bytes_argument_type"),
|
||||
),
|
||||
)
|
||||
|
||||
add_argument_call = cst.Call(
|
||||
func=cst.Attribute(
|
||||
|
|
|
@ -28,6 +28,9 @@ def boolean_argument_type(raw_value: str) -> bool:
|
|||
f"Invalid boolean argument: {{raw_value}}. Value must be one of: {{','.join(TRUE_VALUES + FALSE_VALUES)}}"
|
||||
)
|
||||
|
||||
def bytes_argument_type(raw_value: str) -> bytes:
|
||||
return raw_value.encode()
|
||||
|
||||
def get_abi_json(abi_name: str) -> List[Dict[str, Any]]:
|
||||
abi_full_path = os.path.join(BUILD_DIRECTORY, f"{{abi_name}}.json")
|
||||
if not os.path.isfile(abi_full_path):
|
||||
|
|
|
@ -1 +1 @@
|
|||
MOONWORM_VERSION = "0.1.5"
|
||||
MOONWORM_VERSION = "0.1.6"
|
||||
|
|
Ładowanie…
Reference in New Issue