Ejemplo n.º 1
0
 def deploy_new_instance(cls, w3: Web3) -> 'SimpleRegistry':
     manifest = get_simple_registry_manifest()
     registry_package = Package(manifest, w3)
     registry_factory = registry_package.get_contract_factory(ContractName("PackageRegistry"))
     tx_hash = registry_factory.constructor().transact()
     tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
     return cls(tx_receipt["contractAddress"], w3)
Ejemplo n.º 2
0
 def _get_all_contract_instances(
         self, deployments: Dict[str, DeploymentData]
 ) -> Iterable[Tuple[str, Contract]]:
     for deployment_name, deployment_data in deployments.items():
         if deployment_data['contractType'] not in self.contract_types:
             raise EthPMValidationError(
                 f"Contract type: {deployment_data['contractType']} for alias: "
                 f"{deployment_name} not found. Available contract types include: "
                 f"{self.contract_types}."
             )
         contract_instance = self.get_contract_instance(
             ContractName(deployment_data['contractType']),
             deployment_data['address'],
         )
         yield deployment_name, contract_instance