Skip to content

Commit

Permalink
Merge branch 'master' into avoid-change-set-from-readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon authored Feb 28, 2025
2 parents 8bc5ae8 + f893989 commit 6421d7b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugins/RpcClient/Models/RpcInvokeResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class RpcStack
{
public string Type { get; set; }

public string Value { get; set; }
public JToken Value { get; set; }

public JObject ToJson()
{
Expand All @@ -94,7 +94,7 @@ public static RpcStack FromJson(JObject json)
return new RpcStack
{
Type = json["type"].AsString(),
Value = json["value"].AsString()
Value = json["value"]
};
}
}
Expand Down
15 changes: 15 additions & 0 deletions tests/Neo.Network.RPC.Tests/UT_RpcModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,20 @@ public void TestRpcVersion()
var item = RpcVersion.FromJson((JObject)json);
Assert.AreEqual(json.ToString(), item.ToJson().ToString());
}

[TestMethod]
public void TestRpcStack()
{
var stack = new RpcStack()
{
Type = "Boolean",
Value = true,
};

var expectedJsonString = "{\"type\":\"Boolean\",\"value\":true}";
var actualJsonString = stack.ToJson().ToString();

Assert.AreEqual(expectedJsonString, actualJsonString);
}
}
}

0 comments on commit 6421d7b

Please sign in to comment.