Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Sync Neo #874

Merged
merged 2 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// modifications are permitted.

using Neo.ConsoleService;
using Neo.IO.Json;
using Neo.Json;
using Neo.Network.P2P.Payloads;
using Neo.SmartContract;
using Neo.SmartContract.Native;
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.NEP17.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// modifications are permitted.

using Neo.ConsoleService;
using Neo.IO.Json;
using Neo.Json;
using Neo.Network.P2P.Payloads;
using Neo.SmartContract;
using Neo.SmartContract.Native;
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Akka.Actor;
using Neo.ConsoleService;
using Neo.IO;
using Neo.IO.Json;
using Neo.Json;
using Neo.Network.P2P;
using Neo.Network.P2P.Capabilities;
using Neo.Network.P2P.Payloads;
Expand Down
8 changes: 4 additions & 4 deletions neo-cli/CLI/MainService.Plugins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using Microsoft.Extensions.Configuration;
using Neo.ConsoleService;
using Neo.IO.Json;
using Neo.Json;
using Neo.Plugins;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -79,13 +79,13 @@ private async Task<MemoryStream> DownloadPluginAsync(string pluginName)
$"{GetType().Assembly.GetName().Name}/{GetType().Assembly.GetVersion()}");
using HttpResponseMessage responseApi = await http.SendAsync(request);
byte[] buffer = await responseApi.Content.ReadAsByteArrayAsync();
JObject releases = JObject.Parse(buffer);
JObject asset = releases.GetArray()
var releases = JObject.Parse(buffer);
var asset = ((JArray)releases)
.Where(p => !p["tag_name"].GetString().Contains('-'))
.Select(p => new
{
Version = Version.Parse(p["tag_name"].GetString().TrimStart('v')),
Assets = p["assets"].GetArray()
Assets = (JArray)p["assets"]
})
.OrderByDescending(p => p.Version)
.First(p => p.Version <= versionCore).Assets
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Vote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

using Neo.ConsoleService;
using Neo.Cryptography.ECC;
using Neo.IO.Json;
using Neo.Json;
using Neo.SmartContract;
using Neo.SmartContract.Native;
using Neo.VM;
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Akka.Actor;
using Neo.ConsoleService;
using Neo.Cryptography.ECC;
using Neo.IO.Json;
using Neo.Json;
using Neo.Network.P2P.Payloads;
using Neo.Persistence;
using Neo.SmartContract;
Expand Down
6 changes: 3 additions & 3 deletions neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Neo.ConsoleService;
using Neo.Cryptography.ECC;
using Neo.IO;
using Neo.IO.Json;
using Neo.Json;
using Neo.Ledger;
using Neo.Network.P2P;
using Neo.Network.P2P.Payloads;
Expand Down Expand Up @@ -80,7 +80,7 @@ public MainService() : base()
RegisterCommandHandler<string[], ECPoint[]>(str => str.Select(u => ECPoint.Parse(u.Trim(), ECCurve.Secp256r1)).ToArray());
RegisterCommandHandler<string, JObject>(str => JObject.Parse(str));
RegisterCommandHandler<string, decimal>(str => decimal.Parse(str, CultureInfo.InvariantCulture));
RegisterCommandHandler<JObject, JArray>(obj => (JArray)obj);
RegisterCommandHandler<JToken, JArray>(obj => (JArray)obj);

RegisterCommand(this);

Expand Down Expand Up @@ -565,7 +565,7 @@ private bool OnInvokeWithResult(UInt160 scriptHash, string operation, out StackI
{
foreach (var contractParameter in contractParameters)
{
parameters.Add(ContractParameter.FromJson(contractParameter));
parameters.Add(ContractParameter.FromJson((JObject)contractParameter));
}
}

Expand Down
2 changes: 1 addition & 1 deletion neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="3.3.1" />
<PackageReference Include="Neo" Version="3.3.1-CI01380" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions neo-gui/GUI/InvokeContractDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.IO.Json;
using Neo.Json;
using Neo.Network.P2P.Payloads;
using Neo.Properties;
using Neo.SmartContract;
Expand Down Expand Up @@ -112,7 +112,7 @@ private void button6_Click(object sender, EventArgs e)
private void button7_Click(object sender, EventArgs e)
{
if (openFileDialog2.ShowDialog() != DialogResult.OK) return;
abi = JObject.Parse(File.ReadAllText(openFileDialog2.FileName));
abi = (JObject)JToken.Parse(File.ReadAllText(openFileDialog2.FileName));
script_hash = UInt160.Parse(abi["hash"].AsString());
textBox8.Text = script_hash.ToString();
comboBox1.Items.Clear();
Expand All @@ -134,9 +134,9 @@ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (!(comboBox1.SelectedItem is string method)) return;
JArray functions = (JArray)abi["functions"];
JObject function = functions.First(p => p["name"].AsString() == method);
var function = functions.First(p => p["name"].AsString() == method);
JArray _params = (JArray)function["parameters"];
parameters = _params.Select(p => new ContractParameter(p["type"].TryGetEnum<ContractParameterType>())).ToArray();
parameters = _params.Select(p => new ContractParameter(p["type"].AsEnum<ContractParameterType>())).ToArray();
textBox9.Text = string.Join(", ", _params.Select(p => p["name"].AsString()));
button8.Enabled = parameters.Length > 0;
UpdateScript();
Expand Down