Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Runner generating invalid result json when there's iterators in the result stack #46

Open
meevee98 opened this issue Feb 1, 2023 · 0 comments

Comments

@meevee98
Copy link

meevee98 commented Feb 1, 2023

I'm using Neo Test Runner to run some tests and found out that it generates a invalid json when the invocation has interators in its results
image

I am testing a simple smart contract written in Python:

from typing import Union, Any

from boa3.builtin.compile_time import NeoMetadata, public
from boa3.builtin.interop import storage
from boa3.builtin.interop.iterator import Iterator
from boa3.builtin.type import ByteString


@metadata
def manifest_metadata() -> NeoMetadata:
    meta = NeoMetadata()
    meta.name = 'Example'
    return meta


@public
def find_by_prefix(prefix: bytes) -> Iterator:
    return storage.find(prefix)


@public
def put_on_storage(key: ByteString, value: Union[int, ByteString]):
    storage.put(key, value)


@public
def _deploy(data: Any, update: bool):
    # test data to test in unit tests
    storage.put('example_0', '0')
    storage.put('example_1', '1')
    storage.put('example_2', '2')

with this invoke file:

[{"contract":"Example","operation":"find_by_prefix","args":["0x74657374"]},{"contract":"Example","operation":"find_by_prefix","args":["0x6578616d706c65"]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant