CLIs generated by "moonworm generate-brownie" now handle byte args

pull/32/head
Neeraj Kashyap 2021-12-11 16:50:06 -08:00
rodzic 7d475e8a84
commit 4f5e9650d1
3 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -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(

Wyświetl plik

@ -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):

Wyświetl plik

@ -1 +1 @@
MOONWORM_VERSION = "0.1.5"
MOONWORM_VERSION = "0.1.6"