Package org.ethereum.vm

Examples of org.ethereum.vm.VM


        repository.createAccount(contractAddrB);
        repository.saveCode(contractAddrB, codeB);
        repository.addStorageRow(contractAddrB, key1, value1);

        // Play the program
        VM vm = new VM();
        Program program = new Program(codeB, pi);

        try {
            while(!program.isStopped())
                vm.step(program);
        } catch (RuntimeException e) {
            program.setRuntimeFailure(e);
        }

        System.out.println();
View Full Code Here



        // ****************** //
        //  Play the program  //
        // ****************** //
        VM vm = new VM();
        Program program = new Program(codeB, pi);

        try {
            while(!program.isStopped())
                vm.step(program);
        } catch (RuntimeException e) {
            program.setRuntimeFailure(e);
        }


View Full Code Here

        repository.addBalance(caller_addr_bytes, new BigInteger("100000000000000000000"));

        // ****************** //
        //  Play the program  //
        // ****************** //
        VM vm = new VM();
        Program program = new Program(codeB, pi);

        try {
            while(!program.isStopped())
                vm.step(program);
        } catch (RuntimeException e) {
            program.setRuntimeFailure(e);
        }

        System.out.println();
View Full Code Here

        repository.createAccount(caller_addr_bytes);

        // ****************** //
        //  Play the program  //
        // ****************** //
        VM vm = new VM();
        Program program = new Program(codeA, pi);

    try {
      while (!program.isStopped())
        vm.step(program);
    } catch (RuntimeException e) {
      program.setRuntimeFailure(e);
    }

        System.out.println();
View Full Code Here

        repository.addBalance(caller_addr_bytes, new BigInteger("100000000000000000000"));

        // ****************** //
        //  Play the program  //
        // ****************** //
        VM vm = new VM();
        Program program = new Program(codeB, pi);

        try {
            while(!program.isStopped())
                vm.step(program);
        } catch (RuntimeException e) {
            program.setRuntimeFailure(e);
        }

        System.out.println();
View Full Code Here

  }
 
    @Test // CALLDATASIZE OP
    public void testCALLDATASIZE_1() {

        VM vm = new VM();
        program = new Program(Hex.decode("36"), invoke);
        String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000000040";

        vm.step(program);

        DataWord item1 = program.stackPop();
        assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
    }
View Full Code Here


    @Test // CALLDATALOAD OP
    public void testCALLDATALOAD_1() {

        VM vm = new VM();
        program =
                new Program(Hex.decode("600035"), invoke);
        String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000000A1";

        vm.step(program);
        vm.step(program);

        DataWord item1 = program.stackPop();
        assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
    }
View Full Code Here

    }

    @Test // CALLDATALOAD OP
    public void testCALLDATALOAD_2() {

        VM vm = new VM();
        program =
                new Program(Hex.decode("600235"), invoke);
        String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000A10000";

        vm.step(program);
        vm.step(program);

        DataWord item1 = program.stackPop();
        assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
    }
View Full Code Here


    @Test // CALLDATALOAD OP
    public void testCALLDATALOAD_3() {

        VM vm = new VM();
        program =
                new Program(Hex.decode("602035"), invoke);
        String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000000B1";

        vm.step(program);
        vm.step(program);

        DataWord item1 = program.stackPop();
        assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
    }
View Full Code Here


    @Test // CALLDATALOAD OP
    public void testCALLDATALOAD_4() {

        VM vm = new VM();
        program =
                new Program(Hex.decode("602335"), invoke);
        String s_expected_1 = "00000000000000000000000000000000000000000000000000000000B1000000";

        vm.step(program);
        vm.step(program);

        DataWord item1 = program.stackPop();
        assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
    }
View Full Code Here

TOP

Related Classes of org.ethereum.vm.VM

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.