diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/metadata/MetadataBuilder.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/metadata/MetadataBuilder.java index c8113086..6b1830db 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/metadata/MetadataBuilder.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/metadata/MetadataBuilder.java @@ -207,6 +207,11 @@ public static void addTransaction(final TxFunction txFunction, final String cont final ArrayList tags = new ArrayList(); tags.add(txFunction.getType()); + if (txFunction.getType() == TransactionType.SUBMIT) { // add deprecated tags + tags.add(TransactionType.INVOKE); + } else { + tags.add(TransactionType.QUERY); + } final Map contract = contractMap.get(contractName); @SuppressWarnings("unchecked") diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/TransactionType.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/TransactionType.java index 07e26ecf..80472df5 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/TransactionType.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/TransactionType.java @@ -7,15 +7,23 @@ public enum TransactionType { /** - * - */ - INVOKE, + * + */ + INVOKE, //deprecated /** - * - */ - QUERY, + * + */ + QUERY, //deprecated /** - * - */ - DEFAULT + * + */ + DEFAULT, //deprecated + /** + * + */ + SUBMIT, + /** + * + */ + EVALUATE } diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/TxFunctionImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/TxFunctionImpl.java index 5dc2f58c..242fc911 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/TxFunctionImpl.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/TxFunctionImpl.java @@ -29,6 +29,7 @@ public final class TxFunctionImpl implements TxFunction { private final Method method; private String name; private TransactionType type; + private TransactionType typeDeprecated; private final Routing routing; private TypeSchema returnSchema; private List paramsList = new ArrayList<>(); @@ -90,9 +91,9 @@ public TxFunctionImpl(final Method m, final ContractDefinition contract) { if (m.getAnnotation(Transaction.class) != null) { logger.debug("Found Transaction method: " + m.getName()); if (m.getAnnotation(Transaction.class).intent() == Transaction.TYPE.SUBMIT) { - this.type = TransactionType.INVOKE; + this.type = TransactionType.SUBMIT; } else { - this.type = TransactionType.QUERY; + this.type = TransactionType.EVALUATE; } final String txnName = m.getAnnotation(Transaction.class).name();