use of org.ethereum.vm.program.Stack in project rskj by rsksmart.
the class VMExecutionTest method testJumpSkippingInvalidJump.
@Test
public void testJumpSkippingInvalidJump() {
Program program = executeCode("PUSH1 0x05 JUMP PUSH1 0xa0 JUMPDEST PUSH1 0x01", 4);
Stack stack = program.getStack();
Assert.assertEquals(1, stack.size());
Assert.assertEquals(new DataWord(1), stack.peek());
}
use of org.ethereum.vm.program.Stack in project rskj by rsksmart.
the class VMExecutionTest method dupnFourthItem.
@Test
public void dupnFourthItem() {
Program program = executeCode("PUSH1 0x01 PUSH1 0x02 PUSH1 0x03 PUSH1 0x04 PUSH1 0x03 DUPN", 6);
Stack stack = program.getStack();
Assert.assertEquals(5, stack.size());
Assert.assertEquals(new DataWord(1), stack.peek());
for (int k = 0; k < 4; k++) Assert.assertEquals(new DataWord(k + 1), stack.get(k));
}
use of org.ethereum.vm.program.Stack in project rskj by rsksmart.
the class VMExecutionTest method testPush1.
@Test
public void testPush1() {
Program program = executeCode("PUSH1 0xa0", 1);
Stack stack = program.getStack();
Assert.assertEquals(1, stack.size());
Assert.assertEquals(new DataWord(0xa0), stack.peek());
}
Aggregations