mirror of
https://gitee.com/BDWare/common
synced 2025-01-09 17:34: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<FunctionNode> functions;
|
||||
private final Map<String, FunctionNode> functionMap;
|
||||
private final Map<BasicOperations, FunctionNode> doipOperationsMap;
|
||||
private final Set<String> dependentContracts;
|
||||
public Map<String, REventSemantics> events;
|
||||
public Map<String, REventSemantics> logs;
|
||||
@ -40,7 +39,6 @@ public class ContractNode {
|
||||
permission = new ArrayList<>();
|
||||
instrumentBranch = false;
|
||||
dependentContracts = new HashSet<>();
|
||||
doipOperationsMap = new HashMap<>();
|
||||
}
|
||||
|
||||
public void addFunction(FunctionNode function) {
|
||||
@ -48,6 +46,12 @@ public class ContractNode {
|
||||
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) {
|
||||
getClzs().add(clzNode);
|
||||
}
|
||||
@ -199,25 +203,4 @@ public class ContractNode {
|
||||
public void resetContractName(String 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