Skip to content

Commit 95a0c03

Browse files
Giuseppe CeramiGiuseppe Cerami
authored andcommitted
[WIP] Implement subroutine opcodes
1 parent 29ff22a commit 95a0c03

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

eth/vm/computation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ def stack_push_bytes(self) -> Callable[[bytes], None]:
329329
# Return Stack Management
330330
#
331331
@cached_property
332-
def rstack_push_int(self) -> Callable[[int], None]:
332+
def rstack_push_int(self) -> None:
333333
return self._rstack.push_int
334334

335335
@cached_property
336-
def rstack_pop1_int(self) -> Callable[[int]], None]:
336+
def rstack_pop1_int(self) -> int:
337337
return self._rstack.pop1_int
338338

339339
#

eth/vm/rstack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
validate_stack_int,
1212
)
1313

14-
from eth.utils import (
14+
from eth_utils import (
1515
big_endian_to_int,
1616
ValidationError,
1717
)
1818

19-
import collections.UserList as rstack
19+
from collections import UserList as rstack
2020
"""
2121
This module simply implements for the return stack the exact same design used for the data stack.
2222
As this stack must simply push_int or pop1_int any time a subroutine is accessed or left, only those two functions are provided.

tests/core/opcodes/test_opcodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,10 @@ def test_blake2b_f_compression(vm_class, input_hex, output_hex, expect_exception
11261126
result = comp.output
11271127
assert result.hex() == output_hex
11281128

1129-
1129+
"""
11301130
def test_jumpsub():
11311131
computation.prepare_general_computation(vm_class)
11321132
computation.stack_push1_int(val1)
11331133
#do jumpsub
11341134
#do returnsub
1135+
"""

0 commit comments

Comments
 (0)