@Test(expected = ResourceNotFoundException.class) public void shouldThrowException() { final ContractService contractService = new ContractService(); contractService.getLatestContractInformation(); }
public DeploymentResult getLatestContractInformation() { if (deployHistory.isEmpty()) { throw new ResourceNotFoundException("No deployment!! Deploy your contract first."); } final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1); logger.debug("Latest deployment: {}", latest); if (null == latest.getContractInterface()) { final String encodedContractTxHash = latest.getEncodedContractTransactionHash(); logger.trace("Encoded tx hash: {}", encodedContractTxHash); final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash); final ContractInterface contractInterface = getInterface(contractTxHash); latest.setContractInterface(contractInterface); } return latest; }
ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public DeploymentResult getLatestContractInformation() { if (deployHistory.isEmpty()) { throw new ResourceNotFoundException("No deployment!! Deploy your contract first."); } final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1); logger.debug("Latest deployment: {}", latest); if (null == latest.getContractInterface()) { final String encodedContractTxHash = latest.getEncodedContractTransactionHash(); logger.trace("Encoded tx hash: {}", encodedContractTxHash); final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash); final ContractInterface contractInterface = getInterface(contractTxHash); latest.setContractInterface(contractInterface); } return latest; } }
ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public DeploymentResult getLatestContractInformation() { if (deployHistory.isEmpty()) { throw new ResourceNotFoundException("No deployment!! Deploy your contract first."); } final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1); logger.debug("Latest deployment: {}", latest); if (null == latest.getContractInterface()) { final String encodedContractTxHash = latest.getEncodedContractTransactionHash(); logger.trace("Encoded tx hash: {}", encodedContractTxHash); final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash); final ContractInterface contractInterface = getInterface(contractTxHash); latest.setContractInterface(contractInterface); } return latest; }  }
ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public DeploymentResult getLatestContractInformation() { if (deployHistory.isEmpty()) { throw new ResourceNotFoundException("No deployment!! Deploy your contract first."); } final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1); logger.debug("Latest deployment: {}", latest); if (null == latest.getContractInterface()) { final String encodedContractTxHash = latest.getEncodedContractTransactionHash(); logger.trace("Encoded tx hash: {}", encodedContractTxHash); final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash); final ContractInterface contractInterface = getInterface(contractTxHash); latest.setContractInterface(contractInterface); } return latest; }  @Override Logger logger(); DeploymentResult deploy(final BuildDetails buildDetails); ExecutionResult tryExecute(final String encodedContractTxHash, final String functionName,
      final String... args); QueryResult tryQuery(final String encodedContractTxHash, final String functionName,
      final String... args); DeploymentResult getLatestContractInformation(); ContractInterface getInterface(final ContractTxHash contractTxHash); }
ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public DeploymentResult getLatestContractInformation() { if (deployHistory.isEmpty()) { throw new ResourceNotFoundException("No deployment!! Deploy your contract first."); } final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1); logger.debug("Latest deployment: {}", latest); if (null == latest.getContractInterface()) { final String encodedContractTxHash = latest.getEncodedContractTransactionHash(); logger.trace("Encoded tx hash: {}", encodedContractTxHash); final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash); final ContractInterface contractInterface = getInterface(contractTxHash); latest.setContractInterface(contractInterface); } return latest; }  @Override Logger logger(); DeploymentResult deploy(final BuildDetails buildDetails); ExecutionResult tryExecute(final String encodedContractTxHash, final String functionName,
      final String... args); QueryResult tryQuery(final String encodedContractTxHash, final String functionName,
      final String... args); DeploymentResult getLatestContractInformation(); ContractInterface getInterface(final ContractTxHash contractTxHash);  }