Skip to content
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

Add relayresult #200

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/RpcServer/RpcServer.Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private JObject GetPeers(JArray _params)
return json;
}

private static JObject GetRelayResult(RelayResultReason reason, UInt256 hash)
private static JObject GetRelayResult(VerifyResult reason, UInt256 hash)
{
if (reason == RelayResultReason.Succeed)
if (reason == VerifyResult.Succeed)
{
var ret = new JObject();
ret["hash"] = hash.ToString();
Expand All @@ -70,15 +70,15 @@ private JObject GetVersion(JArray _params)
private JObject SendRawTransaction(JArray _params)
{
Transaction tx = _params[0].AsString().HexToBytes().AsSerializable<Transaction>();
RelayResultReason reason = System.Blockchain.Ask<RelayResultReason>(tx).Result;
VerifyResult reason = System.Blockchain.Ask<VerifyResult>(tx).Result;
return GetRelayResult(reason, tx.Hash);
}

[RpcMethod]
private JObject SubmitBlock(JArray _params)
{
Block block = _params[0].AsString().HexToBytes().AsSerializable<Block>();
RelayResultReason reason = System.Blockchain.Ask<RelayResultReason>(block).Result;
VerifyResult reason = System.Blockchain.Ask<VerifyResult>(block).Result;
return GetRelayResult(reason, block.Hash);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Neo.Network.RPC.Tests/RpcTestCases.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"error": {
"code": -500,
"message": "InsufficientFunds",
"data": " at Neo.Plugins.RpcServer.GetRelayResult(RelayResultReason reason, UInt256 hash)\r\n at Neo.Network.RPC.Models.RpcServer.SendRawTransaction(JArray _params)\r\n at Neo.Network.RPC.Models.RpcServer.ProcessRequest(HttpContext context, JObject request)"
"data": " at Neo.Plugins.RpcServer.GetRelayResult(VerifyResult reason, UInt256 hash)\r\n at Neo.Network.RPC.Models.RpcServer.SendRawTransaction(JArray _params)\r\n at Neo.Network.RPC.Models.RpcServer.ProcessRequest(HttpContext context, JObject request)"
}
}
},
Expand Down