Skip to content

Commit

Permalink
Added IteropInterface to display data in results for neo-vm (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
cschuchardt88 authored Nov 15, 2023
1 parent 9cf7886 commit 930bfea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/neoxp/TransactionExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Neo.Network.P2P.Payloads;
using Neo.Network.RPC;
using Neo.SmartContract;
using Neo.SmartContract.Iterators;
using Neo.SmartContract.Native;
using Neo.VM;
using NeoExpress.Models;
Expand Down Expand Up @@ -299,6 +300,14 @@ static async Task WriteStackItemAsync(System.IO.TextWriter writer, Neo.VM.Types.
await WriteStackItemAsync(writer, m.Value, indent + 1, "value: ").ConfigureAwait(false);
}
break;
case Neo.VM.Types.InteropInterface iop:
if (iop.GetInterface<object>() is IIterator iter)
{
await WriteLineAsync($"{iop.Type}: ({iter.GetType().Name})").ConfigureAwait(false);
while (iter.Next())
await WriteStackItemAsync(writer, iter.Value(null), indent + 1).ConfigureAwait(false);
}
break;
}

async Task WriteLineAsync(string value)
Expand Down

0 comments on commit 930bfea

Please sign in to comment.