BlockEvent extends BlockInfo { BlockEvent(EventHub eventHub, Event event) throws InvalidProtocolBufferException { super(event.getBlock()); this.eventHub = eventHub; this.peer = null; this.event = event; } BlockEvent(EventHub eventHub, Event event);   BlockEvent(Peer peer, PeerEvents.DeliverResponse resp); EventHub getEventHub(); Peer getPeer(); Iterable<TransactionEvent> getTransactionEvents();  }
@Test public void testBlockEvent() { try { BlockEvent be = new BlockEvent(eventHub, goodEventBlock); assertEquals(be.getChannelId(), "TESTCHANNEL"); assertArrayEquals(be.getBlock().toByteArray(), block.toByteArray()); List<BlockEvent.TransactionEvent> txList = be.getTransactionEventsList(); assertEquals(txList.size(), 3); BlockEvent.TransactionEvent te = txList.get(1); assertFalse(te.isValid()); assertEquals(te.getValidationCode(), (byte) TxValidationCode.INVALID_OTHER_REASON_VALUE); te = txList.get(2); assertTrue(te.isValid()); } catch (InvalidProtocolBufferException e) { fail("did not parse Block correctly.Error: " + e.getMessage()); } }