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

fix rpc error #894

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/ApplicationLogs/LogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ protected override void OnSystemLoaded(NeoSystem system)
public JToken GetApplicationLog(JArray _params)
{
if (_params == null || _params.Count == 0)
throw new RpcException(-32602, "Invalid params");
throw new RpcException(RpcError.InvalidParams);
if (UInt256.TryParse(_params[0].AsString(), out var hash))
{
var raw = BlockToJObject(hash);
if (raw == null)
raw = TransactionToJObject(hash);
if (raw == null)
throw new RpcException(-100, "Unknown transaction/blockhash");
throw new RpcException(RpcError.InvalidParams.WithData("Unknown transaction/blockhash"));

if (_params.Count >= 2 && Enum.TryParse(_params[1].AsString(), true, out TriggerType triggerType))
{
Expand All @@ -111,7 +111,7 @@ public JToken GetApplicationLog(JArray _params)
return raw ?? JToken.Null;
}
else
throw new RpcException(-32602, "Invalid params");
throw new RpcException(RpcError.InvalidParams);
}

#endregion
Expand Down
Loading