@Test public void freeRegistrationsAllowedFromCoreVersion() throws Exception { List<Main> mm = new ArrayList<>(); for (int i = 0; i < 4; i++) mm.add(createMain("node" + (i + 1), false)); Main main = mm.get(0); Client client = new Client(TestKeys.privateKey(20), main.myInfo, null); Contract contract = new Contract(TestKeys.privateKey(0)); contract.seal(); ItemState expectedState = ItemState.UNDEFINED; if (Core.VERSION.contains("private")) expectedState = ItemState.APPROVED; System.out.println("Core.VERSION: " + Core.VERSION); System.out.println("expectedState: " + expectedState); ItemResult itemResult = client.register(contract.getPackedTransaction(), 5000); System.out.println("itemResult: " + itemResult); assertEquals(expectedState, itemResult.state); mm.forEach(x -> x.shutdown()); }
public void shutdown() { try { if (hookThread != null) Runtime.getRuntime().removeShutdownHook(hookThread); ledger.close(); log("shutting down"); network.shutdown(); clientHTTPServer.shutdown(); } catch (Exception e) { } synchronized (parser) { parser.notifyAll(); } try { logger.close(); } catch (Exception e) { e.printStackTrace(); } }
Main { public void shutdown() { try { if (hookThread != null) Runtime.getRuntime().removeShutdownHook(hookThread); ledger.close(); log("shutting down"); network.shutdown(); clientHTTPServer.shutdown(); } catch (Exception e) { } synchronized (parser) { parser.notifyAll(); } try { logger.close(); } catch (Exception e) { e.printStackTrace(); } } }
Main { public void shutdown() { try { if (hookThread != null) Runtime.getRuntime().removeShutdownHook(hookThread); ledger.close(); log("shutting down"); network.shutdown(); clientHTTPServer.shutdown(); } catch (Exception e) { } synchronized (parser) { parser.notifyAll(); } try { logger.close(); } catch (Exception e) { e.printStackTrace(); } } Main(String[] args); }
Main { public void shutdown() { try { if (hookThread != null) Runtime.getRuntime().removeShutdownHook(hookThread); ledger.close(); log("shutting down"); network.shutdown(); clientHTTPServer.shutdown(); } catch (Exception e) { } synchronized (parser) { parser.notifyAll(); } try { logger.close(); } catch (Exception e) { e.printStackTrace(); } } Main(String[] args); static void main(String[] args); void waitReady(); void shutdown(); void setVerboseLevel(int level); void setUDPVerboseLevel(int level); void restartUDPAdapter(); PublicKey getNodePublicKey(); }
Main { public void shutdown() { try { if (hookThread != null) Runtime.getRuntime().removeShutdownHook(hookThread); ledger.close(); log("shutting down"); network.shutdown(); clientHTTPServer.shutdown(); } catch (Exception e) { } synchronized (parser) { parser.notifyAll(); } try { logger.close(); } catch (Exception e) { e.printStackTrace(); } } Main(String[] args); static void main(String[] args); void waitReady(); void shutdown(); void setVerboseLevel(int level); void setUDPVerboseLevel(int level); void restartUDPAdapter(); PublicKey getNodePublicKey(); static final String NODE_VERSION; final Reporter reporter; final BufferedLogger logger; public NetConfig netConfig; public NetworkV2 network; final Config config; public NodeInfo myInfo; public Node node; public ItemCache cache; public ParcelCache parcelCache; public PaidOperationCache paidOperationCache; }