mirror of https://github.com/nucypher/nucypher.git
Handle the case of contracts with no constructor
parent
efb62d1693
commit
eac2d3bcab
|
@ -831,7 +831,8 @@ class BlockchainDeployerInterface(BlockchainInterface):
|
|||
constructor_function,
|
||||
*constructor_args,
|
||||
**constructor_kwargs)
|
||||
self.log.info(f"Constructor calldata: {constructor_calldata}")
|
||||
if not constructor_calldata:
|
||||
self.log.info(f"Constructor calldata: {constructor_calldata}")
|
||||
|
||||
#
|
||||
# Transmit the deployment tx #
|
||||
|
|
|
@ -49,8 +49,12 @@ def encode_constructor_arguments(web3: Web3,
|
|||
"""
|
||||
Takes a web3 constructor function and the arguments passed to it, and produces an encoding hex string
|
||||
of the constructor arguments, following the standard ABI encoding conventions.
|
||||
If there's no constructor, it returns None.
|
||||
"""
|
||||
constructor_abi = get_constructor_abi(constructor_function.abi)
|
||||
arguments = merge_args_and_kwargs(constructor_abi, constructor_args, constructor_kwargs)
|
||||
data = encode_abi(web3, constructor_abi, arguments)
|
||||
if constructor_abi:
|
||||
arguments = merge_args_and_kwargs(constructor_abi, constructor_args, constructor_kwargs)
|
||||
data = encode_abi(web3, constructor_abi, arguments)
|
||||
else:
|
||||
data = None
|
||||
return data
|
||||
|
|
Loading…
Reference in New Issue