mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 09:54:07 +00:00
feat: update YJSCompiler
compile setGlobal in all contracts
This commit is contained in:
parent
639d8dc6cb
commit
ad8de7a92c
@ -120,7 +120,7 @@ public class YJSCompiler {
|
|||||||
|
|
||||||
// 如果没有就不限制,根据gas进行插装
|
// 如果没有就不限制,根据gas进行插装
|
||||||
if (0L != cm.getInsnLimit()) {
|
if (0L != cm.getInsnLimit()) {
|
||||||
System.out.println("++++++++++++++++++++++true");
|
LOGGER.info("++++++++++++++++++++++true");
|
||||||
}
|
}
|
||||||
czb.setManifest(cm);
|
czb.setManifest(cm);
|
||||||
Set<String> toParse = new HashSet<>();
|
Set<String> toParse = new HashSet<>();
|
||||||
@ -162,6 +162,15 @@ public class YJSCompiler {
|
|||||||
preSubConName + ".yjs");
|
preSubConName + ".yjs");
|
||||||
czb.put(preSubConName + ".yjs", preSubNode);
|
czb.put(preSubConName + ".yjs", preSubNode);
|
||||||
LOGGER.info("--compile-- " + preSubConName);
|
LOGGER.info("--compile-- " + preSubConName);
|
||||||
|
|
||||||
|
String setGlobalName = cm.main.substring(0, cm.main.length() - 4) + "SetGlobal";
|
||||||
|
String setGlobalContract =
|
||||||
|
"contract " + setGlobalName + "{ function setGlobal (_global) { Global = _global; }}";
|
||||||
|
czb.put(setGlobalName + ".yjs",
|
||||||
|
compile(new ByteArrayInputStream(setGlobalContract.getBytes(StandardCharsets.UTF_8)),
|
||||||
|
setGlobalName + ".yjs"));
|
||||||
|
LOGGER.info("--compile-- " + setGlobalName);
|
||||||
|
|
||||||
return czb;
|
return czb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user