예제 #1
0
    def push_bytes(self, value: bytes) -> None:
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        validate_stack_bytes(value)

        self._append((bytes, value))
예제 #2
0
    def push_int(self, value: int) -> None:
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        validate_stack_int(value)

        self._append((int, value))
예제 #3
0
파일: stack.py 프로젝트: cd4761/ecc-trinity
    def push_bytes(self, value: bytes) -> None:
        """
        Push a bytes item onto the stack.
        """
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        validate_stack_bytes(value)

        self._append((bytes, value))
예제 #4
0
파일: stack.py 프로젝트: cd4761/ecc-trinity
    def push_int(self, value: int) -> None:
        """
        Push an integer item onto the stack.
        """
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        validate_stack_int(value)

        self._append((int, value))
예제 #5
0
파일: stack.py 프로젝트: sjyi/py-evm
    def push(self, value):
        """
        Push an item onto the stack.
        """
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        validate_stack_item(value)

        self.values.append(value)
예제 #6
0
    def dup(self, position: int) -> None:
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        peek_index = -1 * position
        try:
            self._append(self.values[peek_index])
        except IndexError:
            raise InsufficientStack(
                f"Insufficient stack items for DUP{position}")
예제 #7
0
파일: stack.py 프로젝트: cd4761/ecc-trinity
    def dup(self, position: int) -> None:
        """
        Perform a DUP operation on the stack.
        """
        if len(self.values) > 1023:
            raise FullStack('Stack limit reached')

        peek_index = -1 * position
        try:
            self._append(self.values[peek_index])
        except IndexError:
            raise InsufficientStack(
                "Insufficient stack items for DUP{0}".format(position))