kopia lustrzana https://github.com/bugout-dev/moonworm
fix no constructor
rodzic
d8322c2a39
commit
808acda954
|
|
@ -96,10 +96,10 @@ def generate_contract_class(
|
|||
]
|
||||
),
|
||||
)
|
||||
contract_constructor = [c for c in abi if c["type"] == "constructor"]
|
||||
if len(contract_constructor) == 1:
|
||||
contract_constructor = contract_constructor[0]
|
||||
elif len(contract_constructor) == 0:
|
||||
contract_constructors = [c for c in abi if c["type"] == "constructor"]
|
||||
if len(contract_constructors) == 1:
|
||||
contract_constructor = contract_constructors[0]
|
||||
elif len(contract_constructors) == 0:
|
||||
contract_constructor = {"inputs": []}
|
||||
else:
|
||||
raise ValueError("Multiple constructors found in ABI")
|
||||
|
|
@ -268,10 +268,10 @@ def generate_argument_parser_function(abi: List[Dict[str, Any]]) -> cst.Function
|
|||
subparsers.extend(generate_function_subparser(function_abi, "description"))
|
||||
|
||||
# Deploy argparser:
|
||||
contract_constructor = [item for item in abi if item["type"] == "constructor"]
|
||||
if len(contract_constructor) == 1:
|
||||
contract_constructor = contract_constructor[0]
|
||||
elif len(contract_constructor) == 0:
|
||||
contract_constructors = [item for item in abi if item["type"] == "constructor"]
|
||||
if len(contract_constructors) == 1:
|
||||
contract_constructor = contract_constructors[0]
|
||||
elif len(contract_constructors) == 0:
|
||||
contract_constructor = {"inputs": []}
|
||||
else:
|
||||
raise Exception("Multiple constructors found")
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue