From 07c8f40059d1a3ed4250d9e0df7dec6fb3098541 Mon Sep 17 00:00:00 2001 From: "haoeliu@foxmail.com" Date: Wed, 16 Nov 2022 14:57:29 +0800 Subject: [PATCH] remove doipOperationMap in ContractNode --- .../base/org/bdware/sc/node/ContractNode.java | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/main/base/org/bdware/sc/node/ContractNode.java b/src/main/base/org/bdware/sc/node/ContractNode.java index 00704f9..e4bc5ab 100644 --- a/src/main/base/org/bdware/sc/node/ContractNode.java +++ b/src/main/base/org/bdware/sc/node/ContractNode.java @@ -13,7 +13,6 @@ public class ContractNode { private final List clzs; private final List functions; private final Map functionMap; - private final Map doipOperationsMap; private final Set dependentContracts; public Map events; public Map 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); - } }