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

Commit 4a8b56e

Browse files
bestbeforetodayandrew-coleman
authored andcommitted
FABJ-509: Allow transactions to be submitted without ChaincodeID (#39)
Remove the check for the presence of ChaincodeID when invoking transactions using service discovery. ChaincodeName can now be specified as an alternative to ChaincodeID and ChaincodeID is deprecated, so this check is redundant. Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
1 parent 4998053 commit 4a8b56e

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,9 +4421,6 @@ public Collection<ProposalResponse> sendTransactionProposalToEndorsers(Transacti
44214421
if (isNullOrEmpty(transactionProposalRequest.getFcn())) {
44224422
throw new InvalidArgumentException("The proposalRequest's fcn is null or empty.");
44234423
}
4424-
if (transactionProposalRequest.getChaincodeID() == null) {
4425-
throw new InvalidArgumentException("The proposalRequest's chaincode ID is null");
4426-
}
44274424
if (null == serviceDiscovery) {
44284425
throw new ServiceDiscoveryException("The channel is not configured with any peers with the 'discover' role");
44294426
}
@@ -4833,10 +4830,6 @@ private Collection<ProposalResponse> sendProposal(TransactionRequest proposalReq
48334830
throw new InvalidArgumentException("The proposalRequest's fcn is null or empty.");
48344831
}
48354832

4836-
// if (proposalRequest.getChaincodeID() == null) {
4837-
// throw new InvalidArgumentException("The proposalRequest's chaincode ID is null");
4838-
// }
4839-
48404833
try {
48414834
TransactionContext transactionContext = getTransactionContext(proposalRequest.getUserContext());
48424835
transactionContext.verify(proposalRequest.doVerify());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public Orderer addOrderer(Channel.SDOrdererAdditionInfo sdOrdererAdditionInfo) t
192192
assertFalse(transactionPropResp.isEmpty());
193193

194194
transactionProposalRequest = client.newTransactionProposalRequest();
195-
transactionProposalRequest.setChaincodeID(chaincodeID);
195+
transactionProposalRequest.setChaincodeName(CHAIN_CODE_NAME);
196196
transactionProposalRequest.setChaincodeLanguage(CHAIN_CODE_LANG);
197197
transactionProposalRequest.setFcn("move");
198198
transactionProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());

0 commit comments

Comments
 (0)