• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CityOfZion / neo3-boa / 30ae3248-fada-4b8d-8735-31794b222593

17 Jan 2024 01:43PM UTC coverage: 92.103%. Remained the same
30ae3248-fada-4b8d-8735-31794b222593

push

circleci

web-flow
Merge pull request #1170 from CityOfZion/CU-86a1hepnw

CU-86a1hepnw - Fix tests using Python 3.12 (parsing manifest JSON)

1 of 1 new or added line in 1 file covered. (100.0%)

253 existing lines in 51 files now uncovered.

20773 of 22554 relevant lines covered (92.1%)

2.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/boa3/internal/model/operation/binary/logical/leftshift.py
1
from typing import List
3✔
2

3
from boa3.internal.model.operation.binary.binaryoperation import BinaryOperation
3✔
4
from boa3.internal.model.operation.operator import Operator
3✔
5
from boa3.internal.model.type.type import IType, Type
3✔
6
from boa3.internal.neo.vm.opcode.Opcode import Opcode
3✔
7

8

9
class LeftShift(BinaryOperation):
3✔
10
    """
11
    A class used to represent the bit left shift [ << ] operation
12

13
    :ivar operator: the operator of the operation. Inherited from :class:`IOperation`
14
    :ivar left: the left operand type. Inherited from :class:`BinaryOperation`
15
    :ivar right: the left operand type. Inherited from :class:`BinaryOperation`
16
    :ivar result: the result type of the operation.  Inherited from :class:`IOperation`
17
    """
18
    _valid_types: List[IType] = [Type.int, Type.bool]
3✔
19

20
    def __init__(self, left: IType = Type.int, right: IType = Type.int):
3✔
21
        self.operator: Operator = Operator.LeftShift
3✔
22
        super().__init__(left, right)
3✔
23

24
    def validate_type(self, *types: IType) -> bool:
3✔
25
        if len(types) != self.number_of_operands:
3✔
26
            return False
×
27
        left: IType = types[0]
3✔
28
        right: IType = types[1]
3✔
29
        return any(_type.is_type_of(left) for _type in self._valid_types) and Type.int.is_type_of(right)
3✔
30

31
    def _get_result(self, left: IType, right: IType) -> IType:
3✔
32
        if self.validate_type(left, right):
3✔
33
            return left
3✔
34
        else:
35
            return Type.none
×
36

37
    def generate_internal_opcodes(self, code_generator):
3✔
UNCOV
38
        code_generator.insert_opcode(Opcode.SHL)
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc