Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 5c57df4

Browse files
committed
FAB-7994 Fix getConfig block
Change-Id: I1ae047cafe8213555276cefaf03eee8725170712 Signed-off-by: rickr <cr22rc@gmail.com>
1 parent 77cfdc7 commit 5c57df4

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/main/java/org/hyperledger/fabric/sdk/Channel.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public class Channel implements Serializable {
174174
private transient String blh = null;
175175

176176
{
177-
for (Peer.PeerRole peerRole : PeerRole.ALL) {
177+
for (Peer.PeerRole peerRole : EnumSet.allOf(PeerRole.class)) {
178178

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

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

726726
try {
727727

728-
final Channel systemChannel = newSystemChannel(client); //needs to be invoked on system channel
729-
730-
TransactionContext transactionContext = systemChannel.getTransactionContext();
728+
TransactionContext transactionContext = getTransactionContext();
729+
transactionContext.verify(false); // can't verify till we get the config block.
731730

732731
FabricProposal.Proposal proposal = GetConfigBlockBuilder.newBuilder()
733732
.context(transactionContext)

src/main/java/org/hyperledger/fabric/sdk/transaction/CSCCProposalBuilder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ public FabricProposal.Proposal build() throws ProposalException {
3737
ccType(GOLANG);
3838
chaincodeID(CHAINCODE_ID_CSCC);
3939

40-
if (!"".equals(context.getChannel().getName())) { //if not "" this is not the system channel
41-
//TODO use isSystem when public classes are interfaces.
42-
throw new ProposalException("cscc chaincode not called on system channel.");
43-
44-
}
45-
4640
return super.build();
4741

4842
}

src/test/java/org/hyperledger/fabric/sdkintegration/End2endAndBackAgainIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ private void testPeerServiceEventingReplay(HFClient client, Channel replayTestCh
732732
return; // not supported for v1.0
733733
}
734734

735-
assertFalse(replayTestChannel.isInitialized()); //not yet intialized
735+
assertFalse(replayTestChannel.isInitialized()); //not yet initialized
736736
assertFalse(replayTestChannel.isShutdown()); // not yet shutdown.
737737

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

0 commit comments

Comments
 (0)