Skip to content

Commit 747f3db

Browse files
committed
fix: remove unnecessary added add_function() method from ContractFunctionParameters
Signed-off-by: dosi <dosi.kolev@limechain.tech>
1 parent 837ffe9 commit 747f3db

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

src/hiero_sdk_python/contract/contract_function_parameters.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -172,43 +172,6 @@ def add_bytes32_array(self, value: List[bytes]) -> "ContractFunctionParameters":
172172
"""
173173
return self._add_param("bytes32[]", value)
174174

175-
def add_function(
176-
self, address: str, function_signature: str
177-
) -> "ContractFunctionParameters":
178-
"""
179-
Add a function parameter.
180-
181-
Args:
182-
address: The contract address as a hex string (with or without 0x prefix)
183-
function_signature: The function signature (e.g., "transfer(address,uint256)")
184-
185-
Returns:
186-
This instance for method chaining
187-
188-
Raises:
189-
ValueError: If address is not valid or function_signature is invalid
190-
"""
191-
# Process address
192-
if address.startswith("0x"):
193-
address = address[2:]
194-
195-
# Validate and convert address
196-
if len(address) != 40:
197-
raise ValueError("address is required to be 40 characters")
198-
199-
try:
200-
address_bytes = bytes.fromhex(address)
201-
except Exception as e:
202-
raise e
203-
204-
# Generate function selector (4 bytes) from signature using eth_utils
205-
selector_bytes = function_signature_to_4byte_selector(function_signature)
206-
207-
# In Ethereum ABI, a function type is encoded as (address, bytes4)
208-
# So we pass a tuple with address bytes and selector bytes to match the ABI encoding
209-
# eth-abi will handle the proper encoding internally
210-
return self._add_param("(address,bytes4)", (address_bytes, selector_bytes))
211-
212175
def _get_function_selector(self) -> bytes:
213176
"""
214177
Get the function selector (first 4 bytes of the keccak256 hash of the function signature).

0 commit comments

Comments
 (0)