-
Notifications
You must be signed in to change notification settings - Fork 102
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
How are NEP11 Tokens / TokensOf methods supposed to be invoked #647
Comments
private void TokensOf()
{
byte[] script;
using (ScriptBuilder sb = new ScriptBuilder())
{
sb.EmitDynamicCall(UInt160.Parse("0x324552a48aaee3be71f6ab3a4edb971c6d5c1ae2"), "tokensOf", UInt160.Parse("0xbed7d6494ceb31c82630de657cbb1e7fc1254469"));
script = sb.ToArray();
}
RpcInvokeResult invokeResult = _rpcClient.InvokeScriptAsync(script, new Signer[] { }).Result;
} |
How are you supposed to get the results of the iterator out of the RpcInvokeResult? The JSON returned from {
"script": "DBQAAAAAAAAAAAAAAAAAAAAAAAAAABHAHwwIdG9rZW5zT2YMFJpa9Q5eO0wZ\u002BCiMbClC50kOH5vlQWJ9W1I=",
"state": "HALT",
"gasconsumed": "2538240",
"exception": null,
"stack": [
{
"type": "InteropInterface",
"iterator": [
{
"type": "ByteString",
"value": "MCzYlCuv8ZFJBafDBVfbFAhXs6UN0UTp05b7dVH\u002BJ6k="
},
{
"type": "ByteString",
"value": "PeIWEBz1lPu7Q8\u002BZ5u0/xUr7Lku9EPiLpfpBabZIySM="
},
{
"type": "ByteString",
"value": "nKO\u002BA7byvYwio1pv0GJnKJGdx3lDgF0Y8JZPvpZUflA="
}
],
"truncated": false
}
]
} However, public static StackItem StackItemFromJson(JObject json)
{
StackItemType type = json["type"].TryGetEnum<StackItemType>();
switch (type)
{
// other StackItemType case blocks omitted for clarity
case StackItemType.InteropInterface:
return new InteropInterface(new object()); // See https://github.com/neo-project/neo/blob/master/src/neo/VM/Helper.cs#L194
}
return json["value"] is null ? StackItem.Null : json["value"].AsString();
} |
It appears that I have to use |
Also, since the RPC server will only return the first |
Note, this issue may be a more specific duplicate of neo-project/neo-modules#629 |
Can someone please share code demonstrating how to invoke a method that returns an
Iterator
such as NEP11 Tokens or TokensOfThe text was updated successfully, but these errors were encountered: