Skip to content

Commit

Permalink
Merge branch 'master' into dbft3.0-doublespeakers
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho authored Apr 5, 2024
2 parents 2f793cf + 66573ed commit fc82203
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text eol=lf
*.json text eol=lf

###############################################################################
# Set default behavior for command prompt diff.
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
DOTNET_VERSION: 7.0.x
DOTNET_VERSION: 8.0.202

jobs:

Expand All @@ -26,20 +26,19 @@ jobs:
run: dotnet format --verify-no-changes --verbosity diagnostic
- name: Test
run: |
sudo apt-get --assume-yes install libleveldb-dev libsnappy-dev libc6-dev
find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
sudo apt-get --assume-yes install libleveldb-dev
EXCLUDED_TESTS=\"[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
dotnet test tests/Neo.Network.RPC.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Plugins.RpcServer.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Plugins.Storage.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Cryptography.MPTTrie.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Plugins.OracleService.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json /p:CoverletOutputFormat=lcov -p:Exclude=${EXCLUDED_TESTS}
dotnet test ./tests/Neo.Cryptography.MPTTrie.Tests /p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/' /p:Exclude=${EXCLUDED_TESTS}
dotnet test ./tests/Neo.Network.RPC.Tests /p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/' /p:MergeWith='${{ github.workspace }}/TestResults/coverage/coverage.net8.0.json' /p:Exclude=${EXCLUDED_TESTS}
dotnet test ./tests/Neo.Plugins.OracleService.Tests /p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/' /p:MergeWith='${{ github.workspace }}/TestResults/coverage/coverage.net8.0.json' /p:Exclude=${EXCLUDED_TESTS}
dotnet test ./tests/Neo.Plugins.RpcServer.Tests /p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/' /p:MergeWith='${{ github.workspace }}/TestResults/coverage/coverage.net8.0.json' /p:Exclude=${EXCLUDED_TESTS}
dotnet test ./tests/Neo.Plugins.Storage.Tests /p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/' /p:MergeWith='${{ github.workspace }}/TestResults/coverage/coverage.net8.0.json' /p:CoverletOutputFormat='lcov' /p:Exclude=${EXCLUDED_TESTS}
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: lcov
file: ${GITHUB_WORKSPACE}/coverage/lcov.info
file: ${{ github.workspace }}/TestResults/coverage/coverage.net8.0.info

Review:
needs: Test
Expand Down Expand Up @@ -81,7 +80,7 @@ jobs:
prerelease: ${{ contains(steps.get_version.outputs.version, '-') }}
- name: Setup .NET Core
if: steps.check_tag.outputs.statusCode == '404'
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish to NuGet
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>3.6.3</VersionPrefix>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>Neo.Plugins</RootNamespace>
<Authors>The Neo Project</Authors>
<PackageTags>NEO;Blockchain</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.404",
"version": "8.0.202",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion neo
Submodule neo updated 42 files
+3 −3 .devcontainer/devcontainer.json
+12 −10 .github/workflows/main.yml
+1 −1 benchmarks/Neo.Benchmarks/Neo.Benchmarks.csproj
+1 −1 benchmarks/Neo.VM.Benchmarks/Neo.VM.Benchmarks.csproj
+2 −2 global.json
+1 −1 src/Directory.Build.props
+1 −1 src/Neo.CLI/Neo.CLI.csproj
+1 −1 src/Neo.ConsoleService/Neo.ConsoleService.csproj
+1 −2 src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj
+2 −2 src/Neo.Extensions/Neo.Extensions.csproj
+1 −1 src/Neo.GUI/GUI/SigningDialog.cs
+1 −1 src/Neo.GUI/Neo.GUI.csproj
+1 −1 src/Neo.IO/Neo.IO.csproj
+2 −2 src/Neo.Json/Neo.Json.csproj
+1 −1 src/Neo.VM/Neo.VM.csproj
+74 −34 src/Neo/Cryptography/Crypto.cs
+1 −0 src/Neo/Cryptography/ECC/ECPoint.cs
+32 −0 src/Neo/IO/Caching/ECDsaCache.cs
+3 −3 src/Neo/Neo.csproj
+1 −1 src/Neo/SmartContract/ApplicationEngine.Contract.cs
+9 −4 src/Neo/SmartContract/ContractState.cs
+29 −0 src/Neo/SmartContract/IInteroperableVerifiable.cs
+5 −5 src/Neo/SmartContract/Native/ContractManagement.cs
+20 −9 src/Neo/SmartContract/Native/NativeContract.cs
+22 −1 src/Neo/SmartContract/Native/NeoToken.cs
+6 −1 src/Neo/SmartContract/Native/Role.cs
+22 −3 src/Neo/SmartContract/NefFile.cs
+18 −0 src/Neo/SmartContract/StorageItem.cs
+1 −1 src/Neo/Wallets/Helper.cs
+0 −17 tests/Directory.Build.props
+12 −1 tests/Neo.ConsoleService.Tests/Neo.ConsoleService.Tests.csproj
+12 −1 tests/Neo.Cryptography.BLS12_381.Tests/Neo.Cryptography.BLS12_381.Tests.csproj
+12 −1 tests/Neo.Json.UnitTests/Neo.Json.UnitTests.csproj
+2 −2 tests/Neo.UnitTests/Cryptography/ECC/UT_ECPoint.cs
+6 −6 tests/Neo.UnitTests/Cryptography/UT_Crypto.cs
+14 −3 tests/Neo.UnitTests/Neo.UnitTests.csproj
+3 −3 tests/Neo.UnitTests/SmartContract/Manifest/UT_ContractGroup.cs
+3 −0 tests/Neo.UnitTests/SmartContract/Native/UT_NeoToken.cs
+54 −42 tests/Neo.UnitTests/SmartContract/Native/UT_RoleManagement.cs
+18 −18 tests/Neo.UnitTests/SmartContract/UT_InteropService.NEO.cs
+1 −1 tests/Neo.UnitTests/SmartContract/UT_InteropService.cs
+12 −1 tests/Neo.VM.Tests/Neo.VM.Tests.csproj
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
22 changes: 11 additions & 11 deletions src/ApplicationLogs/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"PluginConfiguration": {
"Path": "ApplicationLogs_{0}",
"Network": 860833102,
"MaxStackSize": 65535,
"Debug": false
},
"Dependency": [
"RpcServer"
]
}
{
"PluginConfiguration": {
"Path": "ApplicationLogs_{0}",
"Network": 860833102,
"MaxStackSize": 65535,
"Debug": false
},
"Dependency": [
"RpcServer"
]
}
2 changes: 1 addition & 1 deletion src/OracleService/OracleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private static async Task SendContentAsync(Uri url, string content)
private async Task SendResponseSignatureAsync(ulong requestId, byte[] txSign, KeyPair keyPair)
{
var message = Neo.Helper.Concat(keyPair.PublicKey.ToArray(), BitConverter.GetBytes(requestId), txSign);
var sign = Crypto.Sign(message, keyPair.PrivateKey, keyPair.PublicKey.EncodePoint(false)[1..]);
var sign = Crypto.Sign(message, keyPair.PrivateKey);
var param = "\"" + Convert.ToBase64String(keyPair.PublicKey.ToArray()) + "\", " + requestId + ", \"" + Convert.ToBase64String(txSign) + "\",\"" + Convert.ToBase64String(sign) + "\"";
var content = "{\"id\":" + Interlocked.Increment(ref counter) + ",\"jsonrpc\":\"2.0\",\"method\":\"submitoracleresponse\",\"params\":[" + param + "]}";

Expand Down
2 changes: 1 addition & 1 deletion src/RocksDBStore/RocksDBStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="rocksdb" Version="8.8.1.43919" />
<PackageReference Include="rocksdb" Version="8.11.3.46984" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/SQLiteWallet/SQLiteWallet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
</ItemGroup>

</Project>
15 changes: 0 additions & 15 deletions tests/Directory.Build.props

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>Neo.Cryptography.MPT.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MPTTrie\MPTTrie.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
</ItemGroup>
</Project>
14 changes: 13 additions & 1 deletion tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>Neo.Network.RPC.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -18,4 +25,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>OracleService.Tests</PackageId>
<RootNamespace>Neo.Plugins</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Akka.TestKit" Version="1.5.14" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="1.5.14" />
<PackageReference Include="Akka.TestKit" Version="1.5.18" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="1.5.18" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\OracleService\OracleService.csproj" />
Expand All @@ -21,4 +28,10 @@
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>Neo.Plugins.RpcServer.Tests</RootNamespace>
<AssemblyName>Neo.Plugins.RpcServer.Tests</AssemblyName>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\RpcServer\RpcServer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>Neo.Plugins.Storage.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\LevelDBStore\LevelDBStore.csproj" />
<ProjectReference Include="..\..\src\RocksDBStore\RocksDBStore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
</ItemGroup>
</Project>

0 comments on commit fc82203

Please sign in to comment.