Search in sources :

Example 1 with BytecodeCompiler

use of co.rsk.vm.BytecodeCompiler in project rskj by rsksmart.

the class AltBN128Test method executeCode.

private Program executeCode(String code) {
    VmConfig vmConfig = config.getVmConfig();
    BlockFactory blockFactory = new BlockFactory(config.getActivationConfig());
    ProgramInvokeMockImpl invoke = new ProgramInvokeMockImpl();
    BytecodeCompiler compiler = new BytecodeCompiler();
    byte[] compiledCode = compiler.compile(code);
    VM vm = new VM(vmConfig, precompiledContracts);
    Program program = new Program(vmConfig, precompiledContracts, blockFactory, activations, compiledCode, invoke, null, new HashSet<>());
    vm.play(program);
    return program;
}
Also used : ProgramInvokeMockImpl(org.ethereum.vm.program.invoke.ProgramInvokeMockImpl) Program(org.ethereum.vm.program.Program) BlockFactory(org.ethereum.core.BlockFactory) VM(org.ethereum.vm.VM) BytecodeCompiler(co.rsk.vm.BytecodeCompiler) VmConfig(co.rsk.config.VmConfig)

Aggregations

VmConfig (co.rsk.config.VmConfig)1 BytecodeCompiler (co.rsk.vm.BytecodeCompiler)1 BlockFactory (org.ethereum.core.BlockFactory)1 VM (org.ethereum.vm.VM)1 Program (org.ethereum.vm.program.Program)1 ProgramInvokeMockImpl (org.ethereum.vm.program.invoke.ProgramInvokeMockImpl)1