GRPCClient implements HLAPI { @Override public void sendTransaction(Transaction transaction) throws HLAPIException { byte[] t = transaction.toByteArray(); log.debug("Sending transaction of size {}", t.length); invoke(chaincodeName, t); } GRPCClient(String host, int port, int observerPort); @Override String getClientVersion(); @Override String getServerVersion(); @Override long ping(long nonce); @Override void addAlertListener(AlertListener listener); @Override void removeAlertListener(AlertListener listener); @Override int getChainHeight(); @Override HLAPIHeader getBlockHeader(BID hash); @Override HLAPIBlock getBlock(BID hash); @Override HLAPITransaction getTransaction(TID hash); @Override void sendTransaction(Transaction transaction); @Override void registerRejectListener(RejectListener rejectListener); @Override void removeRejectListener(RejectListener rejectListener); @Override void sendBlock(Block block); @Override void registerTransactionListener(TransactionListener listener); @Override void removeTransactionListener(TransactionListener listener); @Override void registerTrunkListener(TrunkListener listener); @Override void removeTrunkListener(TrunkListener listener); @Override void catchUp(List<BID> inventory, int limit, boolean headers, TrunkListener listener);  }
@Test public void sendTransaction() throws HLAPIException, InterruptedException { Transaction tx = TransactionTest.randomTx(); int originalHeight = client.getChainHeight(); client.sendTransaction(tx); Thread.sleep(1500); HLAPITransaction res = client.getTransaction(tx.getID()); assertEquals(tx, res); int newHeight = client.getChainHeight(); assertEquals(originalHeight + 1, newHeight); }