mirror of
https://gitee.com/BDWare/common
synced 2025-01-10 01:44:16 +00:00
remove doipOperationMap in ContractNode
This commit is contained in:
parent
5fd1c684aa
commit
07c8f40059
@ -13,7 +13,6 @@ public class ContractNode {
|
|||||||
private final List<ClassNode> clzs;
|
private final List<ClassNode> clzs;
|
||||||
private final List<FunctionNode> functions;
|
private final List<FunctionNode> functions;
|
||||||
private final Map<String, FunctionNode> functionMap;
|
private final Map<String, FunctionNode> functionMap;
|
||||||
private final Map<BasicOperations, FunctionNode> doipOperationsMap;
|
|
||||||
private final Set<String> dependentContracts;
|
private final Set<String> dependentContracts;
|
||||||
public Map<String, REventSemantics> events;
|
public Map<String, REventSemantics> events;
|
||||||
public Map<String, REventSemantics> logs;
|
public Map<String, REventSemantics> logs;
|
||||||
@ -40,7 +39,6 @@ public class ContractNode {
|
|||||||
permission = new ArrayList<>();
|
permission = new ArrayList<>();
|
||||||
instrumentBranch = false;
|
instrumentBranch = false;
|
||||||
dependentContracts = new HashSet<>();
|
dependentContracts = new HashSet<>();
|
||||||
doipOperationsMap = new HashMap<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFunction(FunctionNode function) {
|
public void addFunction(FunctionNode function) {
|
||||||
@ -48,6 +46,12 @@ public class ContractNode {
|
|||||||
getFunctions().add(function);
|
getFunctions().add(function);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateFunctionMap(String oldFunctionName, String newFunctionName) {
|
||||||
|
FunctionNode fn = functionMap.get(oldFunctionName);
|
||||||
|
functionMap.remove(oldFunctionName);
|
||||||
|
functionMap.put(newFunctionName, fn);
|
||||||
|
}
|
||||||
|
|
||||||
public void addClass(ClassNode clzNode) {
|
public void addClass(ClassNode clzNode) {
|
||||||
getClzs().add(clzNode);
|
getClzs().add(clzNode);
|
||||||
}
|
}
|
||||||
@ -199,25 +203,4 @@ public class ContractNode {
|
|||||||
public void resetContractName(String name) {
|
public void resetContractName(String name) {
|
||||||
contractName = name;
|
contractName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDoipOperation(FunctionNode function) {
|
|
||||||
doipOperationsMap.put(function.getDoipOperationInfo().operationType, function);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FunctionNode getDoipOperation(String action) {
|
|
||||||
FunctionNode result = null;
|
|
||||||
for (BasicOperations op : BasicOperations.values()) {
|
|
||||||
if (op.toString().equals(action)) {
|
|
||||||
result = doipOperationsMap.get(op);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result = doipOperationsMap.get(BasicOperations.Unknown);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FunctionNode getDoipOperation(BasicOperations basicOperation) {
|
|
||||||
return doipOperationsMap.get(basicOperation);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user