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

CityOfZion / neo3-boa / 0aff654d-b027-49a1-9d97-558d9a2a52ff

05 Mar 2024 04:57PM UTC coverage: 91.985% (-0.1%) from 92.106%
0aff654d-b027-49a1-9d97-558d9a2a52ff

push

circleci

web-flow
Merge pull request #1215 from CityOfZion/CU-86drpndkk

CU-86drpndkk - Refactor test_interop/test_blockchain.py to use BoaTestConstructor

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

658 existing lines in 143 files now uncovered.

20635 of 22433 relevant lines covered (91.99%)

1.84 hits per line

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

63.64
/boa3/internal/model/builtin/interop/iterator/iteratorinitmethod.py
1
from collections.abc import Sequence
2✔
2
from typing import Any
2✔
3

4
from boa3.internal.model.builtin.interop.interopmethod import InteropMethod
2✔
5
from boa3.internal.model.builtin.interop.iterator.iteratortype import IteratorType
2✔
6
from boa3.internal.model.builtin.method.builtinmethod import IBuiltinMethod
2✔
7
from boa3.internal.model.expression import IExpression
2✔
8
from boa3.internal.model.variable import Variable
2✔
9

10

11
class IteratorMethod(InteropMethod):
2✔
12

13
    def __init__(self, return_type: IteratorType):
2✔
14
        identifier = '-Iterator__init__'
2✔
15
        syscall = 'System.Iterator.Create'
2✔
16
        from boa3.internal.model.type.type import Type
2✔
17
        args: dict[str, Variable] = {'entry': Variable(Type.collection)}
2✔
18
        super().__init__(identifier, syscall, args, return_type=return_type)
2✔
19

20
    def validate_parameters(self, *params: IExpression) -> bool:
2✔
UNCOV
21
        return len(params) == 0
×
22

23
    @property
2✔
24
    def _args_on_stack(self) -> int:
2✔
UNCOV
25
        return len(self.args)
×
26

27
    @property
2✔
28
    def _body(self) -> str | None:
2✔
UNCOV
29
        return
×
30

31
    def _entry_arg(self) -> Variable:
2✔
UNCOV
32
        return self.args['entry']
×
33

34
    def build(self, value: Any) -> IBuiltinMethod:
2✔
35
        if isinstance(value, Sequence) and len(value) == 1:
×
UNCOV
36
            argument = value[0]
×
37
        else:
UNCOV
38
            argument = value
×
39

40
        if self._entry_arg().type.is_type_of(argument):
×
41
            iterator = IteratorType.build(argument)
×
42
            if iterator is not self.return_type:
×
43
                return IteratorMethod(iterator)
×
UNCOV
44
        return super().build(value)
×
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