diff --git a/.editorconfig b/.editorconfig index 5acd074d2..269a7e444 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,12 +6,297 @@ # dotnet tool update -g dotnet-format # remember to have: git config --global core.autocrlf false #(which is usually default) +# top-most EditorConfig file root = true -# Every file - +# Don't use tabs for indentation. [*] +indent_style = space insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 end_of_line = lf + +# (Please don't specify an indent_size here; that has too many unintended consequences.) +spelling_exclusion_path = SpellingExclusions.dic + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +# XML project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# XML config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +# Powershell files +[*.ps1] +indent_size = 2 + +# Shell script files +[*.sh] +end_of_line = lf +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Member can be made 'readonly' +csharp_style_prefer_readonly_struct_member = true +dotnet_diagnostic.IDE0251.severity = warning +dotnet_diagnostic.IDE0044.severity = warning + +dotnet_diagnostic.CS1591.severity = silent + +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = false +dotnet_separate_import_directive_groups = false +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:refactoring +dotnet_style_qualification_for_property = false:refactoring +dotnet_style_qualification_for_method = false:refactoring +dotnet_style_qualification_for_event = false:refactoring + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion + +# Whitespace options +dotnet_style_allow_multiple_blank_lines_experimental = false + +# Non-private static fields are PascalCase +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style + +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static + +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case + +# Non-private readonly fields are PascalCase +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style + +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly + +dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case + +# Constants are PascalCase +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style + +dotnet_naming_symbols.constants.applicable_kinds = field, local +dotnet_naming_symbols.constants.required_modifiers = const + +dotnet_naming_style.constant_style.capitalization = pascal_case + +# Static fields are camelCase and start with s_ +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style + +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static + +dotnet_naming_style.static_field_style.capitalization = camel_case +dotnet_naming_style.static_field_style.required_prefix = s_ + +# Instance fields are camelCase and start with _ +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style + +dotnet_naming_symbols.instance_fields.applicable_kinds = field + +dotnet_naming_style.instance_field_style.capitalization = camel_case +dotnet_naming_style.instance_field_style.required_prefix = _ + +# Locals and parameters are camelCase +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style + +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +# Local functions are PascalCase +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function + +dotnet_naming_style.local_function_style.capitalization = pascal_case + +# By default, name items with PascalCase +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.all_members.applicable_kinds = * + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +file_header_template = Copyright (C) 2015-2024 The Neo Project.\n\n{fileName} file belongs to the neo project and is free\nsoftware distributed under the MIT software license, see the\naccompanying file LICENSE in the main directory of the\nrepository or http://www.opensource.org/licenses/mit-license.php\nfor more details.\n\nRedistribution and use in source and binary forms with or without\nmodifications are permitted. + +# Require file header +dotnet_diagnostic.IDE0073.severity = error + +# RS0016: Only enable if API files are present +dotnet_public_api_analyzer.require_api_files = true + +# IDE0055: Fix formatting +# Workaround for https://github.com/dotnet/roslyn/issues/70570 +dotnet_diagnostic.IDE0055.severity = warning + +# CSharp code style settings: +[*.cs] +# Newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left + +# Whitespace options +csharp_style_allow_embedded_statements_on_same_line_experimental = false +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false + +# Prefer "var" everywhere +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +# Prefer method-like constructs to have a block body +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none + +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Blocks are allowed +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +# IDE0060: Remove unused parameter +dotnet_diagnostic.IDE0060.severity = none + +[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures,VisualStudio}/**/*.{cs,vb}] + +# IDE0011: Add braces +csharp_prefer_braces = when_multiline:warning +# NOTE: We need the below severity entry for Add Braces due to https://github.com/dotnet/roslyn/issues/44201 +dotnet_diagnostic.IDE0011.severity = warning + +# IDE0040: Add accessibility modifiers +dotnet_diagnostic.IDE0040.severity = warning + +# IDE0052: Remove unread private member +dotnet_diagnostic.IDE0052.severity = warning + +# IDE0059: Unnecessary assignment to a value +dotnet_diagnostic.IDE0059.severity = warning + +# CA1012: Abstract types should not have public constructors +dotnet_diagnostic.CA1012.severity = warning + +# CA1822: Make member static +dotnet_diagnostic.CA1822.severity = warning + +# Prefer "var" everywhere +dotnet_diagnostic.IDE0007.severity = warning +csharp_style_var_for_built_in_types = true:warning +csharp_style_var_when_type_is_apparent = true:warning +csharp_style_var_elsewhere = true:warning + +# csharp_style_allow_embedded_statements_on_same_line_experimental +dotnet_diagnostic.IDE2001.severity = warning + +# csharp_style_allow_blank_lines_between_consecutive_braces_experimental +dotnet_diagnostic.IDE2002.severity = warning + +# csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental +dotnet_diagnostic.IDE2004.severity = warning + +# csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental +dotnet_diagnostic.IDE2005.severity = warning + +# csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental +dotnet_diagnostic.IDE2006.severity = warning + +[src/{VisualStudio}/**/*.{cs,vb}] +# CA1822: Make member static +# There is a risk of accidentally breaking an internal API that partners rely on though IVT. +dotnet_code_quality.CA1822.api_surface = private \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..0c37abbc2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,64 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text eol=lf + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +*.sln text eol=crlf +#*.csproj text eol=crlf +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +*.jpg binary +*.png binary +*.gif binary +*.ico binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 396a66ba2..4712a2a84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: id: get_version run: | sudo apt install xmlstarlet - find src -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo + find -maxdepth 1 -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo - name: Check tag id: check_tag run: curl -s -I ${{ format('https://github.com/{0}/releases/tag/{1}', github.repository, steps.get_version.outputs.version) }} | head -n 1 | cut -d$' ' -f2 | xargs printf "::set-output name=statusCode::%s" | xargs echo diff --git a/.gitignore b/.gitignore index 29c559f83..3e759b75b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,330 +1,330 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..4c77ef351 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,17 @@ + + + + 3.6.3 + net7.0 + Neo.Plugins + The Neo Project + NEO;Blockchain + https://github.com/neo-project/neo-modules + MIT + git + https://github.com/neo-project/neo-modules.git + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 93691646b..914d5c70d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2018 The Neo Project - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2018 The Neo Project + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NuGet.Config b/NuGet.Config index 5b8642861..897e874c9 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,8 +1,9 @@ - - - - - - - - \ No newline at end of file + + + + + + + + + diff --git a/README.md b/README.md index 0919ba2fd..d8262f759 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,6 @@

- - Current TravisCI build status. - License @@ -62,12 +59,12 @@ You can also use `RocksDBStore` in the NEO system by modifying the default stora ### RpcServer Plugin for hosting a RpcServer on the neo-node, being able to disable specific calls. -### RpcNep17Tracker -Plugin that enables NEP17 tracking using LevelDB. +### TokensTracker +Plugin that enables NEP11 and NEP17 tracking using LevelDB. This module works in conjunction with RpcServer, otherwise, just local storage (on leveldb) would be created. ## C# SDK ### RpcClient The RpcClient Project is an individual SDK that is used to interact with NEO blockchain through NEO RPC methods for development using. The main functions include RPC calling, Transaction making, Contract deployment & calling, and Asset transfering. -It needs a NEO node with the `RpcServer` plugin as a provider. And the provider needs more plugins like `RpcNep17Tracker` and `ApplicationLogs` if you want to call RPC methods supplied by the plugins. +It needs a NEO node with the `RpcServer` plugin as a provider. And the provider needs more plugins like `TokensTracker` and `ApplicationLogs` if you want to call RPC methods supplied by the plugins. diff --git a/SpellingExclusions.dic b/SpellingExclusions.dic new file mode 100644 index 000000000..e69de29bb diff --git a/deps/.gitkeep b/deps/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/global.json b/global.json new file mode 100644 index 000000000..423c2e226 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "7.0.404", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} diff --git a/src/ApplicationLogs/ApplicationLogs.csproj b/src/ApplicationLogs/ApplicationLogs.csproj index c2b42fec8..61ce39219 100644 --- a/src/ApplicationLogs/ApplicationLogs.csproj +++ b/src/ApplicationLogs/ApplicationLogs.csproj @@ -1,12 +1,11 @@ - Neo.Plugins.ApplicationLogs - Neo.Plugins - - + + false + runtime + - - + \ No newline at end of file diff --git a/src/ApplicationLogs/LogReader.cs b/src/ApplicationLogs/LogReader.cs index 71a9253f0..5c42d6a0d 100644 --- a/src/ApplicationLogs/LogReader.cs +++ b/src/ApplicationLogs/LogReader.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.ApplicationLogs is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// LogReader.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -90,14 +91,19 @@ public static JObject TxLogToJson(Blockchain.ApplicationExecuted appExec) trigger["vmstate"] = appExec.VMState; trigger["exception"] = GetExceptionMessage(appExec.Exception); trigger["gasconsumed"] = appExec.GasConsumed.ToString(); - try + var stack = new JArray(); + foreach (var item in appExec.Stack) { - trigger["stack"] = appExec.Stack.Select(q => q.ToJson(Settings.Default.MaxStackSize)).ToArray(); - } - catch (Exception ex) - { - trigger["exception"] = ex.Message; + try + { + stack.Add(item.ToJson(Settings.Default.MaxStackSize)); + } + catch (Exception ex) + { + stack.Add("error: " + ex.Message); + } } + trigger["stack"] = stack; trigger["notifications"] = appExec.Notifications.Select(q => { JObject notification = new JObject(); @@ -133,14 +139,19 @@ public static JObject BlockLogToJson(Block block, IReadOnlyList q.ToJson(Settings.Default.MaxStackSize)).ToArray(); - } - catch (Exception ex) - { - trigger["exception"] = ex.Message; + try + { + stack.Add(item.ToJson(Settings.Default.MaxStackSize)); + } + catch (Exception ex) + { + stack.Add("error: " + ex.Message); + } } + trigger["stack"] = stack; trigger["notifications"] = appExec.Notifications.Select(q => { JObject notification = new JObject(); diff --git a/src/ApplicationLogs/Settings.cs b/src/ApplicationLogs/Settings.cs index 3e1c3ef79..4a32a117a 100644 --- a/src/ApplicationLogs/Settings.cs +++ b/src/ApplicationLogs/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.ApplicationLogs is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Consensus/ConsensusContext.Get.cs b/src/DBFTPlugin/Consensus/ConsensusContext.Get.cs index d9242f05c..b54b6eca1 100644 --- a/src/DBFTPlugin/Consensus/ConsensusContext.Get.cs +++ b/src/DBFTPlugin/Consensus/ConsensusContext.Get.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusContext.Get.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs b/src/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs index 80ddc0a94..a761cbafb 100644 --- a/src/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs +++ b/src/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusContext.MakePayload.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Consensus/ConsensusContext.cs b/src/DBFTPlugin/Consensus/ConsensusContext.cs index ebf406b4c..a224e31d2 100644 --- a/src/DBFTPlugin/Consensus/ConsensusContext.cs +++ b/src/DBFTPlugin/Consensus/ConsensusContext.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusContext.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Consensus/ConsensusService.Check.cs b/src/DBFTPlugin/Consensus/ConsensusService.Check.cs index f6813f101..3b15bcd8f 100644 --- a/src/DBFTPlugin/Consensus/ConsensusService.Check.cs +++ b/src/DBFTPlugin/Consensus/ConsensusService.Check.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusService.Check.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Consensus/ConsensusService.OnMessage.cs b/src/DBFTPlugin/Consensus/ConsensusService.OnMessage.cs index df358fdc4..ecc31f7ba 100644 --- a/src/DBFTPlugin/Consensus/ConsensusService.OnMessage.cs +++ b/src/DBFTPlugin/Consensus/ConsensusService.OnMessage.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusService.OnMessage.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -127,13 +128,26 @@ private void OnPrepareRequestReceived(ExtensiblePayload payload, PrepareRequest { if (mempoolVerified.TryGetValue(hash, out Transaction tx)) { + if (NativeContract.Ledger.ContainsConflictHash(context.Snapshot, hash, tx.Signers.Select(s => s.Account), neoSystem.Settings.MaxTraceableBlocks)) + { + Log($"Invalid request: transaction has on-chain conflict", LogLevel.Warning); + return; + } + if (!AddTransaction(tx, false)) return; } else { if (neoSystem.MemPool.TryGetValue(hash, out tx)) + { + if (NativeContract.Ledger.ContainsConflictHash(context.Snapshot, hash, tx.Signers.Select(s => s.Account), neoSystem.Settings.MaxTraceableBlocks)) + { + Log($"Invalid request: transaction has on-chain conflict", LogLevel.Warning); + return; + } unverified.Add(tx); + } } } foreach (Transaction tx in unverified) diff --git a/src/DBFTPlugin/Consensus/ConsensusService.cs b/src/DBFTPlugin/Consensus/ConsensusService.cs index e50ab42d2..bd32c3ce5 100644 --- a/src/DBFTPlugin/Consensus/ConsensusService.cs +++ b/src/DBFTPlugin/Consensus/ConsensusService.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusService.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -45,7 +46,7 @@ private class Timer { public uint Height; public byte ViewNumber; } /// This will be cleared every block (so it will not grow out of control, but is used to prevent repeatedly /// responding to the same message. /// - private readonly HashSet knownHashes = new HashSet(); + private readonly HashSet knownHashes = new(); ///

/// This variable is only true during OnRecoveryMessageReceived /// @@ -257,7 +258,38 @@ private bool AddTransaction(Transaction tx, bool verify) { if (verify) { - VerifyResult result = tx.Verify(neoSystem.Settings, context.Snapshot, context.VerificationContext); + // At this step we're sure that there's no on-chain transaction that conflicts with + // the provided tx because of the previous Blockchain's OnReceive check. Thus, we only + // need to check that current context doesn't contain conflicting transactions. + VerifyResult result; + + // Firstly, check whether tx has Conlicts attribute with the hash of one of the context's transactions. + foreach (var h in tx.GetAttributes().Select(attr => attr.Hash)) + { + if (context.TransactionHashes.Contains(h)) + { + result = VerifyResult.HasConflicts; + Log($"Rejected tx: {tx.Hash}, {result}{Environment.NewLine}{tx.ToArray().ToHexString()}", LogLevel.Warning); + RequestChangeView(ChangeViewReason.TxInvalid); + return false; + } + } + // After that, check whether context's transactions have Conflicts attribute with tx's hash. + foreach (var pooledTx in context.Transactions.Values) + { + if (pooledTx.GetAttributes().Select(attr => attr.Hash).Contains(tx.Hash)) + { + result = VerifyResult.HasConflicts; + Log($"Rejected tx: {tx.Hash}, {result}{Environment.NewLine}{tx.ToArray().ToHexString()}", LogLevel.Warning); + RequestChangeView(ChangeViewReason.TxInvalid); + return false; + } + } + + // We've ensured that there's no conlicting transactions in the context, thus, can safely provide an empty conflicting list + // for futher verification. + var conflictingTxs = new List(); + result = tx.Verify(neoSystem.Settings, context.Snapshot, context.VerificationContext, conflictingTxs); if (result != VerifyResult.Succeed) { Log($"Rejected tx: {tx.Hash}, {result}{Environment.NewLine}{tx.ToArray().ToHexString()}", LogLevel.Warning); diff --git a/src/DBFTPlugin/DBFTPlugin.cs b/src/DBFTPlugin/DBFTPlugin.cs index 1a332fb9b..7fa29ce0d 100644 --- a/src/DBFTPlugin/DBFTPlugin.cs +++ b/src/DBFTPlugin/DBFTPlugin.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// DBFTPlugin.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/DBFTPlugin.csproj b/src/DBFTPlugin/DBFTPlugin.csproj index f169d5eba..74daed38a 100644 --- a/src/DBFTPlugin/DBFTPlugin.csproj +++ b/src/DBFTPlugin/DBFTPlugin.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/DBFTPlugin/Messages/ChangeView.cs b/src/DBFTPlugin/Messages/ChangeView.cs index 54dca646c..e7be40075 100644 --- a/src/DBFTPlugin/Messages/ChangeView.cs +++ b/src/DBFTPlugin/Messages/ChangeView.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ChangeView.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/Commit.cs b/src/DBFTPlugin/Messages/Commit.cs index 6a8fa988d..6e8fe93d8 100644 --- a/src/DBFTPlugin/Messages/Commit.cs +++ b/src/DBFTPlugin/Messages/Commit.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Commit.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/ConsensusMessage.cs b/src/DBFTPlugin/Messages/ConsensusMessage.cs index 370e7da86..93e3c7d6f 100644 --- a/src/DBFTPlugin/Messages/ConsensusMessage.cs +++ b/src/DBFTPlugin/Messages/ConsensusMessage.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusMessage.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/PrepareRequest.cs b/src/DBFTPlugin/Messages/PrepareRequest.cs index 2a5516465..2bce609f7 100644 --- a/src/DBFTPlugin/Messages/PrepareRequest.cs +++ b/src/DBFTPlugin/Messages/PrepareRequest.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// PrepareRequest.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/PrepareResponse.cs b/src/DBFTPlugin/Messages/PrepareResponse.cs index 781c78ece..7510ff99b 100644 --- a/src/DBFTPlugin/Messages/PrepareResponse.cs +++ b/src/DBFTPlugin/Messages/PrepareResponse.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// PrepareResponse.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.ChangeViewPayloadCompact.cs b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.ChangeViewPayloadCompact.cs index 810624c1a..6a7734e56 100644 --- a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.ChangeViewPayloadCompact.cs +++ b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.ChangeViewPayloadCompact.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RecoveryMessage.ChangeViewPayloadCompact.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.CommitPayloadCompact.cs b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.CommitPayloadCompact.cs index fd2e01b47..2dfa16597 100644 --- a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.CommitPayloadCompact.cs +++ b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.CommitPayloadCompact.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RecoveryMessage.CommitPayloadCompact.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.PreparationPayloadCompact.cs b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.PreparationPayloadCompact.cs index d252b7eb8..80b2a48b6 100644 --- a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.PreparationPayloadCompact.cs +++ b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.PreparationPayloadCompact.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RecoveryMessage.PreparationPayloadCompact.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.cs b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.cs index eaae0c688..fc688d6a1 100644 --- a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.cs +++ b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryMessage.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RecoveryMessage.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryRequest.cs b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryRequest.cs index d1c5ce7a2..84cd381ad 100644 --- a/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryRequest.cs +++ b/src/DBFTPlugin/Messages/RecoveryMessage/RecoveryRequest.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RecoveryRequest.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Settings.cs b/src/DBFTPlugin/Settings.cs index c19921ff1..d0ecbb63f 100644 --- a/src/DBFTPlugin/Settings.cs +++ b/src/DBFTPlugin/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Types/ChangeViewReason.cs b/src/DBFTPlugin/Types/ChangeViewReason.cs index 6c62388dc..4c0a3c110 100644 --- a/src/DBFTPlugin/Types/ChangeViewReason.cs +++ b/src/DBFTPlugin/Types/ChangeViewReason.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ChangeViewReason.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/DBFTPlugin/Types/ConsensusMessageType.cs b/src/DBFTPlugin/Types/ConsensusMessageType.cs index 00fdde096..f325133f0 100644 --- a/src/DBFTPlugin/Types/ConsensusMessageType.cs +++ b/src/DBFTPlugin/Types/ConsensusMessageType.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Consensus.DBFT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ConsensusMessageType.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/Directory.Build.props b/src/Directory.Build.props index edf759437..b173f4db2 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,27 +1,10 @@ - - - 3.5.0 - net7.0 - Neo.Plugins - The Neo Project - NEO;Blockchain - https://github.com/neo-project/neo-modules - MIT - git - https://github.com/neo-project/neo-modules.git - - - - - PreserveNewest - PreserveNewest - - - - - - - - + + + + PreserveNewest + PreserveNewest + + + \ No newline at end of file diff --git a/src/LevelDBStore/IO/Data/LevelDB/DB.cs b/src/LevelDBStore/IO/Data/LevelDB/DB.cs index e53b0c0e7..60e0e24e5 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/DB.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/DB.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// DB.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/Helper.cs b/src/LevelDBStore/IO/Data/LevelDB/Helper.cs index 7fb14d9cf..2ac3a0005 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Helper.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Helper.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Helper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/Iterator.cs b/src/LevelDBStore/IO/Data/LevelDB/Iterator.cs index 79731de7c..6c025380f 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Iterator.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Iterator.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Iterator.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/LevelDBException.cs b/src/LevelDBStore/IO/Data/LevelDB/LevelDBException.cs index 86dfbadc0..c9cca4207 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/LevelDBException.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/LevelDBException.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// LevelDBException.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/Native.cs b/src/LevelDBStore/IO/Data/LevelDB/Native.cs index 8f1a8d7d0..acf8fa82b 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Native.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Native.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Native.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/Options.cs b/src/LevelDBStore/IO/Data/LevelDB/Options.cs index 4c3d29c5f..989987eee 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Options.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Options.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Options.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/ReadOptions.cs b/src/LevelDBStore/IO/Data/LevelDB/ReadOptions.cs index 03c6053c8..727ae9f02 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/ReadOptions.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/ReadOptions.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ReadOptions.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/Snapshot.cs b/src/LevelDBStore/IO/Data/LevelDB/Snapshot.cs index 81c9f54b5..ed5d9fb55 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Snapshot.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Snapshot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Snapshot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/WriteBatch.cs b/src/LevelDBStore/IO/Data/LevelDB/WriteBatch.cs index 06491f87b..ad82dad45 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/WriteBatch.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/WriteBatch.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// WriteBatch.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/IO/Data/LevelDB/WriteOptions.cs b/src/LevelDBStore/IO/Data/LevelDB/WriteOptions.cs index b0e2390ef..48915ba48 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/WriteOptions.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/WriteOptions.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// WriteOptions.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/Plugins/Storage/LevelDBStore.cs b/src/LevelDBStore/Plugins/Storage/LevelDBStore.cs index 95cbda05d..9c676e8a7 100644 --- a/src/LevelDBStore/Plugins/Storage/LevelDBStore.cs +++ b/src/LevelDBStore/Plugins/Storage/LevelDBStore.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// LevelDBStore.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/Plugins/Storage/Snapshot.cs b/src/LevelDBStore/Plugins/Storage/Snapshot.cs index 07fce9f20..8da1c6334 100644 --- a/src/LevelDBStore/Plugins/Storage/Snapshot.cs +++ b/src/LevelDBStore/Plugins/Storage/Snapshot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Snapshot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/LevelDBStore/Plugins/Storage/Store.cs b/src/LevelDBStore/Plugins/Storage/Store.cs index 16f136430..809858dda 100644 --- a/src/LevelDBStore/Plugins/Storage/Store.cs +++ b/src/LevelDBStore/Plugins/Storage/Store.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.LevelDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Store.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Cache.cs b/src/MPTTrie/Cryptography/MPTTrie/Cache.cs index 732818970..d8baef852 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Cache.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Cache.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Cache.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Helper.cs b/src/MPTTrie/Cryptography/MPTTrie/Helper.cs index fb9406d32..5c93afd65 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Helper.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Helper.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Helper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Node.Branch.cs b/src/MPTTrie/Cryptography/MPTTrie/Node.Branch.cs index e6e9d863e..c8ff04dfc 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Node.Branch.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Node.Branch.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Node.Branch.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Node.Extension.cs b/src/MPTTrie/Cryptography/MPTTrie/Node.Extension.cs index 78f73aa3b..510db4925 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Node.Extension.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Node.Extension.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Node.Extension.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Node.Hash.cs b/src/MPTTrie/Cryptography/MPTTrie/Node.Hash.cs index fac66dde3..e0190dd14 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Node.Hash.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Node.Hash.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Node.Hash.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Node.Leaf.cs b/src/MPTTrie/Cryptography/MPTTrie/Node.Leaf.cs index a48835b29..024a07f8c 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Node.Leaf.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Node.Leaf.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Node.Leaf.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Node.cs b/src/MPTTrie/Cryptography/MPTTrie/Node.cs index 8ac4c1dfc..1795ec7f0 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Node.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Node.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Node.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/NodeType.cs b/src/MPTTrie/Cryptography/MPTTrie/NodeType.cs index ba3948430..9c676ff2f 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/NodeType.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/NodeType.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// NodeType.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.Delete.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.Delete.cs index ba364bbf5..2041100a1 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.Delete.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.Delete.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.Delete.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.Find.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.Find.cs index 1d3ad77c4..b3922e8ce 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.Find.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.Find.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.Find.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.Get.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.Get.cs index f68fda763..da69407ac 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.Get.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.Get.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.Get.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.Proof.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.Proof.cs index 066ab6573..e0925452e 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.Proof.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.Proof.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.Proof.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.Put.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.Put.cs index 37076e370..5de6f3fc8 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.Put.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.Put.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.Put.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/Cryptography/MPTTrie/Trie.cs b/src/MPTTrie/Cryptography/MPTTrie/Trie.cs index 4f33f13d4..36a3528ab 100644 --- a/src/MPTTrie/Cryptography/MPTTrie/Trie.cs +++ b/src/MPTTrie/Cryptography/MPTTrie/Trie.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Trie.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/IO/ByteArrayEqualityComparer.cs b/src/MPTTrie/IO/ByteArrayEqualityComparer.cs index 5f3400710..590306d56 100644 --- a/src/MPTTrie/IO/ByteArrayEqualityComparer.cs +++ b/src/MPTTrie/IO/ByteArrayEqualityComparer.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Cryptography.MPT is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ByteArrayEqualityComparer.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/MPTTrie/MPTTrie.csproj b/src/MPTTrie/MPTTrie.csproj index 89d987a31..ed047488f 100644 --- a/src/MPTTrie/MPTTrie.csproj +++ b/src/MPTTrie/MPTTrie.csproj @@ -1,9 +1,9 @@ - - - - Neo.Cryptography.MPT - Neo.Cryptography - true - - - + + + + Neo.Cryptography.MPT + Neo.Cryptography + true + + + diff --git a/src/OracleService/Helper.cs b/src/OracleService/Helper.cs index 608dfa73d..35611e869 100644 --- a/src/OracleService/Helper.cs +++ b/src/OracleService/Helper.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Helper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/OracleService/OracleService.cs b/src/OracleService/OracleService.cs index 1fb66ac61..8959b028c 100644 --- a/src/OracleService/OracleService.cs +++ b/src/OracleService/OracleService.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// OracleService.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/OracleService/OracleService.csproj b/src/OracleService/OracleService.csproj index 5afa10cbe..1e4f29e8a 100644 --- a/src/OracleService/OracleService.csproj +++ b/src/OracleService/OracleService.csproj @@ -1,16 +1,15 @@ - - - Neo.Plugins.OracleService - - - - - - - - - - - - + + Neo.Plugins.OracleService + + + + + + + + false + runtime + + + \ No newline at end of file diff --git a/src/OracleService/Protocols/IOracleProtocol.cs b/src/OracleService/Protocols/IOracleProtocol.cs index 27b88694c..3532a6945 100644 --- a/src/OracleService/Protocols/IOracleProtocol.cs +++ b/src/OracleService/Protocols/IOracleProtocol.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// IOracleProtocol.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/OracleService/Protocols/OracleHttpsProtocol.cs b/src/OracleService/Protocols/OracleHttpsProtocol.cs index 485296bf8..29d3eedc4 100644 --- a/src/OracleService/Protocols/OracleHttpsProtocol.cs +++ b/src/OracleService/Protocols/OracleHttpsProtocol.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// OracleHttpsProtocol.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/OracleService/Protocols/OracleNeoFSProtocol.cs b/src/OracleService/Protocols/OracleNeoFSProtocol.cs index 4f5edc275..bd068c855 100644 --- a/src/OracleService/Protocols/OracleNeoFSProtocol.cs +++ b/src/OracleService/Protocols/OracleNeoFSProtocol.cs @@ -1,25 +1,26 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// OracleNeoFSProtocol.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without // modifications are permitted. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Web; using Neo.Cryptography.ECC; using Neo.FileStorage.API.Client; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Refs; using Neo.Network.P2P.Payloads; using Neo.Wallets; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Web; using Object = Neo.FileStorage.API.Object.Object; using Range = Neo.FileStorage.API.Object.Range; diff --git a/src/OracleService/Settings.cs b/src/OracleService/Settings.cs index 4353f9755..c66010cb5 100644 --- a/src/OracleService/Settings.cs +++ b/src/OracleService/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.OracleService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RocksDBStore/Plugins/Storage/Options.cs b/src/RocksDBStore/Plugins/Storage/Options.cs index 765e0947b..26dd6c63a 100644 --- a/src/RocksDBStore/Plugins/Storage/Options.cs +++ b/src/RocksDBStore/Plugins/Storage/Options.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.RocksDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Options.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RocksDBStore/Plugins/Storage/RocksDBStore.cs b/src/RocksDBStore/Plugins/Storage/RocksDBStore.cs index 2a5e00ef7..079a012f6 100644 --- a/src/RocksDBStore/Plugins/Storage/RocksDBStore.cs +++ b/src/RocksDBStore/Plugins/Storage/RocksDBStore.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.RocksDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RocksDBStore.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RocksDBStore/Plugins/Storage/Snapshot.cs b/src/RocksDBStore/Plugins/Storage/Snapshot.cs index 26d487baf..437a5f5d2 100644 --- a/src/RocksDBStore/Plugins/Storage/Snapshot.cs +++ b/src/RocksDBStore/Plugins/Storage/Snapshot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.RocksDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Snapshot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RocksDBStore/Plugins/Storage/Store.cs b/src/RocksDBStore/Plugins/Storage/Store.cs index 419f63f09..ebf160dab 100644 --- a/src/RocksDBStore/Plugins/Storage/Store.cs +++ b/src/RocksDBStore/Plugins/Storage/Store.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.Storage.RocksDBStore is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Store.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RocksDBStore/RocksDBStore.csproj b/src/RocksDBStore/RocksDBStore.csproj index 4ab704d0e..718fbd5e2 100644 --- a/src/RocksDBStore/RocksDBStore.csproj +++ b/src/RocksDBStore/RocksDBStore.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/RpcClient/ContractClient.cs b/src/RpcClient/ContractClient.cs index 18a1820f2..f4ec020ab 100644 --- a/src/RpcClient/ContractClient.cs +++ b/src/RpcClient/ContractClient.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// ContractClient.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcAccount.cs b/src/RpcClient/Models/RpcAccount.cs index c6cf005f9..2afe18b0e 100644 --- a/src/RpcClient/Models/RpcAccount.cs +++ b/src/RpcClient/Models/RpcAccount.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcAccount.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcApplicationLog.cs b/src/RpcClient/Models/RpcApplicationLog.cs index 1ea337491..b641f9df0 100644 --- a/src/RpcClient/Models/RpcApplicationLog.cs +++ b/src/RpcClient/Models/RpcApplicationLog.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcApplicationLog.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcBlock.cs b/src/RpcClient/Models/RpcBlock.cs index 1958bc5fb..46f54a723 100644 --- a/src/RpcClient/Models/RpcBlock.cs +++ b/src/RpcClient/Models/RpcBlock.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcBlock.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcBlockHeader.cs b/src/RpcClient/Models/RpcBlockHeader.cs index 708800482..e30a6a64a 100644 --- a/src/RpcClient/Models/RpcBlockHeader.cs +++ b/src/RpcClient/Models/RpcBlockHeader.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcBlockHeader.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcContractState.cs b/src/RpcClient/Models/RpcContractState.cs index 0d0e5a7f0..b77a2d3a8 100644 --- a/src/RpcClient/Models/RpcContractState.cs +++ b/src/RpcClient/Models/RpcContractState.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcContractState.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcFoundStates.cs b/src/RpcClient/Models/RpcFoundStates.cs index 718661118..a3a1c1f10 100644 --- a/src/RpcClient/Models/RpcFoundStates.cs +++ b/src/RpcClient/Models/RpcFoundStates.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcFoundStates.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcInvokeResult.cs b/src/RpcClient/Models/RpcInvokeResult.cs index f3c7ddeb9..568eb4ca6 100644 --- a/src/RpcClient/Models/RpcInvokeResult.cs +++ b/src/RpcClient/Models/RpcInvokeResult.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcInvokeResult.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcMethodToken.cs b/src/RpcClient/Models/RpcMethodToken.cs index 1b7fe6546..f426950de 100644 --- a/src/RpcClient/Models/RpcMethodToken.cs +++ b/src/RpcClient/Models/RpcMethodToken.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcMethodToken.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcNativeContract.cs b/src/RpcClient/Models/RpcNativeContract.cs index f103a418e..c28251f9c 100644 --- a/src/RpcClient/Models/RpcNativeContract.cs +++ b/src/RpcClient/Models/RpcNativeContract.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcNativeContract.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -11,7 +12,6 @@ using Neo.Json; using Neo.SmartContract; using Neo.SmartContract.Manifest; -using System.Linq; namespace Neo.Network.RPC.Models { @@ -21,7 +21,6 @@ public class RpcNativeContract public UInt160 Hash { get; set; } public NefFile Nef { get; set; } public ContractManifest Manifest { get; set; } - public uint[] UpdateHistory { get; set; } public static RpcNativeContract FromJson(JObject json) { @@ -30,8 +29,7 @@ public static RpcNativeContract FromJson(JObject json) Id = (int)json["id"].AsNumber(), Hash = UInt160.Parse(json["hash"].AsString()), Nef = RpcNefFile.FromJson((JObject)json["nef"]), - Manifest = ContractManifest.FromJson((JObject)json["manifest"]), - UpdateHistory = ((JArray)json["updatehistory"]).Select(u => (uint)u.GetInt32()).ToArray() + Manifest = ContractManifest.FromJson((JObject)json["manifest"]) }; } @@ -42,8 +40,7 @@ public JObject ToJson() ["id"] = Id, ["hash"] = Hash.ToString(), ["nef"] = Nef.ToJson(), - ["manifest"] = Manifest.ToJson(), - ["updatehistory"] = new JArray(UpdateHistory.Select(u => new JNumber(u)).ToArray()) + ["manifest"] = Manifest.ToJson() }; } } diff --git a/src/RpcClient/Models/RpcNefFile.cs b/src/RpcClient/Models/RpcNefFile.cs index 4be45e5ac..4b33f2b6a 100644 --- a/src/RpcClient/Models/RpcNefFile.cs +++ b/src/RpcClient/Models/RpcNefFile.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcNefFile.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcNep17Balances.cs b/src/RpcClient/Models/RpcNep17Balances.cs index a90ccb091..f7f8b00db 100644 --- a/src/RpcClient/Models/RpcNep17Balances.cs +++ b/src/RpcClient/Models/RpcNep17Balances.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcNep17Balances.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcNep17TokenInfo.cs b/src/RpcClient/Models/RpcNep17TokenInfo.cs index 10b5242bd..a7cb6d0ef 100644 --- a/src/RpcClient/Models/RpcNep17TokenInfo.cs +++ b/src/RpcClient/Models/RpcNep17TokenInfo.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcNep17TokenInfo.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcNep17Transfers.cs b/src/RpcClient/Models/RpcNep17Transfers.cs index 2aca0dd24..3a3226b9a 100644 --- a/src/RpcClient/Models/RpcNep17Transfers.cs +++ b/src/RpcClient/Models/RpcNep17Transfers.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcNep17Transfers.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcPeers.cs b/src/RpcClient/Models/RpcPeers.cs index 38b32b0b1..6659ffe0d 100644 --- a/src/RpcClient/Models/RpcPeers.cs +++ b/src/RpcClient/Models/RpcPeers.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcPeers.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcPlugin.cs b/src/RpcClient/Models/RpcPlugin.cs index 3d8c3d504..12a8669de 100644 --- a/src/RpcClient/Models/RpcPlugin.cs +++ b/src/RpcClient/Models/RpcPlugin.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcPlugin.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcRawMemPool.cs b/src/RpcClient/Models/RpcRawMemPool.cs index 31372c323..4474e0b6b 100644 --- a/src/RpcClient/Models/RpcRawMemPool.cs +++ b/src/RpcClient/Models/RpcRawMemPool.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcRawMemPool.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcRequest.cs b/src/RpcClient/Models/RpcRequest.cs index f64360df7..1c4b67415 100644 --- a/src/RpcClient/Models/RpcRequest.cs +++ b/src/RpcClient/Models/RpcRequest.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcRequest.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcResponse.cs b/src/RpcClient/Models/RpcResponse.cs index a649561c2..25e3212fc 100644 --- a/src/RpcClient/Models/RpcResponse.cs +++ b/src/RpcClient/Models/RpcResponse.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcResponse.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcStateRoot.cs b/src/RpcClient/Models/RpcStateRoot.cs index cbf1009fc..095b054a3 100644 --- a/src/RpcClient/Models/RpcStateRoot.cs +++ b/src/RpcClient/Models/RpcStateRoot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcStateRoot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcTransaction.cs b/src/RpcClient/Models/RpcTransaction.cs index d3ff92387..cb674316d 100644 --- a/src/RpcClient/Models/RpcTransaction.cs +++ b/src/RpcClient/Models/RpcTransaction.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcTransaction.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcTransferOut.cs b/src/RpcClient/Models/RpcTransferOut.cs index 6ce653d82..d5e82a846 100644 --- a/src/RpcClient/Models/RpcTransferOut.cs +++ b/src/RpcClient/Models/RpcTransferOut.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcTransferOut.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcUnclaimedGas.cs b/src/RpcClient/Models/RpcUnclaimedGas.cs index 1a0f38e3a..c25f527d3 100644 --- a/src/RpcClient/Models/RpcUnclaimedGas.cs +++ b/src/RpcClient/Models/RpcUnclaimedGas.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcUnclaimedGas.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcValidateAddressResult.cs b/src/RpcClient/Models/RpcValidateAddressResult.cs index 2de69d388..6f49e08f0 100644 --- a/src/RpcClient/Models/RpcValidateAddressResult.cs +++ b/src/RpcClient/Models/RpcValidateAddressResult.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcValidateAddressResult.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcValidator.cs b/src/RpcClient/Models/RpcValidator.cs index c5cbef8ef..27031631e 100644 --- a/src/RpcClient/Models/RpcValidator.cs +++ b/src/RpcClient/Models/RpcValidator.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcValidator.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Models/RpcVersion.cs b/src/RpcClient/Models/RpcVersion.cs index d978c2991..430d659f7 100644 --- a/src/RpcClient/Models/RpcVersion.cs +++ b/src/RpcClient/Models/RpcVersion.cs @@ -1,14 +1,18 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcVersion.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without // modifications are permitted. using Neo.Json; +using System; +using System.Collections.Generic; +using System.Linq; namespace Neo.Network.RPC.Models { @@ -25,6 +29,7 @@ public class RpcProtocol public uint MaxTransactionsPerBlock { get; set; } public int MemoryPoolMaxTransactions { get; set; } public ulong InitialGasDistribution { get; set; } + public IReadOnlyDictionary Hardforks { get; set; } public JObject ToJson() { @@ -38,6 +43,12 @@ public JObject ToJson() json["maxtransactionsperblock"] = MaxTransactionsPerBlock; json["memorypoolmaxtransactions"] = MemoryPoolMaxTransactions; json["initialgasdistribution"] = InitialGasDistribution; + json["hardforks"] = new JArray(Hardforks.Select(s => new JObject() + { + // Strip HF_ prefix. + ["name"] = StripPrefix(s.Key.ToString(), "HF_"), + ["blockheight"] = s.Value, + })); return json; } @@ -54,14 +65,23 @@ public static RpcProtocol FromJson(JObject json) MaxTransactionsPerBlock = (uint)json["maxtransactionsperblock"].AsNumber(), MemoryPoolMaxTransactions = (int)json["memorypoolmaxtransactions"].AsNumber(), InitialGasDistribution = (ulong)json["initialgasdistribution"].AsNumber(), + Hardforks = new Dictionary(((JArray)json["hardforks"]).Select(s => + { + var name = s["name"].AsString(); + // Add HF_ prefix to the hardfork response for proper Hardfork enum parsing. + return new KeyValuePair(Enum.Parse(name.StartsWith("HF_") ? name : $"HF_{name}"), (uint)s["blockheight"].AsNumber()); + })), }; } + + private static string StripPrefix(string s, string prefix) + { + return s.StartsWith(prefix) ? s.Substring(prefix.Length) : s; + } } public int TcpPort { get; set; } - public int WsPort { get; set; } - public uint Nonce { get; set; } public string UserAgent { get; set; } @@ -73,7 +93,6 @@ public JObject ToJson() JObject json = new(); json["network"] = Protocol.Network; // Obsolete json["tcpport"] = TcpPort; - json["wsport"] = WsPort; json["nonce"] = Nonce; json["useragent"] = UserAgent; json["protocol"] = Protocol.ToJson(); @@ -85,7 +104,6 @@ public static RpcVersion FromJson(JObject json) return new() { TcpPort = (int)json["tcpport"].AsNumber(), - WsPort = (int)json["wsport"].AsNumber(), Nonce = (uint)json["nonce"].AsNumber(), UserAgent = json["useragent"].AsString(), Protocol = RpcProtocol.FromJson((JObject)json["protocol"]) diff --git a/src/RpcClient/Nep17API.cs b/src/RpcClient/Nep17API.cs index 54fde2e6e..518f47092 100644 --- a/src/RpcClient/Nep17API.cs +++ b/src/RpcClient/Nep17API.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep17API.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -132,15 +133,18 @@ public async Task GetTokenInfoAsync(string contractHash) /// to account script hash /// transfer amount /// onPayment data + /// Add assert at the end of the script /// - public async Task CreateTransferTxAsync(UInt160 scriptHash, KeyPair fromKey, UInt160 to, BigInteger amount, object data = null) + public async Task CreateTransferTxAsync(UInt160 scriptHash, KeyPair fromKey, UInt160 to, BigInteger amount, object data = null, bool addAssert = true) { var sender = Contract.CreateSignatureRedeemScript(fromKey.PublicKey).ToScriptHash(); Signer[] signers = new[] { new Signer { Scopes = WitnessScope.CalledByEntry, Account = sender } }; byte[] script = scriptHash.MakeScript("transfer", sender, to, amount, data); + if (addAssert) script = script.Concat(new[] { (byte)OpCode.ASSERT }).ToArray(); - TransactionManagerFactory factory = new TransactionManagerFactory(rpcClient); + TransactionManagerFactory factory = new(rpcClient); TransactionManager manager = await factory.MakeTransactionAsync(script, signers).ConfigureAwait(false); + return await manager .AddSignature(fromKey) .SignAsync().ConfigureAwait(false); @@ -156,17 +160,20 @@ public async Task CreateTransferTxAsync(UInt160 scriptHash, KeyPair /// to account /// transfer amount /// onPayment data + /// Add assert at the end of the script /// - public async Task CreateTransferTxAsync(UInt160 scriptHash, int m, ECPoint[] pubKeys, KeyPair[] fromKeys, UInt160 to, BigInteger amount, object data = null) + public async Task CreateTransferTxAsync(UInt160 scriptHash, int m, ECPoint[] pubKeys, KeyPair[] fromKeys, UInt160 to, BigInteger amount, object data = null, bool addAssert = true) { if (m > fromKeys.Length) throw new ArgumentException($"Need at least {m} KeyPairs for signing!"); var sender = Contract.CreateMultiSigContract(m, pubKeys).ScriptHash; Signer[] signers = new[] { new Signer { Scopes = WitnessScope.CalledByEntry, Account = sender } }; byte[] script = scriptHash.MakeScript("transfer", sender, to, amount, data); + if (addAssert) script = script.Concat(new[] { (byte)OpCode.ASSERT }).ToArray(); - TransactionManagerFactory factory = new TransactionManagerFactory(rpcClient); + TransactionManagerFactory factory = new(rpcClient); TransactionManager manager = await factory.MakeTransactionAsync(script, signers).ConfigureAwait(false); + return await manager .AddMultiSig(fromKeys, m, pubKeys) .SignAsync().ConfigureAwait(false); diff --git a/src/RpcClient/PolicyAPI.cs b/src/RpcClient/PolicyAPI.cs index ceab5382a..60e749a79 100644 --- a/src/RpcClient/PolicyAPI.cs +++ b/src/RpcClient/PolicyAPI.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// PolicyAPI.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Properties/AssemblyInfo.cs b/src/RpcClient/Properties/AssemblyInfo.cs index 28d86664a..d464f67da 100644 --- a/src/RpcClient/Properties/AssemblyInfo.cs +++ b/src/RpcClient/Properties/AssemblyInfo.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// AssemblyInfo.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/RpcClient.cs b/src/RpcClient/RpcClient.cs index 957025f1a..8cd8a717a 100644 --- a/src/RpcClient/RpcClient.cs +++ b/src/RpcClient/RpcClient.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcClient.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -645,6 +646,16 @@ public async Task SendToAddressAsync(string assetId, string address, st .ConfigureAwait(false); } + /// + /// Cancel Tx. + /// + /// This function returns Signed Transaction JSON if successful, ContractParametersContext JSON if signing failed. + public async Task CancelTransactionAsync(UInt256 txId, string[] signers, string extraFee) + { + JToken[] parameters = signers.Select(s => (JString)s.AsScriptHash()).ToArray(); + return (JObject)await RpcSendAsync(GetRpcName(), txId.ToString(), new JArray(parameters), extraFee).ConfigureAwait(false); + } + #endregion Wallet #region Plugins diff --git a/src/RpcClient/RpcException.cs b/src/RpcClient/RpcException.cs index 6554899dc..d0f2e5e64 100644 --- a/src/RpcClient/RpcException.cs +++ b/src/RpcClient/RpcException.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcException.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/StateAPI.cs b/src/RpcClient/StateAPI.cs index 5ee1683d0..6a926fe02 100644 --- a/src/RpcClient/StateAPI.cs +++ b/src/RpcClient/StateAPI.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StateAPI.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -53,7 +54,7 @@ public async Task VerifyProofAsync(UInt256 rootHash, byte[] proofBytes) return (localRootIndex, validatedRootIndex); } - static uint? ToNullableUint(JToken json) => (json == null) ? (uint?)null : (uint?)json.AsNumber(); + static uint? ToNullableUint(JToken json) => (json == null) ? null : (uint?)json.AsNumber(); public static JToken[] MakeFindStatesParams(UInt256 rootHash, UInt160 scriptHash, ReadOnlySpan prefix, ReadOnlySpan from = default, int? count = null) { diff --git a/src/RpcClient/TransactionManager.cs b/src/RpcClient/TransactionManager.cs index 82694fd2d..08e9f31e3 100644 --- a/src/RpcClient/TransactionManager.cs +++ b/src/RpcClient/TransactionManager.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TransactionManager.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/TransactionManagerFactory.cs b/src/RpcClient/TransactionManagerFactory.cs index 8fea000ff..3fe9e3ded 100644 --- a/src/RpcClient/TransactionManagerFactory.cs +++ b/src/RpcClient/TransactionManagerFactory.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TransactionManagerFactory.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcClient/Utility.cs b/src/RpcClient/Utility.cs index 159af4046..659942f8f 100644 --- a/src/RpcClient/Utility.cs +++ b/src/RpcClient/Utility.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Utility.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -197,6 +198,14 @@ public static TransactionAttribute TransactionAttributeFromJson(JObject json) Code = Enum.Parse(json["code"].AsString()), Result = Convert.FromBase64String(json["result"].AsString()), }, + TransactionAttributeType.NotValidBefore => new NotValidBefore() + { + Height = (uint)json["height"].AsNumber(), + }, + TransactionAttributeType.Conflicts => new Conflicts() + { + Hash = UInt256.Parse(json["hash"].AsString()) + }, _ => throw new FormatException(), }; } diff --git a/src/RpcClient/WalletAPI.cs b/src/RpcClient/WalletAPI.cs index fc66fc131..bbf684f75 100644 --- a/src/RpcClient/WalletAPI.cs +++ b/src/RpcClient/WalletAPI.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// WalletAPI.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -109,11 +110,12 @@ public Task GetTokenBalanceAsync(string tokenHash, string account) /// /// wif or private key /// Example: WIF ("KyXwTh1hB76RRMquSvnxZrJzQx7h9nQP2PCRL38v6VDb5ip3nf1p"), PrivateKey ("450d6c2a04b5b470339a745427bae6828400cf048400837d73c415063835e005") + /// Add assert at the end of the script /// The transaction sended - public Task ClaimGasAsync(string key) + public Task ClaimGasAsync(string key, bool addAssert = true) { KeyPair keyPair = Utility.GetKeyPair(key); - return ClaimGasAsync(keyPair); + return ClaimGasAsync(keyPair, addAssert); } /// @@ -121,12 +123,13 @@ public Task ClaimGasAsync(string key) /// This function will transfer NEO balance from account to itself /// /// keyPair + /// Add assert at the end of the script /// The transaction sended - public async Task ClaimGasAsync(KeyPair keyPair) + public async Task ClaimGasAsync(KeyPair keyPair, bool addAssert = true) { UInt160 toHash = Contract.CreateSignatureRedeemScript(keyPair.PublicKey).ToScriptHash(); BigInteger balance = await nep17API.BalanceOfAsync(NativeContract.NEO.Hash, toHash).ConfigureAwait(false); - Transaction transaction = await nep17API.CreateTransferTxAsync(NativeContract.NEO.Hash, keyPair, toHash, balance).ConfigureAwait(false); + Transaction transaction = await nep17API.CreateTransferTxAsync(NativeContract.NEO.Hash, keyPair, toHash, balance, null, addAssert).ConfigureAwait(false); await rpcClient.SendRawTransactionAsync(transaction).ConfigureAwait(false); return transaction; } @@ -139,8 +142,10 @@ public async Task ClaimGasAsync(KeyPair keyPair) /// Example: WIF ("KyXwTh1hB76RRMquSvnxZrJzQx7h9nQP2PCRL38v6VDb5ip3nf1p"), PrivateKey ("450d6c2a04b5b470339a745427bae6828400cf048400837d73c415063835e005") /// address or account script hash /// token amount + /// onPayment data + /// Add assert at the end of the script /// - public async Task TransferAsync(string tokenHash, string fromKey, string toAddress, decimal amount, object data = null) + public async Task TransferAsync(string tokenHash, string fromKey, string toAddress, decimal amount, object data = null, bool addAssert = true) { UInt160 scriptHash = Utility.GetScriptHash(tokenHash, rpcClient.protocolSettings); var decimals = await nep17API.DecimalsAsync(scriptHash).ConfigureAwait(false); @@ -148,7 +153,7 @@ public async Task TransferAsync(string tokenHash, string fromKey, s KeyPair from = Utility.GetKeyPair(fromKey); UInt160 to = Utility.GetScriptHash(toAddress, rpcClient.protocolSettings); BigInteger amountInteger = amount.ToBigInteger(decimals); - return await TransferAsync(scriptHash, from, to, amountInteger, data).ConfigureAwait(false); + return await TransferAsync(scriptHash, from, to, amountInteger, data, addAssert).ConfigureAwait(false); } /// @@ -158,10 +163,12 @@ public async Task TransferAsync(string tokenHash, string fromKey, s /// from KeyPair /// to account script hash /// transfer amount + /// onPayment data + /// Add assert at the end of the script /// - public async Task TransferAsync(UInt160 scriptHash, KeyPair from, UInt160 to, BigInteger amountInteger, object data = null) + public async Task TransferAsync(UInt160 scriptHash, KeyPair from, UInt160 to, BigInteger amountInteger, object data = null, bool addAssert = true) { - Transaction transaction = await nep17API.CreateTransferTxAsync(scriptHash, from, to, amountInteger, data).ConfigureAwait(false); + Transaction transaction = await nep17API.CreateTransferTxAsync(scriptHash, from, to, amountInteger, data, addAssert).ConfigureAwait(false); await rpcClient.SendRawTransactionAsync(transaction).ConfigureAwait(false); return transaction; } @@ -175,10 +182,12 @@ public async Task TransferAsync(UInt160 scriptHash, KeyPair from, U /// sign keys /// to account /// transfer amount + /// onPayment data + /// Add assert at the end of the script /// - public async Task TransferAsync(UInt160 scriptHash, int m, ECPoint[] pubKeys, KeyPair[] keys, UInt160 to, BigInteger amountInteger, object data = null) + public async Task TransferAsync(UInt160 scriptHash, int m, ECPoint[] pubKeys, KeyPair[] keys, UInt160 to, BigInteger amountInteger, object data = null, bool addAssert = true) { - Transaction transaction = await nep17API.CreateTransferTxAsync(scriptHash, m, pubKeys, keys, to, amountInteger, data).ConfigureAwait(false); + Transaction transaction = await nep17API.CreateTransferTxAsync(scriptHash, m, pubKeys, keys, to, amountInteger, data, addAssert).ConfigureAwait(false); await rpcClient.SendRawTransactionAsync(transaction).ConfigureAwait(false); return transaction; } diff --git a/src/RpcServer/Diagnostic.cs b/src/RpcServer/Diagnostic.cs index 6115d6c67..a8cba4af9 100644 --- a/src/RpcServer/Diagnostic.cs +++ b/src/RpcServer/Diagnostic.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Diagnostic.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/RpcException.cs b/src/RpcServer/RpcException.cs index 2c2f929e3..827dc6210 100644 --- a/src/RpcServer/RpcException.cs +++ b/src/RpcServer/RpcException.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcException.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/RpcMethodAttribute.cs b/src/RpcServer/RpcMethodAttribute.cs index 1578f53d4..89edccdd5 100644 --- a/src/RpcServer/RpcMethodAttribute.cs +++ b/src/RpcServer/RpcMethodAttribute.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcMethodAttribute.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/RpcServer.Blockchain.cs b/src/RpcServer/RpcServer.Blockchain.cs index 5fc81fb5f..be60508e6 100644 --- a/src/RpcServer/RpcServer.Blockchain.cs +++ b/src/RpcServer/RpcServer.Blockchain.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.Blockchain.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index 7c8dfeaa8..b28820f2f 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.Node.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -69,7 +70,6 @@ protected virtual JToken GetVersion(JArray _params) { JObject json = new(); json["tcpport"] = localNode.ListenerTcpPort; - json["wsport"] = localNode.ListenerWsPort; json["nonce"] = LocalNode.Nonce; json["useragent"] = LocalNode.UserAgent; json["protocol"] = new JObject(); @@ -82,9 +82,22 @@ protected virtual JToken GetVersion(JArray _params) json["protocol"]["maxtransactionsperblock"] = system.Settings.MaxTransactionsPerBlock; json["protocol"]["memorypoolmaxtransactions"] = system.Settings.MemoryPoolMaxTransactions; json["protocol"]["initialgasdistribution"] = system.Settings.InitialGasDistribution; + json["protocol"]["hardforks"] = new JArray(system.Settings.Hardforks.Select(hf => + { + JObject forkJson = new(); + // Strip "HF_" prefix. + forkJson["name"] = StripPrefix(hf.Key.ToString(), "HF_"); + forkJson["blockheight"] = hf.Value; + return forkJson; + })); return json; } + private static string StripPrefix(string s, string prefix) + { + return s.StartsWith(prefix) ? s.Substring(prefix.Length) : s; + } + [RpcMethod] protected virtual JToken SendRawTransaction(JArray _params) { diff --git a/src/RpcServer/RpcServer.SmartContract.cs b/src/RpcServer/RpcServer.SmartContract.cs index cf22c2780..6ccf10965 100644 --- a/src/RpcServer/RpcServer.SmartContract.cs +++ b/src/RpcServer/RpcServer.SmartContract.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.SmartContract.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -23,6 +24,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading; +using Array = System.Array; namespace Neo.Plugins { @@ -92,14 +94,19 @@ private JObject GetInvokeResult(byte[] script, Signer[] signers = null, Witness[ ["storagechanges"] = ToJson(session.Engine.Snapshot.GetChangeSet()) }; } - try + var stack = new JArray(); + foreach (var item in session.Engine.ResultStack) { - json["stack"] = new JArray(session.Engine.ResultStack.Select(p => ToJson(p, session))); - } - catch (InvalidOperationException) - { - json["stack"] = "error: invalid operation"; + try + { + stack.Add(ToJson(item, session)); + } + catch (Exception ex) + { + stack.Add("error: " + ex.Message); + } } + json["stack"] = stack; if (session.Engine.State != VMState.FAULT) { ProcessInvokeWithWallet(json, signers); @@ -165,13 +172,18 @@ private static JObject ToJson(StackItem item, Session session) private static Signer[] SignersFromJson(JArray _params, ProtocolSettings settings) { + if (_params.Count > Transaction.MaxTransactionAttributes) + { + throw new RpcException(-100, "Max allowed witness exceeded."); + } + var ret = _params.Select(u => new Signer { Account = AddressToScriptHash(u["account"].AsString(), settings.AddressVersion), Scopes = (WitnessScope)Enum.Parse(typeof(WitnessScope), u["scopes"]?.AsString()), - AllowedContracts = ((JArray)u["allowedcontracts"])?.Select(p => UInt160.Parse(p.AsString())).ToArray(), - AllowedGroups = ((JArray)u["allowedgroups"])?.Select(p => ECPoint.Parse(p.AsString(), ECCurve.Secp256r1)).ToArray(), - Rules = ((JArray)u["rules"])?.Select(r => WitnessRule.FromJson((JObject)r)).ToArray(), + AllowedContracts = ((JArray)u["allowedcontracts"])?.Select(p => UInt160.Parse(p.AsString())).ToArray() ?? Array.Empty(), + AllowedGroups = ((JArray)u["allowedgroups"])?.Select(p => ECPoint.Parse(p.AsString(), ECCurve.Secp256r1)).ToArray() ?? Array.Empty(), + Rules = ((JArray)u["rules"])?.Select(r => WitnessRule.FromJson((JObject)r)).ToArray() ?? Array.Empty(), }).ToArray(); // Validate format @@ -183,6 +195,11 @@ private static Signer[] SignersFromJson(JArray _params, ProtocolSettings setting private static Witness[] WitnessesFromJson(JArray _params) { + if (_params.Count > Transaction.MaxTransactionAttributes) + { + throw new RpcException(-100, "Max allowed witness exceeded."); + } + return _params.Select(u => new { Invocation = u["invocation"]?.AsString(), diff --git a/src/RpcServer/RpcServer.Utilities.cs b/src/RpcServer/RpcServer.Utilities.cs index 39d9282ca..28da86829 100644 --- a/src/RpcServer/RpcServer.Utilities.cs +++ b/src/RpcServer/RpcServer.Utilities.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.Utilities.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/RpcServer.Wallet.cs b/src/RpcServer/RpcServer.Wallet.cs index 7ced0421a..288533cb4 100644 --- a/src/RpcServer/RpcServer.Wallet.cs +++ b/src/RpcServer/RpcServer.Wallet.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.Wallet.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -319,6 +320,57 @@ protected virtual JToken SendToAddress(JArray _params) return SignAndRelay(snapshot, tx); } + [RpcMethod] + protected virtual JToken CancelTransaction(JArray _params) + { + CheckWallet(); + var txid = UInt256.Parse(_params[0].AsString()); + TransactionState state = NativeContract.Ledger.GetTransactionState(system.StoreView, txid); + if (state != null) + { + throw new RpcException(32700, "This tx is already confirmed, can't be cancelled."); + } + + var conflict = new TransactionAttribute[] { new Conflicts() { Hash = txid } }; + Signer[] signers = _params.Count >= 2 ? ((JArray)_params[1]).Select(j => new Signer() { Account = AddressToScriptHash(j.AsString(), system.Settings.AddressVersion), Scopes = WitnessScope.None }).ToArray() : Array.Empty(); + if (!signers.Any()) + { + throw new RpcException(32701, "no signers"); + } + + Transaction tx = new Transaction + { + Signers = signers, + Attributes = conflict, + Witnesses = Array.Empty(), + }; + + try + { + tx = wallet.MakeTransaction(system.StoreView, new[] { (byte)OpCode.RET }, signers[0].Account, signers, conflict); + } + catch (InvalidOperationException e) + { + throw new RpcException(-500, GetExceptionMessage(e)); + } + + if (system.MemPool.TryGetValue(txid, out Transaction conflictTx)) + { + tx.NetworkFee = Math.Max(tx.NetworkFee, conflictTx.NetworkFee) + 1; + } + else if (_params.Count >= 3) + { + var extraFee = _params[2].AsString(); + AssetDescriptor descriptor = new(system.StoreView, system.Settings, NativeContract.GAS.Hash); + if (!BigDecimal.TryParse(extraFee, descriptor.Decimals, out BigDecimal decimalExtraFee) || decimalExtraFee.Sign <= 0) + { + throw new RpcException(32702, "Incorrect Amount Format"); + } + tx.NetworkFee += (long)decimalExtraFee.Value; + }; + return SignAndRelay(system.StoreView, tx); + } + [RpcMethod] protected virtual JToken InvokeContractVerify(JArray _params) { diff --git a/src/RpcServer/RpcServer.cs b/src/RpcServer/RpcServer.cs index d28e07e57..8023622f5 100644 --- a/src/RpcServer/RpcServer.cs +++ b/src/RpcServer/RpcServer.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServer.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -32,6 +33,8 @@ namespace Neo.Plugins { public partial class RpcServer : IDisposable { + private const int MaxParamsDepth = 32; + private readonly Dictionary> methods = new(); private IWebHost host; @@ -52,9 +55,14 @@ private bool CheckAuth(HttpContext context) { if (string.IsNullOrEmpty(settings.RpcUser)) return true; - context.Response.Headers["WWW-Authenticate"] = "Basic realm=\"Restricted\""; - string reqauth = context.Request.Headers["Authorization"]; + if (string.IsNullOrEmpty(reqauth)) + { + context.Response.Headers["WWW-Authenticate"] = "Basic realm=\"Restricted\""; + context.Response.StatusCode = 401; + return false; + } + string authstring; try { @@ -105,12 +113,19 @@ public void StartRpcServer() { host = new WebHostBuilder().UseKestrel(options => options.Listen(settings.BindAddress, settings.Port, listenOptions => { + // Default value is 5Mb + options.Limits.MaxRequestBodySize = settings.MaxRequestBodySize; + options.Limits.MaxRequestLineSize = Math.Min(settings.MaxRequestBodySize, options.Limits.MaxRequestLineSize); // Default value is 40 options.Limits.MaxConcurrentConnections = settings.MaxConcurrentConnections; + // Default value is 1 minutes - options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(1); + options.Limits.KeepAliveTimeout = settings.KeepAliveTimeout == -1 ? + TimeSpan.MaxValue : + TimeSpan.FromSeconds(settings.KeepAliveTimeout); + // Default value is 15 seconds - options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(15); + options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(settings.RequestHeadersTimeout); if (string.IsNullOrEmpty(settings.SslCert)) return; listenOptions.UseHttps(settings.SslCert, settings.SslCertPassword, httpsConnectionAdapterOptions => @@ -129,11 +144,41 @@ public void StartRpcServer() })) .Configure(app => { + if (settings.EnableCors) + app.UseCors("All"); + app.UseResponseCompression(); app.Run(ProcessAsync); }) .ConfigureServices(services => { + if (settings.EnableCors) + { + if (settings.AllowOrigins.Length == 0) + services.AddCors(options => + { + options.AddPolicy("All", policy => + { + policy.AllowAnyOrigin() + .WithHeaders("Content-Type") + .WithMethods("GET", "POST"); + // The CORS specification states that setting origins to "*" (all origins) + // is invalid if the Access-Control-Allow-Credentials header is present. + }); + }); + else + services.AddCors(options => + { + options.AddPolicy("All", policy => + { + policy.WithOrigins(settings.AllowOrigins) + .WithHeaders("Content-Type") + .AllowCredentials() + .WithMethods("GET", "POST"); + }); + }); + } + services.AddResponseCompression(options => { // options.EnableForHttps = false; @@ -158,10 +203,6 @@ internal void UpdateSettings(RpcServerSettings settings) public async Task ProcessAsync(HttpContext context) { - context.Response.Headers["Access-Control-Allow-Origin"] = "*"; - context.Response.Headers["Access-Control-Allow-Methods"] = "GET, POST"; - context.Response.Headers["Access-Control-Allow-Headers"] = "Content-Type"; - context.Response.Headers["Access-Control-Max-Age"] = "31536000"; if (context.Request.Method != "GET" && context.Request.Method != "POST") return; JToken request = null; if (context.Request.Method == "GET") @@ -182,7 +223,7 @@ public async Task ProcessAsync(HttpContext context) request["jsonrpc"] = jsonrpc; request["id"] = id; request["method"] = method; - request["params"] = JToken.Parse(_params); + request["params"] = JToken.Parse(_params, MaxParamsDepth); } } else if (context.Request.Method == "POST") @@ -190,7 +231,7 @@ public async Task ProcessAsync(HttpContext context) using StreamReader reader = new(context.Request.Body); try { - request = JToken.Parse(await reader.ReadToEndAsync()); + request = JToken.Parse(await reader.ReadToEndAsync(), MaxParamsDepth); } catch (FormatException) { } } diff --git a/src/RpcServer/RpcServer.csproj b/src/RpcServer/RpcServer.csproj index 77a4c158e..68f6e62ed 100644 --- a/src/RpcServer/RpcServer.csproj +++ b/src/RpcServer/RpcServer.csproj @@ -2,7 +2,9 @@ Neo.Plugins.RpcServer - Neo.Plugins + + + diff --git a/src/RpcServer/RpcServerPlugin.cs b/src/RpcServer/RpcServerPlugin.cs index 6e148f4da..bc51d6394 100644 --- a/src/RpcServer/RpcServerPlugin.cs +++ b/src/RpcServer/RpcServerPlugin.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// RpcServerPlugin.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -42,6 +43,16 @@ protected override void OnSystemLoaded(NeoSystem system) RpcServerSettings s = settings.Servers.FirstOrDefault(p => p.Network == system.Settings.Network); if (s is null) return; + if (s.EnableCors && string.IsNullOrEmpty(s.RpcUser) == false && s.AllowOrigins.Length == 0) + { + Log("RcpServer: CORS is misconfigured!", LogLevel.Warning); + Log($"You have {nameof(s.EnableCors)} and Basic Authentication enabled but " + + $"{nameof(s.AllowOrigins)} is empty in config.json for RcpServer. " + + "You must add url origins to the list to have CORS work from " + + $"browser with basic authentication enabled. " + + $"Example: \"AllowOrigins\": [\"http://{s.BindAddress}:{s.Port}\"]", LogLevel.Info); + } + RpcServer server = new(system, s); if (handlers.Remove(s.Network, out var list)) diff --git a/src/RpcServer/Session.cs b/src/RpcServer/Session.cs index 564ba6530..2b4213c28 100644 --- a/src/RpcServer/Session.cs +++ b/src/RpcServer/Session.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Session.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/Settings.cs b/src/RpcServer/Settings.cs index 6d5b1202a..f4aef116c 100644 --- a/src/RpcServer/Settings.cs +++ b/src/RpcServer/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -36,8 +37,13 @@ public record RpcServerSettings public string SslCertPassword { get; init; } public string[] TrustedAuthorities { get; init; } public int MaxConcurrentConnections { get; init; } + public int MaxRequestBodySize { get; init; } public string RpcUser { get; init; } public string RpcPass { get; init; } + public bool EnableCors { get; init; } + public string[] AllowOrigins { get; init; } + public int KeepAliveTimeout { get; init; } + public uint RequestHeadersTimeout { get; init; } public long MaxGasInvoke { get; init; } public long MaxFee { get; init; } public int MaxIteratorResultItems { get; init; } @@ -56,10 +62,15 @@ public record RpcServerSettings MaxGasInvoke = (long)new BigDecimal(10M, NativeContract.GAS.Decimals).Value, MaxFee = (long)new BigDecimal(0.1M, NativeContract.GAS.Decimals).Value, TrustedAuthorities = Array.Empty(), + EnableCors = true, + AllowOrigins = Array.Empty(), + KeepAliveTimeout = 60, + RequestHeadersTimeout = 15, MaxIteratorResultItems = 100, MaxStackSize = ushort.MaxValue, DisabledMethods = Array.Empty(), MaxConcurrentConnections = 40, + MaxRequestBodySize = 5 * 1024 * 1024, SessionEnabled = false, SessionExpirationTime = TimeSpan.FromSeconds(60), FindStoragePageSize = 50 @@ -75,12 +86,17 @@ public record RpcServerSettings TrustedAuthorities = section.GetSection("TrustedAuthorities").GetChildren().Select(p => p.Get()).ToArray(), RpcUser = section.GetSection("RpcUser").Value, RpcPass = section.GetSection("RpcPass").Value, + EnableCors = section.GetValue(nameof(EnableCors), Default.EnableCors), + AllowOrigins = section.GetSection(nameof(AllowOrigins)).GetChildren().Select(p => p.Get()).ToArray(), + KeepAliveTimeout = section.GetValue(nameof(KeepAliveTimeout), Default.KeepAliveTimeout), + RequestHeadersTimeout = section.GetValue(nameof(RequestHeadersTimeout), Default.RequestHeadersTimeout), MaxGasInvoke = (long)new BigDecimal(section.GetValue("MaxGasInvoke", Default.MaxGasInvoke), NativeContract.GAS.Decimals).Value, MaxFee = (long)new BigDecimal(section.GetValue("MaxFee", Default.MaxFee), NativeContract.GAS.Decimals).Value, MaxIteratorResultItems = section.GetValue("MaxIteratorResultItems", Default.MaxIteratorResultItems), MaxStackSize = section.GetValue("MaxStackSize", Default.MaxStackSize), DisabledMethods = section.GetSection("DisabledMethods").GetChildren().Select(p => p.Get()).ToArray(), MaxConcurrentConnections = section.GetValue("MaxConcurrentConnections", Default.MaxConcurrentConnections), + MaxRequestBodySize = section.GetValue("MaxRequestBodySize", Default.MaxRequestBodySize), SessionEnabled = section.GetValue("SessionEnabled", Default.SessionEnabled), SessionExpirationTime = TimeSpan.FromSeconds(section.GetValue("SessionExpirationTime", (int)Default.SessionExpirationTime.TotalSeconds)), FindStoragePageSize = section.GetValue("FindStoragePageSize", Default.FindStoragePageSize) diff --git a/src/RpcServer/Tree.cs b/src/RpcServer/Tree.cs index a4de74127..77ca1fc2a 100644 --- a/src/RpcServer/Tree.cs +++ b/src/RpcServer/Tree.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Tree.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/TreeNode.cs b/src/RpcServer/TreeNode.cs index 05407a25b..82785277b 100644 --- a/src/RpcServer/TreeNode.cs +++ b/src/RpcServer/TreeNode.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TreeNode.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/RpcServer/Utility.cs b/src/RpcServer/Utility.cs index 33750c4c9..ccbae34db 100644 --- a/src/RpcServer/Utility.cs +++ b/src/RpcServer/Utility.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Network.RPC is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Utility.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -39,8 +40,7 @@ public static JObject NativeContractToJson(this NativeContract contract, Protoco ["id"] = contract.Id, ["hash"] = contract.Hash.ToString(), ["nef"] = contract.Nef.ToJson(), - ["manifest"] = contract.Manifest.ToJson(), - ["updatehistory"] = settings.NativeUpdateHistory[contract.Name].Select(p => (JToken)p).ToArray() + ["manifest"] = contract.Manifest.ToJson() }; } } diff --git a/src/RpcServer/config.json b/src/RpcServer/config.json index cfb60752f..8f6905dea 100644 --- a/src/RpcServer/config.json +++ b/src/RpcServer/config.json @@ -10,6 +10,10 @@ "TrustedAuthorities": [], "RpcUser": "", "RpcPass": "", + "EnableCors": true, + "AllowOrigins": [], + "KeepAliveTimeout": 60, + "RequestHeadersTimeout": 15, "MaxGasInvoke": 20, "MaxFee": 0.1, "MaxConcurrentConnections": 40, diff --git a/src/SQLiteWallet/Account.cs b/src/SQLiteWallet/Account.cs index 2eba9008d..e7ae09af9 100644 --- a/src/SQLiteWallet/Account.cs +++ b/src/SQLiteWallet/Account.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// Account.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/Address.cs b/src/SQLiteWallet/Address.cs index ca43b244a..6f2b73e42 100644 --- a/src/SQLiteWallet/Address.cs +++ b/src/SQLiteWallet/Address.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// Address.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/Contract.cs b/src/SQLiteWallet/Contract.cs index 827be9349..2da432a63 100644 --- a/src/SQLiteWallet/Contract.cs +++ b/src/SQLiteWallet/Contract.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// Contract.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/Key.cs b/src/SQLiteWallet/Key.cs index 24107a3c8..81a8a6daf 100644 --- a/src/SQLiteWallet/Key.cs +++ b/src/SQLiteWallet/Key.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// Key.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/SQLiteWallet.cs b/src/SQLiteWallet/SQLiteWallet.cs index 7c1edd1bc..1a99c1672 100644 --- a/src/SQLiteWallet/SQLiteWallet.cs +++ b/src/SQLiteWallet/SQLiteWallet.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// SQLiteWallet.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/SQLiteWallet.csproj b/src/SQLiteWallet/SQLiteWallet.csproj index 49b8de1e8..2cac0cbd7 100644 --- a/src/SQLiteWallet/SQLiteWallet.csproj +++ b/src/SQLiteWallet/SQLiteWallet.csproj @@ -1,13 +1,13 @@ - - - - Neo.Wallets.SQLite - Neo.Wallets.SQLite - enable - - - - - - - + + + + Neo.Wallets.SQLite + Neo.Wallets.SQLite + enable + + + + + + + diff --git a/src/SQLiteWallet/SQLiteWalletAccount.cs b/src/SQLiteWallet/SQLiteWalletAccount.cs index 7c96ce1c3..88526f7e5 100644 --- a/src/SQLiteWallet/SQLiteWalletAccount.cs +++ b/src/SQLiteWallet/SQLiteWalletAccount.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// SQLiteWalletAccount.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/SQLiteWalletFactory.cs b/src/SQLiteWallet/SQLiteWalletFactory.cs index 54a506a9a..d952fd0fc 100644 --- a/src/SQLiteWallet/SQLiteWalletFactory.cs +++ b/src/SQLiteWallet/SQLiteWalletFactory.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// SQLiteWalletFactory.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/VerificationContract.cs b/src/SQLiteWallet/VerificationContract.cs index 60712225f..e128045ad 100644 --- a/src/SQLiteWallet/VerificationContract.cs +++ b/src/SQLiteWallet/VerificationContract.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// VerificationContract.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/SQLiteWallet/WalletDataContext.cs b/src/SQLiteWallet/WalletDataContext.cs index 10a3c4434..79ca538cd 100644 --- a/src/SQLiteWallet/WalletDataContext.cs +++ b/src/SQLiteWallet/WalletDataContext.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.Wallets.SQLite is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Copyright (C) 2015-2024 The Neo Project. +// +// WalletDataContext.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. diff --git a/src/StateService/Network/MessageType.cs b/src/StateService/Network/MessageType.cs index 4cda8e35e..88ed5b2e9 100644 --- a/src/StateService/Network/MessageType.cs +++ b/src/StateService/Network/MessageType.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// MessageType.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Network/StateRoot.cs b/src/StateService/Network/StateRoot.cs index 4a2b2cd65..5b4e8610f 100644 --- a/src/StateService/Network/StateRoot.cs +++ b/src/StateService/Network/StateRoot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StateRoot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Network/Vote.cs b/src/StateService/Network/Vote.cs index 2950a8cf9..e6840c7a9 100644 --- a/src/StateService/Network/Vote.cs +++ b/src/StateService/Network/Vote.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Vote.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Settings.cs b/src/StateService/Settings.cs index c48e6d1f8..8557866bc 100644 --- a/src/StateService/Settings.cs +++ b/src/StateService/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/StatePlugin.cs b/src/StateService/StatePlugin.cs index e71b69b67..b760eed79 100644 --- a/src/StateService/StatePlugin.cs +++ b/src/StateService/StatePlugin.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StatePlugin.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/StateService.csproj b/src/StateService/StateService.csproj index 4f6902f20..b438508f8 100644 --- a/src/StateService/StateService.csproj +++ b/src/StateService/StateService.csproj @@ -1,18 +1,16 @@ - - - Neo.Plugins.StateService - Neo.Plugins - true - - - - - - - - - - - - + + Neo.Plugins.StateService + true + + + + + + + + false + runtime + + + \ No newline at end of file diff --git a/src/StateService/Storage/Keys.cs b/src/StateService/Storage/Keys.cs index e7a0a66a1..4ffecef48 100644 --- a/src/StateService/Storage/Keys.cs +++ b/src/StateService/Storage/Keys.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Keys.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Storage/StateSnapshot.cs b/src/StateService/Storage/StateSnapshot.cs index 8c4dcffb7..70ec00622 100644 --- a/src/StateService/Storage/StateSnapshot.cs +++ b/src/StateService/Storage/StateSnapshot.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StateSnapshot.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Storage/StateStore.cs b/src/StateService/Storage/StateStore.cs index 9a54dabd6..e0bc4ed78 100644 --- a/src/StateService/Storage/StateStore.cs +++ b/src/StateService/Storage/StateStore.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StateStore.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Verification/VerificationContext.cs b/src/StateService/Verification/VerificationContext.cs index f5b08946d..53743c134 100644 --- a/src/StateService/Verification/VerificationContext.cs +++ b/src/StateService/Verification/VerificationContext.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// VerificationContext.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StateService/Verification/VerificationService.cs b/src/StateService/Verification/VerificationService.cs index 646607883..c6730e790 100644 --- a/src/StateService/Verification/VerificationService.cs +++ b/src/StateService/Verification/VerificationService.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StateService is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// VerificationService.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StatesDumper/PersistActions.cs b/src/StatesDumper/PersistActions.cs index 360f42cde..9c1aa2210 100644 --- a/src/StatesDumper/PersistActions.cs +++ b/src/StatesDumper/PersistActions.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StatesDumper is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// PersistActions.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StatesDumper/Settings.cs b/src/StatesDumper/Settings.cs index ad1fcfee0..ffe472674 100644 --- a/src/StatesDumper/Settings.cs +++ b/src/StatesDumper/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StatesDumper is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StatesDumper/StatesDumper.cs b/src/StatesDumper/StatesDumper.cs index a9f9f9fc4..a74bda155 100644 --- a/src/StatesDumper/StatesDumper.cs +++ b/src/StatesDumper/StatesDumper.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StatesDumper is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StatesDumper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/StatesDumper/StatesDumper.csproj b/src/StatesDumper/StatesDumper.csproj index ab9aaa9dd..02d67dbe3 100644 --- a/src/StatesDumper/StatesDumper.csproj +++ b/src/StatesDumper/StatesDumper.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/StorageDumper/Settings.cs b/src/StorageDumper/Settings.cs index 841b2a3c4..eccb04f66 100644 --- a/src/StorageDumper/Settings.cs +++ b/src/StorageDumper/Settings.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StatesDumper is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Settings.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -10,8 +11,6 @@ using Microsoft.Extensions.Configuration; using Neo.SmartContract.Native; -using System.Collections.Generic; -using System.Linq; namespace Neo.Plugins { @@ -28,7 +27,7 @@ internal class Settings public IReadOnlyList Exclude { get; } - public static Settings Default { get; private set; } + public static Settings? Default { get; private set; } private Settings(IConfigurationSection section) { diff --git a/src/StorageDumper/StorageDumper.cs b/src/StorageDumper/StorageDumper.cs index 4eb3b434f..9f377b8ef 100644 --- a/src/StorageDumper/StorageDumper.cs +++ b/src/StorageDumper/StorageDumper.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.StatesDumper is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// StorageDumper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without @@ -15,10 +16,6 @@ using Neo.Network.P2P.Payloads; using Neo.Persistence; using Neo.SmartContract.Native; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; namespace Neo.Plugins { @@ -59,11 +56,11 @@ protected override void OnSystemLoaded(NeoSystem system) /// Process "dump contract-storage" command /// [ConsoleCommand("dump contract-storage", Category = "Storage", Description = "You can specify the contract script hash or use null to get the corresponding information from the storage")] - private void OnDumpStorage(uint network, UInt160 contractHash = null) + private void OnDumpStorage(uint network, UInt160? contractHash = null) { if (!systems.ContainsKey(network)) throw new InvalidOperationException("invalid network"); string path = $"dump_{network}.json"; - byte[] prefix = null; + byte[]? prefix = null; if (contractHash is not null) { var contract = NativeContract.ContractManagement.GetContract(systems[network].StoreView, contractHash); diff --git a/src/StorageDumper/StorageDumper.csproj b/src/StorageDumper/StorageDumper.csproj index 6ba3c63ea..a291fda32 100644 --- a/src/StorageDumper/StorageDumper.csproj +++ b/src/StorageDumper/StorageDumper.csproj @@ -7,6 +7,6 @@ - + diff --git a/src/TokensTracker/Extensions.cs b/src/TokensTracker/Extensions.cs index 3b8fe6f50..780505628 100644 --- a/src/TokensTracker/Extensions.cs +++ b/src/TokensTracker/Extensions.cs @@ -1,19 +1,20 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Extensions.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without // modifications are permitted. -using System; -using System.Collections.Generic; -using System.Numerics; using Neo.IO; using Neo.Persistence; using Neo.VM.Types; +using System; +using System.Collections.Generic; +using System.Numerics; namespace Neo.Plugins { diff --git a/src/TokensTracker/TokensTracker.cs b/src/TokensTracker/TokensTracker.cs index 3960aeb95..5567d7d1f 100644 --- a/src/TokensTracker/TokensTracker.cs +++ b/src/TokensTracker/TokensTracker.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TokensTracker.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/TokensTracker.csproj b/src/TokensTracker/TokensTracker.csproj index f4a8482ee..28ac9bf3d 100644 --- a/src/TokensTracker/TokensTracker.csproj +++ b/src/TokensTracker/TokensTracker.csproj @@ -1,12 +1,11 @@ - - - Neo.Plugins.TokensTracker - Neo.Plugins - - - - - - - + + Neo.Plugins.TokensTracker + + + + false + runtime + + + \ No newline at end of file diff --git a/src/TokensTracker/Trackers/NEP-11/Nep11BalanceKey.cs b/src/TokensTracker/Trackers/NEP-11/Nep11BalanceKey.cs index 8f9763165..1f375f33d 100644 --- a/src/TokensTracker/Trackers/NEP-11/Nep11BalanceKey.cs +++ b/src/TokensTracker/Trackers/NEP-11/Nep11BalanceKey.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep11BalanceKey.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs b/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs index 812419deb..75a41e909 100644 --- a/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs +++ b/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep11Tracker.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/NEP-11/Nep11TransferKey.cs b/src/TokensTracker/Trackers/NEP-11/Nep11TransferKey.cs index 07e5d0032..5c999e8e0 100644 --- a/src/TokensTracker/Trackers/NEP-11/Nep11TransferKey.cs +++ b/src/TokensTracker/Trackers/NEP-11/Nep11TransferKey.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep11TransferKey.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/NEP-17/Nep17BalanceKey.cs b/src/TokensTracker/Trackers/NEP-17/Nep17BalanceKey.cs index 1501c0f79..bbceabec2 100644 --- a/src/TokensTracker/Trackers/NEP-17/Nep17BalanceKey.cs +++ b/src/TokensTracker/Trackers/NEP-17/Nep17BalanceKey.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep17BalanceKey.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/NEP-17/Nep17Tracker.cs b/src/TokensTracker/Trackers/NEP-17/Nep17Tracker.cs index 38a613149..989bc6a41 100644 --- a/src/TokensTracker/Trackers/NEP-17/Nep17Tracker.cs +++ b/src/TokensTracker/Trackers/NEP-17/Nep17Tracker.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep17Tracker.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/NEP-17/Nep17TransferKey.cs b/src/TokensTracker/Trackers/NEP-17/Nep17TransferKey.cs index 89e616e3c..8f48195fc 100644 --- a/src/TokensTracker/Trackers/NEP-17/Nep17TransferKey.cs +++ b/src/TokensTracker/Trackers/NEP-17/Nep17TransferKey.cs @@ -1,15 +1,16 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// Nep17TransferKey.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without // modifications are permitted. -using System; using Neo.IO; +using System; namespace Neo.Plugins.Trackers.NEP_17 { diff --git a/src/TokensTracker/Trackers/TokenBalance.cs b/src/TokensTracker/Trackers/TokenBalance.cs index 8e19b7d13..f54a7c985 100644 --- a/src/TokensTracker/Trackers/TokenBalance.cs +++ b/src/TokensTracker/Trackers/TokenBalance.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TokenBalance.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/TokenTransfer.cs b/src/TokensTracker/Trackers/TokenTransfer.cs index e79403a82..0a221850f 100644 --- a/src/TokensTracker/Trackers/TokenTransfer.cs +++ b/src/TokensTracker/Trackers/TokenTransfer.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TokenTransfer.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/TokenTransferKey.cs b/src/TokensTracker/Trackers/TokenTransferKey.cs index 3aed7197a..252eb20af 100644 --- a/src/TokensTracker/Trackers/TokenTransferKey.cs +++ b/src/TokensTracker/Trackers/TokenTransferKey.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TokenTransferKey.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/src/TokensTracker/Trackers/TrackerBase.cs b/src/TokensTracker/Trackers/TrackerBase.cs index a4d03c93a..471362b01 100644 --- a/src/TokensTracker/Trackers/TrackerBase.cs +++ b/src/TokensTracker/Trackers/TrackerBase.cs @@ -1,8 +1,9 @@ -// Copyright (C) 2015-2023 The Neo Project. +// Copyright (C) 2015-2024 The Neo Project. // -// The Neo.Plugins.TokensTracker is free software distributed under the MIT software license, -// see the accompanying file LICENSE in the main directory of the -// project or http://www.opensource.org/licenses/mit-license.php +// TrackerBase.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php // for more details. // // Redistribution and use in source and binary forms with or without diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index bfbc4d574..6ff47a7c2 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,15 +1,15 @@ - + - net7.0 false - - - - + + + - - + + + + \ No newline at end of file diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/Helper.cs b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/Helper.cs index 7f87051e1..15f796046 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/Helper.cs +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/Helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// Helper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using System.IO; namespace Neo.Cryptography.MPTTrie.Tests diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Cache.cs b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Cache.cs index 2ed2d5d86..3a3496205 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Cache.cs +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Cache.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Cache.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.IO; using Neo.Persistence; diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Helper.cs b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Helper.cs index 77ee3b08e..980e7a429 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Helper.cs +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Helper.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using System; diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Node.cs b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Node.cs index 1aedc2051..8f46fbec2 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Node.cs +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Node.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Node.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.IO; using System; diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Trie.cs b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Trie.cs index bc0a821fc..372de6a73 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Trie.cs +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Cryptography/MPTTrie/UT_Trie.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Trie.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.IO; using Neo.Persistence; diff --git a/tests/Neo.Cryptography.MPTTrie.Tests/Neo.Cryptography.MPTTrie.Tests.csproj b/tests/Neo.Cryptography.MPTTrie.Tests/Neo.Cryptography.MPTTrie.Tests.csproj index 1b75c6025..17392da61 100644 --- a/tests/Neo.Cryptography.MPTTrie.Tests/Neo.Cryptography.MPTTrie.Tests.csproj +++ b/tests/Neo.Cryptography.MPTTrie.Tests/Neo.Cryptography.MPTTrie.Tests.csproj @@ -1,10 +1,8 @@ - Neo.Cryptography.MPT.Tests - - + \ No newline at end of file diff --git a/tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj b/tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj index 03a168e92..73e7a531a 100644 --- a/tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj +++ b/tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj @@ -1,26 +1,21 @@ - Neo.Network.RPC.Tests - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive - - PreserveNewest - diff --git a/tests/Neo.Network.RPC.Tests/RpcTestCases.json b/tests/Neo.Network.RPC.Tests/RpcTestCases.json index f8b1e59b8..4e36c98f8 100644 --- a/tests/Neo.Network.RPC.Tests/RpcTestCases.json +++ b/tests/Neo.Network.RPC.Tests/RpcTestCases.json @@ -1202,8 +1202,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -2, @@ -1300,8 +1299,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -3, @@ -1505,8 +1503,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -4, @@ -1614,8 +1611,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -5, @@ -1796,8 +1792,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -6, @@ -1860,8 +1855,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -7, @@ -1969,8 +1963,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } }, { "id": -8, @@ -2263,8 +2256,7 @@ ], "trusts": [], "extra": null - }, - "updatehistory": [ 0 ] + } } ] } @@ -2479,7 +2471,6 @@ "result": { "network": 0, "tcpport": 20333, - "wsport": 20334, "nonce": 592651621, "useragent": "/Neo:3.0.0-rc1/", "protocol": { @@ -2491,7 +2482,13 @@ "addressversion": 0, "maxtransactionsperblock": 0, "memorypoolmaxtransactions": 0, - "initialgasdistribution": 0 + "initialgasdistribution": 0, + "hardforks": [ + { + "name": "Aspidochelone", + "blockheight": 0 + } + ] } } } diff --git a/tests/Neo.Network.RPC.Tests/TestUtils.cs b/tests/Neo.Network.RPC.Tests/TestUtils.cs index 74380f613..068de3388 100644 --- a/tests/Neo.Network.RPC.Tests/TestUtils.cs +++ b/tests/Neo.Network.RPC.Tests/TestUtils.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// TestUtils.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Neo.Json; using Neo.Network.P2P.Payloads; using Neo.Network.RPC.Models; diff --git a/tests/Neo.Network.RPC.Tests/UT_ContractClient.cs b/tests/Neo.Network.RPC.Tests/UT_ContractClient.cs index b46289f8a..c3cf226a3 100644 --- a/tests/Neo.Network.RPC.Tests/UT_ContractClient.cs +++ b/tests/Neo.Network.RPC.Tests/UT_ContractClient.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_ContractClient.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.SmartContract; diff --git a/tests/Neo.Network.RPC.Tests/UT_Nep17API.cs b/tests/Neo.Network.RPC.Tests/UT_Nep17API.cs index 566efc9e4..3bfb4e87f 100644 --- a/tests/Neo.Network.RPC.Tests/UT_Nep17API.cs +++ b/tests/Neo.Network.RPC.Tests/UT_Nep17API.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Nep17API.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.Json; @@ -104,13 +115,13 @@ public async Task TestGetTokenInfo() { var result = await nep17API.GetTokenInfoAsync(NativeContract.GAS.Name.ToLower()); Assert.AreEqual(NativeContract.GAS.Symbol, result.Symbol); - Assert.AreEqual(8, (int)result.Decimals); + Assert.AreEqual(8, result.Decimals); Assert.AreEqual(1_00000000, (int)result.TotalSupply); Assert.AreEqual("GasToken", result.Name); result = await nep17API.GetTokenInfoAsync(NativeContract.GAS.Hash); Assert.AreEqual(NativeContract.GAS.Symbol, result.Symbol); - Assert.AreEqual(8, (int)result.Decimals); + Assert.AreEqual(8, result.Decimals); Assert.AreEqual(1_00000000, (int)result.TotalSupply); Assert.AreEqual("GasToken", result.Name); haveGasTokenUT = true; @@ -119,13 +130,13 @@ public async Task TestGetTokenInfo() { var result = await nep17API.GetTokenInfoAsync(NativeContract.NEO.Name.ToLower()); Assert.AreEqual(NativeContract.NEO.Symbol, result.Symbol); - Assert.AreEqual(0, (int)result.Decimals); + Assert.AreEqual(0, result.Decimals); Assert.AreEqual(1_00000000, (int)result.TotalSupply); Assert.AreEqual("NeoToken", result.Name); result = await nep17API.GetTokenInfoAsync(NativeContract.NEO.Hash); Assert.AreEqual(NativeContract.NEO.Symbol, result.Symbol); - Assert.AreEqual(0, (int)result.Decimals); + Assert.AreEqual(0, result.Decimals); Assert.AreEqual(1_00000000, (int)result.TotalSupply); Assert.AreEqual("NeoToken", result.Name); haveNeoTokenUT = true; @@ -137,16 +148,20 @@ public async Task TestGetTokenInfo() [TestMethod] public async Task TestTransfer() { - byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, new BigInteger(1_00000000), null); + byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, new BigInteger(1_00000000), null) + .Concat(new[] { (byte)OpCode.ASSERT }) + .ToArray(); UT_TransactionManager.MockInvokeScript(rpcClientMock, testScript, new ContractParameter()); var client = rpcClientMock.Object; - var result = await nep17API.CreateTransferTxAsync(NativeContract.GAS.Hash, keyPair1, UInt160.Zero, new BigInteger(1_00000000)); + var result = await nep17API.CreateTransferTxAsync(NativeContract.GAS.Hash, keyPair1, UInt160.Zero, new BigInteger(1_00000000), null, true); - testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, new BigInteger(1_00000000), string.Empty); + testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, new BigInteger(1_00000000), string.Empty) + .Concat(new[] { (byte)OpCode.ASSERT }) + .ToArray(); UT_TransactionManager.MockInvokeScript(rpcClientMock, testScript, new ContractParameter()); - result = await nep17API.CreateTransferTxAsync(NativeContract.GAS.Hash, keyPair1, UInt160.Zero, new BigInteger(1_00000000), string.Empty); + result = await nep17API.CreateTransferTxAsync(NativeContract.GAS.Hash, keyPair1, UInt160.Zero, new BigInteger(1_00000000), string.Empty, true); Assert.IsNotNull(result); } } diff --git a/tests/Neo.Network.RPC.Tests/UT_PolicyAPI.cs b/tests/Neo.Network.RPC.Tests/UT_PolicyAPI.cs index 610a25313..7defa163a 100644 --- a/tests/Neo.Network.RPC.Tests/UT_PolicyAPI.cs +++ b/tests/Neo.Network.RPC.Tests/UT_PolicyAPI.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_PolicyAPI.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.SmartContract; diff --git a/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs b/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs index 52191b34f..4af0f557e 100644 --- a/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs +++ b/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_RpcClient.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; diff --git a/tests/Neo.Network.RPC.Tests/UT_RpcModels.cs b/tests/Neo.Network.RPC.Tests/UT_RpcModels.cs index b31a4e818..43eb7cfe7 100644 --- a/tests/Neo.Network.RPC.Tests/UT_RpcModels.cs +++ b/tests/Neo.Network.RPC.Tests/UT_RpcModels.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_RpcModels.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.Json; diff --git a/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs b/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs index 6d6120c25..ae025cf65 100644 --- a/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs +++ b/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_TransactionManager.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.Cryptography; diff --git a/tests/Neo.Network.RPC.Tests/UT_Utility.cs b/tests/Neo.Network.RPC.Tests/UT_Utility.cs index a91b40725..fa410c543 100644 --- a/tests/Neo.Network.RPC.Tests/UT_Utility.cs +++ b/tests/Neo.Network.RPC.Tests/UT_Utility.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_Utility.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.SmartContract; using Neo.Wallets; diff --git a/tests/Neo.Network.RPC.Tests/UT_WalletAPI.cs b/tests/Neo.Network.RPC.Tests/UT_WalletAPI.cs index 991c7f8b8..10a35fd06 100644 --- a/tests/Neo.Network.RPC.Tests/UT_WalletAPI.cs +++ b/tests/Neo.Network.RPC.Tests/UT_WalletAPI.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_WalletAPI.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Neo.Cryptography.ECC; @@ -8,6 +19,7 @@ using Neo.SmartContract.Native; using Neo.VM; using Neo.Wallets; +using System.Linq; using System.Numerics; using System.Threading.Tasks; @@ -89,7 +101,7 @@ public async Task TestClaimGas() json["hash"] = UInt256.Zero.ToString(); rpcClientMock.Setup(p => p.RpcSendAsync("sendrawtransaction", It.IsAny())).ReturnsAsync(json); - var tranaction = await walletAPI.ClaimGasAsync(keyPair1.Export()); + var tranaction = await walletAPI.ClaimGasAsync(keyPair1.Export(), false); Assert.AreEqual(testScript.ToHexString(), tranaction.Script.Span.ToHexString()); } @@ -99,14 +111,16 @@ public async Task TestTransfer() byte[] decimalsScript = NativeContract.GAS.Hash.MakeScript("decimals"); UT_TransactionManager.MockInvokeScript(rpcClientMock, decimalsScript, new ContractParameter { Type = ContractParameterType.Integer, Value = new BigInteger(8) }); - byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, NativeContract.GAS.Factor * 100, null); + byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", sender, UInt160.Zero, NativeContract.GAS.Factor * 100, null) + .Concat(new[] { (byte)OpCode.ASSERT }) + .ToArray(); UT_TransactionManager.MockInvokeScript(rpcClientMock, testScript, new ContractParameter { Type = ContractParameterType.Integer, Value = new BigInteger(1_10000000) }); var json = new JObject(); json["hash"] = UInt256.Zero.ToString(); rpcClientMock.Setup(p => p.RpcSendAsync("sendrawtransaction", It.IsAny())).ReturnsAsync(json); - var tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash.ToString(), keyPair1.Export(), UInt160.Zero.ToAddress(client.protocolSettings.AddressVersion), 100); + var tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash.ToString(), keyPair1.Export(), UInt160.Zero.ToAddress(client.protocolSettings.AddressVersion), 100, null, true); Assert.AreEqual(testScript.ToHexString(), tranaction.Script.Span.ToHexString()); } @@ -121,19 +135,21 @@ public async Task TestTransferfromMultiSigAccount() byte[] decimalsScript = NativeContract.GAS.Hash.MakeScript("decimals"); UT_TransactionManager.MockInvokeScript(rpcClientMock, decimalsScript, new ContractParameter { Type = ContractParameterType.Integer, Value = new BigInteger(8) }); - byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", multiSender, UInt160.Zero, NativeContract.GAS.Factor * 100, null); + byte[] testScript = NativeContract.GAS.Hash.MakeScript("transfer", multiSender, UInt160.Zero, NativeContract.GAS.Factor * 100, null) + .Concat(new[] { (byte)OpCode.ASSERT }) + .ToArray(); UT_TransactionManager.MockInvokeScript(rpcClientMock, testScript, new ContractParameter { Type = ContractParameterType.Integer, Value = new BigInteger(1_10000000) }); var json = new JObject(); json["hash"] = UInt256.Zero.ToString(); rpcClientMock.Setup(p => p.RpcSendAsync("sendrawtransaction", It.IsAny())).ReturnsAsync(json); - var tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 1, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100); + var tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 1, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100, null, true); Assert.AreEqual(testScript.ToHexString(), tranaction.Script.Span.ToHexString()); try { - tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 2, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100); + tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 2, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100, null, true); Assert.Fail(); } catch (System.Exception e) @@ -141,10 +157,12 @@ public async Task TestTransferfromMultiSigAccount() Assert.AreEqual(e.Message, $"Need at least 2 KeyPairs for signing!"); } - testScript = NativeContract.GAS.Hash.MakeScript("transfer", multiSender, UInt160.Zero, NativeContract.GAS.Factor * 100, string.Empty); + testScript = NativeContract.GAS.Hash.MakeScript("transfer", multiSender, UInt160.Zero, NativeContract.GAS.Factor * 100, string.Empty) + .Concat(new[] { (byte)OpCode.ASSERT }) + .ToArray(); UT_TransactionManager.MockInvokeScript(rpcClientMock, testScript, new ContractParameter { Type = ContractParameterType.Integer, Value = new BigInteger(1_10000000) }); - tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 1, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100, string.Empty); + tranaction = await walletAPI.TransferAsync(NativeContract.GAS.Hash, 1, new[] { keyPair1.PublicKey }, new[] { keyPair1 }, UInt160.Zero, NativeContract.GAS.Factor * 100, string.Empty, true); Assert.AreEqual(testScript.ToHexString(), tranaction.Script.Span.ToHexString()); } diff --git a/tests/Neo.Plugins.OracleService.Tests/Neo.Plugins.OracleService.Tests.csproj b/tests/Neo.Plugins.OracleService.Tests/Neo.Plugins.OracleService.Tests.csproj index ca84e4303..cb4dd1c6c 100644 --- a/tests/Neo.Plugins.OracleService.Tests/Neo.Plugins.OracleService.Tests.csproj +++ b/tests/Neo.Plugins.OracleService.Tests/Neo.Plugins.OracleService.Tests.csproj @@ -1,17 +1,17 @@ - OracleService.Tests Neo.Plugins - - - + + - - + + + false + runtime + - - + \ No newline at end of file diff --git a/tests/Neo.Plugins.OracleService.Tests/TestBlockchain.cs b/tests/Neo.Plugins.OracleService.Tests/TestBlockchain.cs index 4210beba9..fca5ca9d4 100644 --- a/tests/Neo.Plugins.OracleService.Tests/TestBlockchain.cs +++ b/tests/Neo.Plugins.OracleService.Tests/TestBlockchain.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// TestBlockchain.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Neo.Persistence; using System; diff --git a/tests/Neo.Plugins.OracleService.Tests/TestUtils.cs b/tests/Neo.Plugins.OracleService.Tests/TestUtils.cs index f6e06a46e..5700b8376 100644 --- a/tests/Neo.Plugins.OracleService.Tests/TestUtils.cs +++ b/tests/Neo.Plugins.OracleService.Tests/TestUtils.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// TestUtils.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Neo.IO; using Neo.SmartContract; using Neo.SmartContract.Native; diff --git a/tests/Neo.Plugins.OracleService.Tests/UT_OracleService.cs b/tests/Neo.Plugins.OracleService.Tests/UT_OracleService.cs index 672ded757..08f96c95d 100644 --- a/tests/Neo.Plugins.OracleService.Tests/UT_OracleService.cs +++ b/tests/Neo.Plugins.OracleService.Tests/UT_OracleService.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_OracleService.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Akka.TestKit.Xunit2; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.Cryptography.ECC; @@ -64,7 +75,7 @@ public void TestCreateOracleResponseTx() var executionFactor = NativeContract.Policy.GetExecFeeFactor(snapshot); Assert.AreEqual(executionFactor, (uint)30); var feePerByte = NativeContract.Policy.GetFeePerByte(snapshot); - Assert.AreEqual(feePerByte, (uint)1000); + Assert.AreEqual(feePerByte, 1000); OracleRequest request = new OracleRequest { diff --git a/tests/Neo.Plugins.RpcServer.Tests/Neo.Plugins.RpcServer.Tests.csproj b/tests/Neo.Plugins.RpcServer.Tests/Neo.Plugins.RpcServer.Tests.csproj index 422b0ae28..9b3fcaed4 100644 --- a/tests/Neo.Plugins.RpcServer.Tests/Neo.Plugins.RpcServer.Tests.csproj +++ b/tests/Neo.Plugins.RpcServer.Tests/Neo.Plugins.RpcServer.Tests.csproj @@ -1,16 +1,12 @@ - Neo.Plugins.RpcServer.Tests Neo.Plugins.RpcServer.Tests - - - + - - + \ No newline at end of file diff --git a/tests/Neo.Plugins.RpcServer.Tests/UT_RpcServer.cs b/tests/Neo.Plugins.RpcServer.Tests/UT_RpcServer.cs index a2b3476a9..803980eb8 100644 --- a/tests/Neo.Plugins.RpcServer.Tests/UT_RpcServer.cs +++ b/tests/Neo.Plugins.RpcServer.Tests/UT_RpcServer.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// UT_RpcServer.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Neo.Plugins.RpcServer.Tests diff --git a/tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj b/tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj index c6798b71a..10f373f5e 100644 --- a/tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj +++ b/tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj @@ -1,12 +1,9 @@ - Neo.Plugins.Storage.Tests - - - + \ No newline at end of file diff --git a/tests/Neo.Plugins.Storage.Tests/StoreTest.cs b/tests/Neo.Plugins.Storage.Tests/StoreTest.cs index 1ce26a13e..2773f92e8 100644 --- a/tests/Neo.Plugins.Storage.Tests/StoreTest.cs +++ b/tests/Neo.Plugins.Storage.Tests/StoreTest.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2024 The Neo Project. +// +// StoreTest.cs file belongs to the neo project and is free +// software distributed under the MIT software license, see the +// accompanying file LICENSE in the main directory of the +// repository or http://www.opensource.org/licenses/mit-license.php +// for more details. +// +// Redistribution and use in source and binary forms with or without +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.Persistence; using System.IO;