Update contract_proxy.py

This commit is contained in:
Ragnar 2025-02-27 03:35:08 +01:00 committed by GitHub
parent 898350e271
commit affb34b50b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
from gettext import npgettext from gettext import ngettext
from config.node_config import TX_PARAMS from config.node_config import TX_PARAMS
from utility.utils import assert_equal from utility.utils import assert_equal
from copy import copy from copy import copy
@ -57,19 +57,19 @@ class ContractProxy:
class FlowContractProxy(ContractProxy): class FlowContractProxy(ContractProxy):
def submit( def submit(
self, submission_nodes, node_idx=0, tx_prarams=None, parent_hash=None, self, submission_nodes, node_idx=0, tx_params=None, parent_hash=None,
): ):
assert node_idx < len(self.blockchain_nodes) assert node_idx < len(self.blockchain_nodes)
combined_tx_prarams = copy(TX_PARAMS) combined_tx_params = copy(TX_PARAMS)
if tx_prarams is not None: if tx_params is not None:
combined_tx_prarams.update(tx_prarams) combined_tx_params.update(tx_params)
contract = self._get_contract(node_idx) contract = self._get_contract(node_idx)
# print(contract.functions.submit(submission_nodes).estimate_gas(combined_tx_prarams)) # print(contract.functions.submit(submission_nodes).estimate_gas(combined_tx_params))
tx_hash = contract.functions.submit(submission_nodes).transact(combined_tx_prarams) tx_hash = contract.functions.submit(submission_nodes).transact(combined_tx_params)
receipt = self.blockchain_nodes[node_idx].wait_for_transaction_receipt( receipt = self.blockchain_nodes[node_idx].wait_for_transaction_receipt(
contract.w3, tx_hash, parent_hash=parent_hash contract.w3, tx_hash, parent_hash=parent_hash
) )