From 465d871a12e484463376578180ab2d91252e6abc Mon Sep 17 00:00:00 2001 From: rickr Date: Wed, 24 May 2017 11:02:31 -0400 Subject: [PATCH] FAB-4088 Determine which proposals are consistent Decided this should be checked all the time by default. Allow users to turn off and then check explicitly if they so desire. Change-Id: Ied8c02db63fe6af0033e25f061031e5a75b553b2 Signed-off-by: rickr --- .../org/hyperledger/fabric/sdk/Channel.java | 22 ++++++++++++------- .../fabric/sdk/ProposalResponse.java | 10 +++++---- .../hyperledger/fabric/sdk/helper/Config.java | 14 ++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/hyperledger/fabric/sdk/Channel.java b/src/main/java/org/hyperledger/fabric/sdk/Channel.java index cc35c37c..5887ed05 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/Channel.java +++ b/src/main/java/org/hyperledger/fabric/sdk/Channel.java @@ -995,16 +995,16 @@ private Block getConfigurationBlock() throws TransactionException { Payload payload = Payload.parseFrom(envelopeRet.getPayload()); ChannelHeader channelHeader = ChannelHeader.parseFrom(payload.getHeader().getChannelHeader()); if (channelHeader.getType() != HeaderType.CONFIG.getNumber()) { - throw new TransactionException(format("Bad last configuation block type %d, expected %d", + throw new TransactionException(format("Bad last configuration block type %d, expected %d", channelHeader.getType(), HeaderType.CONFIG.getNumber())); } if (!name.equals(channelHeader.getChannelId())) { - throw new TransactionException(format("Bad last configuation block channel id %s, expected %s", + throw new TransactionException(format("Bad last configuration block channel id %s, expected %s", channelHeader.getChannelId(), name)); } - logger.trace(format("Channel %s getConfigurationBlock retraceturned %s", name, "" + configBlock)); + logger.trace(format("Channel %s getConfigurationBlock returned %s", name, "" + configBlock)); if (!logger.isTraceEnabled()) { logger.debug(format("Channel %s getConfigurationBlock returned", name)); } @@ -1246,9 +1246,9 @@ public Collection sendInstantiationProposal(InstantiateProposa * * @param instantiateProposalRequest * @param peers + * @return * @throws IllegalArgumentException * @throws ProposalException - * @return */ public Collection sendInstantiationProposal(InstantiateProposalRequest instantiateProposalRequest, Collection peers) throws InvalidArgumentException, ProposalException { @@ -1502,7 +1502,7 @@ public BlockInfo queryBlockByHash(Peer peer, byte[] blockHash) throws InvalidArg } responseBlock = new BlockInfo(Block.parseFrom(proposalResponse.getProposalResponse().getResponse().getPayload())); } catch (Exception e) { - String emsg = format("queryBlockByHash hash: %s %npeer %s channel %s %nerror: %s", + String emsg = format("queryBlockByHash hash: %s peer %s channel %s error: %s", Hex.encodeHexString(blockHash), peer.getName(), name, e.getMessage()); logger.error(emsg, e); throw new ProposalException(emsg, e); @@ -2057,7 +2057,6 @@ public Collection queryByChaincode(QueryByChaincodeRequest que * @return * @throws InvalidArgumentException * @throws ProposalException - * */ public Collection queryByChaincode(QueryByChaincodeRequest queryByChaincodeRequest, Collection peers) throws InvalidArgumentException, ProposalException { @@ -2229,6 +2228,15 @@ public CompletableFuture sendTransaction(Collection ed = new LinkedList<>(); FabricProposal.Proposal proposal = null; ByteString proposalResponsePayload = null; @@ -2275,8 +2283,6 @@ public CompletableFuture sendTransaction(Collection