Skip to content

Commit

Permalink
Transaction metadata tags updated
Browse files Browse the repository at this point in the history
Signed-off-by: Kestutis Gudynas <[email protected]>
  • Loading branch information
kemi04 committed Mar 22, 2021
1 parent aa6eded commit 3f190ef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ public static void addTransaction(final TxFunction txFunction, final String cont

final ArrayList<TransactionType> tags = new ArrayList<TransactionType>();
tags.add(txFunction.getType());
if (txFunction.getType() == TransactionType.SUBMIT) { // add deprecated tags
tags.add(TransactionType.INVOKE);
} else {
tags.add(TransactionType.QUERY);
}

final Map<String, Serializable> contract = contractMap.get(contractName);
@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@

public enum TransactionType {
/**
*
*/
INVOKE,
*
*/
INVOKE, //deprecated
/**
*
*/
QUERY,
*
*/
QUERY, //deprecated
/**
*
*/
DEFAULT
*
*/
DEFAULT, //deprecated
/**
*
*/
SUBMIT,
/**
*
*/
EVALUATE
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<ParameterDefinition> paramsList = new ArrayList<>();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3f190ef

Please sign in to comment.