本文整理汇总了Java中org.ethereum.vm.trace.ProgramTraceListener类的典型用法代码示例。如果您正苦于以下问题:Java ProgramTraceListener类的具体用法?Java ProgramTraceListener怎么用?Java ProgramTraceListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgramTraceListener类属于org.ethereum.vm.trace包,在下文中一共展示了ProgramTraceListener类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Program
import org.ethereum.vm.trace.ProgramTraceListener; //导入依赖的package包/类
public Program(RskSystemProperties config, byte[] ops, ProgramInvoke programInvoke) {
this.config = config;
isLogEnabled = logger.isInfoEnabled();
isGasLogEnabled = gasLogger.isInfoEnabled();
if (isLogEnabled ) {
logger.warn("WARNING! VM logging is enabled. This will make the VM 200 times slower. Do not use in production.");
}
if (isGasLogEnabled) {
gasLogger.warn("WARNING! Gas logging is enabled. This will the make VM 200 times slower. Do not use in production.");
}
this.invoke = programInvoke;
this.ops = nullToEmpty(ops);
this.memory = setupProgramListener(new Memory());
this.stack = setupProgramListener(new Stack());
this.stack.ensureCapacity(1024); // faster?
this.storage = setupProgramListener(new Storage(programInvoke));
this.trace = new ProgramTrace(config, programInvoke);
if (useDataWordPool) {
this.dataWordPool = new java.util.Stack<>();
this.dataWordPool.ensureCapacity(1024); // faster?
} else {
this.dataWordPool = null;
}
precompile();
traceListener = new ProgramTraceListener(config);
}
示例2: Program
import org.ethereum.vm.trace.ProgramTraceListener; //导入依赖的package包/类
public Program(byte[] codeHash, byte[] ops, ProgramInvoke programInvoke, Transaction transaction, SystemProperties config) {
this.config = config;
this.invoke = programInvoke;
this.transaction = transaction;
this.codeHash = codeHash == null || FastByteComparisons.equal(HashUtil.EMPTY_DATA_HASH, codeHash) ? null : codeHash;
this.ops = nullToEmpty(ops);
traceListener = new ProgramTraceListener(config.vmTrace());
this.memory = setupProgramListener(new Memory());
this.stack = setupProgramListener(new Stack());
this.storage = setupProgramListener(new Storage(programInvoke));
this.trace = new ProgramTrace(config, programInvoke);
this.blockchainConfig = config.getBlockchainConfig().getConfigForBlock(programInvoke.getNumber().longValue());
}