@Test(expected = BlockchainValidationException.class) public void testAddFinishVoteOperationWithNotSameEditOp() throws FailedVerificationException { testVotingProcessForVoteOperation(); OpOperation finalOp = generateFinalOpWithRef(); finalOp.getEdited().clear(); finalOp.addEdited(getNotValidEditObj()); blocksManager.addOperation(finalOp); }
public synchronized boolean addOperation(OpOperation op) { if (blockchain == null) { return false; } Metric m = mBlockAddOpp.start(); op.makeImmutable(); boolean existing = dataManager.validateExistingOperation(op); if (!existing) { dataManager.insertOperation(op); } boolean added = false; try { added = blockchain.addOperation(op); } finally { if (!added && !existing) { dataManager.removeOperations(Collections.singleton(op.getHash())); } m.capture(); } return added; }
BlocksManager { public synchronized boolean addOperation(OpOperation op) { if (blockchain == null) { return false; } Metric m = mBlockAddOpp.start(); op.makeImmutable(); boolean existing = dataManager.validateExistingOperation(op); if (!existing) { dataManager.insertOperation(op); } boolean added = false; try { added = blockchain.addOperation(op); } finally { if (!added && !existing) { dataManager.removeOperations(Collections.singleton(op.getHash())); } m.capture(); } return added; } }
BlocksManager { public synchronized boolean addOperation(OpOperation op) { if (blockchain == null) { return false; } Metric m = mBlockAddOpp.start(); op.makeImmutable(); boolean existing = dataManager.validateExistingOperation(op); if (!existing) { dataManager.insertOperation(op); } boolean added = false; try { added = blockchain.addOperation(op); } finally { if (!added && !existing) { dataManager.removeOperations(Collections.singleton(op.getHash())); } m.capture(); } return added; }  }
BlocksManager { public synchronized boolean addOperation(OpOperation op) { if (blockchain == null) { return false; } Metric m = mBlockAddOpp.start(); op.makeImmutable(); boolean existing = dataManager.validateExistingOperation(op); if (!existing) { dataManager.insertOperation(op); } boolean added = false; try { added = blockchain.addOperation(op); } finally { if (!added && !existing) { dataManager.removeOperations(Collections.singleton(op.getHash())); } m.capture(); } return added; }  String getServerPrivateKey(); String getServerUser(); KeyPair getServerLoginKeyPair(); boolean isBlockCreationOn(); boolean isReplicateOn(); String getReplicateUrl(); synchronized void setReplicateOn(boolean on); synchronized void setBlockCreationOn(boolean on); synchronized void init(MetadataDb metadataDB, OpBlockChain initBlockchain); synchronized boolean unlockBlockchain(); synchronized boolean lockBlockchain(String msg); synchronized boolean validateOperation(OpOperation op); synchronized boolean removeOrphanedBlock(String blockHash); synchronized boolean addOperation(OpOperation op); synchronized OpBlock createBlock(); synchronized OpBlock createBlock(double minCapacity); synchronized boolean compact(); synchronized boolean clearQueue(); synchronized boolean replicate(); synchronized boolean replicateOneBlock(OpBlock block); synchronized Set<String> removeQueueOperations(Set<String> operationsToDelete); synchronized void bootstrap(String serverName, KeyPair serverLoginKeyPair); synchronized boolean revertOneBlock(); synchronized boolean revertSuperblock(); OpBlockChain getBlockchain(); Map<String, OpBlock> getOrphanedBlocks(); String getCurrentStateDescription(); String getCurrentState(); boolean isBlockchainPaused(); OpOperation generateHashAndSign(OpOperation op, KeyPair... keyPair); KeyPair getLoginKeyPairFromPwd(String name, String pwd); KeyPair getLoginKeyPair(String name, String privateKey); OpObject getLoginObj(String nickname); List<String> getBootstrapList(); Collection<OpIndexColumn> getIndicesForType(String type); OpIndexColumn getIndex(String type, String indexId); void setBootstrapList(List<String> bootstrapList); double getQueueCapacity(); Map<String, Map<String, OpIndexColumn>> getIndices(); }
BlocksManager { public synchronized boolean addOperation(OpOperation op) { if (blockchain == null) { return false; } Metric m = mBlockAddOpp.start(); op.makeImmutable(); boolean existing = dataManager.validateExistingOperation(op); if (!existing) { dataManager.insertOperation(op); } boolean added = false; try { added = blockchain.addOperation(op); } finally { if (!added && !existing) { dataManager.removeOperations(Collections.singleton(op.getHash())); } m.capture(); } return added; }  String getServerPrivateKey(); String getServerUser(); KeyPair getServerLoginKeyPair(); boolean isBlockCreationOn(); boolean isReplicateOn(); String getReplicateUrl(); synchronized void setReplicateOn(boolean on); synchronized void setBlockCreationOn(boolean on); synchronized void init(MetadataDb metadataDB, OpBlockChain initBlockchain); synchronized boolean unlockBlockchain(); synchronized boolean lockBlockchain(String msg); synchronized boolean validateOperation(OpOperation op); synchronized boolean removeOrphanedBlock(String blockHash); synchronized boolean addOperation(OpOperation op); synchronized OpBlock createBlock(); synchronized OpBlock createBlock(double minCapacity); synchronized boolean compact(); synchronized boolean clearQueue(); synchronized boolean replicate(); synchronized boolean replicateOneBlock(OpBlock block); synchronized Set<String> removeQueueOperations(Set<String> operationsToDelete); synchronized void bootstrap(String serverName, KeyPair serverLoginKeyPair); synchronized boolean revertOneBlock(); synchronized boolean revertSuperblock(); OpBlockChain getBlockchain(); Map<String, OpBlock> getOrphanedBlocks(); String getCurrentStateDescription(); String getCurrentState(); boolean isBlockchainPaused(); OpOperation generateHashAndSign(OpOperation op, KeyPair... keyPair); KeyPair getLoginKeyPairFromPwd(String name, String pwd); KeyPair getLoginKeyPair(String name, String privateKey); OpObject getLoginObj(String nickname); List<String> getBootstrapList(); Collection<OpIndexColumn> getIndicesForType(String type); OpIndexColumn getIndex(String type, String indexId); void setBootstrapList(List<String> bootstrapList); double getQueueCapacity(); Map<String, Map<String, OpIndexColumn>> getIndices(); static final String BOOT_STD_OPS_DEFINTIONS; static final String BOOT_STD_ROLES; static final String BOOT_STD_VALIDATION; @Value("${opendb.mgmt.publicKey}")
	private String serverPublicKey; }