Skip to content

Commit

Permalink
FAB-7994 Fix getConfig block
Browse files Browse the repository at this point in the history
Change-Id: I1ae047cafe8213555276cefaf03eee8725170712
Signed-off-by: rickr <cr22rc@gmail.com>
  • Loading branch information
cr22rc committed Feb 9, 2018
1 parent 77cfdc7 commit 5c57df4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/hyperledger/fabric/sdk/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public class Channel implements Serializable {
private transient String blh = null;

{
for (Peer.PeerRole peerRole : PeerRole.ALL) {
for (Peer.PeerRole peerRole : EnumSet.allOf(PeerRole.class)) {

peerRoleSetMap.put(peerRole, Collections.synchronizedSet(new HashSet<>()));

Expand Down Expand Up @@ -725,9 +725,8 @@ private Block getConfigBlock(Peer peer) throws ProposalException {

try {

final Channel systemChannel = newSystemChannel(client); //needs to be invoked on system channel

TransactionContext transactionContext = systemChannel.getTransactionContext();
TransactionContext transactionContext = getTransactionContext();
transactionContext.verify(false); // can't verify till we get the config block.

FabricProposal.Proposal proposal = GetConfigBlockBuilder.newBuilder()
.context(transactionContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ public FabricProposal.Proposal build() throws ProposalException {
ccType(GOLANG);
chaincodeID(CHAINCODE_ID_CSCC);

if (!"".equals(context.getChannel().getName())) { //if not "" this is not the system channel
//TODO use isSystem when public classes are interfaces.
throw new ProposalException("cscc chaincode not called on system channel.");

}

return super.build();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ private void testPeerServiceEventingReplay(HFClient client, Channel replayTestCh
return; // not supported for v1.0
}

assertFalse(replayTestChannel.isInitialized()); //not yet intialized
assertFalse(replayTestChannel.isInitialized()); //not yet initialized
assertFalse(replayTestChannel.isShutdown()); // not yet shutdown.

//Remove all peers just have one ledger peer and one eventing peer.
Expand Down

0 comments on commit 5c57df4

Please sign in to comment.