mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +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进行插装
|
||||
if (0L != cm.getInsnLimit()) {
|
||||
System.out.println("++++++++++++++++++++++true");
|
||||
LOGGER.info("++++++++++++++++++++++true");
|
||||
}
|
||||
czb.setManifest(cm);
|
||||
Set<String> toParse = new HashSet<>();
|
||||
@ -162,6 +162,15 @@ public class YJSCompiler {
|
||||
preSubConName + ".yjs");
|
||||
czb.put(preSubConName + ".yjs", preSubNode);
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user