Skip to content

Commit 963c557

Browse files
authored
Merge branch 'master' into update-native-contracts
2 parents 487f4ac + 3d0d27e commit 963c557

File tree

91 files changed

+8113
-305
lines changed

Some content is hidden

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

91 files changed

+8113
-305
lines changed

.devcontainer/devcontainer.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-7.0-jammy",
6+
"postCreateCommand": "dotnet restore && dotnet build",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-dotnettools.csdevkit"
11+
]
12+
}
13+
}
14+
}

.gitattributes

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text eol=lf
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
*.sln text eol=crlf
26+
#*.csproj text eol=crlf
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
*.jpg binary
44+
*.png binary
45+
*.gif binary
46+
*.ico binary
47+
48+
###############################################################################
49+
# diff behavior for common document formats
50+
#
51+
# Convert binary document formats to text before diffing them. This feature
52+
# is only available from the command line. Turn it on by uncommenting the
53+
# entries below.
54+
###############################################################################
55+
#*.doc diff=astextplain
56+
#*.DOC diff=astextplain
57+
#*.docx diff=astextplain
58+
#*.DOCX diff=astextplain
59+
#*.dot diff=astextplain
60+
#*.DOT diff=astextplain
61+
#*.pdf diff=astextplain
62+
#*.PDF diff=astextplain
63+
#*.rtf diff=astextplain
64+
#*.RTF diff=astextplain

.github/PULL_REQUEST_TEMPLATE.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Description
2+
3+
<!-- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
<!-- Please delete options that are not relevant. -->
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
**Test Configuration**:
24+
25+
26+
# Checklist:
27+
28+
- [ ] My code follows the style guidelines of this project
29+
- [ ] I have performed a self-review of my code
30+
- [ ] I have commented my code, particularly in hard-to-understand areas
31+
- [ ] I have made corresponding changes to the documentation
32+
- [ ] My changes generate no new warnings
33+
- [ ] I have added tests that prove my fix is effective or that my feature works
34+
- [ ] New and existing unit tests pass locally with my changes
35+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/main.yml

+45-37
Original file line numberDiff line numberDiff line change
@@ -36,44 +36,46 @@ jobs:
3636
uses: coverallsapp/github-action@master
3737
with:
3838
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
path-to-lcov: ./coverage/lcov.net7.0.info
3940

40-
PublishMyGet:
41-
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
42-
needs: Test
43-
runs-on: ubuntu-latest
44-
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v4
47-
with:
48-
fetch-depth: 0
49-
- name: Setup .NET
50-
uses: actions/setup-dotnet@v4
51-
with:
52-
dotnet-version: ${{ env.DOTNET_VERSION }}
53-
- name: Set Version
54-
run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV
55-
- name : Pack (Neo)
56-
run: |
57-
dotnet pack \
58-
--configuration Debug \
59-
--output ./out \
60-
--version-suffix ${{ env.VERSION_SUFFIX }}
61-
- name: Remove Unwanted Files
62-
working-directory: ./out
63-
run: |
64-
rm -v Neo.CLI*
65-
rm -v Neo.GUI*
66-
- name: Publish to MyGet
67-
working-directory: ./out
68-
run: |
69-
for filename in *.nupkg; do
70-
dotnet nuget push "${filename}" \
71-
--source https://www.myget.org/F/neo/api/v3/index.json \
72-
--api-key "${{ secrets.MYGET_TOKEN }}" \
73-
--disable-buffering \
74-
--no-service-endpoint;
75-
done;
76-
shell: bash
41+
# MyGet isn't working
42+
# PublishMyGet:
43+
# if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
44+
# needs: Test
45+
# runs-on: ubuntu-latest
46+
# steps:
47+
# - name: Checkout
48+
# uses: actions/checkout@v4
49+
# with:
50+
# fetch-depth: 0
51+
# - name: Setup .NET
52+
# uses: actions/setup-dotnet@v4
53+
# with:
54+
# dotnet-version: ${{ env.DOTNET_VERSION }}
55+
# - name: Set Version
56+
# run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV
57+
# - name : Pack (Neo)
58+
# run: |
59+
# dotnet pack \
60+
# --configuration Debug \
61+
# --output ./out \
62+
# --version-suffix ${{ env.VERSION_SUFFIX }}
63+
# - name: Remove Unwanted Files
64+
# working-directory: ./out
65+
# run: |
66+
# rm -v Neo.CLI*
67+
# rm -v Neo.GUI*
68+
# - name: Publish to MyGet
69+
# working-directory: ./out
70+
# run: |
71+
# for filename in *.nupkg; do
72+
# dotnet nuget push "${filename}" \
73+
# --source https://www.myget.org/F/neo/api/v3/index.json \
74+
# --api-key "${{ secrets.MYGET_TOKEN }}" \
75+
# --disable-buffering \
76+
# --no-service-endpoint;
77+
# done;
78+
# shell: bash
7779

7880
Release:
7981
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
@@ -129,6 +131,12 @@ jobs:
129131
dotnet pack ./src/Neo.ConsoleService \
130132
--configuration Release \
131133
--output ./out
134+
- name : Pack (Neo.Cryptography.BLS12_381)
135+
if: steps.check_tag.outputs.statusCode == '404'
136+
run: |
137+
dotnet pack ./src/Neo.Cryptography.BLS12_381 \
138+
--configuration Release \
139+
--output ./out
132140
- name: Publish to NuGet
133141
if: steps.check_tag.outputs.statusCode == '404'
134142
run: |

NuGet.Config

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<configuration>
33
<packageSources>
44
<clear />
5-
<add key="MyGet-neo" value="https://www.myget.org/F/neo/api/v3/index.json" />
65
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
76
</packageSources>
8-
</configuration>
7+
</configuration>

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@
8888
</a>
8989
</p>
9090

91-
91+
<p align="center">
92+
<a href="https://codespaces.new/neo-project/neo">
93+
<img src="https://github.com/codespaces/badge.svg" alt="Open in GitHub Codespaces.">
94+
</a>
95+
</p>
9296

9397

9498
## Table of Contents
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
6-
<RootNamespace>Neo</RootNamespace>
7-
<ImplicitUsings>enable</ImplicitUsings>
8-
<IsPackable>false</IsPackable>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<ProjectReference Include="..\..\src\Neo\Neo.csproj" />
13-
</ItemGroup>
14-
15-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<RootNamespace>Neo</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\Neo\Neo.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

global.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{
2-
"sdk": {
3-
"version": "7.0.404",
4-
"rollForward": "latestFeature",
5-
"allowPrerelease": false
6-
}
1+
{
2+
"sdk": {
3+
"version": "7.0.404",
4+
"rollForward": "latestFeature",
5+
"allowPrerelease": false
6+
}
77
}

neo.sln

+14
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.CLI", "src\Neo.CLI\Neo.
3232
EndProject
3333
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.ConsoleService.Tests", "tests\Neo.ConsoleService.Tests\Neo.ConsoleService.Tests.csproj", "{B40F8584-5AFB-452C-AEFA-009C80CC23A9}"
3434
EndProject
35+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Cryptography.BLS12_381", "src\Neo.Cryptography.BLS12_381\Neo.Cryptography.BLS12_381.csproj", "{D48C1FAB-3471-4CA0-8688-25E6F43F2C25}"
36+
EndProject
37+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Cryptography.BLS12_381.Tests", "tests\Neo.Cryptography.BLS12_381.Tests\Neo.Cryptography.BLS12_381.Tests.csproj", "{387CCF6C-9A26-43F6-A639-0A82E91E10D8}"
38+
EndProject
3539
Global
3640
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3741
Debug|Any CPU = Debug|Any CPU
@@ -86,6 +90,14 @@ Global
8690
{B40F8584-5AFB-452C-AEFA-009C80CC23A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
8791
{B40F8584-5AFB-452C-AEFA-009C80CC23A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
8892
{B40F8584-5AFB-452C-AEFA-009C80CC23A9}.Release|Any CPU.Build.0 = Release|Any CPU
93+
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94+
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25}.Debug|Any CPU.Build.0 = Debug|Any CPU
95+
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25}.Release|Any CPU.ActiveCfg = Release|Any CPU
96+
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25}.Release|Any CPU.Build.0 = Release|Any CPU
97+
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
98+
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
99+
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
100+
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Release|Any CPU.Build.0 = Release|Any CPU
89101
EndGlobalSection
90102
GlobalSection(SolutionProperties) = preSolution
91103
HideSolutionNode = FALSE
@@ -103,6 +115,8 @@ Global
103115
{02ABDE42-9880-43B4-B6F7-8D618602A277} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
104116
{BDFBE455-4C1F-4FC4-B5FC-1387B93A8687} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
105117
{B40F8584-5AFB-452C-AEFA-009C80CC23A9} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
118+
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
119+
{387CCF6C-9A26-43F6-A639-0A82E91E10D8} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
106120
EndGlobalSection
107121
GlobalSection(ExtensibilityGlobals) = postSolution
108122
SolutionGuid = {BCBA19D9-F868-4C6D-8061-A2B91E06E3EC}

src/Directory.Build.props

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<PropertyGroup>
55
<Copyright>2015-2023 The Neo Project</Copyright>
66
<VersionPrefix>3.6.2</VersionPrefix>
7+
<LangVersion>11.0</LangVersion>
78
<Authors>The Neo Project</Authors>
8-
<TargetFrameworks>net7.0</TargetFrameworks>
99
<PackageIcon>neo.png</PackageIcon>
1010
<PackageProjectUrl>https://github.com/neo-project/neo</PackageProjectUrl>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -22,4 +22,8 @@
2222
<None Include="../neo.png" Pack="true" Visible="false" PackagePath=""/>
2323
<None Include="../README.md" Pack="true" Visible="false" PackagePath=""/>
2424
</ItemGroup>
25+
26+
<ItemGroup>
27+
<Compile Include="$(MSBuildThisFileDirectory)IsExternalInit.cs" Visible="false" />
28+
</ItemGroup>
2529
</Project>
File renamed without changes.

src/Neo.CLI/CLI/MainService.Contracts.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void OnDeployCommand(string filePath, string? manifestPath = null, JObje
4949
ConsoleHelper.Info("Gas consumed: ", $"{new BigDecimal((BigInteger)tx.SystemFee, NativeContract.GAS.Decimals)}");
5050
ConsoleHelper.Info("Network fee: ", $"{new BigDecimal((BigInteger)tx.NetworkFee, NativeContract.GAS.Decimals)}");
5151
ConsoleHelper.Info("Total fee: ", $"{new BigDecimal((BigInteger)(tx.SystemFee + tx.NetworkFee), NativeContract.GAS.Decimals)} GAS");
52-
if (!ReadUserInput("Relay tx? (no|yes)").IsYes()) // Add this in case just want to get hash but not relay
52+
if (!ConsoleHelper.ReadUserInput("Relay tx? (no|yes)").IsYes()) // Add this in case just want to get hash but not relay
5353
{
5454
return;
5555
}
@@ -111,7 +111,7 @@ private void OnUpdateCommand(UInt160 scriptHash, string filePath, string manifes
111111
ConsoleHelper.Info("Gas consumed: ", $"{new BigDecimal((BigInteger)tx.SystemFee, NativeContract.GAS.Decimals)}");
112112
ConsoleHelper.Info("Network fee: ", $"{new BigDecimal((BigInteger)tx.NetworkFee, NativeContract.GAS.Decimals)}");
113113
ConsoleHelper.Info("Total fee: ", $"{new BigDecimal((BigInteger)(tx.SystemFee + tx.NetworkFee), NativeContract.GAS.Decimals)} GAS");
114-
if (!ReadUserInput("Relay tx? (no|yes)").IsYes()) // Add this in case just want to get hash but not relay
114+
if (!ConsoleHelper.ReadUserInput("Relay tx? (no|yes)").IsYes()) // Add this in case just want to get hash but not relay
115115
{
116116
return;
117117
}
@@ -173,7 +173,7 @@ private void OnInvokeCommand(UInt160 scriptHash, string operation, JArray? contr
173173
$"{new BigDecimal((BigInteger)tx.NetworkFee, NativeContract.GAS.Decimals)}\t",
174174
"Total fee: ",
175175
$"{new BigDecimal((BigInteger)(tx.SystemFee + tx.NetworkFee), NativeContract.GAS.Decimals)} GAS");
176-
if (!ReadUserInput("Relay tx? (no|yes)").IsYes())
176+
if (!ConsoleHelper.ReadUserInput("Relay tx? (no|yes)").IsYes())
177177
{
178178
return;
179179
}

src/Neo.CLI/CLI/MainService.NEP17.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private void OnTransferCommand(UInt160 tokenHash, UInt160 to, decimal amount, UI
6767
ConsoleHelper.Error(GetExceptionMessage(e));
6868
return;
6969
}
70-
if (!ReadUserInput("Relay tx(no|yes)").IsYes())
70+
if (!ConsoleHelper.ReadUserInput("Relay tx(no|yes)").IsYes())
7171
{
7272
return;
7373
}

0 commit comments

Comments
 (0)