Skip to content

Commit 1703774

Browse files
chenzhitongJim8ycschuchardt88shargonNGDAdmin
authored
* .NET 9 * format * update * update * update * Update .editorconfig * Update Directory.Build.props * UT seems it changed * Update tests/Neo.VM.Tests/UT_ScriptBuilder.cs * fixes * resolve a conflict * fixed bug * Fixes * Update packages * fix ut --------- Co-authored-by: Jimmy <jinghui@wayne.edu> Co-authored-by: Christopher Schuchardt <cschuchardt88@gmail.com> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: NGD Admin <154295625+NGDAdmin@users.noreply.github.com>
1 parent 3878045 commit 1703774

File tree

58 files changed

+154
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+154
-125
lines changed

.devcontainer/devcontainer.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM mcr.microsoft.com/devcontainers/dotnet:8.0-jammy
1+
FROM mcr.microsoft.com/devcontainers/dotnet:9.0-jammy
22
# Install the libleveldb-dev package
33
RUN apt-get update && apt-get install -y libleveldb-dev

.github/workflows/docker.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66

77
env:
8-
DOTNET_VERSION: 8.0.x
8+
DOTNET_VERSION: 9.0.x
99
DIST_DIR: ./dist
1010

1111
jobs:
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build (neo-cli)
3030
run: |
3131
dotnet publish ./src/Neo.CLI \
32-
--framework net8.0 \
32+
--framework net9.0 \
3333
--configuration Release \
3434
--runtime linux-x64 \
3535
--self-contained true \
@@ -49,7 +49,7 @@ jobs:
4949
- name: Build (LevelDbStore)
5050
run: |
5151
dotnet build ./src/Plugins/LevelDBStore \
52-
--framework net8.0 \
52+
--framework net9.0 \
5353
--configuration Release \
5454
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \
5555
--verbosity normal \

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77

88
env:
9-
DOTNET_VERSION: 8.0.x
9+
DOTNET_VERSION: 9.0.x
1010

1111
jobs:
1212

@@ -69,7 +69,7 @@ jobs:
6969
run: |
7070
brew install leveldb
7171
dotnet build
72-
cp -vp /opt/homebrew/Cellar/leveldb/1.23_1/lib/libleveldb.dylib ./tests/Neo.Plugins.Storage.Tests/bin/Debug/net8.0/
72+
cp -vp /opt/homebrew/Cellar/leveldb/1.23_1/lib/libleveldb.dylib ./tests/Neo.Plugins.Storage.Tests/bin/Debug/net9.0/
7373
dotnet test --blame-hang --blame-crash --no-build
7474
7575
- name: Test (windows)

.github/workflows/nuget.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
# Define environment variables
99
env:
10-
DOTNET_VERSION: 8.0.x
10+
DOTNET_VERSION: 9.0.x
1111
CONFIGURATION: Release
1212

1313
jobs:

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
# Define environment variables
99
env:
10-
DOTNET_VERSION: 8.0.x
10+
DOTNET_VERSION: 9.0.x
1111
CONFIGURATION: Release
1212
DIST_PATH: /tmp/dist
1313
OUTPUT_PATH: /tmp/out
@@ -106,7 +106,7 @@ jobs:
106106
run: |
107107
dotnet publish ./src/Neo.CLI \
108108
--version-suffix ${{ matrix.runtime }} \
109-
--framework net8.0 \
109+
--framework net9.0 \
110110
--configuration ${{ env.CONFIGURATION }} \
111111
--runtime ${{ matrix.runtime }} \
112112
--self-contained true \
@@ -128,7 +128,7 @@ jobs:
128128
run: |
129129
dotnet build ./src/Plugins/LevelDBStore \
130130
--version-suffix ${{ matrix.runtime }} \
131-
--framework net8.0 \
131+
--framework net9.0 \
132132
--configuration ${{ env.CONFIGURATION }} \
133133
--output ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}/Plugins/LevelDBStore \
134134
--verbosity normal \

benchmarks/Neo.Benchmarks/Neo.Benchmarks.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<TargetFrameworks>net9.0</TargetFrameworks>
66
<RootNamespace>Neo</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
12+
<PackageReference Include="System.IO.Hashing" Version="9.0.0" />
1313
<ProjectReference Include="..\..\src\Neo\Neo.csproj" />
14-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
14+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

benchmarks/Neo.Extensions.Benchmarks/Neo.Extensions.Benchmarks.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>Neo.Extensions</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
1313
<ProjectReference Include="..\..\src\Neo.Extensions\Neo.Extensions.csproj" />
14-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
14+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1515
</ItemGroup>
1616

1717
</Project>

benchmarks/Neo.VM.Benchmarks/Neo.VM.Benchmarks.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<TargetFrameworks>net9.0</TargetFrameworks>
66
<RootNamespace>Neo.VM</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
1313
<ProjectReference Include="..\..\src\Neo.Extensions\Neo.Extensions.csproj" />
1414
<ProjectReference Include="..\..\src\Neo.Json\Neo.Json.csproj" />
1515
<ProjectReference Include="..\..\src\Neo.VM\Neo.VM.csproj" />
16-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
16+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1717
<ProjectReference Include="..\..\tests\Neo.VM.Tests\Neo.VM.Tests.csproj" />
1818
</ItemGroup>
1919

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.202",
3+
"version": "9.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

scripts/Neo.CLI/test-neo-cli.exp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set timeout 10
66
exp_internal true
77

88
# Start neo-cli
9-
spawn dotnet ./bin/Neo.CLI/net8.0/neo-cli.dll
9+
spawn dotnet ./bin/Neo.CLI/net9.0/neo-cli.dll
1010

1111
# Expect the main input prompt
1212
expect {

src/Neo.CLI/CLI/MainService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,13 @@ private void WriteBlocks(uint start, uint count, string path, bool writeStart)
521521
if (writeStart)
522522
{
523523
fs.Seek(sizeof(uint), SeekOrigin.Begin);
524-
fs.Read(buffer, 0, buffer.Length);
524+
fs.ReadExactly(buffer);
525525
start += BitConverter.ToUInt32(buffer, 0);
526526
fs.Seek(sizeof(uint), SeekOrigin.Begin);
527527
}
528528
else
529529
{
530-
fs.Read(buffer, 0, buffer.Length);
530+
fs.ReadExactly(buffer);
531531
start = BitConverter.ToUInt32(buffer, 0);
532532
fs.Seek(0, SeekOrigin.Begin);
533533
}

src/Neo.CLI/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS Build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS Build
22

33
# Run this from the repository root folder
44
COPY src .
55
COPY NuGet.Config /Neo.CLI
66

77
WORKDIR /Neo.CLI
8-
RUN dotnet restore && dotnet publish -f net8.0 -c Release -o /app
8+
RUN dotnet restore && dotnet publish -f net9.0 -c Release -o /app
99

10-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 AS Final
10+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0 AS Final
1111
RUN apt-get update && apt-get install -y \
1212
screen \
1313
libleveldb-dev \

src/Neo.CLI/Neo.CLI.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<AssemblyTitle>Neo.CLI</AssemblyTitle>
66
<AssemblyName>neo-cli</AssemblyName>
77
<OutputType>Exe</OutputType>
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
55
<PackageId>Neo.ConsoleService</PackageId>
66
<Nullable>enable</Nullable>
77
<OutputPath>../../bin/$(PackageId)</OutputPath>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
12-
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
12+
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0" />
1313
</ItemGroup>
1414

1515
</Project>

src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<VersionPrefix>0.3.0</VersionPrefix>
5-
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<PackageId>Neo.Cryptography.BLS12_381</PackageId>
99
<OutputPath>../../bin/$(PackageId)</OutputPath>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
13+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Neo.Extensions/Neo.Extensions.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<PackageId>Neo.Extensions</PackageId>
@@ -10,8 +10,8 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Akka" Version="1.5.26" />
14-
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
13+
<PackageReference Include="Akka" Version="1.5.31" />
14+
<PackageReference Include="System.IO.Hashing" Version="9.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Neo.GUI/GUI/ChangePasswordDialog.cs

+3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
// modifications are permitted.
1111

1212
using System;
13+
using System.ComponentModel;
1314
using System.Windows.Forms;
1415

1516
namespace Neo.GUI
1617
{
1718
internal partial class ChangePasswordDialog : Form
1819
{
20+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
1921
public string OldPassword
2022
{
2123
get
@@ -28,6 +30,7 @@ public string OldPassword
2830
}
2931
}
3032

33+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3134
public string NewPassword
3235
{
3336
get

src/Neo.GUI/GUI/CreateWalletDialog.cs

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// modifications are permitted.
1111

1212
using System;
13+
using System.ComponentModel;
1314
using System.Windows.Forms;
1415

1516
namespace Neo.GUI
@@ -21,6 +22,7 @@ public CreateWalletDialog()
2122
InitializeComponent();
2223
}
2324

25+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
2426
public string Password
2527
{
2628
get
@@ -34,6 +36,7 @@ public string Password
3436
}
3537
}
3638

39+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3740
public string WalletPath
3841
{
3942
get

src/Neo.GUI/GUI/ImportPrivateKeyDialog.cs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// modifications are permitted.
1111

1212
using System;
13+
using System.ComponentModel;
1314
using System.Windows.Forms;
1415

1516
namespace Neo.GUI
@@ -21,6 +22,7 @@ public ImportPrivateKeyDialog()
2122
InitializeComponent();
2223
}
2324

25+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
2426
public string[] WifStrings
2527
{
2628
get

src/Neo.GUI/GUI/OpenWalletDialog.cs

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// modifications are permitted.
1111

1212
using System;
13+
using System.ComponentModel;
1314
using System.Windows.Forms;
1415

1516
namespace Neo.GUI
@@ -21,6 +22,7 @@ public OpenWalletDialog()
2122
InitializeComponent();
2223
}
2324

25+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
2426
public string Password
2527
{
2628
get
@@ -33,6 +35,7 @@ public string Password
3335
}
3436
}
3537

38+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3639
public string WalletPath
3740
{
3841
get

src/Neo.GUI/GUI/TxOutListBox.cs

+3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ internal partial class TxOutListBox : UserControl
2323
{
2424
public event EventHandler ItemsChanged;
2525

26+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
2627
public AssetDescriptor Asset { get; set; }
2728

2829
public int ItemCount => listBox1.Items.Count;
2930

3031
public IEnumerable<TxOutListBoxItem> Items => listBox1.Items.OfType<TxOutListBoxItem>();
3132

33+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3234
public bool ReadOnly
3335
{
3436
get
@@ -42,6 +44,7 @@ public bool ReadOnly
4244
}
4345

4446
private UInt160 _script_hash = null;
47+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
4548
public UInt160 ScriptHash
4649
{
4750
get

src/Neo.GUI/Neo.GUI.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Copyright>2016-2024 The Neo Project</Copyright>
55
<AssemblyTitle>Neo.GUI</AssemblyTitle>
66
<OutputType>WinExe</OutputType>
7-
<TargetFramework>net8.0-windows</TargetFramework>
7+
<TargetFramework>net9.0-windows</TargetFramework>
88
<EnableWindowsTargeting>true</EnableWindowsTargeting>
99
<RootNamespace>Neo</RootNamespace>
1010
<UseWindowsForms>true</UseWindowsForms>

src/Neo.IO/Neo.IO.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<Nullable>enable</Nullable>
77
<PackageId>Neo.IO</PackageId>

0 commit comments

Comments
 (0)