Itearator returned by contract

I have a smart contract method that returns an Iterator.
When calling that through the TestEngine, I receive an InteropInterface, but I am not quite sure how to test that the key/value pairs or just values are accessible through the Iterator I intend to return.

Couldn’t find any tests in boa regarding that. There are a few tests in case of iterator creation and returning it, but nothing when it comes to actually accessing the data inside.

1 Like

I’m not sure if it is exact the same problem, but I did some testing with NEP 11 contracts on NEO 2. I struggled with the returned InteropInterface from the ‘tokensOf’ method. The problem was neon.js (which I used for invokes) also wasn’t able to get the data inside.

After some research I’ve found this: Implement buildIteratorScript by WyattMufson · Pull Request #466 · CityOfZion/neon-js · GitHub

As this is python based, and I use javascript for the project, it was necessary to call it from inside javascript. Therefore, the solution is only suitable for server based calls. Won’t work in the browser.

I hope this could be a hint for you.

Since I’m going to rework the whole NEO integration for the hackathon I’m definitely interested if something has changed in neon.js towards working with returned InteropInterface.

Maybe someone has an insight? :slight_smile: