From 930bfeaa90ce53ccc5653676d250e7ca0087a336 Mon Sep 17 00:00:00 2001 From: Christopher Schuchardt Date: Wed, 15 Nov 2023 14:57:00 -0500 Subject: [PATCH] Added IteropInterface to display data in results for neo-vm (#341) --- src/neoxp/TransactionExecutor.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/neoxp/TransactionExecutor.cs b/src/neoxp/TransactionExecutor.cs index 8fcb0581..c2a97aaf 100644 --- a/src/neoxp/TransactionExecutor.cs +++ b/src/neoxp/TransactionExecutor.cs @@ -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; @@ -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() 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)