refactor: prune unused code

This commit is contained in:
Frank.R.Wu 2021-11-01 15:12:50 +08:00
parent d70490b5fb
commit a8abd53446
3 changed files with 15 additions and 43 deletions

View File

@ -264,9 +264,9 @@ public class DesktopEngine extends JSEngine {
for (String topic : contractNode.events.keySet()) {
compileEventFunction(topic, topic, contractNode.events.get(topic));
}
for (String log : contractNode.logs.keySet()) {
String topic = HashUtil.sha3(contract.getID() + log);
compileEventFunction(log, topic, contractNode.logs.get(log));
for (String logName : contractNode.logs.keySet()) {
String topic = HashUtil.sha3(contract.getID(), logName);
compileEventFunction(logName, topic, contractNode.logs.get(logName));
}
for (ClassNode cn : contractNode.getClzs()) {
try {

View File

@ -109,47 +109,19 @@ public class SyncMechUtil {
}
public void clearAllFiles() {
File file = new File(syncDir);
if (file.isDirectory()) {
String[] children = file.list();
for (int i = 0; i < children.length; i++) {
File temp = new File(file, children[i]);
temp.delete();
}
}
cleanDirectory(syncDir);
cleanDirectory(crDir);
cleanDirectory(memoryDir);
cleanDirectory(traceDir);
cleanDirectory(transDir);
}
file = new File(crDir);
private void cleanDirectory(String path) {
File file = new File(path);
if (file.isDirectory()) {
String[] children = file.list();
for (int i = 0; i < children.length; i++) {
File temp = new File(file, children[i]);
temp.delete();
}
}
file = new File(memoryDir);
if (file.isDirectory()) {
String[] children = file.list();
for (int i = 0; i < children.length; i++) {
File temp = new File(file, children[i]);
temp.delete();
}
}
file = new File(traceDir);
if (file.isDirectory()) {
String[] children = file.list();
for (int i = 0; i < children.length; i++) {
File temp = new File(file, children[i]);
temp.delete();
}
}
file = new File(transDir);
if (file.isDirectory()) {
String[] children = file.list();
for (int i = 0; i < children.length; i++) {
File temp = new File(file, children[i]);
for (String child : children) {
File temp = new File(file, child);
temp.delete();
}
}

View File

@ -127,7 +127,7 @@ public class ContractHandler extends MsgHandler implements Runnable {
cb.onResult(result);
}
@Description("get functionEvaluates ")
@Description("get functionEvaluates")
public void functionEvaluates(GetMessage msg, ResultCallback cb) {
cb.onResult(cs.evaluatesAnalysis(msg.arg));
}
@ -137,7 +137,7 @@ public class ContractHandler extends MsgHandler implements Runnable {
cb.onResult(cs.getMemorySet());
}
@Description("get logType ")
@Description("get logType")
public void getLogType(GetMessage msg, ResultCallback cb) {
cb.onResult(cs.getLogType(msg.arg));
}