Ejemplo n.º 1
0
 def __set_assigned_request_count(self, num, gas_price=0):
     return safe_transact(
         self.__config.audit_contract.functions.setAssignedRequestCount(
             self.__config.account,
             num),
         {"from": self.__config.account, "gasPrice": gas_price}
     )
Ejemplo n.º 2
0
 def __set_any_request_available(self, number):
     tx_hash = safe_transact(
         self.__config.audit_contract.functions.setAnyRequestAvailableResult(number),
         {"from": self.__config.account}
     )
     self.__config.web3_client.eth.waitForTransactionReceipt(tx_hash)
     return tx_hash
Ejemplo n.º 3
0
 def __send_done_message(self, request_id):
     return safe_transact(
         self.__config.audit_contract.functions.emitLogAuditFinished(
             request_id,
             self.__config.account,
             0,
             ""),
         {"from": self.__config.account}
     )
Ejemplo n.º 4
0
 def __request_assign_and_emit(self, request_id, contract_uri, price,
                               request_block_number):
     """
     Emulates assigning a request for a given target contract by submitting the appropriate
     event.
     """
     requestor = self.__config.account
     auditor = self.__config.account
     return safe_transact(
         self.__config.audit_contract.functions.assignAuditAndEmit(
             request_id, requestor, auditor, contract_uri, price,
             request_block_number), {"from": requestor})