diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4f76e26 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,320 @@ +############################### +# Core EditorConfig Options # +############################### + +# dotnet-format requires version 3.1.37601 +# 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 + +# 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 + +# YAML files +[*.yml] +end_of_line = lf +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Use block-scoped namespace +csharp_style_namespace_declarations = block_scoped:error +dotnet_diagnostic.IDE0160.severity = error +dotnet_diagnostic.IDE0161.severity = error + +# 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:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning + +# 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:warning +dotnet_style_collection_initializer = true:warning +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-2025 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}] + +# Use collection expression for array +dotnet_diagnostic.IDE0300.severity = warning + +# Avoid "this." and "Me." if not necessary +dotnet_diagnostic.IDE0003.severity = warning +dotnet_diagnostic.IDE0009.severity = warning + +# 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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3a65aeb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,70 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text eol=lf +*.cs text eol=lf +*.csproj text eol=lf +*.props text eol=lf +*.json text eol=lf +*.targets 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 +*.zip 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 new file mode 100644 index 0000000..0b8f8c6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,93 @@ +name: .NET Core Test and Publish + +on: + push: + branches: [master] + pull_request: + +env: + DOTNET_VERSION: 9.0.x + +jobs: + + Format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Check Format (*.cs) + run: dotnet format --verify-no-changes --verbosity diagnostic + + Test: + needs: [Format] + timeout-minutes: 15 + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Test + run: | + dotnet restore + dotnet build --no-restore + #dotnet test --no-build + + PublishPackage: + if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/') + needs: [Test] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Set Version + run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV + + - name : Pack (Everything) + run: | + dotnet pack \ + --configuration Release \ + --output ./out \ + --version-suffix ${{ env.VERSION_SUFFIX }} + + - name: Publish to Github Packages + working-directory: ./out + run: | + dotnet nuget push * \ + --source https://nuget.pkg.github.com/neo-project/index.json \ + --api-key "${{ secrets.GITHUB_TOKEN }}" \ + --disable-buffering \ + --no-service-endpoint + + - name: Publish to myGet + working-directory: ./out + run: | + dotnet nuget push * \ + --source https://www.myget.org/F/neo/api/v3/index.json \ + --api-key "${{ secrets.MYGET_TOKEN }}" \ + --disable-buffering \ + --no-service-endpoint diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml new file mode 100644 index 0000000..01404b0 --- /dev/null +++ b/.github/workflows/nuget.yml @@ -0,0 +1,47 @@ +name: Release (nuget) + +# Trigger the workflow on a release event when a new release is published +on: + release: + types: [published] + +# Define environment variables +env: + DOTNET_VERSION: 9.0.x + CONFIGURATION: Release + +jobs: + nuget-release: + runs-on: ubuntu-latest + steps: + # Step to set the application version from the release tag + - name: Set Application Version (Environment Variable) + run: | + APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2) + echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Pack NuGet Packages + run: | + dotnet pack ./neo.sln \ + --configuration Release \ + --output ./pkgs \ + --verbosity normal \ + -p:VersionPrefix=${{ env.APP_VERSION }} + + - name: Publish to NuGet.org + run: | + dotnet nuget push ./pkgs/*.nupkg \ + --source https://api.nuget.org/v3/index.json \ + --api-key ${{ secrets.NUGET_TOKEN }} \ + --skip-duplicate diff --git a/.github/workflows/pkgs-delete.yml b/.github/workflows/pkgs-delete.yml new file mode 100644 index 0000000..ed61076 --- /dev/null +++ b/.github/workflows/pkgs-delete.yml @@ -0,0 +1,27 @@ +name: Package Cleanup + +on: + schedule: + - cron: '0 0 * * *' # Run every day at 24:00 + +jobs: + + delete-git-nuget-pkgs: + name: Delete Old Nuget Packages + strategy: + matrix: + pkgs: + - "Neo.FileStorage.API" + + runs-on: ubuntu-latest + + steps: + - name: Delete ${{ matrix.pkgs }} Package + uses: actions/delete-package-versions@v4 + continue-on-error: true + with: + package-name: ${{ matrix.pkgs }} + package-type: nuget + min-versions-to-keep: 3 + delete-only-pre-release-versions: "true" + token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8493892..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: .NET - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 9.0.x - - name: Pull dependency - run: git submodule update --init - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - # - name: Test - # run: dotnet test --filter 'FullyQualifiedName!~Neo.FileStorage.API.UnitTests.FSClient.UT_Client&FullyQualifiedName!~Neo.FileStorage.API.UnitTests.UT_ControlClient' --no-build --verbosity normal diff --git a/.gitignore b/.gitignore index a183254..16342ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,264 @@ -.vs -.vscode -.idea -bin -obj +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. -vendor/* -!vendor/.gitkeep +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates -publish -tests/Neo.FileStorage.API.UnitTests/Netmap/TestData/ +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# 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 + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.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 + +# 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 + +# 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 +# TODO: 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 +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable 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 + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +*.[Cc]ache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# 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 + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# 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 + +PublishProfiles +/.vscode +launchSettings.json +/coverages +**/.DS_Store + +# Benchmarks +**/BenchmarkDotNet.Artifacts/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5fd0592 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,82 @@ + +# Contributing to NEO +Neo is an open-source project and it depends on its contributors and constant community feedback to implement the features required for a smart economy. You are more than welcome to join us in the development of Neo. + +Read this document to understand how issues are organized and how you can start contributing. + +*This document covers this repository only and does not include community repositories or repositories managed by NGD Shanghai and NGD Seattle.* + +### Questions and Support +The issue list is reserved exclusively for bug reports and features discussions. If you have questions or need support, please visit us in our [Discord](https://discord.io/neo) server. + +### dApp Development +This document does not relate to dApp development. If you are looking to build a dApp using Neo, please [start here](https://neo.org/dev). + +### Contributing to open source projects +If you are new to open-source development, please [read here](https://opensource.guide/how-to-contribute/#opening-a-pull-request) how to submit your code. + +## Developer Guidance +We try to have as few rules as possible, just enough to keep the project organized: + + +1. **Discuss before coding**. Proposals must be discussed before being implemented. +Avoid implementing issues with the discussion tag. +2. **Tests during code review**. We expect reviewers to test the issue before approving or requesting changes. + +3. **Wait for at least 2 reviews before merging**. Changes can be merged after 2 approvals, for Neo 3.x branch, and 3 approvals for Neo 2.x branch. + +3. **Give time to other developers review an issue**. Even if the code has been approved, you should leave at least 24 hours for others to review it before merging the code. + +4. **Create unit tests**. It is important that the developer includes basic unit tests so reviewers can test it. + +5. **Task assignment**. If a developer wants to work in a specific issue, he may ask the team to assign it to himself. The proposer of an issue has priority in task assignment. + + +### Issues for beginners +If you are looking to start contributing to NEO, we suggest you start working on issues with ![](./.github/images/cosmetic.png) or ![](./.github/images/house-keeping.png) tags since they usually do not depend on extensive NEO platform knowledge. + +### Tags for Issues States + +![Discussion](./.github/images/discussion.png) Whenever someone posts a new feature request, the tag discussion is added. This means that there is no consensus if the feature should be implemented or not. Avoid creating PR to solve issues in this state since it may be completely discarded. + +![Design](./.github/images/solution-design.png) When a feature request is accepted by the team, but there is no consensus about the implementation, the issue is tagged with design. We recommend the team to agree in the solution design before anyone attempts to implement it, using text or UML. It is not recommended, but developers can also present their solution using code. +Note that PRs for issues in this state may also be discarded if the team disagree with the proposed solution. + +![Ready-to-implement](./.github/images/ready-to-implement.png) Once the team has agreed on feature and the proposed solution, the issue is tagged with ready-to-implement. When implementing it, please follow the solution accepted by the team. + +### Tags for Issue Types + +![Cosmetic](./.github/images/cosmetic.png) Issues with the cosmetic tag are usually changes in code or documentation that improve user experience without affecting current functionality. These issues are recommended for beginners because they require little to no knowledge about Neo platform. + +![Enhancement](./.github/images/enhancement.png) Enhancements are platform changes that may affect performance, usability or add new features to existing modules. It is recommended that developers have previous knowledge in the platform to work in these improvements, specially in more complicated modules like the compiler, ledger and consensus. + +![Feature](./.github/images/new-feature.png) New features may include large changes in the code base. Some are complex, but some are not. So, a few issues with new-feature may be recommended for starters, specially those related to the rpc and the sdk module. + +![Migration](./.github/images/migration.png) Issues related to the migration from Neo 2 to Neo 3 are tagged with migration. These issues are usually the most complicated ones since they require a deep knowledge in both versions. + +### Tags for Project Modules +These tags do not necessarily represent each module at code level. Modules consensus and compiler are not recommended for beginners. + +![Compiler](./.github/images/compiler.png) Issues that are related or influence the behavior of our C# compiler. Note that the compiler itself is hosted in the [neo-devpack-dotnet](https://github.com/neo-project/neo-devpack-dotnet) repository. + +![Consensus](./.github/images/consensus.png) Changes to consensus are usually harder to make and test. Avoid implementing issues in this module that are not yet decided. + +![Ledger](./.github/images/ledger.png) The ledger is our 'database', any changes in the way we store information or the data-structures have this tag. + +![House-keeping](./.github/images/house-keeping.png) 'Small' enhancements that need to be done in order to keep the project organised and ensure overall quality. These changes may be applied in any place in code, as long as they are small or do not alter current behavior. + +![Network-policy](./.github/images/network-policy.png) Identify issues that affect the network-policy like fees, access list or other related issues. Voting may also be related to the network policy module. + +![P2P](./.github/images/p2p.png) This module includes peer-to-peer message exchange and network optimisations, at TCP or UDP level (not HTTP). + +![RPC](./.github/images/rpc.png) All HTTP communication is handled by the RPC module. This module usually provides support methods since the main communication protocol takes place at the p2p module. + +![VM](./.github/images/vm.png) New features that affect the Neo Virtual Machine or the Interop layer. + +![SDK](./.github/images/sdk.png) Neo provides an SDK to help developers to interact with the blockchain. Changes in this module must not impact other parts of the software. + +![Wallet](./.github/images/wallet.png) Wallets are used to track funds and interact with the blockchain. Note that this module depends on a full node implementation (data stored on local disk). + + + + diff --git a/LICENSE b/LICENSE index 99f8e00..20efd1b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 +Copyright (c) 2015 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NuGet.Config b/NuGet.Config index 5b86428..53fc635 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 7a0f33c..8a48ce8 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,154 @@ -# NeoFS API CSharp +

+ + neo-logo + +

-[docs](./docs) +

CSharp implementation of the neo blockchain protocol.

-[nuget package](https://www.nuget.org/packages/NeoFS.API/) +

+ A modern distributed network for the Smart Economy. +
+ Documentation » +
+
+ Neo + · + Neo Modules + · + Neo DevPack +

+

+ + + +   + + + +   + + + +   + + + +   + + + +   + + + +   + + + +   + + + + +   + + + +

+

+ + Current neo version. + + + Coverage Status + + + License. + +

-### Requirements -- DotNet SDK (v5.0.0+) -- protobuf / protoc (3.11.4+) +

+ + Open in GitHub Codespaces. + +

-### Regenerate NeoFS Proto files and documentation -``` -# DotNet Restore -$ dotnet restore -# Regenerate doc files -$ make docgen -``` +## Table of Contents +1. [Overview](#overview) +2. [Project structure](#project-structure) +3. [Related projects](#related-projects) +4. [Opening a new issue](#opening-a-new-issue) +5. [Bounty program](#bounty-program) +6. [License](#license) -## License +## Overview +This repository is a csharp implementation of the [neo](https://neo.org) blockchain. It is jointly maintained by the neo core developers and neo global development community. +Visit the [tutorials](https://docs.neo.org) to get started. + + +## Project structure +An overview of the project folders can be seen below. + +|Folder|Content| +|---|---| +|[/src/neo/Cryptography/](https://github.com/neo-project/neo/tree/master/src/Neo/Cryptography)|General cryptography implementation, including ECC.| +|[/src/neo/IO/](https://github.com/neo-project/neo/tree/master/src/Neo/IO)|Data structures used for caching and collection interaction.| +|[/src/neo/Ledger/](https://github.com/neo-project/neo/tree/master/src/Neo/Ledger)|Classes responsible for the state control, including the `MemoryPool` and `Blockchain`.| +|[/src/neo/Network/](https://github.com/neo-project/neo/tree/master/src/Neo/Network)|Peer-to-peer protocol implementation.| +|[/src/neo/Persistence/](https://github.com/neo-project/neo/tree/master/src/Neo/Persistence)|Classes used to allow other classes to access application state.| +|[/src/neo/Plugins/](https://github.com/neo-project/neo/tree/master/src/Neo/Plugins)|Interfaces used to extend Neo, including the storage interface.| +|[/src/neo/SmartContract/](https://github.com/neo-project/neo/tree/master/src/Neo/SmartContract)|Native contracts, `ApplicationEngine`, `InteropService` and other smart-contract related classes.| +|[/src/neo/VM/](https://github.com/neo-project/neo/tree/master/src/Neo/VM)|Helper methods used to interact with the VM.| +|[/src/neo/Wallets/](https://github.com/neo-project/neo/tree/master/src/Neo/Wallets)|Wallet and account implementation.| +|[/src/Neo.CLI/](https://github.com/neo-project/neo/tree/master/src/Neo.CLI)| `neo-cli` console application for running a _FULL_ node.| +|[/src/Neo.Extensions/](https://github.com/neo-project/neo/tree/master/src/Neo.Extensions)| Extensions to expand the existing functionality.| +|[/src/Neo.Json/](https://github.com/neo-project/neo/tree/master/src/Neo.Json)| Neo's JSON specification.| +|[/src/Neo.VM/](https://github.com/neo-project/neo/tree/master/src/Neo.VM)|Neo virtual machine.| +|[/src/plugins/](https://github.com/neo-project/neo/tree/master/src/Plugins)| Include `ApplicationLogs`, `LevelDBStore`, `RpcServer`, `OracleService`, `DBFTPlugin` and more.| +|[/tests/](https://github.com/neo-project/neo/tree/master/tests)|All unit tests.| + +## Related projects +Code references are provided for all platform building blocks. That includes the base library, the VM, a command line application and the compiler. + +* [neo:](https://github.com/neo-project/neo/) Included libraries are Neo, Neo-CLI, Neo-GUI, Neo-VM, test and plugin modules. +* [neo-express:](https://github.com/neo-project/neo-express/) A private net optimized for development scenarios. +* [neo-devpack-dotnet:](https://github.com/neo-project/neo-devpack-dotnet/) These are the official tools used to convert a C# smart-contract into a *neo executable file*. +* [neo-proposals:](https://github.com/neo-project/proposals) NEO Enhancement Proposals (NEPs) describe standards for the NEO platform, including core protocol specifications, client APIs, and contract standards. +* [neo-non-native-contracts:](https://github.com/neo-project/non-native-contracts) Includes non-native contracts that live on the blockchain, included but not limited to NeoNameService. -This project is licensed under the MIT License - -see the [LICENSE](LICENSE) file for details +## Opening a new issue +Please feel free to create new issues to suggest features or ask questions. + +- [Feature request](https://github.com/neo-project/neo/issues/new?assignees=&labels=discussion&template=feature-or-enhancement-request.md&title=) +- [Bug report](https://github.com/neo-project/neo/issues/new?assignees=&labels=&template=bug_report.md&title=) +- [Questions](https://github.com/neo-project/neo/issues/new?assignees=&labels=question&template=questions.md&title=) + +If you found a security issue, please refer to our [security policy](https://github.com/neo-project/neo/security/policy). + +## Bounty program +You can be rewarded by finding security issues. Please refer to our [bounty program page](https://neo.org/bounty) for more information. + +## License +The NEO project is licensed under the [MIT license](LICENSE). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..24894d5 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,13 @@ +# Security Policy + +The purpose of NEO vulnerability bounty program is to be proactive about blockchain security by providing a channel for security researchers to report potential security vulnerabilities identified related to our underlying infrastructure. + +First, it is recommended to read the following page https://neo.org/dev/bounty, if you find a security vulnerability in NEO, please report it as indicated on that page. + +Please withhold public disclosure until the security team has addressed the vulnerability and it has been solved. + +We appreciate your efforts to responsibly disclose your findings, and we will make every effort to acknowledge your contributions. + +The security team will acknowledge your email within 5 business days. You will receive a more detailed response within 10 business days. + +When in doubt, please do send us a report. diff --git a/SpellingExclusions.dic b/SpellingExclusions.dic new file mode 100644 index 0000000..e69de29 diff --git a/global.json b/global.json new file mode 100644 index 0000000..13ac5fc --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "9.0.102", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} diff --git a/src/Neo.FileStorage.API/EnumJsonConverter.cs b/src/Neo.FileStorage.API/EnumJsonConverter.cs index 3b2c854..3b457d6 100644 --- a/src/Neo.FileStorage.API/EnumJsonConverter.cs +++ b/src/Neo.FileStorage.API/EnumJsonConverter.cs @@ -1,8 +1,19 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// EnumJsonConverter.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. + #nullable enable +using Newtonsoft.Json; using System; using System.Linq; -using Newtonsoft.Json; namespace Neo.FileStorage.API { diff --git a/src/Neo.FileStorage.API/Neo.FileStorage.API.csproj b/src/Neo.FileStorage.API/Neo.FileStorage.API.csproj index 73c7a8e..37fd682 100644 --- a/src/Neo.FileStorage.API/Neo.FileStorage.API.csproj +++ b/src/Neo.FileStorage.API/Neo.FileStorage.API.csproj @@ -1,23 +1,29 @@ - + - 2020-2021 The Neo Project - Neo.FileStorage.API - 3.5.0 + net9.0 + 2015-2025 The Neo Project + NeoFS API for CSharp + latest The Neo Project - net9.0 - NeoFS.API + true + $(MSBuildProjectName) + neo.png NEO;NeoFS - https://github.com/neo-ngd/neofs-api-csharp + https://github.com/neo-project/neofs-api-csharp MIT + README.md git - https://github.com/neo-ngd/neofs-api-csharp.git - Neo.FileStorage.API - false - false + https://github.com/neo-project/neofs-api-csharp.git + true + snupkg The Neo Project - NeoFS API for CSharp - $(DefineConstants);GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + true + 3.7.5 + true + 4 + latest + ../../bin/$(PackageId) @@ -56,6 +62,7 @@ + diff --git a/src/Neo.FileStorage.API/NeoFS.API.0.3.5.nupkg b/src/Neo.FileStorage.API/NeoFS.API.0.3.5.nupkg deleted file mode 100644 index ff58ac5..0000000 Binary files a/src/Neo.FileStorage.API/NeoFS.API.0.3.5.nupkg and /dev/null differ diff --git a/src/Neo.FileStorage.API/accounting/Extension.Message.cs b/src/Neo.FileStorage.API/accounting/Extension.Message.cs index 69d7605..5c09fb0 100644 --- a/src/Neo.FileStorage.API/accounting/Extension.Message.cs +++ b/src/Neo.FileStorage.API/accounting/Extension.Message.cs @@ -1,4 +1,15 @@ -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; using Neo.FileStorage.API.Session; namespace Neo.FileStorage.API.Accounting diff --git a/src/Neo.FileStorage.API/acl/Extantion.BasicAcl.cs b/src/Neo.FileStorage.API/acl/Extantion.BasicAcl.cs index 72cc7f9..888b5ee 100644 --- a/src/Neo.FileStorage.API/acl/Extantion.BasicAcl.cs +++ b/src/Neo.FileStorage.API/acl/Extantion.BasicAcl.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extantion.BasicAcl.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.Collections.Generic; namespace Neo.FileStorage.API.Acl diff --git a/src/Neo.FileStorage.API/acl/Extension.EACLRecord.Filter.cs b/src/Neo.FileStorage.API/acl/Extension.EACLRecord.Filter.cs index 157262e..a41d6d6 100644 --- a/src/Neo.FileStorage.API/acl/Extension.EACLRecord.Filter.cs +++ b/src/Neo.FileStorage.API/acl/Extension.EACLRecord.Filter.cs @@ -1,3 +1,13 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.EACLRecord.Filter.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. namespace Neo.FileStorage.API.Acl { diff --git a/src/Neo.FileStorage.API/client/CallOptions.cs b/src/Neo.FileStorage.API/client/CallOptions.cs index 7923a66..673f3d3 100644 --- a/src/Neo.FileStorage.API/client/CallOptions.cs +++ b/src/Neo.FileStorage.API/client/CallOptions.cs @@ -1,8 +1,19 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// CallOptions.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.FileStorage.API.Acl; +using Neo.FileStorage.API.Session; using System; using System.Collections.Generic; using System.Security.Cryptography; -using Neo.FileStorage.API.Acl; -using Neo.FileStorage.API.Session; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/client/Client.Accounting.cs b/src/Neo.FileStorage.API/client/Client.Accounting.cs index 4ae3a93..f2e3323 100644 --- a/src/Neo.FileStorage.API/client/Client.Accounting.cs +++ b/src/Neo.FileStorage.API/client/Client.Accounting.cs @@ -1,9 +1,20 @@ -using System; -using System.Threading; -using System.Threading.Tasks; +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Accounting.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.FileStorage.API.Accounting; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Refs; +using System; +using System.Threading; +using System.Threading.Tasks; namespace Neo.FileStorage.API.Client { @@ -19,9 +30,9 @@ public sealed partial class Client Body = new BalanceRequest.Types.Body { OwnerId = owner, - } + }, + MetaHeader = opts.GetRequestMetaHeader() }; - req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); return await GetBalance(req, opts.Deadline, context); } diff --git a/src/Neo.FileStorage.API/client/Client.Container.cs b/src/Neo.FileStorage.API/client/Client.Container.cs index c1ce57e..1966cee 100644 --- a/src/Neo.FileStorage.API/client/Client.Container.cs +++ b/src/Neo.FileStorage.API/client/Client.Container.cs @@ -1,15 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Container.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 Google.Protobuf; using Neo.FileStorage.API.Acl; using Neo.FileStorage.API.Container; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Session; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Threading; +using System.Threading.Tasks; using UsedSpaceAnnouncement = Neo.FileStorage.API.Container.AnnounceUsedSpaceRequest.Types.Body.Types.Announcement; namespace Neo.FileStorage.API.Client diff --git a/src/Neo.FileStorage.API/client/Client.Netmap.cs b/src/Neo.FileStorage.API/client/Client.Netmap.cs index e089db7..618addf 100644 --- a/src/Neo.FileStorage.API/client/Client.Netmap.cs +++ b/src/Neo.FileStorage.API/client/Client.Netmap.cs @@ -1,8 +1,19 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Netmap.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.FileStorage.API.Cryptography; +using Neo.FileStorage.API.Netmap; using System; using System.Threading; using System.Threading.Tasks; -using Neo.FileStorage.API.Cryptography; -using Neo.FileStorage.API.Netmap; namespace Neo.FileStorage.API.Client { @@ -14,9 +25,9 @@ public async Task LocalNodeInfo(CallOptions options = null, Cancellati CheckOptions(opts); var req = new LocalNodeInfoRequest { - Body = new LocalNodeInfoRequest.Types.Body { } + Body = new LocalNodeInfoRequest.Types.Body { }, + MetaHeader = opts.GetRequestMetaHeader() }; - req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); return await LocalNodeInfo(req, opts.Deadline, context); @@ -77,9 +88,9 @@ public async Task NetworkInfo(CallOptions options = null, Cancellat CheckOptions(opts); var req = new NetworkInfoRequest { - Body = new NetworkInfoRequest.Types.Body { } + Body = new NetworkInfoRequest.Types.Body { }, + MetaHeader = opts.GetRequestMetaHeader() }; - req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); var resp = await NetmapClient.NetworkInfoAsync(req, cancellationToken: context); ProcessResponse(resp); diff --git a/src/Neo.FileStorage.API/client/Client.Object.cs b/src/Neo.FileStorage.API/client/Client.Object.cs index 1c626a3..c76f3cf 100644 --- a/src/Neo.FileStorage.API/client/Client.Object.cs +++ b/src/Neo.FileStorage.API/client/Client.Object.cs @@ -1,3 +1,20 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Object.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 Google.Protobuf; +using Grpc.Core; +using Neo.FileStorage.API.Cryptography; +using Neo.FileStorage.API.Object; +using Neo.FileStorage.API.Refs; +using Neo.FileStorage.API.Session; using System; using System.Collections.Generic; using System.IO; @@ -5,12 +22,6 @@ using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; -using Google.Protobuf; -using Grpc.Core; -using Neo.FileStorage.API.Cryptography; -using Neo.FileStorage.API.Object; -using Neo.FileStorage.API.Refs; -using Neo.FileStorage.API.Session; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/client/Client.Option.cs b/src/Neo.FileStorage.API/client/Client.Option.cs index a1346cd..718c41d 100644 --- a/src/Neo.FileStorage.API/client/Client.Option.cs +++ b/src/Neo.FileStorage.API/client/Client.Option.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Option.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.FileStorage.API.Session; using System; diff --git a/src/Neo.FileStorage.API/client/Client.Reputation.cs b/src/Neo.FileStorage.API/client/Client.Reputation.cs index 58fd62d..9781ca4 100644 --- a/src/Neo.FileStorage.API/client/Client.Reputation.cs +++ b/src/Neo.FileStorage.API/client/Client.Reputation.cs @@ -1,9 +1,20 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.Reputation.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.FileStorage.API.Cryptography; +using Neo.FileStorage.API.Reputation; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Neo.FileStorage.API.Cryptography; -using Neo.FileStorage.API.Reputation; namespace Neo.FileStorage.API.Client { @@ -46,9 +57,9 @@ public async Task AnnounceIntermediateTrust(ulong epoch, uint iter, PeerToPeerTr Epoch = epoch, Iteration = iter, Trust = trust, - } + }, + MetaHeader = opts.GetRequestMetaHeader() }; - req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); var resp = await ReputationClient.AnnounceIntermediateResultAsync(req, cancellationToken: context); if (!resp.Verify()) diff --git a/src/Neo.FileStorage.API/client/Client.Session.cs b/src/Neo.FileStorage.API/client/Client.Session.cs index bece273..513ee2e 100644 --- a/src/Neo.FileStorage.API/client/Client.Session.cs +++ b/src/Neo.FileStorage.API/client/Client.Session.cs @@ -1,9 +1,20 @@ -using System; -using System.Threading; -using System.Threading.Tasks; +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.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 +// modifications are permitted. + using Neo.FileStorage.API.Acl; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Session; +using System; +using System.Threading; +using System.Threading.Tasks; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/client/Client.cs b/src/Neo.FileStorage.API/client/Client.cs index 7710b65..fdc4e66 100644 --- a/src/Neo.FileStorage.API/client/Client.cs +++ b/src/Neo.FileStorage.API/client/Client.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Client.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 Grpc.Core; using Grpc.Net.Client; using Neo.FileStorage.API.Accounting; diff --git a/src/Neo.FileStorage.API/client/ContainerWithSignature.cs b/src/Neo.FileStorage.API/client/ContainerWithSignature.cs index 41a2742..28f0bfa 100644 --- a/src/Neo.FileStorage.API/client/ContainerWithSignature.cs +++ b/src/Neo.FileStorage.API/client/ContainerWithSignature.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// ContainerWithSignature.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.FileStorage.API.Refs; using Neo.FileStorage.API.Session; diff --git a/src/Neo.FileStorage.API/client/EAclWithSignature.cs b/src/Neo.FileStorage.API/client/EAclWithSignature.cs index dbca652..5533ce5 100644 --- a/src/Neo.FileStorage.API/client/EAclWithSignature.cs +++ b/src/Neo.FileStorage.API/client/EAclWithSignature.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// EAclWithSignature.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.FileStorage.API.Acl; using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Session; diff --git a/src/Neo.FileStorage.API/client/IClientStream.cs b/src/Neo.FileStorage.API/client/IClientStream.cs index df675d8..96062c0 100644 --- a/src/Neo.FileStorage.API/client/IClientStream.cs +++ b/src/Neo.FileStorage.API/client/IClientStream.cs @@ -1,6 +1,17 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IClientStream.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.FileStorage.API.Session; using System; using System.Threading.Tasks; -using Neo.FileStorage.API.Session; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/client/Interfaces.cs b/src/Neo.FileStorage.API/client/Interfaces.cs index 7a8990d..e57ea15 100644 --- a/src/Neo.FileStorage.API/client/Interfaces.cs +++ b/src/Neo.FileStorage.API/client/Interfaces.cs @@ -1,7 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +// Copyright (C) 2015-2025 The Neo Project. +// +// Interfaces.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.FileStorage.API.Accounting; using Neo.FileStorage.API.Acl; using Neo.FileStorage.API.Container; @@ -10,6 +17,10 @@ using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Reputation; using Neo.FileStorage.API.Session; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using UsedSpaceAnnouncement = Neo.FileStorage.API.Container.AnnounceUsedSpaceRequest.Types.Body.Types.Announcement; namespace Neo.FileStorage.API.Client diff --git a/src/Neo.FileStorage.API/client/ObjectReader.cs b/src/Neo.FileStorage.API/client/ObjectReader.cs index d2eba8f..1d0f3ab 100644 --- a/src/Neo.FileStorage.API/client/ObjectReader.cs +++ b/src/Neo.FileStorage.API/client/ObjectReader.cs @@ -1,6 +1,17 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// ObjectReader.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 Grpc.Core; using Neo.FileStorage.API.Object; +using System; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/client/PutStream.cs b/src/Neo.FileStorage.API/client/PutStream.cs index 87c922a..fe55d7d 100644 --- a/src/Neo.FileStorage.API/client/PutStream.cs +++ b/src/Neo.FileStorage.API/client/PutStream.cs @@ -1,9 +1,20 @@ -using System; -using System.Threading.Tasks; +// Copyright (C) 2015-2025 The Neo Project. +// +// PutStream.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 Grpc.Core; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Object; using Neo.FileStorage.API.Session; +using System; +using System.Threading.Tasks; namespace Neo.FileStorage.API.Client { diff --git a/src/Neo.FileStorage.API/container/Extension.Container.cs b/src/Neo.FileStorage.API/container/Extension.Container.cs index 15c5d9c..777d89e 100644 --- a/src/Neo.FileStorage.API/container/Extension.Container.cs +++ b/src/Neo.FileStorage.API/container/Extension.Container.cs @@ -1,6 +1,17 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Container.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 Google.Protobuf; -using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Cryptography; +using Neo.FileStorage.API.Refs; using System; namespace Neo.FileStorage.API.Container diff --git a/src/Neo.FileStorage.API/container/Extension.Message.cs b/src/Neo.FileStorage.API/container/Extension.Message.cs index 26d8bdc..2a51d16 100644 --- a/src/Neo.FileStorage.API/container/Extension.Message.cs +++ b/src/Neo.FileStorage.API/container/Extension.Message.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; using Neo.FileStorage.API.Session; diff --git a/src/Neo.FileStorage.API/control/ControlClient.cs b/src/Neo.FileStorage.API/control/ControlClient.cs index 33018ab..e94baf9 100644 --- a/src/Neo.FileStorage.API/control/ControlClient.cs +++ b/src/Neo.FileStorage.API/control/ControlClient.cs @@ -1,9 +1,18 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// ControlClient.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 Google.Protobuf; using Grpc.Core; using Grpc.Net.Client; using System; -using System.Collections.Generic; -using System.Linq; using System.Security.Cryptography; namespace Neo.FileStorage.API.Control diff --git a/src/Neo.FileStorage.API/control/Extension.Messages.cs b/src/Neo.FileStorage.API/control/Extension.Messages.cs index 89b48f9..a6fbb00 100644 --- a/src/Neo.FileStorage.API/control/Extension.Messages.cs +++ b/src/Neo.FileStorage.API/control/Extension.Messages.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Messages.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 Google.Protobuf; namespace Neo.FileStorage.API.Control diff --git a/src/Neo.FileStorage.API/control/Helper.cs b/src/Neo.FileStorage.API/control/Helper.cs index 3bd6140..d10e457 100644 --- a/src/Neo.FileStorage.API/control/Helper.cs +++ b/src/Neo.FileStorage.API/control/Helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; using System.Security.Cryptography; diff --git a/src/Neo.FileStorage.API/control/IControlMessage.cs b/src/Neo.FileStorage.API/control/IControlMessage.cs index 4be2813..ed452ec 100644 --- a/src/Neo.FileStorage.API/control/IControlMessage.cs +++ b/src/Neo.FileStorage.API/control/IControlMessage.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IControlMessage.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 Google.Protobuf; namespace Neo.FileStorage.API.Control diff --git a/src/Neo.FileStorage.API/cryptography/Base58.cs b/src/Neo.FileStorage.API/cryptography/Base58.cs index 354688f..af41c42 100644 --- a/src/Neo.FileStorage.API/cryptography/Base58.cs +++ b/src/Neo.FileStorage.API/cryptography/Base58.cs @@ -1,10 +1,11 @@ -// Copyright (C) 2015-2021 The Neo Project. -// -// The neo 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-2025 The Neo Project. +// +// Base58.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/Neo.FileStorage.API/cryptography/Helper.cs b/src/Neo.FileStorage.API/cryptography/Helper.cs index bbbf233..24b4fa1 100644 --- a/src/Neo.FileStorage.API/cryptography/Helper.cs +++ b/src/Neo.FileStorage.API/cryptography/Helper.cs @@ -1,10 +1,21 @@ -using System; -using System.Buffers.Binary; -using System.Security.Cryptography; +// Copyright (C) 2015-2025 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 Google.Protobuf; using Neo.FileStorage.API.Cryptography.Tz; using Neo.FileStorage.API.Refs; using Org.BouncyCastle.Crypto.Digests; +using System; +using System.Buffers.Binary; +using System.Security.Cryptography; namespace Neo.FileStorage.API.Cryptography; diff --git a/src/Neo.FileStorage.API/cryptography/Key.cs b/src/Neo.FileStorage.API/cryptography/Key.cs index b8cc1e7..7feac4c 100644 --- a/src/Neo.FileStorage.API/cryptography/Key.cs +++ b/src/Neo.FileStorage.API/cryptography/Key.cs @@ -1,11 +1,22 @@ -using System; +// Copyright (C) 2015-2025 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. + +using Neo.FileStorage.API.Refs; +using Org.BouncyCastle.Asn1.Sec; +using System; using System.Buffers.Binary; using System.Linq; using System.Numerics; using System.Security.Cryptography; using System.Text; -using Neo.FileStorage.API.Refs; -using Org.BouncyCastle.Asn1.Sec; using static Neo.FileStorage.API.Helper; namespace Neo.FileStorage.API.Cryptography; diff --git a/src/Neo.FileStorage.API/cryptography/Murmur3_128.cs b/src/Neo.FileStorage.API/cryptography/Murmur3_128.cs index 745e1aa..a5180a4 100644 --- a/src/Neo.FileStorage.API/cryptography/Murmur3_128.cs +++ b/src/Neo.FileStorage.API/cryptography/Murmur3_128.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Murmur3_128.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.Buffers.Binary; using System.Security.Cryptography; diff --git a/src/Neo.FileStorage.API/cryptography/Sign.cs b/src/Neo.FileStorage.API/cryptography/Sign.cs index 86f0f18..e05f1a3 100644 --- a/src/Neo.FileStorage.API/cryptography/Sign.cs +++ b/src/Neo.FileStorage.API/cryptography/Sign.cs @@ -1,5 +1,14 @@ -using System; -using System.Security.Cryptography; +// Copyright (C) 2015-2025 The Neo Project. +// +// Sign.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 Google.Protobuf; using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Session; @@ -8,6 +17,8 @@ using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Signers; using Org.BouncyCastle.Math; +using System; +using System.Security.Cryptography; namespace Neo.FileStorage.API.Cryptography { diff --git a/src/Neo.FileStorage.API/cryptography/Tz/GF127.cs b/src/Neo.FileStorage.API/cryptography/Tz/GF127.cs index 2a40371..50fa075 100644 --- a/src/Neo.FileStorage.API/cryptography/Tz/GF127.cs +++ b/src/Neo.FileStorage.API/cryptography/Tz/GF127.cs @@ -1,4 +1,15 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// GF127.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.Security.Cryptography; namespace Neo.FileStorage.API.Cryptography.Tz @@ -242,7 +253,7 @@ public byte[] ToByteArray() // ToString() returns hex-encoded representation, starting with MSB. public override string ToString() { - return this.ToByteArray().ToHexString(); + return ToByteArray().ToHexString(); } } diff --git a/src/Neo.FileStorage.API/cryptography/Tz/Helper.cs b/src/Neo.FileStorage.API/cryptography/Tz/Helper.cs index 7a1070f..d561db6 100644 --- a/src/Neo.FileStorage.API/cryptography/Tz/Helper.cs +++ b/src/Neo.FileStorage.API/cryptography/Tz/Helper.cs @@ -1,7 +1,16 @@ -using System; -using System.Globalization; +// Copyright (C) 2015-2025 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; using System.Security.Cryptography; -using System.Text; namespace Neo.FileStorage.API.Cryptography.Tz { diff --git a/src/Neo.FileStorage.API/cryptography/Tz/SL2.cs b/src/Neo.FileStorage.API/cryptography/Tz/SL2.cs index 5bdc310..9df93ca 100644 --- a/src/Neo.FileStorage.API/cryptography/Tz/SL2.cs +++ b/src/Neo.FileStorage.API/cryptography/Tz/SL2.cs @@ -1,4 +1,15 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// SL2.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.Linq; namespace Neo.FileStorage.API.Cryptography.Tz diff --git a/src/Neo.FileStorage.API/cryptography/Tz/TzHash.cs b/src/Neo.FileStorage.API/cryptography/Tz/TzHash.cs index a95de33..0b9a093 100644 --- a/src/Neo.FileStorage.API/cryptography/Tz/TzHash.cs +++ b/src/Neo.FileStorage.API/cryptography/Tz/TzHash.cs @@ -1,4 +1,15 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// TzHash.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.Security; using System.Security.Cryptography; @@ -18,17 +29,17 @@ public TzHash() public override void Initialize() { - this.x = new GF127[4]; - this.Reset(); + x = new GF127[4]; + Reset(); HashValue = null; } public void Reset() { - this.x[0] = new GF127(1, 0); - this.x[1] = new GF127(0, 0); - this.x[2] = new GF127(0, 0); - this.x[3] = new GF127(1, 0); + x[0] = new GF127(1, 0); + x[1] = new GF127(0, 0); + x[2] = new GF127(0, 0); + x[3] = new GF127(1, 0); } public byte[] ToByteArray() @@ -36,7 +47,7 @@ public byte[] ToByteArray() var buff = new byte[HashSize]; for (int i = 0; i < 4; i++) { - Array.Copy(this.x[i].ToByteArray(), 0, buff, i * 16, 16); + Array.Copy(x[i].ToByteArray(), 0, buff, i * 16, 16); } return buff; } diff --git a/src/Neo.FileStorage.API/cryptography/UUID.cs b/src/Neo.FileStorage.API/cryptography/UUID.cs index 235d2b5..d3b797a 100644 --- a/src/Neo.FileStorage.API/cryptography/UUID.cs +++ b/src/Neo.FileStorage.API/cryptography/UUID.cs @@ -1,4 +1,15 @@ -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// UUID.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 Google.Protobuf; using System; namespace Neo.FileStorage.API.Cryptography diff --git a/src/Neo.FileStorage.API/helper.cs b/src/Neo.FileStorage.API/helper.cs index 33db866..74d96e7 100644 --- a/src/Neo.FileStorage.API/helper.cs +++ b/src/Neo.FileStorage.API/helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 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; using System.Globalization; using System.Runtime.CompilerServices; diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MaxAgg.cs b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MaxAgg.cs index 89c6e94..d562341 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MaxAgg.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MaxAgg.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// MaxAgg.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. namespace Neo.FileStorage.API.Netmap.Aggregator { diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanAgg.cs b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanAgg.cs index 1c3fc7a..48ee7b4 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanAgg.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanAgg.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// MeanAgg.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. namespace Neo.FileStorage.API.Netmap.Aggregator { diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanIQRAgg.cs b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanIQRAgg.cs index 3a6d8b0..bb24617 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanIQRAgg.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanIQRAgg.cs @@ -1,6 +1,15 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// MeanIQRAgg.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.Collections.Generic; -using System.Linq; namespace Neo.FileStorage.API.Netmap.Aggregator { diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanSumAgg.cs b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanSumAgg.cs index 611f1e9..15bd512 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanSumAgg.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MeanSumAgg.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// MeanSumAgg.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. namespace Neo.FileStorage.API.Netmap.Aggregator { @@ -9,8 +18,8 @@ public class MeanSumAgg : IAggregator public void Add(double n) { - this.sum += n; - this.count++; + sum += n; + count++; } public double Compute() diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MinAgg.cs b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MinAgg.cs index 89fe5d5..d924d71 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MinAgg.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/Agg/MinAgg.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// MinAgg.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. namespace Neo.FileStorage.API.Netmap.Aggregator { diff --git a/src/Neo.FileStorage.API/netmap/Aggregator/IAggregator.cs b/src/Neo.FileStorage.API/netmap/Aggregator/IAggregator.cs index cdc4c4f..c339afc 100644 --- a/src/Neo.FileStorage.API/netmap/Aggregator/IAggregator.cs +++ b/src/Neo.FileStorage.API/netmap/Aggregator/IAggregator.cs @@ -1,3 +1,13 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IAggregator.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. namespace Neo.FileStorage.API.Netmap.Aggregator { diff --git a/src/Neo.FileStorage.API/netmap/Context.Filter.cs b/src/Neo.FileStorage.API/netmap/Context.Filter.cs index ed36d38..e3a2f62 100644 --- a/src/Neo.FileStorage.API/netmap/Context.Filter.cs +++ b/src/Neo.FileStorage.API/netmap/Context.Filter.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Context.Filter.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; namespace Neo.FileStorage.API.Netmap diff --git a/src/Neo.FileStorage.API/netmap/Context.Select.cs b/src/Neo.FileStorage.API/netmap/Context.Select.cs index 501d4c1..b9e14e3 100644 --- a/src/Neo.FileStorage.API/netmap/Context.Select.cs +++ b/src/Neo.FileStorage.API/netmap/Context.Select.cs @@ -1,7 +1,18 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Context.Select.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.FileStorage.API.Refs; using System; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Refs; namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Context.cs b/src/Neo.FileStorage.API/netmap/Context.cs index c2088de..9ee23f2 100644 --- a/src/Neo.FileStorage.API/netmap/Context.cs +++ b/src/Neo.FileStorage.API/netmap/Context.cs @@ -1,7 +1,18 @@ -using System; -using System.Collections.Generic; +// Copyright (C) 2015-2025 The Neo Project. +// +// Context.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.FileStorage.API.Cryptography; using Neo.FileStorage.API.Netmap.Aggregator; +using System; +using System.Collections.Generic; namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Extension.Filter.cs b/src/Neo.FileStorage.API/netmap/Extension.Filter.cs index 1616067..925b0ec 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.Filter.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.Filter.cs @@ -1,4 +1,13 @@ -using System.Collections.Generic; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Filter.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. namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Extension.Message.cs b/src/Neo.FileStorage.API/netmap/Extension.Message.cs index d901887..11c1a40 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.Message.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.Message.cs @@ -1,4 +1,15 @@ -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; using Neo.FileStorage.API.Session; namespace Neo.FileStorage.API.Netmap diff --git a/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.Attribute.cs b/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.Attribute.cs index 578456d..0cbdbfc 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.Attribute.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.Attribute.cs @@ -1,4 +1,13 @@ -using System.Linq; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.NodeInfo.Attribute.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. namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.cs b/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.cs index 0353ffa..f86b826 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.NodeInfo.cs @@ -1,7 +1,16 @@ -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.NodeInfo.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.FileStorage.API.Refs; using System.Collections.Generic; -using System.Linq; using static Neo.FileStorage.API.Netmap.NodeInfo.Types; namespace Neo.FileStorage.API.Netmap diff --git a/src/Neo.FileStorage.API/netmap/Extension.PlacementPolicy.cs b/src/Neo.FileStorage.API/netmap/Extension.PlacementPolicy.cs index 0d3b0e2..74096fa 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.PlacementPolicy.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.PlacementPolicy.cs @@ -1,3 +1,13 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.PlacementPolicy.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.Collections.Generic; diff --git a/src/Neo.FileStorage.API/netmap/Extension.Replica.cs b/src/Neo.FileStorage.API/netmap/Extension.Replica.cs index 70c8878..7ffa269 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.Replica.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.Replica.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Replica.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. + namespace Neo.FileStorage.API.Netmap { public partial class Replica diff --git a/src/Neo.FileStorage.API/netmap/Extension.Selector.cs b/src/Neo.FileStorage.API/netmap/Extension.Selector.cs index e6e710d..e1d2eca 100644 --- a/src/Neo.FileStorage.API/netmap/Extension.Selector.cs +++ b/src/Neo.FileStorage.API/netmap/Extension.Selector.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Selector.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. + namespace Neo.FileStorage.API.Netmap { public partial class Selector diff --git a/src/Neo.FileStorage.API/netmap/Helper.cs b/src/Neo.FileStorage.API/netmap/Helper.cs index 65c9d94..722793b 100644 --- a/src/Neo.FileStorage.API/netmap/Helper.cs +++ b/src/Neo.FileStorage.API/netmap/Helper.cs @@ -1,8 +1,19 @@ +// Copyright (C) 2015-2025 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 Neo.FileStorage.API.Netmap.Aggregator; +using Neo.FileStorage.API.Netmap.Normalize; using System; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Netmap.Aggregator; -using Neo.FileStorage.API.Netmap.Normalize; namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/NetMap.cs b/src/Neo.FileStorage.API/netmap/NetMap.cs index fcc3e9b..e5a9c5a 100644 --- a/src/Neo.FileStorage.API/netmap/NetMap.cs +++ b/src/Neo.FileStorage.API/netmap/NetMap.cs @@ -1,7 +1,18 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// NetMap.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.FileStorage.API.Cryptography; using System; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Cryptography; namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Node.cs b/src/Neo.FileStorage.API/netmap/Node.cs index 36cadab..1f37abe 100644 --- a/src/Neo.FileStorage.API/netmap/Node.cs +++ b/src/Neo.FileStorage.API/netmap/Node.cs @@ -1,8 +1,18 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// 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 Neo.FileStorage.API.Cryptography; using System; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Cryptography; -using Newtonsoft.Json.Linq; namespace Neo.FileStorage.API.Netmap { diff --git a/src/Neo.FileStorage.API/netmap/Normalizer/INormalizer.cs b/src/Neo.FileStorage.API/netmap/Normalizer/INormalizer.cs index 8801a71..d44bf96 100644 --- a/src/Neo.FileStorage.API/netmap/Normalizer/INormalizer.cs +++ b/src/Neo.FileStorage.API/netmap/Normalizer/INormalizer.cs @@ -1,4 +1,13 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// INormalizer.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. namespace Neo.FileStorage.API.Netmap.Normalize { diff --git a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ConstNorm.cs b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ConstNorm.cs index 647379b..e117991 100644 --- a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ConstNorm.cs +++ b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ConstNorm.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// ConstNorm.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. namespace Neo.FileStorage.API.Netmap.Normalize { diff --git a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/MaxNorm.cs b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/MaxNorm.cs index 96befe6..0868e12 100644 --- a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/MaxNorm.cs +++ b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/MaxNorm.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// MaxNorm.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. namespace Neo.FileStorage.API.Netmap.Normalize { diff --git a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ReverseMinNorm.cs b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ReverseMinNorm.cs index b971159..a7f4087 100644 --- a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ReverseMinNorm.cs +++ b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/ReverseMinNorm.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// ReverseMinNorm.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. namespace Neo.FileStorage.API.Netmap.Normalize { diff --git a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/SigmoidNorm.cs b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/SigmoidNorm.cs index 2544d3c..93d5197 100644 --- a/src/Neo.FileStorage.API/netmap/Normalizer/Norm/SigmoidNorm.cs +++ b/src/Neo.FileStorage.API/netmap/Normalizer/Norm/SigmoidNorm.cs @@ -1,4 +1,13 @@ - +// Copyright (C) 2015-2025 The Neo Project. +// +// SigmoidNorm.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. namespace Neo.FileStorage.API.Netmap.Normalize { diff --git a/src/Neo.FileStorage.API/object/Extension.Header.cs b/src/Neo.FileStorage.API/object/Extension.Header.cs index 36aca9e..fba872e 100644 --- a/src/Neo.FileStorage.API/object/Extension.Header.cs +++ b/src/Neo.FileStorage.API/object/Extension.Header.cs @@ -1,4 +1,13 @@ -using System.Linq; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Header.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. namespace Neo.FileStorage.API.Object { diff --git a/src/Neo.FileStorage.API/object/Extension.Message.cs b/src/Neo.FileStorage.API/object/Extension.Message.cs index 0bc4fc8..e2c2524 100644 --- a/src/Neo.FileStorage.API/object/Extension.Message.cs +++ b/src/Neo.FileStorage.API/object/Extension.Message.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; using Neo.FileStorage.API.Session; diff --git a/src/Neo.FileStorage.API/object/Extension.Object.cs b/src/Neo.FileStorage.API/object/Extension.Object.cs index 24c3a92..5de1f6c 100644 --- a/src/Neo.FileStorage.API/object/Extension.Object.cs +++ b/src/Neo.FileStorage.API/object/Extension.Object.cs @@ -1,11 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Object.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Refs; using Neo.FileStorage.API.Session; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; using Version = Neo.FileStorage.API.Refs.Version; namespace Neo.FileStorage.API.Object; diff --git a/src/Neo.FileStorage.API/object/Extension.ObjectType.cs b/src/Neo.FileStorage.API/object/Extension.ObjectType.cs index 0e945e5..9cadb97 100644 --- a/src/Neo.FileStorage.API/object/Extension.ObjectType.cs +++ b/src/Neo.FileStorage.API/object/Extension.ObjectType.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.ObjectType.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; diff --git a/src/Neo.FileStorage.API/object/Extension.SearchRequest.Filter.cs b/src/Neo.FileStorage.API/object/Extension.SearchRequest.Filter.cs index ffc31a6..b0b4281 100644 --- a/src/Neo.FileStorage.API/object/Extension.SearchRequest.Filter.cs +++ b/src/Neo.FileStorage.API/object/Extension.SearchRequest.Filter.cs @@ -1,3 +1,13 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.SearchRequest.Filter.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. namespace Neo.FileStorage.API.Object { diff --git a/src/Neo.FileStorage.API/object/ObjectException.cs b/src/Neo.FileStorage.API/object/ObjectException.cs index 3e562c8..c594321 100644 --- a/src/Neo.FileStorage.API/object/ObjectException.cs +++ b/src/Neo.FileStorage.API/object/ObjectException.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// ObjectException.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. + #nullable enable using System; diff --git a/src/Neo.FileStorage.API/object/SearchFilters.cs b/src/Neo.FileStorage.API/object/SearchFilters.cs index 4b8c7f4..6e94eee 100644 --- a/src/Neo.FileStorage.API/object/SearchFilters.cs +++ b/src/Neo.FileStorage.API/object/SearchFilters.cs @@ -1,6 +1,17 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// SearchFilters.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.FileStorage.API.Refs; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Refs; using static Neo.FileStorage.API.Object.SearchRequest.Types.Body.Types; namespace Neo.FileStorage.API.Object diff --git a/src/Neo.FileStorage.API/object/SplitID.cs b/src/Neo.FileStorage.API/object/SplitID.cs index 61e1aa7..01e7129 100644 --- a/src/Neo.FileStorage.API/object/SplitID.cs +++ b/src/Neo.FileStorage.API/object/SplitID.cs @@ -1,5 +1,16 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// SplitID.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 Google.Protobuf; +using System; namespace Neo.FileStorage.API.Object { diff --git a/src/Neo.FileStorage.API/policy/Encode.cs b/src/Neo.FileStorage.API/policy/Encode.cs index 8f29fa0..9bec2ee 100644 --- a/src/Neo.FileStorage.API/policy/Encode.cs +++ b/src/Neo.FileStorage.API/policy/Encode.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Encode.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.FileStorage.API.Netmap; using System.Collections.Generic; using System.Text; diff --git a/src/Neo.FileStorage.API/policy/Grammer.cs b/src/Neo.FileStorage.API/policy/Grammer.cs index 3f38ffd..7bd13de 100644 --- a/src/Neo.FileStorage.API/policy/Grammer.cs +++ b/src/Neo.FileStorage.API/policy/Grammer.cs @@ -1,5 +1,16 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// Grammer.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 Sprache; +using System; namespace Neo.FileStorage.API.Policy { @@ -12,10 +23,10 @@ public class Query public Query(ReplicaStmt[] replicas, uint cbf, SelectorStmt[] selectors, FilterStmt[] filters) { - this.Replicas = replicas; - this.CBF = cbf; - this.Selectors = selectors; - this.Filters = filters; + Replicas = replicas; + CBF = cbf; + Selectors = selectors; + Filters = filters; } public static Query Parse(string s) @@ -31,8 +42,8 @@ public class ReplicaStmt public ReplicaStmt(uint count, string selector) { - this.Count = count; - this.Selector = selector; + Count = count; + Selector = selector; } } @@ -45,10 +56,10 @@ public class SelectorStmt public SelectorStmt(uint count, string[] bucket, string filter, string name) { - this.Count = count; - this.Bucket = bucket; - this.Filter = filter; - this.Name = name; + Count = count; + Bucket = bucket; + Filter = filter; + Name = name; } } @@ -59,8 +70,8 @@ public class FilterStmt public FilterStmt(OrChain value, string name) { - this.Value = value; - this.Name = name; + Value = value; + Name = name; } } @@ -70,7 +81,7 @@ public class OrChain public OrChain(AndChain[] clauses) { - this.Clauses = clauses; + Clauses = clauses; } } @@ -80,7 +91,7 @@ public class AndChain public AndChain(FilterOrExpr[] clauses) { - this.Clauses = clauses; + Clauses = clauses; } } @@ -93,16 +104,16 @@ public FilterOrExpr(string value) { if (value.StartsWith("@")) { - this.Reference = value[1..]; - this.Expr = null; + Reference = value[1..]; + Expr = null; } else { var values = value.Split(Helper.ExprSpliter); if (values.Length != 3) throw new ArgumentException($"invalid filter expression {value}"); - this.Expr = new SimpleExpr(values[0], values[1], values[2]); - this.Reference = ""; + Expr = new SimpleExpr(values[0], values[1], values[2]); + Reference = ""; } } } @@ -115,9 +126,9 @@ public class SimpleExpr public SimpleExpr(string key, string op, string value) { - this.Key = key; - this.Op = op; - this.Value = value; + Key = key; + Op = op; + Value = value; } } } diff --git a/src/Neo.FileStorage.API/policy/Helper.cs b/src/Neo.FileStorage.API/policy/Helper.cs index 0639efe..9fc52dc 100644 --- a/src/Neo.FileStorage.API/policy/Helper.cs +++ b/src/Neo.FileStorage.API/policy/Helper.cs @@ -1,8 +1,19 @@ +// Copyright (C) 2015-2025 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 Neo.FileStorage.API.Netmap; +using Sprache; using System; using System.Collections.Generic; using System.Linq; -using Neo.FileStorage.API.Netmap; -using Sprache; namespace Neo.FileStorage.API.Policy { diff --git a/src/Neo.FileStorage.API/refs/Extension.Address.cs b/src/Neo.FileStorage.API/refs/Extension.Address.cs index 8fb3c37..65145d8 100644 --- a/src/Neo.FileStorage.API/refs/Extension.Address.cs +++ b/src/Neo.FileStorage.API/refs/Extension.Address.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.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. + using System; namespace Neo.FileStorage.API.Refs diff --git a/src/Neo.FileStorage.API/refs/Extension.Checksum.cs b/src/Neo.FileStorage.API/refs/Extension.Checksum.cs index dd95b47..a9dca04 100644 --- a/src/Neo.FileStorage.API/refs/Extension.Checksum.cs +++ b/src/Neo.FileStorage.API/refs/Extension.Checksum.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Checksum.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography.Tz; using System; diff --git a/src/Neo.FileStorage.API/refs/Extension.ContainerID.cs b/src/Neo.FileStorage.API/refs/Extension.ContainerID.cs index 87ebce5..bde401e 100644 --- a/src/Neo.FileStorage.API/refs/Extension.ContainerID.cs +++ b/src/Neo.FileStorage.API/refs/Extension.ContainerID.cs @@ -1,6 +1,17 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.ContainerID.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; +using System; using static Neo.FileStorage.API.Cryptography.Helper; namespace Neo.FileStorage.API.Refs; diff --git a/src/Neo.FileStorage.API/refs/Extension.ObjectID.cs b/src/Neo.FileStorage.API/refs/Extension.ObjectID.cs index 0fe0583..e5d0620 100644 --- a/src/Neo.FileStorage.API/refs/Extension.ObjectID.cs +++ b/src/Neo.FileStorage.API/refs/Extension.ObjectID.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.ObjectID.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; using static Neo.FileStorage.API.Cryptography.Helper; diff --git a/src/Neo.FileStorage.API/refs/Extension.OwnerID.cs b/src/Neo.FileStorage.API/refs/Extension.OwnerID.cs index 637c77f..41662e1 100644 --- a/src/Neo.FileStorage.API/refs/Extension.OwnerID.cs +++ b/src/Neo.FileStorage.API/refs/Extension.OwnerID.cs @@ -1,6 +1,17 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.OwnerID.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; +using System; namespace Neo.FileStorage.API.Refs { diff --git a/src/Neo.FileStorage.API/refs/Extension.SubnetID.cs b/src/Neo.FileStorage.API/refs/Extension.SubnetID.cs index 92f7734..b97403d 100644 --- a/src/Neo.FileStorage.API/refs/Extension.SubnetID.cs +++ b/src/Neo.FileStorage.API/refs/Extension.SubnetID.cs @@ -1,3 +1,13 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.SubnetID.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. namespace Neo.FileStorage.API.Refs { diff --git a/src/Neo.FileStorage.API/refs/Extension.Version.cs b/src/Neo.FileStorage.API/refs/Extension.Version.cs index aeb71c8..c26cc2f 100644 --- a/src/Neo.FileStorage.API/refs/Extension.Version.cs +++ b/src/Neo.FileStorage.API/refs/Extension.Version.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Version.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. + namespace Neo.FileStorage.API.Refs { public partial class Version diff --git a/src/Neo.FileStorage.API/reputation/Extension.GlobalTrust.cs b/src/Neo.FileStorage.API/reputation/Extension.GlobalTrust.cs index 033d305..51af844 100644 --- a/src/Neo.FileStorage.API/reputation/Extension.GlobalTrust.cs +++ b/src/Neo.FileStorage.API/reputation/Extension.GlobalTrust.cs @@ -1,6 +1,16 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.GlobalTrust.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.Security.Cryptography; using Neo.FileStorage.API.Cryptography; +using System.Security.Cryptography; namespace Neo.FileStorage.API.Reputation { diff --git a/src/Neo.FileStorage.API/reputation/Extension.Message.cs b/src/Neo.FileStorage.API/reputation/Extension.Message.cs index 29ca3c1..4063481 100644 --- a/src/Neo.FileStorage.API/reputation/Extension.Message.cs +++ b/src/Neo.FileStorage.API/reputation/Extension.Message.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; using Neo.FileStorage.API.Session; diff --git a/src/Neo.FileStorage.API/reputation/Extension.PeerID.cs b/src/Neo.FileStorage.API/reputation/Extension.PeerID.cs index 4188172..96abec2 100644 --- a/src/Neo.FileStorage.API/reputation/Extension.PeerID.cs +++ b/src/Neo.FileStorage.API/reputation/Extension.PeerID.cs @@ -1,6 +1,17 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.PeerID.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 Google.Protobuf; using Neo.FileStorage.API.Cryptography; +using System; namespace Neo.FileStorage.API.Reputation { diff --git a/src/Neo.FileStorage.API/session/Extension.ContainerSessionContext.cs b/src/Neo.FileStorage.API/session/Extension.ContainerSessionContext.cs index d8210e3..7ac4382 100644 --- a/src/Neo.FileStorage.API/session/Extension.ContainerSessionContext.cs +++ b/src/Neo.FileStorage.API/session/Extension.ContainerSessionContext.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.ContainerSessionContext.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. + namespace Neo.FileStorage.API.Session { public sealed partial class ContainerSessionContext diff --git a/src/Neo.FileStorage.API/session/Extension.Message.cs b/src/Neo.FileStorage.API/session/Extension.Message.cs index f5805be..e709e60 100644 --- a/src/Neo.FileStorage.API/session/Extension.Message.cs +++ b/src/Neo.FileStorage.API/session/Extension.Message.cs @@ -1,4 +1,15 @@ -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Message.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 Google.Protobuf; namespace Neo.FileStorage.API.Session { diff --git a/src/Neo.FileStorage.API/session/Extension.MetaHeader.cs b/src/Neo.FileStorage.API/session/Extension.MetaHeader.cs index cf42624..5fb104a 100644 --- a/src/Neo.FileStorage.API/session/Extension.MetaHeader.cs +++ b/src/Neo.FileStorage.API/session/Extension.MetaHeader.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.MetaHeader.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.FileStorage.API.Refs; namespace Neo.FileStorage.API.Session diff --git a/src/Neo.FileStorage.API/session/Extension.ObjectSessionContext.cs b/src/Neo.FileStorage.API/session/Extension.ObjectSessionContext.cs index 0acf94d..d66d04e 100644 --- a/src/Neo.FileStorage.API/session/Extension.ObjectSessionContext.cs +++ b/src/Neo.FileStorage.API/session/Extension.ObjectSessionContext.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.ObjectSessionContext.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. + namespace Neo.FileStorage.API.Session { public sealed partial class ObjectSessionContext diff --git a/src/Neo.FileStorage.API/session/Extension.SessionToken.cs b/src/Neo.FileStorage.API/session/Extension.SessionToken.cs index 8346564..3c61c9a 100644 --- a/src/Neo.FileStorage.API/session/Extension.SessionToken.cs +++ b/src/Neo.FileStorage.API/session/Extension.SessionToken.cs @@ -1,5 +1,16 @@ -using System.Security.Cryptography; +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.SessionToken.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.FileStorage.API.Cryptography; +using System.Security.Cryptography; namespace Neo.FileStorage.API.Session { diff --git a/src/Neo.FileStorage.API/session/Extension.VerificationHeader.cs b/src/Neo.FileStorage.API/session/Extension.VerificationHeader.cs index 6f9ddea..922975f 100644 --- a/src/Neo.FileStorage.API/session/Extension.VerificationHeader.cs +++ b/src/Neo.FileStorage.API/session/Extension.VerificationHeader.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.VerificationHeader.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. + namespace Neo.FileStorage.API.Session { public partial class RequestVerificationHeader : IVerificationHeader diff --git a/src/Neo.FileStorage.API/session/Extension.XHeader.cs b/src/Neo.FileStorage.API/session/Extension.XHeader.cs index cd3ccc4..aa36574 100644 --- a/src/Neo.FileStorage.API/session/Extension.XHeader.cs +++ b/src/Neo.FileStorage.API/session/Extension.XHeader.cs @@ -1,4 +1,15 @@ -namespace Neo.FileStorage.API.Session +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.XHeader.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. + +namespace Neo.FileStorage.API.Session { public partial class XHeader { diff --git a/src/Neo.FileStorage.API/session/IMetaHeader.cs b/src/Neo.FileStorage.API/session/IMetaHeader.cs index 65238cd..7f9e9a8 100644 --- a/src/Neo.FileStorage.API/session/IMetaHeader.cs +++ b/src/Neo.FileStorage.API/session/IMetaHeader.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IMetaHeader.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 Google.Protobuf; namespace Neo.FileStorage.API.Session diff --git a/src/Neo.FileStorage.API/session/IRequest.cs b/src/Neo.FileStorage.API/session/IRequest.cs index 2d2afcd..105dc21 100644 --- a/src/Neo.FileStorage.API/session/IRequest.cs +++ b/src/Neo.FileStorage.API/session/IRequest.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IRequest.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. + namespace Neo.FileStorage.API.Session { public interface IRequest : IVerificableMessage diff --git a/src/Neo.FileStorage.API/session/IResponse.cs b/src/Neo.FileStorage.API/session/IResponse.cs index 7da8b02..2b6aeda 100644 --- a/src/Neo.FileStorage.API/session/IResponse.cs +++ b/src/Neo.FileStorage.API/session/IResponse.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IResponse.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. + namespace Neo.FileStorage.API.Session { public interface IResponse : IVerificableMessage diff --git a/src/Neo.FileStorage.API/session/IVerifiableMessage.cs b/src/Neo.FileStorage.API/session/IVerifiableMessage.cs index b349357..7c82836 100644 --- a/src/Neo.FileStorage.API/session/IVerifiableMessage.cs +++ b/src/Neo.FileStorage.API/session/IVerifiableMessage.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IVerifiableMessage.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 Google.Protobuf; namespace Neo.FileStorage.API.Session diff --git a/src/Neo.FileStorage.API/session/IVerificationHeader.cs b/src/Neo.FileStorage.API/session/IVerificationHeader.cs index c1182e1..834782d 100644 --- a/src/Neo.FileStorage.API/session/IVerificationHeader.cs +++ b/src/Neo.FileStorage.API/session/IVerificationHeader.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// IVerificationHeader.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 Google.Protobuf; using Neo.FileStorage.API.Refs; diff --git a/src/Neo.FileStorage.API/status/Extension.Status.cs b/src/Neo.FileStorage.API/status/Extension.Status.cs index 352fe3e..0c4d4f4 100644 --- a/src/Neo.FileStorage.API/status/Extension.Status.cs +++ b/src/Neo.FileStorage.API/status/Extension.Status.cs @@ -1,6 +1,17 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// Extension.Status.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 Grpc.Core; using System; using System.Collections.Generic; -using Grpc.Core; namespace Neo.FileStorage.API.Status; diff --git a/src/Neo.FileStorage.API/status/Helper.cs b/src/Neo.FileStorage.API/status/Helper.cs index 83a920b..caa8c28 100644 --- a/src/Neo.FileStorage.API/status/Helper.cs +++ b/src/Neo.FileStorage.API/status/Helper.cs @@ -1,5 +1,16 @@ -using System; +// Copyright (C) 2015-2025 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 Neo.FileStorage.API.Session; +using System; namespace Neo.FileStorage.API.Status { diff --git a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_BasicACL.cs b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_BasicACL.cs index f6190da..bc2c566 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_BasicACL.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_BasicACL.cs @@ -1,9 +1,19 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_BasicACL.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.FileStorage.API.Acl; using System; using System.Collections.Generic; using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Neo.FileStorage.API.Acl; -using Neo.FileStorage.API.Object; namespace Neo.FileStorage.API.UnitTests.Acl { diff --git a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Filter.cs b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Filter.cs index 026982e..bbec684 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Filter.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Filter.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Filter.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.FileStorage.API.Acl; using static Neo.FileStorage.API.Acl.EACLRecord.Types; diff --git a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Operation.cs b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Operation.cs index f35ca95..9be849d 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Operation.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Operation.cs @@ -1,6 +1,16 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Operation.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.FileStorage.API.Acl; -using static Neo.FileStorage.API.Acl.EACLRecord.Types; namespace Neo.FileStorage.API.UnitTests.Acl { diff --git a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Record.cs b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Record.cs index 28de633..e98d59f 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Record.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Record.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Record.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.FileStorage.API.Acl; diff --git a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Target.cs b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Target.cs index eea35be..1d32822 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Target.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Acl/UT_Target.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Target.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.FileStorage.API.Acl; using static Neo.FileStorage.API.Acl.EACLRecord.Types; diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Accounting.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Accounting.cs index 96826a4..31b8ca2 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Accounting.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Accounting.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.Accounting.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.FileStorage.API.Refs; diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Container.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Container.cs index 783ea99..9350035 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Container.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Container.cs @@ -1,12 +1,22 @@ -using System; -using System.Linq; -using System.Threading; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.Container.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Acl; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Netmap; -using Neo.FileStorage.API.Refs; +using System; +using System.Linq; +using System.Threading; namespace Neo.FileStorage.API.UnitTests.FSClient { diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.HandleException.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.HandleException.cs index cd996c1..5407a77 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.HandleException.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.HandleException.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.HandleException.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 Grpc.Core; using Grpc.Net.Client; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Netmap.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Netmap.cs index 6c5f888..3bbfc4b 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Netmap.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Netmap.cs @@ -1,6 +1,17 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.Netmap.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; using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Neo.FileStorage.API.UnitTests.FSClient { diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Object.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Object.cs index f1a5eac..26aa680 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Object.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Object.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.Object.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Client; @@ -85,6 +96,7 @@ public void TestObjectPutStream() } [TestMethod] + [Obsolete] public void TestObjectPutStorageGroup() { List oids = new() { ObjectID.FromString("7Q7fPKESmRJ1VGHKcB2pB4JWVebsQzrJypwQiNLU1ekv"), ObjectID.FromString("HwfVt5i9ucjPUhRpHyxamnfTvhKtTUysCZWXcJ6YZsZ4") }; diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Session.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Session.cs index 1cceb64..7e5ca42 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Session.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.Session.cs @@ -1,7 +1,18 @@ -using System; -using System.Threading; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.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 +// modifications are permitted. + using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Cryptography; +using System; +using System.Threading; namespace Neo.FileStorage.API.UnitTests.FSClient { diff --git a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.cs b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.cs index 31635f0..75bc91a 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Client/UT_Client.cs @@ -1,11 +1,22 @@ -using System; -using System.Security.Cryptography; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Client.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Cryptography.Tz; using Neo.FileStorage.API.Object; using Neo.FileStorage.API.Refs; +using System; +using System.Security.Cryptography; namespace Neo.FileStorage.API.UnitTests.FSClient { diff --git a/tests/Neo.FileStorage.API.UnitTests/Container/UT_Container.cs b/tests/Neo.FileStorage.API.UnitTests/Container/UT_Container.cs index 9b67c84..95e5478 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Container/UT_Container.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Container/UT_Container.cs @@ -1,10 +1,19 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Container.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Neo.FileStorage.API.Container; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Netmap; -using Neo.FileStorage.API.Refs; +using System; namespace Neo.FileStorage.API.UnitTests.TestContainer { diff --git a/tests/Neo.FileStorage.API.UnitTests/Control/UT_ControlClient.cs b/tests/Neo.FileStorage.API.UnitTests/Control/UT_ControlClient.cs index 1bfa558..fb5b31f 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Control/UT_ControlClient.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Control/UT_ControlClient.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_ControlClient.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Control; diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_GF127.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_GF127.cs index f80e32d..bf45673 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_GF127.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_GF127.cs @@ -1,8 +1,16 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_GF127.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.FileStorage.API.Cryptography.Tz; -using System; -using System.Collections.Generic; -using System.Text; namespace Neo.FileStorage.API.UnitTests.TestCryptography.Tz { diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_Helper.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_Helper.cs index c0eb0b4..1f488eb 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_Helper.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_Helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 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 static Neo.FileStorage.API.Cryptography.Tz.Helper; diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_SL2.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_SL2.cs index 7050823..a656f5d 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_SL2.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_SL2.cs @@ -1,4 +1,15 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_SL2.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.FileStorage.API.Cryptography.Tz; namespace Neo.FileStorage.API.UnitTests.TestCryptography.Tz diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_TzHash.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_TzHash.cs index a6f033d..f9de114 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_TzHash.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/TzHash/UT_TzHash.cs @@ -1,5 +1,15 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Neo.FileStorage.API.Cryptography; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_TzHash.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.FileStorage.API.Cryptography.Tz; using System; using System.Linq; diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Key.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Key.cs index 7d84240..86fdde6 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Key.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Key.cs @@ -1,4 +1,14 @@ -using System; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_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. + using Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Cryptography; diff --git a/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Sign.cs b/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Sign.cs index 3f94e4c..67de8ce 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Sign.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Cryptography/UT_Sign.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Sign.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.FileStorage.API.Accounting; using Neo.FileStorage.API.Cryptography; @@ -34,12 +45,12 @@ public void TestSignRequest() { Value = 100 }, + }, + MetaHeader = new ResponseMetaHeader() + { + Ttl = 1 } }; - req.MetaHeader = new ResponseMetaHeader() - { - Ttl = 1 - }; key.Sign(req); Console.WriteLine(req); Assert.IsTrue(req.Verify()); diff --git a/tests/Neo.FileStorage.API.UnitTests/Neo.FileStorage.API.UnitTests.csproj b/tests/Neo.FileStorage.API.UnitTests/Neo.FileStorage.API.UnitTests.csproj index a59ad87..874c9d4 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Neo.FileStorage.API.UnitTests.csproj +++ b/tests/Neo.FileStorage.API.UnitTests/Neo.FileStorage.API.UnitTests.csproj @@ -1,25 +1,25 @@ - - - - net9.0 - true - Exe - $(DefineConstants);GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - - - - - - - - - - - - - PreserveNewest - PreserveNewest - json_tests/%(FileName)%(Extension) - - - + + + + net9.0 + true + Exe + $(DefineConstants);GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + + + + + + + + + + + + + PreserveNewest + PreserveNewest + json_tests/%(FileName)%(Extension) + + + diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/Helper.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/Helper.cs index d6a4c02..0e739bd 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/Helper.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/Helper.cs @@ -1,5 +1,16 @@ -using System.Collections.Generic; +// Copyright (C) 2015-2025 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 Neo.FileStorage.API.Netmap; +using System.Collections.Generic; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/TestNetmap.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/TestNetmap.cs index f32aec5..63888ac 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/TestNetmap.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/TestNetmap.cs @@ -1,11 +1,21 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// TestNetmap.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.FileStorage.API.Netmap; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Google.Protobuf.WellKnownTypes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Neo.FileStorage.API.Netmap; -using Newtonsoft.Json; namespace Neo.FileStorage.API.UnitTests.TestNetmap { @@ -13,7 +23,7 @@ namespace Neo.FileStorage.API.UnitTests.TestNetmap public class TestNetmap { private const string jsonDir = "./json_tests"; - private List tests = new(); + private readonly List tests = new(); private class Placement { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Clause.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Clause.cs index 0eb40a3..9b7c9b2 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Clause.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Clause.cs @@ -1,6 +1,16 @@ -using System; -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Clause.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; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Filter.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Filter.cs index f472f9a..0af4f97 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Filter.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Filter.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Filter.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.FileStorage.API.Netmap; using System; diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Helper.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Helper.cs index e739cad..58abb9c 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Helper.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Helper.cs @@ -1,6 +1,17 @@ -using System.Collections.Generic; +// Copyright (C) 2015-2025 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 Neo.FileStorage.API.Netmap; +using System.Collections.Generic; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetMap.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetMap.cs index 2d323cd..0a7ed2a 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetMap.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetMap.cs @@ -1,10 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Linq; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_NetMap.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.FileStorage.API.Netmap; using Neo.FileStorage.API.Refs; using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetmapState.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetmapState.cs index 0baaec2..a23de84 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetmapState.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NetmapState.cs @@ -1,7 +1,17 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_NetmapState.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 Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Netmap; +using System; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NodeInfo.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NodeInfo.cs index 77e929d..109a559 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NodeInfo.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_NodeInfo.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_NodeInfo.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.FileStorage.API.Netmap; using Neo.FileStorage.API.Refs; diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Policy.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Policy.cs index 9c48f30..88d8ba6 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Policy.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Policy.cs @@ -1,6 +1,17 @@ -using System.Linq; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Policy.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.FileStorage.API.Netmap; +using System.Linq; namespace Neo.FileStorage.API.UnitTests.TestNetmap { diff --git a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Selector.cs b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Selector.cs index b923319..f7b371a 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Selector.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Netmap/UT_Selector.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Selector.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Netmap; @@ -257,7 +268,7 @@ public void TestGetPlacementVectors() Assert.AreEqual(4, result[1].Count); foreach (var ni in result[1]) { - var value = ni.Attributes["Continent"]; + var value = ni.Attributes["Continent"]; Assert.IsTrue(value == "NA" || value == "SA"); } diff --git a/tests/Neo.FileStorage.API.UnitTests/Object/UT_ObjectType.cs b/tests/Neo.FileStorage.API.UnitTests/Object/UT_ObjectType.cs index 964d298..8390ea5 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Object/UT_ObjectType.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Object/UT_ObjectType.cs @@ -1,11 +1,19 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_ObjectType.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Object; using Neo.FileStorage.API.Refs; +using System; namespace Neo.FileStorage.API.UnitTests.TestObject { @@ -28,8 +36,10 @@ public void TestParse() [TestMethod] public void TestJson() { - Header header = new(); - header.ContainerId = ContainerID.FromValue((new byte[] { 1, 2, 3 }).Sha256()); + Header header = new() + { + ContainerId = ContainerID.FromValue((new byte[] { 1, 2, 3 }).Sha256()) + }; Console.WriteLine(header.ToString()); } } diff --git a/tests/Neo.FileStorage.API.UnitTests/Object/UT_Search.cs b/tests/Neo.FileStorage.API.UnitTests/Object/UT_Search.cs index ab86ee7..8d4dc6b 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Object/UT_Search.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Object/UT_Search.cs @@ -1,5 +1,14 @@ -using System; -using Google.Protobuf; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Search.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.FileStorage.API.Cryptography; using Neo.FileStorage.API.Object; diff --git a/tests/Neo.FileStorage.API.UnitTests/Object/UT_SplitID.cs b/tests/Neo.FileStorage.API.UnitTests/Object/UT_SplitID.cs index 00b9164..c9b7fef 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Object/UT_SplitID.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Object/UT_SplitID.cs @@ -1,9 +1,18 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_SplitID.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Object; +using System; namespace Neo.FileStorage.API.UnitTests.TestObject { diff --git a/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Encode.cs b/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Encode.cs index 2c94de8..1df3c7d 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Encode.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Encode.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Encode.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.FileStorage.API.Policy; using static Neo.FileStorage.API.Policy.Helper; diff --git a/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Policy.cs b/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Policy.cs index f9d533a..4b55869 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Policy.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Policy/UT_Policy.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Policy.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.FileStorage.API.Netmap; using Sprache; diff --git a/tests/Neo.FileStorage.API.UnitTests/Refs/UT_Refs.cs b/tests/Neo.FileStorage.API.UnitTests/Refs/UT_Refs.cs index f04f005..0f59f70 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Refs/UT_Refs.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Refs/UT_Refs.cs @@ -1,10 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Linq; +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Refs.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 Google.Protobuf; using Microsoft.VisualStudio.TestTools.UnitTesting; using Neo.FileStorage.API.Cryptography; using Neo.FileStorage.API.Refs; +using System; +using System.Collections.Generic; +using System.Linq; namespace Neo.FileStorage.API.UnitTests.TestRefs { diff --git a/tests/Neo.FileStorage.API.UnitTests/Status/UT_Status.cs b/tests/Neo.FileStorage.API.UnitTests/Status/UT_Status.cs index cbc7d72..f5ff343 100644 --- a/tests/Neo.FileStorage.API.UnitTests/Status/UT_Status.cs +++ b/tests/Neo.FileStorage.API.UnitTests/Status/UT_Status.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 The Neo Project. +// +// UT_Status.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.FileStorage.API.Status; diff --git a/tests/Neo.FileStorage.API.UnitTests/helper.cs b/tests/Neo.FileStorage.API.UnitTests/helper.cs index 038262a..3d62726 100644 --- a/tests/Neo.FileStorage.API.UnitTests/helper.cs +++ b/tests/Neo.FileStorage.API.UnitTests/helper.cs @@ -1,3 +1,14 @@ +// Copyright (C) 2015-2025 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; using System.Globalization; using System.Runtime.CompilerServices;