diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..ea59817 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: 👾 Bug Report +about: Report a bug or issue with the project. +title: '' +labels: 'bug' +assignees: '' + +--- + +### Description +A clear and concise description of what the bug is. + +### Steps To Reproduce +1. Log in... +2. Ensure that... +3. Allow a long period of inactivity to pass... +4. Observe that... +5. Attempt to log in... + +### Current Behavior +- After the period of inactivity... +- When the user tries to log in using another method... +- This causes a bug due to... + +### Expected Behavior +- After a long period of inactivity... +- When a user logs in successfully... +- This ensures that only... + +### Environment +- Platform: PC +- Node: v18.18.0 +- Browser: Chrome 126.0.6478.56 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..163c1c4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +blank_issues_enabled: false +issue_template: + - name: 👾 Bug Report + description: Report a bug or issue with the project. + labels: ["bug"] + template: bug_report.md + - name: 💡 Feature Request + description: Create a new ticket for a new feature request. + labels: ["enhancement"] + template: feature_request.md \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..a4b8175 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,27 @@ +--- +name: 💡 Feature Request +about: Create a new ticket for a new feature request +title: '' +labels: 'enhancement' +assignees: '' + +--- + +### Expected Behavior +Describe the expected behavior here. + +### Specifications +As a `user`, I would like to `action` so that `reason`. + +**Features:** +- describe feature details here. + +**Development Tasks:** +- [ ] Task 1 +- [ ] Task 2 + +### Dependencies +List any dependencies that are required for this feature by providing links to the issues or repositories. + +### References +List any references that are related to this feature request. \ No newline at end of file diff --git a/.github/workflows/mainnet-package.yaml b/.github/workflows/mainnet-package.yaml new file mode 100644 index 0000000..13bc440 --- /dev/null +++ b/.github/workflows/mainnet-package.yaml @@ -0,0 +1,76 @@ +name: build and package +on: + push: + tags: + - "v*.*.*" +env: + DOTNET_INSTALL_DIR: "./.dotnet" +jobs: + publish: + runs-on: ebridge-runner + strategy: + matrix: + servicename: + [ + AElf.CrossChainServer.AuthServer, + AElf.CrossChainServer.EntityHandler, + AElf.CrossChainServer.HttpApi.Host, + AElf.CrossChainServer.DbMigrator + ] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0' # which dotnet version is required? + - run: dotnet publish src/${{ matrix.servicename }}/${{ matrix.servicename }}.csproj -o out/${{ matrix.servicename }} + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.servicename }} + path: out/${{ matrix.servicename }} + retention-days: 1 + build-and-push-image: + needs: publish + runs-on: ebridge-runner + strategy: + matrix: + servicename: + [ + AElf.CrossChainServer.AuthServer, + AElf.CrossChainServer.EntityHandler, + AElf.CrossChainServer.HttpApi.Host, + AElf.CrossChainServer.DbMigrator + ] + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.servicename }} + path: out/${{ matrix.servicename }} + - name: Create image tag + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ matrix.servicename }} + tags: | + type=ref,event=tag + - # Setting up Docker Buildx with docker-container driver is required + # at the moment to be able to use a subdirectory with Git context + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + build-args: | + servicename=${{ matrix.servicename }} + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=gha +# cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..62cc37d --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,23 @@ +name: Security Review + +permissions: + pull-requests: write + contents: read + +on: + pull_request: + +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 2 + + - uses: Portkey-Wallet/claude-code-security-review@main + with: + comment-pr: true + claude-api-key: ${{ secrets.CLAUDE_API_KEY }} + run-every-commit: true diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml new file mode 100644 index 0000000..c3e4c3f --- /dev/null +++ b/.github/workflows/sonarqube.yaml @@ -0,0 +1,43 @@ +on: + pull_request: + types: [opened, synchronize, reopened] + +name: PR Static Code Analysis +jobs: + static-code-analysis: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0' + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache SonarQube scanner + id: cache-sonar-scanner + uses: actions/cache@v4 + with: + path: ./.sonar/scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + - name: Install SonarScanner for .NET + run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + - name: Add .NET global tools to PATH + run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + - name: Begin SonarQube analysis + run: | + ./.sonar/scanner/dotnet-sonarscanner begin /k:"ebridge-server" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + dotnet build + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/test-with-code-coverage.yml b/.github/workflows/test-with-code-coverage.yml new file mode 100644 index 0000000..fe70243 --- /dev/null +++ b/.github/workflows/test-with-code-coverage.yml @@ -0,0 +1,61 @@ +name: Test with code coverage + +on: + push: + branches: + - 'release/*' + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + +jobs: + test: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + services: + elasticsearch: + image: elasticsearch:7.17.0 + ports: + - 9200:9200 + options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0' + #- name: Verify Elasticsearch connection + # env: + # ELASTIC_SEARCH_URL: http://127.0.0.1:${{ job.services.elasticsearch.ports[9200] }} + # run: | + # echo $ELASTIC_SEARCH_URL + # curl -fsSL "$ELASTIC_SEARCH_URL/_cat/health?h=status" + - name: Download AElf build tools + run: bash scripts/download_binary.sh + + - name: Install protobuf + run: bash scripts/install_protobuf.sh + + - name: Install dependencies + run: dotnet restore --verbosity quiet + + - name: Build + run: dotnet build --no-restore /clp:ErrorsOnly /p:GeneratePackageOnBuild=false --verbosity quiet + + - name: Test + run: | + for name in `ls ./test/*.Tests/*.csproj | awk '{print $NF}'`; + do + dotnet test ${name} --no-restore --no-build --logger trx --settings CodeCoverage.runsettings --results-directory coverage --collect:"XPlat Code Coverage" + done + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + files: coverage/*/coverage.cobertura.xml + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/testnet-package.yaml b/.github/workflows/testnet-package.yaml new file mode 100644 index 0000000..afda7b0 --- /dev/null +++ b/.github/workflows/testnet-package.yaml @@ -0,0 +1,132 @@ +name: build and package +on: + push: + branches: + - 'release/*' + +run-name: Deploy eBridgeServer on ${{ github.ref }} to Testnet from ${{ github.sha }}) + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + +concurrency: + group: workflow-${{ github.ref }} + cancel-in-progress: true + +jobs: + publish: + runs-on: ebridge-runner + strategy: + matrix: + servicename: + [ + AElf.CrossChainServer.AuthServer, + AElf.CrossChainServer.EntityHandler, + AElf.CrossChainServer.HttpApi.Host + ] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0" + + - name: Cache NuGet Packages + id: nuget-packages + uses: actions/cache@v4 + env: + cache-name: nuget-package-cache + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.servicename }} + + - name: List NuGet Packages + if: ${{ steps.nuget-packages.outputs.cache-hit == 'true' }} + continue-on-error: true + run: ls -lh ~/.nuget/packages + + - name: Publish .NET service + run: dotnet publish src/${{ matrix.servicename }}/${{ matrix.servicename }}.csproj -o out/${{ matrix.servicename }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.servicename }} + path: out/${{ matrix.servicename }} + retention-days: 1 + + build-and-push-image: + needs: publish + runs-on: ebridge-runner + strategy: + matrix: + servicename: + [ + AElf.CrossChainServer.AuthServer, + AElf.CrossChainServer.EntityHandler, + AElf.CrossChainServer.HttpApi.Host + ] + permissions: + contents: read + outputs: + short_sha: ${{ steps.vars.outputs.short_sha }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set short git commit SHA + id: vars + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT" + + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.servicename }} + path: out/${{ matrix.servicename }} + + - name: Create image tag + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ matrix.servicename }} + tags: | + type=sha + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + build-args: | + servicename=${{ matrix.servicename }} + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=gha +# cache-to: type=gha,mode=max + + dispatch: + runs-on: eBridge-runner + needs: build-and-push-image + steps: + - name: Deploy + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.TOK }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'eBridgeCrosschain', + repo: 'devops', + workflow_id: 'deployment_testnet.yaml', + ref: 'main', + inputs: { + appName: 'ebridge-backend', + commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}', + } + }) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a36f45f --- /dev/null +++ b/.gitignore @@ -0,0 +1,264 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +.dotnet + +# 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 +ClientBin/ +~$* +*~ +*.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 + +#Codecov +CodeCoverage + +src/AElf.CrossChainServer.HttpApi.Host/Logs/* +src/AElf.CrossChainServer.IdentityServer/Logs/* +src/AElf.CrossChainServer.DbMigrator/Logs/* +src/AElf.CrossChainServer.EntityHandler/Logs/* +src/AElf.CrossChainServer.ContractEventHandler/Logs/* + +**/wwwroot/libs/* diff --git a/AElf.CrossChainServer.sln b/AElf.CrossChainServer.sln new file mode 100644 index 0000000..2047560 --- /dev/null +++ b/AElf.CrossChainServer.sln @@ -0,0 +1,165 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29020.237 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Domain", "src\AElf.CrossChainServer.Domain\AElf.CrossChainServer.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Application", "src\AElf.CrossChainServer.Application\AElf.CrossChainServer.Application.csproj", "{1A94A50E-06DC-43C1-80B5-B662820EC3EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.EntityFrameworkCore", "src\AElf.CrossChainServer.EntityFrameworkCore\AElf.CrossChainServer.EntityFrameworkCore.csproj", "{C956DD76-69C8-4A9C-83EA-D17DF83340FD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CA9AC87F-097E-4F15-8393-4BC07735A5B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04DBDB01-70F4-4E06-B468-8F87850B22BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Application.Tests", "test\AElf.CrossChainServer.Application.Tests\AElf.CrossChainServer.Application.Tests.csproj", "{50B2631D-129C-47B3-A587-029CCD6099BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Domain.Shared", "src\AElf.CrossChainServer.Domain.Shared\AElf.CrossChainServer.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Application.Contracts", "src\AElf.CrossChainServer.Application.Contracts\AElf.CrossChainServer.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.HttpApi", "src\AElf.CrossChainServer.HttpApi\AElf.CrossChainServer.HttpApi.csproj", "{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.HttpApi.Client", "src\AElf.CrossChainServer.HttpApi.Client\AElf.CrossChainServer.HttpApi.Client.csproj", "{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.HttpApi.Host", "src\AElf.CrossChainServer.HttpApi.Host\AElf.CrossChainServer.HttpApi.Host.csproj", "{E6D5BF0E-DE92-4D82-A352-EF04B37CB11C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.EntityFrameworkCore.Tests", "test\AElf.CrossChainServer.EntityFrameworkCore.Tests\AElf.CrossChainServer.EntityFrameworkCore.Tests.csproj", "{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.TestBase", "test\AElf.CrossChainServer.TestBase\AElf.CrossChainServer.TestBase.csproj", "{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.Domain.Tests", "test\AElf.CrossChainServer.Domain.Tests\AElf.CrossChainServer.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp", "test\AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp\AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp.csproj", "{EF480016-9127-4916-8735-D2466BDBC582}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AElf.CrossChainServer.DbMigrator", "src\AElf.CrossChainServer.DbMigrator\AElf.CrossChainServer.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.Worker", "src\AElf.CrossChainServer.Worker\AElf.CrossChainServer.Worker.csproj", "{68CC1E16-7370-4F26-A728-11CA1E17BAFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.EntityHandler.Core", "src\AElf.CrossChainServer.EntityHandler.Core\AElf.CrossChainServer.EntityHandler.Core.csproj", "{DE635372-2830-49D6-8AB3-0718747EE28A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.EntityHandler", "src\AElf.CrossChainServer.EntityHandler\AElf.CrossChainServer.EntityHandler.csproj", "{07B948AC-AACC-4A84-9C59-E7CF0BD8DB29}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.AetherlinkApi", "src\AElf.CrossChainServer.AetherlinkApi\AElf.CrossChainServer.AetherlinkApi.csproj", "{9311BF41-D5E8-4BD4-8B18-BE3ED24848E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.AuthServer", "src\AElf.CrossChainServer.AuthServer\AElf.CrossChainServer.AuthServer.csproj", "{81A49BEA-810A-4591-B0FF-FFB765685C75}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.EvmIndexer", "src\AElf.CrossChainServer.EvmIndexer\AElf.CrossChainServer.EvmIndexer.csproj", "{CE0B99D2-DBC4-421A-8684-50463B7D2F3E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.Build.0 = Release|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.Build.0 = Release|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.Build.0 = Release|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.Build.0 = Release|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.Build.0 = Release|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.Build.0 = Release|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.Build.0 = Release|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.Build.0 = Release|Any CPU + {E6D5BF0E-DE92-4D82-A352-EF04B37CB11C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6D5BF0E-DE92-4D82-A352-EF04B37CB11C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6D5BF0E-DE92-4D82-A352-EF04B37CB11C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6D5BF0E-DE92-4D82-A352-EF04B37CB11C}.Release|Any CPU.Build.0 = Release|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.Build.0 = Release|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.Build.0 = Release|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU + {EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.Build.0 = Release|Any CPU + {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.Build.0 = Release|Any CPU + {68CC1E16-7370-4F26-A728-11CA1E17BAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68CC1E16-7370-4F26-A728-11CA1E17BAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68CC1E16-7370-4F26-A728-11CA1E17BAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68CC1E16-7370-4F26-A728-11CA1E17BAFC}.Release|Any CPU.Build.0 = Release|Any CPU + {DE635372-2830-49D6-8AB3-0718747EE28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE635372-2830-49D6-8AB3-0718747EE28A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE635372-2830-49D6-8AB3-0718747EE28A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE635372-2830-49D6-8AB3-0718747EE28A}.Release|Any CPU.Build.0 = Release|Any CPU + {07B948AC-AACC-4A84-9C59-E7CF0BD8DB29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07B948AC-AACC-4A84-9C59-E7CF0BD8DB29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07B948AC-AACC-4A84-9C59-E7CF0BD8DB29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07B948AC-AACC-4A84-9C59-E7CF0BD8DB29}.Release|Any CPU.Build.0 = Release|Any CPU + {9311BF41-D5E8-4BD4-8B18-BE3ED24848E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9311BF41-D5E8-4BD4-8B18-BE3ED24848E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9311BF41-D5E8-4BD4-8B18-BE3ED24848E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9311BF41-D5E8-4BD4-8B18-BE3ED24848E9}.Release|Any CPU.Build.0 = Release|Any CPU + {81A49BEA-810A-4591-B0FF-FFB765685C75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81A49BEA-810A-4591-B0FF-FFB765685C75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81A49BEA-810A-4591-B0FF-FFB765685C75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81A49BEA-810A-4591-B0FF-FFB765685C75}.Release|Any CPU.Build.0 = Release|Any CPU + {CE0B99D2-DBC4-421A-8684-50463B7D2F3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE0B99D2-DBC4-421A-8684-50463B7D2F3E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE0B99D2-DBC4-421A-8684-50463B7D2F3E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE0B99D2-DBC4-421A-8684-50463B7D2F3E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {1A94A50E-06DC-43C1-80B5-B662820EC3EB} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {C956DD76-69C8-4A9C-83EA-D17DF83340FD} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {E6D5BF0E-DE92-4D82-A352-EF04B37CB11C} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {EF480016-9127-4916-8735-D2466BDBC582} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {68CC1E16-7370-4F26-A728-11CA1E17BAFC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {DE635372-2830-49D6-8AB3-0718747EE28A} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {07B948AC-AACC-4A84-9C59-E7CF0BD8DB29} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {9311BF41-D5E8-4BD4-8B18-BE3ED24848E9} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {81A49BEA-810A-4591-B0FF-FFB765685C75} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {CE0B99D2-DBC4-421A-8684-50463B7D2F3E} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} + EndGlobalSection +EndGlobal diff --git a/AElf.CrossChainServer.sln.DotSettings b/AElf.CrossChainServer.sln.DotSettings new file mode 100644 index 0000000..cb0b2c9 --- /dev/null +++ b/AElf.CrossChainServer.sln.DotSettings @@ -0,0 +1,23 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + \ No newline at end of file diff --git a/CodeCoverage.runsettings b/CodeCoverage.runsettings new file mode 100755 index 0000000..290c399 --- /dev/null +++ b/CodeCoverage.runsettings @@ -0,0 +1,46 @@ + + + + + + + + cobertura + [xunit.*]*,[*Tests]* + + **/test/**/*.cs, + **/src/AElf.CrossChainServer.AuthServer/**/*.cs, + **/src/AElf.CrossChainServer.AetherlinkApi/**/*.cs, + **/src/AElf.CrossChainServer.EvmIndexer/**/*.cs, + **/src/AElf.CrossChainServer.Worker/**/*.cs, + **/src/AElf.CrossChainServer.DbMigrator/**/*.cs, + **/src/AElf.CrossChainServer.EntityHandler/**/*.cs, + **/src/AElf.CrossChainServer.HttpApi.Host/**/*.cs, + **/src/AElf.CrossChainServer.HttpApi.Client/**/*.cs, + **/src/AElf.CrossChainServer.Application.Contracts/**/*.cs, + **/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/*.cs, + **/src/AElf.CrossChainServer.Application/Contracts/**/*.cs, + **/src/AElf.CrossChainServer.Application/Chains/*.cs, + **/src/AElf.CrossChainServer.Application/Chains/Ton/*.cs, + **/src/AElf.CrossChainServer.Application/Indexer/**/*.cs, + **/src/AElf.CrossChainServer.Application/CrossChain/AetherlinkOptions.cs, + **/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.ExceptionHandler.cs, + **/src/AElf.CrossChainServer.Application/CrossChain/IAetherLinkProvider.cs, + **/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs, + **/src/AElf.CrossChainServer.Application/TokenAccess/**/*.cs, + **/src/AElf.CrossChainServer.Application/TokenPool/ITokenLiquidityMonitorProvider.cs, + **/src/AElf.CrossChainServer.Domain/Notify/*.cs, + **/src/AElf.CrossChainServer.Domain/Data/**/*.cs, + **/src/AElf.CrossChainServer.Domain/OpenIddict/*.cs, + **/src/AElf.CrossChainServer.Domain/Chains/ChainDataSeedContributor.cs, + **/src/AElf.CrossChainServer.Domain.Shared/*.cs, + **/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContextFactory.cs, + **/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCrossChainServerDbSchemaMigrator.cs, + **/src/AElf.CrossChainServer.Application/HttpClient/*.cs + Obsolete,GeneratedCodeAttribute + false + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d2aee1c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0.302-1 +ARG servicename +WORKDIR /app +COPY out/$servicename . \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..9210a2e --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100755 index 0000000..4d33a37 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,30 @@ +jobs: + # All tasks on Linux + - job: build_all_linux + displayName: Build all tasks (Linux) + timeoutInMinutes: 120 + pool: + vmImage: ubuntu-latest + steps: + - task: UseDotNet@2 + displayName: 'Install .NET Core SDK' + inputs: + version: 8.0.x + - script: cd scripts && bash elasticsearch-linux.sh + displayName: 'Start an elasticsearch' + - script: bash build.sh --target=Build + displayName: 'Build' +# - task: PublishTestResults@2 +# condition: always() +# inputs: +# testRunner: VSTest +# testResultsFiles: '**/*.trx' +# - task: reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Build.SourcesDirectory)/test/*/TestResults/*/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/CodeCoverage' +# reporttypes: 'Cobertura' +# assemblyfilters: '-xunit*' +# - script: bash build.sh --target=Upload-Coverage-Azure +# displayName: 'Upload data to Codecov' \ No newline at end of file diff --git a/build.cake b/build.cake new file mode 100755 index 0000000..7b94d1b --- /dev/null +++ b/build.cake @@ -0,0 +1,78 @@ +#tool nuget:?package=Codecov +#addin nuget:?package=Cake.Codecov&version=0.8.0 + +var target = Argument("target", "Default"); +var configuration = Argument("configuration", "Debug"); +var rootPath = "./"; +var srcPath = rootPath + "src/"; +var testPath = rootPath + "test/"; +var solution = rootPath + "AElf.CrossChainServer.sln"; + +Task("Clean") + .Description("clean up project cache") + .Does(() => +{ + CleanDirectories(srcPath + "**/bin"); + CleanDirectories(srcPath + "**/obj"); + CleanDirectories(testPath + "**/bin"); + CleanDirectories(testPath + "**/obj"); +}); + +Task("Restore") + .Description("restore project dependencies") + .Does(() => +{ + DotNetCoreRestore(solution, new DotNetCoreRestoreSettings + { + Verbosity = DotNetCoreVerbosity.Quiet, + Sources = new [] { "https://www.myget.org/F/aelf-project-dev/api/v3/index.json", "https://api.nuget.org/v3/index.json" } + }); +}); +Task("Build") + .Description("Compilation project") + .IsDependentOn("Clean") + .IsDependentOn("Restore") + .Does(() => +{ + var buildSetting = new DotNetCoreBuildSettings{ + NoRestore = true, + Configuration = configuration, + ArgumentCustomization = args => { + return args.Append("/clp:ErrorsOnly") + .Append("-v quiet");} + }; + + DotNetCoreBuild(solution, buildSetting); +}); + +Task("Test-with-Codecov") + .Description("operation tes") + .IsDependentOn("Build") + .Does(() => +{ + var testSetting = new DotNetCoreTestSettings{ + Configuration = configuration, + NoRestore = true, + NoBuild = true, + ArgumentCustomization = args => { + return args + .Append("--logger trx") + .Append("--settings CodeCoverage.runsettings") + .Append("--collect:\"XPlat Code Coverage\""); + } + }; + var testProjects = GetFiles("./test/*.Tests/*.csproj"); + var testProjectList = testProjects.OrderBy(p=>p.FullPath).ToList(); + foreach(var testProject in testProjectList) + { + DotNetCoreTest(testProject.FullPath, testSetting); + } +}); + +Task("Upload-Coverage-Azure") + .Does(() => +{ + Codecov("./CodeCoverage/Cobertura.xml","$CODECOV_TOKEN"); +}); + +RunTarget(target); diff --git a/build.config b/build.config new file mode 100755 index 0000000..610a1ce --- /dev/null +++ b/build.config @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +CAKE_VERSION=0.37.0 +DOTNET_VERSION=8.0.302 diff --git a/build.ps1 b/build.ps1 new file mode 100755 index 0000000..e48d09a --- /dev/null +++ b/build.ps1 @@ -0,0 +1,154 @@ +#!/usr/bin/env pwsh +$DotNetInstallerUri = 'https://dot.net/v1/dotnet-install.ps1'; +$DotNetUnixInstallerUri = 'https://dot.net/v1/dotnet-install.sh' +$DotNetChannel = 'LTS' +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +[string] $CakeVersion = '' +[string] $DotNetVersion= '' +foreach($line in Get-Content (Join-Path $PSScriptRoot 'build.config')) +{ + if ($line -like 'CAKE_VERSION=*') { + $CakeVersion = $line.SubString(13) + } + elseif ($line -like 'DOTNET_VERSION=*') { + $DotNetVersion =$line.SubString(15) + } +} + + +if ([string]::IsNullOrEmpty($CakeVersion) -or [string]::IsNullOrEmpty($DotNetVersion)) { + 'Failed to parse Cake / .NET Core SDK Version' + exit 1 +} + +# Make sure tools folder exists +$ToolPath = Join-Path $PSScriptRoot "tools" +if (!(Test-Path $ToolPath)) { + Write-Verbose "Creating tools directory..." + New-Item -Path $ToolPath -Type Directory -Force | out-null +} + + +if ($PSVersionTable.PSEdition -ne 'Core') { + # Attempt to set highest encryption available for SecurityProtocol. + # PowerShell will not set this by default (until maybe .NET 4.6.x). This + # will typically produce a message for PowerShell v2 (just an info + # message though) + try { + # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) + # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't + # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is + # installed (.NET 4.5 is an in-place upgrade). + [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 + } catch { + Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' + } +} + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +$env:DOTNET_CLI_TELEMETRY_OPTOUT=1 +$env:DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 + + +Function Remove-PathVariable([string]$VariableToRemove) +{ + $SplitChar = ';' + if ($IsMacOS -or $IsLinux) { + $SplitChar = ':' + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + if ($path -ne $null) + { + $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "User") + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + if ($path -ne $null) + { + $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "Process") + } +} + +# Get .NET Core CLI path if installed. +$FoundDotNetCliVersion = $null; +if (Get-Command dotnet -ErrorAction SilentlyContinue) { + $FoundDotNetCliVersion = dotnet --version; +} + +if($FoundDotNetCliVersion -ne $DotNetVersion) { + $InstallPath = Join-Path $PSScriptRoot ".dotnet" + if (!(Test-Path $InstallPath)) { + New-Item -Path $InstallPath -ItemType Directory -Force | Out-Null; + } + + if ($IsMacOS -or $IsLinux) { + $ScriptPath = Join-Path $InstallPath 'dotnet-install.sh' + (New-Object System.Net.WebClient).DownloadFile($DotNetUnixInstallerUri, $ScriptPath); + & bash $ScriptPath --version "$DotNetVersion" --install-dir "$InstallPath" --channel "$DotNetChannel" --no-path + + Remove-PathVariable "$InstallPath" + $env:PATH = "$($InstallPath):$env:PATH" + } + else { + $ScriptPath = Join-Path $InstallPath 'dotnet-install.ps1' + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, $ScriptPath); + & $ScriptPath -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath; + + Remove-PathVariable "$InstallPath" + $env:PATH = "$InstallPath;$env:PATH" + } + $env:DOTNET_ROOT=$InstallPath +} + +########################################################################### +# INSTALL CAKE +########################################################################### + +# Make sure Cake has been installed. +[string] $CakeExePath = '' +[string] $CakeInstalledVersion = Get-Command dotnet-cake -ErrorAction SilentlyContinue | % {&$_.Source --version} + +if ($CakeInstalledVersion -eq $CakeVersion) { + # Cake found locally + $CakeExePath = (Get-Command dotnet-cake).Source +} +else { + $CakePath = [System.IO.Path]::Combine($ToolPath,'.store', 'cake.tool', $CakeVersion) # Old PowerShell versions Join-Path only supports one child path + + $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) + + + if ((!(Test-Path -Path $CakePath -PathType Container)) -or (!(Test-Path $CakeExePath -PathType Leaf))) { + + if ((![string]::IsNullOrEmpty($CakeExePath)) -and (Test-Path $CakeExePath -PathType Leaf)) + { + & dotnet tool uninstall --tool-path $ToolPath Cake.Tool + } + + & dotnet tool install --tool-path $ToolPath --version $CakeVersion Cake.Tool + if ($LASTEXITCODE -ne 0) + { + 'Failed to install cake' + exit 1 + } + $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) + } +} + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### +& "$CakeExePath" ./build.cake --bootstrap +if ($LASTEXITCODE -eq 0) +{ + & "$CakeExePath" ./build.cake $args +} +exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..06bcee8 --- /dev/null +++ b/build.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# Define varibles +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source $SCRIPT_DIR/build.config +TOOLS_DIR=$SCRIPT_DIR/tools +CAKE_EXE=$TOOLS_DIR/dotnet-cake +CAKE_PATH=$TOOLS_DIR/.store/cake.tool/$CAKE_VERSION + +if [ "$CAKE_VERSION" = "" ] || [ "$DOTNET_VERSION" = "" ]; then + echo "An error occured while parsing Cake / .NET Core SDK version." + exit 1 +fi + +# Make sure the tools folder exist. +if [ ! -d "$TOOLS_DIR" ]; then + mkdir "$TOOLS_DIR" +fi + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 +export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 + +DOTNET_INSTALLED_VERSION=$(dotnet --version 2>&1) + +if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then + echo "Installing .NET CLI..." + if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then + mkdir "$SCRIPT_DIR/.dotnet" + fi + curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh + bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path + export PATH="$SCRIPT_DIR/.dotnet":$PATH + export DOTNET_ROOT="$SCRIPT_DIR/.dotnet" +fi + +########################################################################### +# INSTALL CAKE +########################################################################### + +CAKE_INSTALLED_VERSION=$(dotnet-cake --version 2>&1) + +if [ "$CAKE_VERSION" != "$CAKE_INSTALLED_VERSION" ]; then + if [ ! -f "$CAKE_EXE" ] || [ ! -d "$CAKE_PATH" ]; then + if [ -f "$CAKE_EXE" ]; then + dotnet tool uninstall --tool-path $TOOLS_DIR Cake.Tool + fi + + echo "Installing Cake $CAKE_VERSION..." + dotnet tool install --tool-path $TOOLS_DIR --version $CAKE_VERSION Cake.Tool + if [ $? -ne 0 ]; then + echo "An error occured while installing Cake." + exit 1 + fi + fi + + # Make sure that Cake has been installed. + if [ ! -f "$CAKE_EXE" ]; then + echo "Could not find Cake.exe at '$CAKE_EXE'." + exit 1 + fi +else + CAKE_EXE="dotnet-cake" +fi + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### + +# Start Cake +(exec "$CAKE_EXE" build.cake --bootstrap) && (exec "$CAKE_EXE" build.cake "$@") \ No newline at end of file diff --git a/codecov.sh b/codecov.sh new file mode 100755 index 0000000..6b97c5b --- /dev/null +++ b/codecov.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +TOKEN=$1 +rm -r ./test/*.Tests/TestResults +rm -r CodeCoverage +for name in `ls ./test/*.Tests/*.csproj | awk '{print $NF}'`; +do + echo ${name} + dotnet test ${name} --logger trx --settings CodeCoverage.runsettings --collect:"XPlat Code Coverage" +done +reportgenerator /test/*/TestResults/*/coverage.cobertura.xml -reports:./test/*/TestResults/*/coverage.cobertura.xml -targetdir:./CodeCoverage -reporttypes:Cobertura -assemblyfilters:-xunit* +codecov -f ./CodeCoverage/Cobertura.xml -t ${TOKEN} \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100755 index 0000000..23be405 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +codecov: + notify: + after_n_builds: 1 \ No newline at end of file diff --git a/common.props b/common.props new file mode 100644 index 0000000..6ef9bae --- /dev/null +++ b/common.props @@ -0,0 +1,15 @@ + + + latest + 1.0.0 + $(NoWarn);CS1591 + app + + + + + $(NoWarn);0436 + + + + \ No newline at end of file diff --git a/scripts/download_binary.bat b/scripts/download_binary.bat new file mode 100644 index 0000000..02382a3 --- /dev/null +++ b/scripts/download_binary.bat @@ -0,0 +1,16 @@ +SET scriptdir=%~dp0 + +SET version=v1.0.3 +SET filename=contract_csharp_plugin-%version%-win32.zip + +SET url=https://github.com/AElfProject/contract-plugin/releases/download/%version%/%filename% +SET file=%scriptdir%%filename% + +if not exist "%scriptdir%contract_csharp_plugin.exe" ( + if not exist "%file%" ( + echo "download contract plugin from: %url%" + powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri '%url%' -OutFile '%file%'" + ) + echo "unzip file: %file%" + unzip %scriptdir%%filename% -d %scriptdir% +) diff --git a/scripts/download_binary.sh b/scripts/download_binary.sh new file mode 100644 index 0000000..49b8fdb --- /dev/null +++ b/scripts/download_binary.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +scriptdir=`dirname "$0"` + +d="Darwin" +l="Linux" +if [[ "$(uname -s | grep ${d})" != "" ]]; then + osn="macosx" +elif [[ "$(uname -s | grep ${l})" != "" ]]; then + osn="linux" +else + osn="windows" +fi + +plugin="${scriptdir}/contract_csharp_plugin" + +version="v1.0.3" + +if [[ ! -f ${plugin} ]]; then + if [[ ${osn} == "macosx" ]]; then + suffix="osx" + elif [[ ${osn} == "linux" ]]; then + suffix="linux" + fi + filename=contract_csharp_plugin-${version}-${suffix}.zip + # Make sure you grab the latest version + if [[ ! -f ${filename} ]]; then + echo "download contract plugin ${filename} from github" + curl -OL https://github.com/AElfProject/contract-plugin/releases/download/${version}/${filename} + fi + + # Unzip + unzip -o ${filename} -d "${scriptdir}" +fi diff --git a/scripts/elasticsearch-linux.sh b/scripts/elasticsearch-linux.sh new file mode 100644 index 0000000..3b29595 --- /dev/null +++ b/scripts/elasticsearch-linux.sh @@ -0,0 +1,7 @@ +#!/bin/bash +wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.1-linux-x86_64.tar.gz +tar xzvf elasticsearch-7.15.1-linux-x86_64.tar.gz +cd elasticsearch-7.15.1/ +bin/elasticsearch -d +sleep 30 +curl http://127.0.0.1:9200 diff --git a/scripts/elasticsearch-macOS.sh b/scripts/elasticsearch-macOS.sh new file mode 100644 index 0000000..620e400 --- /dev/null +++ b/scripts/elasticsearch-macOS.sh @@ -0,0 +1,7 @@ +#!/bin/bash +wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.1-darwin-x86_64.tar.gz +tar xzvf elasticsearch-7.15.1-darwin-x86_64.tar.gz +cd elasticsearch-7.15.1/ +bin/elasticsearch -d +sleep 30 +curl http://127.0.0.1:9200 diff --git a/scripts/elasticsearch-windows.ps1 b/scripts/elasticsearch-windows.ps1 new file mode 100644 index 0000000..c435a76 --- /dev/null +++ b/scripts/elasticsearch-windows.ps1 @@ -0,0 +1,9 @@ +#!/usr/bin/env pwsh +$WebClient = New-Object System.Net.WebClient +$WebClient.DownloadFile("https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.1-windows-x86_64.zip","elasticsearch.zip") +Expand-Archive -Path elasticsearch.zip -DestinationPath elasticsearch; +cd elasticsearch/elasticsearch-7.15.1/ +.\bin\elasticsearch-service.bat install +.\bin\elasticsearch-service.bat start +sleep 30 +curl http://127.0.0.1:9200 diff --git a/scripts/install_protobuf.sh b/scripts/install_protobuf.sh new file mode 100644 index 0000000..0d6400d --- /dev/null +++ b/scripts/install_protobuf.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +d="Darwin" +l="Linux" +if [[ "$(uname -s | grep ${d})" != "" ]]; then + osn="macosx" +elif [[ "$(uname -s | grep ${l})" != "" ]]; then + osn="linux" +else + osn="windows" +fi + +echo "Install protobuf on ${osn}" + +if [[ ${osn} == "macosx" ]]; then + curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-osx-x86_64.zip + unzip protoc-3.11.4-osx-x86_64.zip -d protoc3 + sudo mv protoc3/bin/* /usr/local/bin/ + sudo mv protoc3/include/* /usr/local/include + sudo chown ${USER} /usr/local/bin/protoc + sudo chown -R ${USER} /usr/local/include/google +elif [[ ${osn} == "linux" ]]; then + # Make sure you grab the latest version + curl -OL https://github.com/google/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip + + # Unzip + unzip protoc-3.11.4-linux-x86_64.zip -d protoc3 + + # Move protoc to /usr/local/bin/ + sudo mv protoc3/bin/* /usr/local/bin/ + + # Move protoc3/include to /usr/local/include/ + sudo mv protoc3/include/* /usr/local/include/ + + # Optional: change owner + sudo chown ${USER} /usr/local/bin/protoc + sudo chown -R ${USER} /usr/local/include/google +fi diff --git a/src/AElf.CrossChainServer.AetherlinkApi/AElf.CrossChainServer.AetherlinkApi.csproj b/src/AElf.CrossChainServer.AetherlinkApi/AElf.CrossChainServer.AetherlinkApi.csproj new file mode 100644 index 0000000..8ef07a2 --- /dev/null +++ b/src/AElf.CrossChainServer.AetherlinkApi/AElf.CrossChainServer.AetherlinkApi.csproj @@ -0,0 +1,18 @@ + + + + + + net8.0 + AElf.AetherlinkApi + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.AetherlinkApi/CrossChainServerAetherlinkApiModule.cs b/src/AElf.CrossChainServer.AetherlinkApi/CrossChainServerAetherlinkApiModule.cs new file mode 100644 index 0000000..1d39cf6 --- /dev/null +++ b/src/AElf.CrossChainServer.AetherlinkApi/CrossChainServerAetherlinkApiModule.cs @@ -0,0 +1,18 @@ +using AElf.CrossChainServer.TokenPrice; +using Aetherlink.PriceServer; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; + +namespace AElf.AetherlinkApi; + +[DependsOn( + typeof(AetherlinkPriceServerModule) +)] +public class CrossChainServerAetherlinkApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + context.Services.AddSingleton(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AetherlinkApi/TokenPriceProvider.cs b/src/AElf.CrossChainServer.AetherlinkApi/TokenPriceProvider.cs new file mode 100644 index 0000000..8483f71 --- /dev/null +++ b/src/AElf.CrossChainServer.AetherlinkApi/TokenPriceProvider.cs @@ -0,0 +1,62 @@ +using System; +using System.Globalization; +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenPrice; +using AElf.ExceptionHandler; +using Aetherlink.PriceServer; +using Aetherlink.PriceServer.Dtos; +using Serilog; +using Volo.Abp.DependencyInjection; + +namespace AElf.AetherlinkApi; + +public class TokenPriceProvider : ITokenPriceProvider, ISingletonDependency +{ + private readonly IPriceServerProvider _priceServerProvider; + + public TokenPriceProvider(IPriceServerProvider priceServerProvider) + { + _priceServerProvider = priceServerProvider; + } + + [ExceptionHandler(typeof(Exception), Message = "GetPrice Error", LogOnly = true)] + public async Task GetPriceAsync(string pair) + { + var result = await _priceServerProvider.GetAggregatedTokenPriceAsync(new GetAggregatedTokenPriceRequestDto + { + TokenPair = pair, + AggregateType = AggregateType.Latest + }); + var data = result.Data; + if (data == null) + { + Log.Error( + "Get token price from Aetherlink price service failed."); + return 0; + } + Log.Information( + "Get token price from Aetherlink price service, pair: {pair}, price: {price}, decimal: {tokenDecimal}", + data.TokenPair, data.Price, data.Decimal); + + return (decimal)(data.Price / Math.Pow(10, (double)data.Decimal)); + } + + [ExceptionHandler(typeof(Exception), Message = "Get history price error", LogOnly = true)] + public async Task GetHistoryPriceAsync(string pair, string dateTime) + { + var date = DateTime.ParseExact(dateTime, "dd-MM-yyyy", CultureInfo.InvariantCulture).ToString("yyyyMMdd"); + + var tokenPair = pair; + var result = (await _priceServerProvider.GetDailyPriceAsync(new GetDailyPriceRequestDto + { + TokenPair = tokenPair, + TimeStamp = date + })).Data; + + Log.Information( + "Get history token price from Aetherlink price service, tokenPair: {tokenPair}, TimeStamp: {date}, result.Price: {resultPrice}, result.Decimal: {resultDecimal}", + tokenPair, date, result.Price, result.Decimal); + + return (decimal)(result.Price / Math.Pow(10, (double)result.Decimal)); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/AElf.CrossChainServer.Application.Contracts.csproj b/src/AElf.CrossChainServer.Application.Contracts/AElf.CrossChainServer.Application.Contracts.csproj new file mode 100644 index 0000000..7e40ce4 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/AElf.CrossChainServer.Application.Contracts.csproj @@ -0,0 +1,35 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/BlockDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/BlockDto.cs new file mode 100644 index 0000000..9eef924 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/BlockDto.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains; + +public class BlockDto +{ + public string BlockHash { get; set; } + public BlockHeaderDto Header { get; set; } + public BlockBodyDto Body { get; set; } +} + +public class BlockHeaderDto +{ + public string PreviousBlockHash { get; set; } + public long Height { get; set; } + + public DateTime Time { get; set; } + + public string ChainId { get; set; } +} + +public class BlockBodyDto +{ + public int TransactionsCount { get; set; } + + public List Transactions { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainDto.cs new file mode 100644 index 0000000..5f6c077 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainDto.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Chains +{ + public class ChainDto: EntityDto + { + public string Name { get; set; } + /// + /// 0: AElf, 1: Evm, 2:TVM + /// + public BlockchainType Type { get; set; } + public bool IsMainChain { get; set; } + public int AElfChainId { get; set; } + public string BlockChain { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainStatusDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainStatusDto.cs new file mode 100644 index 0000000..ecac992 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/ChainStatusDto.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Chains; + +public class ChainStatusDto +{ + public string ChainId { get; set; } + public long BlockHeight { get; set; } + public long ConfirmedBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/CreateChainInput.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/CreateChainInput.cs new file mode 100644 index 0000000..8f95cb5 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/CreateChainInput.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Chains +{ + public class CreateChainInput + { + public int Id { get; set; } + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogDto.cs new file mode 100644 index 0000000..2fc57c1 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogDto.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using Nethereum.Hex.HexTypes; + +namespace AElf.CrossChainServer.Chains; + +public class FilterLogsDto +{ + public List Logs { get; set; } +} + +public class FilterLog +{ + public bool Removed { get; set; } + public string Type { get; set; } + public long LogIndex { get; set; } + public string TransactionHash { get; set; } + public long TransactionIndex { get; set; } + public string BlockHash { get; set; } + public long BlockNumber { get; set; } + public string Address { get; set; } + public string Data { get; set; } + public object[] Topics { get; set; } +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogsAndEventsDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogsAndEventsDto.cs new file mode 100644 index 0000000..7fae68d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/FilterLogsAndEventsDto.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.Chains; + +public class FilterLogsAndEventsDto where TEventDTO : IEventDTO, new() +{ + public List> Events { get; set; } +} + +public class EventLogs where TEventDTO : IEventDTO, new() +{ + public TEventDTO Event { get; set; } + + public FilterLog Log { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/GetChainsInput.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/GetChainsInput.cs new file mode 100644 index 0000000..2636943 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/GetChainsInput.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.Chains; + +public class GetChainsInput +{ + public BlockchainType? Type { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/GetTonTransactionInput.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/GetTonTransactionInput.cs new file mode 100644 index 0000000..c64732d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/GetTonTransactionInput.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Chains; + +public class GetTonTransactionInput +{ + public string ChainId { get; set; } + public string ContractAddress { get; set; } + public string LatestTransactionLt { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/IBlockchainAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/IBlockchainAppService.cs new file mode 100644 index 0000000..ccc6a28 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/IBlockchainAppService.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Chains +{ + public interface IBlockchainAppService + { + Task GetTokenInfoAsync(string chainId, string address, string symbol = null); + Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false); + Task GetChainStatusAsync(string chainId); + Task GetTransactionResultAsync(string chainId, string transactionId); + Task GetMerklePathAsync(string chainId, string transactionId); + Task> GetTonTransactionAsync(GetTonTransactionInput input); + Task GetTonUserFriendlyAddressAsync(string chainId, string address); + Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight); + Task GetChainHeightAsync(string chainId); + + Task> GetContractLogsAndParseAsync(string chainId, + string contractAddress, long startHeight, long endHeight, string logSignature) + where TEventDto : IEventDTO, new(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/IChainAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/IChainAppService.cs new file mode 100644 index 0000000..15e7d86 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/IChainAppService.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Chains +{ + public interface IChainAppService + { + Task> GetListAsync(GetChainsInput input); + + Task GetAsync(string id); + + Task GetByNameAsync(string name); + + Task GetByAElfChainIdAsync(int aelfChainId); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/TonAddressHelper.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonAddressHelper.cs new file mode 100644 index 0000000..c962473 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonAddressHelper.cs @@ -0,0 +1,92 @@ +using TonSdk.Core; + +namespace AElf.CrossChainServer.Chains; + +public partial class TonAddressHelper +{ + public static string GetTonUserFriendlyAddress(string rawAddress, bool isTestOnly = false, + bool isBounceable = false) + { + var splitRaw = rawAddress.Split(":"); + var wc = int.Parse(splitRaw[0]); + var hash = ByteArrayHelper.HexStringToByteArray(splitRaw[1]); + var address = new Address(wc, hash, new AddressRewriteOptions + { + Bounceable = isBounceable, + TestOnly = isTestOnly + }); + return address.ToString(); + } + + public static string GetTonRawAddress(string address) + { + var tonAddress = new Address(address); + var hash = tonAddress.GetHash(); + var wc = tonAddress.GetWorkchain(); + var raw = wc + ":" + hash.ToHex(); + return raw; + } + + public static bool IsTonFriendlyAddress(string source) + { + // Check length + if (source.Length != 48) + { + return false; + } + + // Check if address is valid base64 + return Base64Regex().IsMatch(source); + } + + public static bool IsTonRawAddress(string source) + { + // Check if has delimiter + if (!source.Contains(':')) + { + return false; + } + + var parts = source.Split(':'); + if (parts.Length != 2) + { + return false; + } + + var wc = parts[0]; + var hash = parts[1]; + + // Check if wc is valid + if (!int.TryParse(wc, out _)) + { + return false; + } + + // Check if hash is valid + if (!HashRegex().IsMatch(hash.ToLower())) + { + return false; + } + + // Check if hash length is correct + return hash.Length == 64; + } + + public static string ConvertRawAddressToFriendly(string address, bool isTestOnly = false, bool isBounceable = false) + { + return IsTonRawAddress(address) ? GetTonUserFriendlyAddress(address, isTestOnly, isBounceable) : address; + } + + [System.Text.RegularExpressions.GeneratedRegex(@"^[A-Za-z0-9+/_-]+$")] + private static partial System.Text.RegularExpressions.Regex Base64Regex(); + + [System.Text.RegularExpressions.GeneratedRegex(@"^[a-f0-9]+$")] + private static partial System.Text.RegularExpressions.Regex HashRegex(); +} + +public class AddressRewriteOptions : IAddressRewriteOptions +{ + public int? Workchain { get; set; } + public bool? Bounceable { get; set; } + public bool? TestOnly { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/TonApiTransactionDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonApiTransactionDto.cs new file mode 100644 index 0000000..c545864 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonApiTransactionDto.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains; + +public class TonApiTransactionDto +{ + public string Hash { get; set; } + public long Lt { get; set; } + public TonApiAccountDto Account { get; set; } + public bool Success { get; set; } + public long Utime { get; set; } + public string OrigStatus { get; set; } + public string EndStatus { get; set; } + public long TotalFees { get; set; } + public long EndBalance { get; set; } + public string TransactionType { get; set; } + public string StateUpdateOld { get; set; } + public string StateUpdateNew { get; set; } + public TonapiMessageDto InMsg { get; set; } + public List OutMsg { get; set; } + public string Block { get; set; } + public string PrevTransHash { get; set; } + public long PrevTransLt { get; set; } + public TonapiComputePhaseDto ComputePhase { get; set; } + public TonapiStoragePhaseDto StoragePhase { get; set; } + public TonapiCreditPhaseDto CreditPhase { get; set; } + public TonapiActionPhaseDto ActionPhase { get; set; } + public string BouncePhase { get; set; } + public bool Aborted { get; set; } + public bool Destroyed { get; set; } + public string Raw { get; set; } +} + +public class TonApiAccountDto +{ + public string Address { get; set; } + public string Name { get; set; } + public bool IsScam { get; set; } + public string Icon { get; set; } + public bool IsWallet { get; set; } +} + +public class TonapiMessageDto +{ + public string MsgType { get; set; } + public long CreatedLt { get; set; } + public bool IhrDisabled { get; set; } + public bool Bounce { get; set; } + public bool Bounced { get; set; } + public long Value { get; set; } + public long FwdFee { get; set; } + public long IhrFee { get; set; } + public TonApiAccountDto Destination { get; set; } + public TonApiAccountDto Source { get; set; } + public long ImportFee { get; set; } + public long CreatedAt { get; set; } + public string OpCode { get; set; } + public InitDto Init { get; set; } + public string Hash { get; set; } + public string RawBody { get; set; } + public string DecodedOpName { get; set; } + public DecodedBodyDto DecodedBody { get; set; } +} + +public class InitDto +{ + public string Boc { get; set; } + public List Interfaces { get; set; } +} + +public class TonapiComputePhaseDto +{ + public bool Skipped { get; set; } + public string SkipReason { get; set; } + public bool Success { get; set; } + public long GasFees { get; set; } + public long GasUsed { get; set; } + public long VmSteps { get; set; } + public int ExitCode { get; set; } + public string ExitCodeDescription { get; set; } +} + +public class TonapiStoragePhaseDto +{ + public long FeesCollected { get; set; } + public long FeesDue { get; set; } + public string StatusChange { get; set; } +} + +public class TonapiCreditPhaseDto +{ + public long FeesCollected { get; set; } + public long Credit { get; set; } +} + +public class TonapiActionPhaseDto +{ + public bool Success { get; set; } + public int ResultCode { get; set; } + public int TotalActions { get; set; } + public int SkippedActions { get; set; } + public long FwdFees { get; set; } + public long TotalFees { get; set; } + public string ResultCodeDescription { get; set; } +} + +public class DecodedBodyDto +{ + public string Payload { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/TonTransactionDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonTransactionDto.cs new file mode 100644 index 0000000..49dbfc7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/TonTransactionDto.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains; + +public class TonTransactionDto +{ + public string Account { get; set; } + public TonBlockIdDto BlockRef { get; set; } + public string Hash { get; set; } + public TonMessageDto InMsg { get; set; } + public long McBlockSeqno { get; set; } + public string Lt { get; set; } + public int Now { get; set; } + public string OrigStatus { get; set; } + public List OutMsgs { get; set; } + public string PrevTransHash { get; set; } + public string PrevTransLt { get; set; } + public string TotalFees { get; set; } + public string TraceId { get; set; } +} + +public class TonBlockIdDto +{ + public long Seqno { get; set; } + public string Shard { get; set; } + public int Workchain { get; set; } +} + +public class TonMessageDto +{ + public bool? Bounce { get; set; } + public bool? Bounced { get; set; } + public string CreatedAt { get; set; } + public string CreatedLt { get; set; } + public string Destination { get; set; } + public string FwdFee { get; set; } + public string Hash { get; set; } + public bool? IhrDisabled { get; set; } + public string IhrFee { get; set; } + public string ImportFee { get; set; } + public TonMessageContentDto InitState { get; set; } + public TonMessageContentDto MessageContent { get; set; } + public string Opcode { get; set; } + public string Source { get; set; } + public string Value { get; set; } +} + +public class TonMessageContentDto +{ + public string Body { get; set; } + public TonDecodedContentDto Decoded { get; set; } + public string Hash { get; set; } +} + +public class TonDecodedContentDto +{ + public string Comment { get; set; } + public string Type { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Chains/TransactionResultDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Chains/TransactionResultDto.cs new file mode 100644 index 0000000..67dc513 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Chains/TransactionResultDto.cs @@ -0,0 +1,14 @@ +using AElf.Client.Dto; + +namespace AElf.CrossChainServer.Chains; + +public class TransactionResultDto +{ + public string ChainId { get; set; } + public bool IsMined { get; set; } + public bool IsFailed { get; set; } + public long BlockHeight { get; set; } + public string BlockHash { get; set; } + public TransactionDto Transaction { get; set; } + public LogEventDto[] Logs { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.c.cs new file mode 100644 index 0000000..9bd543f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.c.cs @@ -0,0 +1,303 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs0.proto +// +// Original file comments: +// * +// AElf Standards ACS0(Contract Deployment Standard) +// +// Used to manage the deployment and update of contracts. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Standards.ACS0 { + + #region Events + internal partial class ContractProposed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public ContractProposed GetNonIndexed() + { + return new ContractProposed + { + ProposedContractInputHash = ProposedContractInputHash, + }; + } + } + + internal partial class ContractDeployed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ContractDeployed + { + Author = Author + }, + new ContractDeployed + { + CodeHash = CodeHash + }, + }; + } + + public ContractDeployed GetNonIndexed() + { + return new ContractDeployed + { + Address = Address, + Version = Version, + Name = Name, + }; + } + } + + internal partial class CodeCheckRequired : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CodeCheckRequired GetNonIndexed() + { + return new CodeCheckRequired + { + Code = Code, + ProposedContractInputHash = ProposedContractInputHash, + Category = Category, + IsSystemContract = IsSystemContract, + }; + } + } + + internal partial class CodeUpdated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new CodeUpdated + { + Address = Address + }, + }; + } + + public CodeUpdated GetNonIndexed() + { + return new CodeUpdated + { + OldCodeHash = OldCodeHash, + NewCodeHash = NewCodeHash, + Version = Version, + }; + } + } + + #endregion + internal static partial class ACS0Container + { + static readonly string __ServiceName = "acs0.ACS0"; + + #region Marshallers + static readonly aelf::Marshaller __Marshaller_acs0_SystemContractDeploymentInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.SystemContractDeploymentInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_Address = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.Address.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ContractDeploymentInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ContractDeploymentInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ContractUpdateInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ContractUpdateInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_Hash = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.Hash.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ContractCodeCheckInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ContractCodeCheckInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ReleaseContractInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ReleaseContractInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_Empty = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ValidateSystemContractAddressInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ValidateSystemContractAddressInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_BoolValue = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.BoolValue.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_Int64Value = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Int64Value.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ContractInfo = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ContractInfo.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_SmartContractRegistration = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.SmartContractRegistration.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs0_ContractCodeHashList = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS0.ContractCodeHashList.Parser.ParseFrom); + #endregion + + #region Methods + static readonly aelf::Method __Method_DeploySystemSmartContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "DeploySystemSmartContract", + __Marshaller_acs0_SystemContractDeploymentInput, + __Marshaller_aelf_Address); + + static readonly aelf::Method __Method_DeploySmartContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "DeploySmartContract", + __Marshaller_acs0_ContractDeploymentInput, + __Marshaller_aelf_Address); + + static readonly aelf::Method __Method_UpdateSmartContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "UpdateSmartContract", + __Marshaller_acs0_ContractUpdateInput, + __Marshaller_aelf_Address); + + static readonly aelf::Method __Method_ProposeNewContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ProposeNewContract", + __Marshaller_acs0_ContractDeploymentInput, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_ProposeContractCodeCheck = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ProposeContractCodeCheck", + __Marshaller_acs0_ContractCodeCheckInput, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_ProposeUpdateContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ProposeUpdateContract", + __Marshaller_acs0_ContractUpdateInput, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_ReleaseApprovedContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ReleaseApprovedContract", + __Marshaller_acs0_ReleaseContractInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ReleaseCodeCheckedContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ReleaseCodeCheckedContract", + __Marshaller_acs0_ReleaseContractInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ValidateSystemContractAddress = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ValidateSystemContractAddress", + __Marshaller_acs0_ValidateSystemContractAddressInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_SetContractProposerRequiredState = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetContractProposerRequiredState", + __Marshaller_google_protobuf_BoolValue, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_CurrentContractSerialNumber = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "CurrentContractSerialNumber", + __Marshaller_google_protobuf_Empty, + __Marshaller_google_protobuf_Int64Value); + + static readonly aelf::Method __Method_GetContractInfo = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetContractInfo", + __Marshaller_aelf_Address, + __Marshaller_acs0_ContractInfo); + + static readonly aelf::Method __Method_GetContractAuthor = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetContractAuthor", + __Marshaller_aelf_Address, + __Marshaller_aelf_Address); + + static readonly aelf::Method __Method_GetContractHash = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetContractHash", + __Marshaller_aelf_Address, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_GetContractAddressByName = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetContractAddressByName", + __Marshaller_aelf_Hash, + __Marshaller_aelf_Address); + + static readonly aelf::Method __Method_GetSmartContractRegistrationByAddress = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetSmartContractRegistrationByAddress", + __Marshaller_aelf_Address, + __Marshaller_aelf_SmartContractRegistration); + + static readonly aelf::Method __Method_GetSmartContractRegistrationByCodeHash = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetSmartContractRegistrationByCodeHash", + __Marshaller_aelf_Hash, + __Marshaller_aelf_SmartContractRegistration); + + static readonly aelf::Method __Method_GetContractCodeHashListByDeployingBlockHeight = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetContractCodeHashListByDeployingBlockHeight", + __Marshaller_google_protobuf_Int64Value, + __Marshaller_acs0_ContractCodeHashList); + + #endregion + + #region Descriptors + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.Services[0], + }; + } + } + #endregion + + public class ACS0ReferenceState : global::AElf.Sdk.CSharp.State.ContractReferenceState + { + internal global::AElf.Sdk.CSharp.State.MethodReference DeploySystemSmartContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference DeploySmartContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference UpdateSmartContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ProposeNewContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ProposeContractCodeCheck { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ProposeUpdateContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ReleaseApprovedContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ReleaseCodeCheckedContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ValidateSystemContractAddress { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference SetContractProposerRequiredState { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference CurrentContractSerialNumber { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetContractInfo { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetContractAuthor { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetContractHash { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetContractAddressByName { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetSmartContractRegistrationByAddress { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetSmartContractRegistrationByCodeHash { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetContractCodeHashListByDeployingBlockHeight { get; set; } + } + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.g.cs new file mode 100644 index 0000000..8d2298c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs0.g.cs @@ -0,0 +1,3071 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs0.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS0 { + + /// Holder for reflection information generated from acs0.proto + internal static partial class Acs0Reflection { + + #region Descriptor + /// File descriptor for acs0.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs0Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgphY3MwLnByb3RvEgRhY3MwGg9hZWxmL2NvcmUucHJvdG8aEmFlbGYvb3B0", + "aW9ucy5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGh5nb29n", + "bGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8iogEKDENvbnRyYWN0SW5mbxIV", + "Cg1zZXJpYWxfbnVtYmVyGAEgASgDEh0KBmF1dGhvchgCIAEoCzINLmFlbGYu", + "QWRkcmVzcxIQCghjYXRlZ29yeRgDIAEoERIdCgljb2RlX2hhc2gYBCABKAsy", + "Ci5hZWxmLkhhc2gSGgoSaXNfc3lzdGVtX2NvbnRyYWN0GAUgASgIEg8KB3Zl", + "cnNpb24YBiABKAUiOQoXQ29udHJhY3REZXBsb3ltZW50SW5wdXQSEAoIY2F0", + "ZWdvcnkYASABKBESDAoEY29kZRgCIAEoDCL7AgodU3lzdGVtQ29udHJhY3RE", + "ZXBsb3ltZW50SW5wdXQSEAoIY2F0ZWdvcnkYASABKBESDAoEY29kZRgCIAEo", + "DBIYCgRuYW1lGAMgASgLMgouYWVsZi5IYXNoEmkKHHRyYW5zYWN0aW9uX21l", + "dGhvZF9jYWxsX2xpc3QYBCABKAsyQy5hY3MwLlN5c3RlbUNvbnRyYWN0RGVw", + "bG95bWVudElucHV0LlN5c3RlbVRyYW5zYWN0aW9uTWV0aG9kQ2FsbExpc3Qa", + "QgobU3lzdGVtVHJhbnNhY3Rpb25NZXRob2RDYWxsEhMKC21ldGhvZF9uYW1l", + "GAEgASgJEg4KBnBhcmFtcxgCIAEoDBpxCh9TeXN0ZW1UcmFuc2FjdGlvbk1l", + "dGhvZENhbGxMaXN0Ek4KBXZhbHVlGAEgAygLMj8uYWNzMC5TeXN0ZW1Db250", + "cmFjdERlcGxveW1lbnRJbnB1dC5TeXN0ZW1UcmFuc2FjdGlvbk1ldGhvZENh", + "bGwiQwoTQ29udHJhY3RVcGRhdGVJbnB1dBIeCgdhZGRyZXNzGAEgASgLMg0u", + "YWVsZi5BZGRyZXNzEgwKBGNvZGUYAiABKAwi0wEKFkNvbnRyYWN0Q29kZUNo", + "ZWNrSW5wdXQSFgoOY29udHJhY3RfaW5wdXQYASABKAwSHgoWaXNfY29udHJh", + "Y3RfZGVwbG95bWVudBgCIAEoCBIhChljb2RlX2NoZWNrX3JlbGVhc2VfbWV0", + "aG9kGAMgASgJEjAKHHByb3Bvc2VkX2NvbnRyYWN0X2lucHV0X2hhc2gYBCAB", + "KAsyCi5hZWxmLkhhc2gSEAoIY2F0ZWdvcnkYBSABKBESGgoSaXNfc3lzdGVt", + "X2NvbnRyYWN0GAYgASgIIkoKEENvbnRyYWN0UHJvcG9zZWQSMAoccHJvcG9z", + "ZWRfY29udHJhY3RfaW5wdXRfaGFzaBgBIAEoCzIKLmFlbGYuSGFzaDoEoLsY", + "ASKvAQoQQ29udHJhY3REZXBsb3llZBIkCgZhdXRob3IYASABKAsyDS5hZWxm", + "LkFkZHJlc3NCBYiP9QEBEiQKCWNvZGVfaGFzaBgCIAEoCzIKLmFlbGYuSGFz", + "aEIFiI/1AQESHgoHYWRkcmVzcxgDIAEoCzINLmFlbGYuQWRkcmVzcxIPCgd2", + "ZXJzaW9uGAQgASgFEhgKBE5hbWUYBSABKAsyCi5hZWxmLkhhc2g6BKC7GAEi", + "hwEKEUNvZGVDaGVja1JlcXVpcmVkEgwKBGNvZGUYASABKAwSMAoccHJvcG9z", + "ZWRfY29udHJhY3RfaW5wdXRfaGFzaBgCIAEoCzIKLmFlbGYuSGFzaBIQCghj", + "YXRlZ29yeRgDIAEoERIaChJpc19zeXN0ZW1fY29udHJhY3QYBCABKAg6BKC7", + "GAEikQEKC0NvZGVVcGRhdGVkEiUKB2FkZHJlc3MYASABKAsyDS5hZWxmLkFk", + "ZHJlc3NCBYiP9QEBEiEKDW9sZF9jb2RlX2hhc2gYAiABKAsyCi5hZWxmLkhh", + "c2gSIQoNbmV3X2NvZGVfaGFzaBgDIAEoCzIKLmFlbGYuSGFzaBIPCgd2ZXJz", + "aW9uGAQgASgFOgSguxgBInMKIlZhbGlkYXRlU3lzdGVtQ29udHJhY3RBZGRy", + "ZXNzSW5wdXQSLQoZc3lzdGVtX2NvbnRyYWN0X2hhc2hfbmFtZRgBIAEoCzIK", + "LmFlbGYuSGFzaBIeCgdhZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNzImkK", + "FFJlbGVhc2VDb250cmFjdElucHV0Eh8KC3Byb3Bvc2FsX2lkGAEgASgLMgou", + "YWVsZi5IYXNoEjAKHHByb3Bvc2VkX2NvbnRyYWN0X2lucHV0X2hhc2gYAiAB", + "KAsyCi5hZWxmLkhhc2giMQoUQ29udHJhY3RDb2RlSGFzaExpc3QSGQoFdmFs", + "dWUYASADKAsyCi5hZWxmLkhhc2gilAEKE0NvbnRyYWN0Q29kZUhhc2hNYXAS", + "MwoFdmFsdWUYASADKAsyJC5hY3MwLkNvbnRyYWN0Q29kZUhhc2hNYXAuVmFs", + "dWVFbnRyeRpICgpWYWx1ZUVudHJ5EgsKA2tleRgBIAEoAxIpCgV2YWx1ZRgC", + "IAEoCzIaLmFjczAuQ29udHJhY3RDb2RlSGFzaExpc3Q6AjgBMogLCgRBQ1Mw", + "ElEKGURlcGxveVN5c3RlbVNtYXJ0Q29udHJhY3QSIy5hY3MwLlN5c3RlbUNv", + "bnRyYWN0RGVwbG95bWVudElucHV0Gg0uYWVsZi5BZGRyZXNzIgASRQoTRGVw", + "bG95U21hcnRDb250cmFjdBIdLmFjczAuQ29udHJhY3REZXBsb3ltZW50SW5w", + "dXQaDS5hZWxmLkFkZHJlc3MiABJBChNVcGRhdGVTbWFydENvbnRyYWN0Ehku", + "YWNzMC5Db250cmFjdFVwZGF0ZUlucHV0Gg0uYWVsZi5BZGRyZXNzIgASQQoS", + "UHJvcG9zZU5ld0NvbnRyYWN0Eh0uYWNzMC5Db250cmFjdERlcGxveW1lbnRJ", + "bnB1dBoKLmFlbGYuSGFzaCIAEkYKGFByb3Bvc2VDb250cmFjdENvZGVDaGVj", + "axIcLmFjczAuQ29udHJhY3RDb2RlQ2hlY2tJbnB1dBoKLmFlbGYuSGFzaCIA", + "EkAKFVByb3Bvc2VVcGRhdGVDb250cmFjdBIZLmFjczAuQ29udHJhY3RVcGRh", + "dGVJbnB1dBoKLmFlbGYuSGFzaCIAEk8KF1JlbGVhc2VBcHByb3ZlZENvbnRy", + "YWN0EhouYWNzMC5SZWxlYXNlQ29udHJhY3RJbnB1dBoWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eSIAElIKGlJlbGVhc2VDb2RlQ2hlY2tlZENvbnRyYWN0Ehou", + "YWNzMC5SZWxlYXNlQ29udHJhY3RJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5F", + "bXB0eSIAEmMKHVZhbGlkYXRlU3lzdGVtQ29udHJhY3RBZGRyZXNzEiguYWNz", + "MC5WYWxpZGF0ZVN5c3RlbUNvbnRyYWN0QWRkcmVzc0lucHV0GhYuZ29vZ2xl", + "LnByb3RvYnVmLkVtcHR5IgASWAogU2V0Q29udHJhY3RQcm9wb3NlclJlcXVp", + "cmVkU3RhdGUSGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlGhYuZ29vZ2xl", + "LnByb3RvYnVmLkVtcHR5IgASWQobQ3VycmVudENvbnRyYWN0U2VyaWFsTnVt", + "YmVyEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhsuZ29vZ2xlLnByb3RvYnVm", + "LkludDY0VmFsdWUiBYiJ9wEBEjsKD0dldENvbnRyYWN0SW5mbxINLmFlbGYu", + "QWRkcmVzcxoSLmFjczAuQ29udHJhY3RJbmZvIgWIifcBARI4ChFHZXRDb250", + "cmFjdEF1dGhvchINLmFlbGYuQWRkcmVzcxoNLmFlbGYuQWRkcmVzcyIFiIn3", + "AQESMwoPR2V0Q29udHJhY3RIYXNoEg0uYWVsZi5BZGRyZXNzGgouYWVsZi5I", + "YXNoIgWIifcBARI8ChhHZXRDb250cmFjdEFkZHJlc3NCeU5hbWUSCi5hZWxm", + "Lkhhc2gaDS5hZWxmLkFkZHJlc3MiBYiJ9wEBEl4KJUdldFNtYXJ0Q29udHJh", + "Y3RSZWdpc3RyYXRpb25CeUFkZHJlc3MSDS5hZWxmLkFkZHJlc3MaHy5hZWxm", + "LlNtYXJ0Q29udHJhY3RSZWdpc3RyYXRpb24iBYiJ9wEBElwKJkdldFNtYXJ0", + "Q29udHJhY3RSZWdpc3RyYXRpb25CeUNvZGVIYXNoEgouYWVsZi5IYXNoGh8u", + "YWVsZi5TbWFydENvbnRyYWN0UmVnaXN0cmF0aW9uIgWIifcBARJvCi1HZXRD", + "b250cmFjdENvZGVIYXNoTGlzdEJ5RGVwbG95aW5nQmxvY2tIZWlnaHQSGy5n", + "b29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRoaLmFjczAuQ29udHJhY3RDb2Rl", + "SGFzaExpc3QiBYiJ9wEBQhaqAhNBRWxmLlN0YW5kYXJkcy5BQ1MwUABiBnBy", + "b3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractInfo), global::AElf.Standards.ACS0.ContractInfo.Parser, new[]{ "SerialNumber", "Author", "Category", "CodeHash", "IsSystemContract", "Version" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractDeploymentInput), global::AElf.Standards.ACS0.ContractDeploymentInput.Parser, new[]{ "Category", "Code" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.SystemContractDeploymentInput), global::AElf.Standards.ACS0.SystemContractDeploymentInput.Parser, new[]{ "Category", "Code", "Name", "TransactionMethodCallList" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCall), global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCall.Parser, new[]{ "MethodName", "Params" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList), global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList.Parser, new[]{ "Value" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractUpdateInput), global::AElf.Standards.ACS0.ContractUpdateInput.Parser, new[]{ "Address", "Code" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractCodeCheckInput), global::AElf.Standards.ACS0.ContractCodeCheckInput.Parser, new[]{ "ContractInput", "IsContractDeployment", "CodeCheckReleaseMethod", "ProposedContractInputHash", "Category", "IsSystemContract" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractProposed), global::AElf.Standards.ACS0.ContractProposed.Parser, new[]{ "ProposedContractInputHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractDeployed), global::AElf.Standards.ACS0.ContractDeployed.Parser, new[]{ "Author", "CodeHash", "Address", "Version", "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.CodeCheckRequired), global::AElf.Standards.ACS0.CodeCheckRequired.Parser, new[]{ "Code", "ProposedContractInputHash", "Category", "IsSystemContract" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.CodeUpdated), global::AElf.Standards.ACS0.CodeUpdated.Parser, new[]{ "Address", "OldCodeHash", "NewCodeHash", "Version" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ValidateSystemContractAddressInput), global::AElf.Standards.ACS0.ValidateSystemContractAddressInput.Parser, new[]{ "SystemContractHashName", "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ReleaseContractInput), global::AElf.Standards.ACS0.ReleaseContractInput.Parser, new[]{ "ProposalId", "ProposedContractInputHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractCodeHashList), global::AElf.Standards.ACS0.ContractCodeHashList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS0.ContractCodeHashMap), global::AElf.Standards.ACS0.ContractCodeHashMap.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }) + })); + } + #endregion + + } + #region Messages + internal sealed partial class ContractInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractInfo(ContractInfo other) : this() { + serialNumber_ = other.serialNumber_; + author_ = other.author_ != null ? other.author_.Clone() : null; + category_ = other.category_; + codeHash_ = other.codeHash_ != null ? other.codeHash_.Clone() : null; + isSystemContract_ = other.isSystemContract_; + version_ = other.version_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractInfo Clone() { + return new ContractInfo(this); + } + + /// Field number for the "serial_number" field. + public const int SerialNumberFieldNumber = 1; + private long serialNumber_; + /// + /// The serial number of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long SerialNumber { + get { return serialNumber_; } + set { + serialNumber_ = value; + } + } + + /// Field number for the "author" field. + public const int AuthorFieldNumber = 2; + private global::AElf.Types.Address author_; + /// + /// The author of the contract, this is the person who deployed the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Author { + get { return author_; } + set { + author_ = value; + } + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 3; + private int category_; + /// + /// The category of contract code(0: C#). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Category { + get { return category_; } + set { + category_ = value; + } + } + + /// Field number for the "code_hash" field. + public const int CodeHashFieldNumber = 4; + private global::AElf.Types.Hash codeHash_; + /// + /// The hash of the contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash CodeHash { + get { return codeHash_; } + set { + codeHash_ = value; + } + } + + /// Field number for the "is_system_contract" field. + public const int IsSystemContractFieldNumber = 5; + private bool isSystemContract_; + /// + /// Whether it is a system contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsSystemContract { + get { return isSystemContract_; } + set { + isSystemContract_ = value; + } + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 6; + private int version_; + /// + /// The version of the current contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Version { + get { return version_; } + set { + version_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SerialNumber != other.SerialNumber) return false; + if (!object.Equals(Author, other.Author)) return false; + if (Category != other.Category) return false; + if (!object.Equals(CodeHash, other.CodeHash)) return false; + if (IsSystemContract != other.IsSystemContract) return false; + if (Version != other.Version) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (SerialNumber != 0L) hash ^= SerialNumber.GetHashCode(); + if (author_ != null) hash ^= Author.GetHashCode(); + if (Category != 0) hash ^= Category.GetHashCode(); + if (codeHash_ != null) hash ^= CodeHash.GetHashCode(); + if (IsSystemContract != false) hash ^= IsSystemContract.GetHashCode(); + if (Version != 0) hash ^= Version.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (SerialNumber != 0L) { + output.WriteRawTag(8); + output.WriteInt64(SerialNumber); + } + if (author_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Author); + } + if (Category != 0) { + output.WriteRawTag(24); + output.WriteSInt32(Category); + } + if (codeHash_ != null) { + output.WriteRawTag(34); + output.WriteMessage(CodeHash); + } + if (IsSystemContract != false) { + output.WriteRawTag(40); + output.WriteBool(IsSystemContract); + } + if (Version != 0) { + output.WriteRawTag(48); + output.WriteInt32(Version); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (SerialNumber != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(SerialNumber); + } + if (author_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Author); + } + if (Category != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Category); + } + if (codeHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CodeHash); + } + if (IsSystemContract != false) { + size += 1 + 1; + } + if (Version != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Version); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractInfo other) { + if (other == null) { + return; + } + if (other.SerialNumber != 0L) { + SerialNumber = other.SerialNumber; + } + if (other.author_ != null) { + if (author_ == null) { + Author = new global::AElf.Types.Address(); + } + Author.MergeFrom(other.Author); + } + if (other.Category != 0) { + Category = other.Category; + } + if (other.codeHash_ != null) { + if (codeHash_ == null) { + CodeHash = new global::AElf.Types.Hash(); + } + CodeHash.MergeFrom(other.CodeHash); + } + if (other.IsSystemContract != false) { + IsSystemContract = other.IsSystemContract; + } + if (other.Version != 0) { + Version = other.Version; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SerialNumber = input.ReadInt64(); + break; + } + case 18: { + if (author_ == null) { + Author = new global::AElf.Types.Address(); + } + input.ReadMessage(Author); + break; + } + case 24: { + Category = input.ReadSInt32(); + break; + } + case 34: { + if (codeHash_ == null) { + CodeHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CodeHash); + break; + } + case 40: { + IsSystemContract = input.ReadBool(); + break; + } + case 48: { + Version = input.ReadInt32(); + break; + } + } + } + } + + } + + internal sealed partial class ContractDeploymentInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractDeploymentInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeploymentInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeploymentInput(ContractDeploymentInput other) : this() { + category_ = other.category_; + code_ = other.code_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeploymentInput Clone() { + return new ContractDeploymentInput(this); + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 1; + private int category_; + /// + /// The category of contract code(0: C#). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Category { + get { return category_; } + set { + category_ = value; + } + } + + /// Field number for the "code" field. + public const int CodeFieldNumber = 2; + private pb::ByteString code_ = pb::ByteString.Empty; + /// + /// The byte array of the contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Code { + get { return code_; } + set { + code_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractDeploymentInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractDeploymentInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Category != other.Category) return false; + if (Code != other.Code) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Category != 0) hash ^= Category.GetHashCode(); + if (Code.Length != 0) hash ^= Code.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Category != 0) { + output.WriteRawTag(8); + output.WriteSInt32(Category); + } + if (Code.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Code); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Category != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Category); + } + if (Code.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Code); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractDeploymentInput other) { + if (other == null) { + return; + } + if (other.Category != 0) { + Category = other.Category; + } + if (other.Code.Length != 0) { + Code = other.Code; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Category = input.ReadSInt32(); + break; + } + case 18: { + Code = input.ReadBytes(); + break; + } + } + } + } + + } + + internal sealed partial class SystemContractDeploymentInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SystemContractDeploymentInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemContractDeploymentInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemContractDeploymentInput(SystemContractDeploymentInput other) : this() { + category_ = other.category_; + code_ = other.code_; + name_ = other.name_ != null ? other.name_.Clone() : null; + transactionMethodCallList_ = other.transactionMethodCallList_ != null ? other.transactionMethodCallList_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemContractDeploymentInput Clone() { + return new SystemContractDeploymentInput(this); + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 1; + private int category_; + /// + /// The category of contract code(0: C#). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Category { + get { return category_; } + set { + category_ = value; + } + } + + /// Field number for the "code" field. + public const int CodeFieldNumber = 2; + private pb::ByteString code_ = pb::ByteString.Empty; + /// + /// The byte array of the contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Code { + get { return code_; } + set { + code_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 3; + private global::AElf.Types.Hash name_; + /// + /// The name of the contract. It has to be unique. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash Name { + get { return name_; } + set { + name_ = value; + } + } + + /// Field number for the "transaction_method_call_list" field. + public const int TransactionMethodCallListFieldNumber = 4; + private global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList transactionMethodCallList_; + /// + /// An initial list of transactions for the system contract, + /// which is executed in sequence when the contract is deployed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList TransactionMethodCallList { + get { return transactionMethodCallList_; } + set { + transactionMethodCallList_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SystemContractDeploymentInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SystemContractDeploymentInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Category != other.Category) return false; + if (Code != other.Code) return false; + if (!object.Equals(Name, other.Name)) return false; + if (!object.Equals(TransactionMethodCallList, other.TransactionMethodCallList)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Category != 0) hash ^= Category.GetHashCode(); + if (Code.Length != 0) hash ^= Code.GetHashCode(); + if (name_ != null) hash ^= Name.GetHashCode(); + if (transactionMethodCallList_ != null) hash ^= TransactionMethodCallList.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Category != 0) { + output.WriteRawTag(8); + output.WriteSInt32(Category); + } + if (Code.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Code); + } + if (name_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Name); + } + if (transactionMethodCallList_ != null) { + output.WriteRawTag(34); + output.WriteMessage(TransactionMethodCallList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Category != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Category); + } + if (Code.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Code); + } + if (name_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Name); + } + if (transactionMethodCallList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionMethodCallList); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SystemContractDeploymentInput other) { + if (other == null) { + return; + } + if (other.Category != 0) { + Category = other.Category; + } + if (other.Code.Length != 0) { + Code = other.Code; + } + if (other.name_ != null) { + if (name_ == null) { + Name = new global::AElf.Types.Hash(); + } + Name.MergeFrom(other.Name); + } + if (other.transactionMethodCallList_ != null) { + if (transactionMethodCallList_ == null) { + TransactionMethodCallList = new global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList(); + } + TransactionMethodCallList.MergeFrom(other.TransactionMethodCallList); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Category = input.ReadSInt32(); + break; + } + case 18: { + Code = input.ReadBytes(); + break; + } + case 26: { + if (name_ == null) { + Name = new global::AElf.Types.Hash(); + } + input.ReadMessage(Name); + break; + } + case 34: { + if (transactionMethodCallList_ == null) { + TransactionMethodCallList = new global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCallList(); + } + input.ReadMessage(TransactionMethodCallList); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the SystemContractDeploymentInput message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + internal sealed partial class SystemTransactionMethodCall : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SystemTransactionMethodCall()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.SystemContractDeploymentInput.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCall() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCall(SystemTransactionMethodCall other) : this() { + methodName_ = other.methodName_; + params_ = other.params_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCall Clone() { + return new SystemTransactionMethodCall(this); + } + + /// Field number for the "method_name" field. + public const int MethodNameFieldNumber = 1; + private string methodName_ = ""; + /// + /// The method name of system transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MethodName { + get { return methodName_; } + set { + methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "params" field. + public const int ParamsFieldNumber = 2; + private pb::ByteString params_ = pb::ByteString.Empty; + /// + /// The params of system transaction method. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Params { + get { return params_; } + set { + params_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SystemTransactionMethodCall); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SystemTransactionMethodCall other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MethodName != other.MethodName) return false; + if (Params != other.Params) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (MethodName.Length != 0) hash ^= MethodName.GetHashCode(); + if (Params.Length != 0) hash ^= Params.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (MethodName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(MethodName); + } + if (Params.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Params); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (MethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName); + } + if (Params.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Params); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SystemTransactionMethodCall other) { + if (other == null) { + return; + } + if (other.MethodName.Length != 0) { + MethodName = other.MethodName; + } + if (other.Params.Length != 0) { + Params = other.Params; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MethodName = input.ReadString(); + break; + } + case 18: { + Params = input.ReadBytes(); + break; + } + } + } + } + + } + + internal sealed partial class SystemTransactionMethodCallList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SystemTransactionMethodCallList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.SystemContractDeploymentInput.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCallList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCallList(SystemTransactionMethodCallList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SystemTransactionMethodCallList Clone() { + return new SystemTransactionMethodCallList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Standards.ACS0.SystemContractDeploymentInput.Types.SystemTransactionMethodCall.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + /// + /// The list of system transactions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SystemTransactionMethodCallList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SystemTransactionMethodCallList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SystemTransactionMethodCallList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + } + #endregion + + } + + internal sealed partial class ContractUpdateInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractUpdateInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractUpdateInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractUpdateInput(ContractUpdateInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + code_ = other.code_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractUpdateInput Clone() { + return new ContractUpdateInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The contract address that needs to be updated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "code" field. + public const int CodeFieldNumber = 2; + private pb::ByteString code_ = pb::ByteString.Empty; + /// + /// The byte array of the new contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Code { + get { return code_; } + set { + code_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractUpdateInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractUpdateInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (Code != other.Code) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (Code.Length != 0) hash ^= Code.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Code.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Code); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Code.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Code); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractUpdateInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Code.Length != 0) { + Code = other.Code; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + Code = input.ReadBytes(); + break; + } + } + } + } + + } + + internal sealed partial class ContractCodeCheckInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractCodeCheckInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeCheckInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeCheckInput(ContractCodeCheckInput other) : this() { + contractInput_ = other.contractInput_; + isContractDeployment_ = other.isContractDeployment_; + codeCheckReleaseMethod_ = other.codeCheckReleaseMethod_; + proposedContractInputHash_ = other.proposedContractInputHash_ != null ? other.proposedContractInputHash_.Clone() : null; + category_ = other.category_; + isSystemContract_ = other.isSystemContract_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeCheckInput Clone() { + return new ContractCodeCheckInput(this); + } + + /// Field number for the "contract_input" field. + public const int ContractInputFieldNumber = 1; + private pb::ByteString contractInput_ = pb::ByteString.Empty; + /// + /// The byte array of the contract code to be checked. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString ContractInput { + get { return contractInput_; } + set { + contractInput_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "is_contract_deployment" field. + public const int IsContractDeploymentFieldNumber = 2; + private bool isContractDeployment_; + /// + /// Whether the input contract is to be deployed or updated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsContractDeployment { + get { return isContractDeployment_; } + set { + isContractDeployment_ = value; + } + } + + /// Field number for the "code_check_release_method" field. + public const int CodeCheckReleaseMethodFieldNumber = 3; + private string codeCheckReleaseMethod_ = ""; + /// + /// Method to call after code check complete(DeploySmartContract or UpdateSmartContract). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CodeCheckReleaseMethod { + get { return codeCheckReleaseMethod_; } + set { + codeCheckReleaseMethod_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "proposed_contract_input_hash" field. + public const int ProposedContractInputHashFieldNumber = 4; + private global::AElf.Types.Hash proposedContractInputHash_; + /// + /// The id of the proposed contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposedContractInputHash { + get { return proposedContractInputHash_; } + set { + proposedContractInputHash_ = value; + } + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 5; + private int category_; + /// + /// The category of contract code(0: C#). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Category { + get { return category_; } + set { + category_ = value; + } + } + + /// Field number for the "is_system_contract" field. + public const int IsSystemContractFieldNumber = 6; + private bool isSystemContract_; + /// + /// Indicates if the contract is the system contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsSystemContract { + get { return isSystemContract_; } + set { + isSystemContract_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractCodeCheckInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractCodeCheckInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ContractInput != other.ContractInput) return false; + if (IsContractDeployment != other.IsContractDeployment) return false; + if (CodeCheckReleaseMethod != other.CodeCheckReleaseMethod) return false; + if (!object.Equals(ProposedContractInputHash, other.ProposedContractInputHash)) return false; + if (Category != other.Category) return false; + if (IsSystemContract != other.IsSystemContract) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ContractInput.Length != 0) hash ^= ContractInput.GetHashCode(); + if (IsContractDeployment != false) hash ^= IsContractDeployment.GetHashCode(); + if (CodeCheckReleaseMethod.Length != 0) hash ^= CodeCheckReleaseMethod.GetHashCode(); + if (proposedContractInputHash_ != null) hash ^= ProposedContractInputHash.GetHashCode(); + if (Category != 0) hash ^= Category.GetHashCode(); + if (IsSystemContract != false) hash ^= IsSystemContract.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ContractInput.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(ContractInput); + } + if (IsContractDeployment != false) { + output.WriteRawTag(16); + output.WriteBool(IsContractDeployment); + } + if (CodeCheckReleaseMethod.Length != 0) { + output.WriteRawTag(26); + output.WriteString(CodeCheckReleaseMethod); + } + if (proposedContractInputHash_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ProposedContractInputHash); + } + if (Category != 0) { + output.WriteRawTag(40); + output.WriteSInt32(Category); + } + if (IsSystemContract != false) { + output.WriteRawTag(48); + output.WriteBool(IsSystemContract); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ContractInput.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(ContractInput); + } + if (IsContractDeployment != false) { + size += 1 + 1; + } + if (CodeCheckReleaseMethod.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CodeCheckReleaseMethod); + } + if (proposedContractInputHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedContractInputHash); + } + if (Category != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Category); + } + if (IsSystemContract != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractCodeCheckInput other) { + if (other == null) { + return; + } + if (other.ContractInput.Length != 0) { + ContractInput = other.ContractInput; + } + if (other.IsContractDeployment != false) { + IsContractDeployment = other.IsContractDeployment; + } + if (other.CodeCheckReleaseMethod.Length != 0) { + CodeCheckReleaseMethod = other.CodeCheckReleaseMethod; + } + if (other.proposedContractInputHash_ != null) { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + ProposedContractInputHash.MergeFrom(other.ProposedContractInputHash); + } + if (other.Category != 0) { + Category = other.Category; + } + if (other.IsSystemContract != false) { + IsSystemContract = other.IsSystemContract; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ContractInput = input.ReadBytes(); + break; + } + case 16: { + IsContractDeployment = input.ReadBool(); + break; + } + case 26: { + CodeCheckReleaseMethod = input.ReadString(); + break; + } + case 34: { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposedContractInputHash); + break; + } + case 40: { + Category = input.ReadSInt32(); + break; + } + case 48: { + IsSystemContract = input.ReadBool(); + break; + } + } + } + } + + } + + internal sealed partial class ContractProposed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractProposed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractProposed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractProposed(ContractProposed other) : this() { + proposedContractInputHash_ = other.proposedContractInputHash_ != null ? other.proposedContractInputHash_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractProposed Clone() { + return new ContractProposed(this); + } + + /// Field number for the "proposed_contract_input_hash" field. + public const int ProposedContractInputHashFieldNumber = 1; + private global::AElf.Types.Hash proposedContractInputHash_; + /// + /// The id of the proposed contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposedContractInputHash { + get { return proposedContractInputHash_; } + set { + proposedContractInputHash_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractProposed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractProposed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposedContractInputHash, other.ProposedContractInputHash)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposedContractInputHash_ != null) hash ^= ProposedContractInputHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposedContractInputHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposedContractInputHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposedContractInputHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedContractInputHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractProposed other) { + if (other == null) { + return; + } + if (other.proposedContractInputHash_ != null) { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + ProposedContractInputHash.MergeFrom(other.ProposedContractInputHash); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposedContractInputHash); + break; + } + } + } + } + + } + + internal sealed partial class ContractDeployed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractDeployed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeployed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeployed(ContractDeployed other) : this() { + author_ = other.author_ != null ? other.author_.Clone() : null; + codeHash_ = other.codeHash_ != null ? other.codeHash_.Clone() : null; + address_ = other.address_ != null ? other.address_.Clone() : null; + version_ = other.version_; + name_ = other.name_ != null ? other.name_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractDeployed Clone() { + return new ContractDeployed(this); + } + + /// Field number for the "author" field. + public const int AuthorFieldNumber = 1; + private global::AElf.Types.Address author_; + /// + /// The author of the contract, this is the person who deployed the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Author { + get { return author_; } + set { + author_ = value; + } + } + + /// Field number for the "code_hash" field. + public const int CodeHashFieldNumber = 2; + private global::AElf.Types.Hash codeHash_; + /// + /// The hash of the contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash CodeHash { + get { return codeHash_; } + set { + codeHash_ = value; + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 3; + private global::AElf.Types.Address address_; + /// + /// The address of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 4; + private int version_; + /// + /// The version of the current contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Version { + get { return version_; } + set { + version_ = value; + } + } + + /// Field number for the "Name" field. + public const int NameFieldNumber = 5; + private global::AElf.Types.Hash name_; + /// + /// The name of the contract. It has to be unique. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash Name { + get { return name_; } + set { + name_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractDeployed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractDeployed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Author, other.Author)) return false; + if (!object.Equals(CodeHash, other.CodeHash)) return false; + if (!object.Equals(Address, other.Address)) return false; + if (Version != other.Version) return false; + if (!object.Equals(Name, other.Name)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (author_ != null) hash ^= Author.GetHashCode(); + if (codeHash_ != null) hash ^= CodeHash.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (Version != 0) hash ^= Version.GetHashCode(); + if (name_ != null) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (author_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Author); + } + if (codeHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CodeHash); + } + if (address_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Address); + } + if (Version != 0) { + output.WriteRawTag(32); + output.WriteInt32(Version); + } + if (name_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (author_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Author); + } + if (codeHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CodeHash); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Version != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Version); + } + if (name_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Name); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractDeployed other) { + if (other == null) { + return; + } + if (other.author_ != null) { + if (author_ == null) { + Author = new global::AElf.Types.Address(); + } + Author.MergeFrom(other.Author); + } + if (other.codeHash_ != null) { + if (codeHash_ == null) { + CodeHash = new global::AElf.Types.Hash(); + } + CodeHash.MergeFrom(other.CodeHash); + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Version != 0) { + Version = other.Version; + } + if (other.name_ != null) { + if (name_ == null) { + Name = new global::AElf.Types.Hash(); + } + Name.MergeFrom(other.Name); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (author_ == null) { + Author = new global::AElf.Types.Address(); + } + input.ReadMessage(Author); + break; + } + case 18: { + if (codeHash_ == null) { + CodeHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CodeHash); + break; + } + case 26: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 32: { + Version = input.ReadInt32(); + break; + } + case 42: { + if (name_ == null) { + Name = new global::AElf.Types.Hash(); + } + input.ReadMessage(Name); + break; + } + } + } + } + + } + + internal sealed partial class CodeCheckRequired : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CodeCheckRequired()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeCheckRequired() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeCheckRequired(CodeCheckRequired other) : this() { + code_ = other.code_; + proposedContractInputHash_ = other.proposedContractInputHash_ != null ? other.proposedContractInputHash_.Clone() : null; + category_ = other.category_; + isSystemContract_ = other.isSystemContract_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeCheckRequired Clone() { + return new CodeCheckRequired(this); + } + + /// Field number for the "code" field. + public const int CodeFieldNumber = 1; + private pb::ByteString code_ = pb::ByteString.Empty; + /// + /// The byte array of the contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Code { + get { return code_; } + set { + code_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "proposed_contract_input_hash" field. + public const int ProposedContractInputHashFieldNumber = 2; + private global::AElf.Types.Hash proposedContractInputHash_; + /// + /// The id of the proposed contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposedContractInputHash { + get { return proposedContractInputHash_; } + set { + proposedContractInputHash_ = value; + } + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 3; + private int category_; + /// + /// The category of contract code(0: C#). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Category { + get { return category_; } + set { + category_ = value; + } + } + + /// Field number for the "is_system_contract" field. + public const int IsSystemContractFieldNumber = 4; + private bool isSystemContract_; + /// + /// Indicates if the contract is the system contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsSystemContract { + get { return isSystemContract_; } + set { + isSystemContract_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CodeCheckRequired); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CodeCheckRequired other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + if (!object.Equals(ProposedContractInputHash, other.ProposedContractInputHash)) return false; + if (Category != other.Category) return false; + if (IsSystemContract != other.IsSystemContract) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code.Length != 0) hash ^= Code.GetHashCode(); + if (proposedContractInputHash_ != null) hash ^= ProposedContractInputHash.GetHashCode(); + if (Category != 0) hash ^= Category.GetHashCode(); + if (IsSystemContract != false) hash ^= IsSystemContract.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Code.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(Code); + } + if (proposedContractInputHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ProposedContractInputHash); + } + if (Category != 0) { + output.WriteRawTag(24); + output.WriteSInt32(Category); + } + if (IsSystemContract != false) { + output.WriteRawTag(32); + output.WriteBool(IsSystemContract); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Code); + } + if (proposedContractInputHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedContractInputHash); + } + if (Category != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Category); + } + if (IsSystemContract != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CodeCheckRequired other) { + if (other == null) { + return; + } + if (other.Code.Length != 0) { + Code = other.Code; + } + if (other.proposedContractInputHash_ != null) { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + ProposedContractInputHash.MergeFrom(other.ProposedContractInputHash); + } + if (other.Category != 0) { + Category = other.Category; + } + if (other.IsSystemContract != false) { + IsSystemContract = other.IsSystemContract; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Code = input.ReadBytes(); + break; + } + case 18: { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposedContractInputHash); + break; + } + case 24: { + Category = input.ReadSInt32(); + break; + } + case 32: { + IsSystemContract = input.ReadBool(); + break; + } + } + } + } + + } + + internal sealed partial class CodeUpdated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CodeUpdated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeUpdated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeUpdated(CodeUpdated other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + oldCodeHash_ = other.oldCodeHash_ != null ? other.oldCodeHash_.Clone() : null; + newCodeHash_ = other.newCodeHash_ != null ? other.newCodeHash_.Clone() : null; + version_ = other.version_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CodeUpdated Clone() { + return new CodeUpdated(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The address of the updated contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "old_code_hash" field. + public const int OldCodeHashFieldNumber = 2; + private global::AElf.Types.Hash oldCodeHash_; + /// + /// The byte array of the old contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash OldCodeHash { + get { return oldCodeHash_; } + set { + oldCodeHash_ = value; + } + } + + /// Field number for the "new_code_hash" field. + public const int NewCodeHashFieldNumber = 3; + private global::AElf.Types.Hash newCodeHash_; + /// + /// The byte array of the new contract code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash NewCodeHash { + get { return newCodeHash_; } + set { + newCodeHash_ = value; + } + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 4; + private int version_; + /// + /// The version of the current contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Version { + get { return version_; } + set { + version_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CodeUpdated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CodeUpdated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (!object.Equals(OldCodeHash, other.OldCodeHash)) return false; + if (!object.Equals(NewCodeHash, other.NewCodeHash)) return false; + if (Version != other.Version) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (oldCodeHash_ != null) hash ^= OldCodeHash.GetHashCode(); + if (newCodeHash_ != null) hash ^= NewCodeHash.GetHashCode(); + if (Version != 0) hash ^= Version.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (oldCodeHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OldCodeHash); + } + if (newCodeHash_ != null) { + output.WriteRawTag(26); + output.WriteMessage(NewCodeHash); + } + if (Version != 0) { + output.WriteRawTag(32); + output.WriteInt32(Version); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (oldCodeHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OldCodeHash); + } + if (newCodeHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewCodeHash); + } + if (Version != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Version); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CodeUpdated other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.oldCodeHash_ != null) { + if (oldCodeHash_ == null) { + OldCodeHash = new global::AElf.Types.Hash(); + } + OldCodeHash.MergeFrom(other.OldCodeHash); + } + if (other.newCodeHash_ != null) { + if (newCodeHash_ == null) { + NewCodeHash = new global::AElf.Types.Hash(); + } + NewCodeHash.MergeFrom(other.NewCodeHash); + } + if (other.Version != 0) { + Version = other.Version; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + if (oldCodeHash_ == null) { + OldCodeHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(OldCodeHash); + break; + } + case 26: { + if (newCodeHash_ == null) { + NewCodeHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(NewCodeHash); + break; + } + case 32: { + Version = input.ReadInt32(); + break; + } + } + } + } + + } + + internal sealed partial class ValidateSystemContractAddressInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateSystemContractAddressInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateSystemContractAddressInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateSystemContractAddressInput(ValidateSystemContractAddressInput other) : this() { + systemContractHashName_ = other.systemContractHashName_ != null ? other.systemContractHashName_.Clone() : null; + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateSystemContractAddressInput Clone() { + return new ValidateSystemContractAddressInput(this); + } + + /// Field number for the "system_contract_hash_name" field. + public const int SystemContractHashNameFieldNumber = 1; + private global::AElf.Types.Hash systemContractHashName_; + /// + /// The name hash of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash SystemContractHashName { + get { return systemContractHashName_; } + set { + systemContractHashName_ = value; + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 2; + private global::AElf.Types.Address address_; + /// + /// The address of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValidateSystemContractAddressInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValidateSystemContractAddressInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SystemContractHashName, other.SystemContractHashName)) return false; + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (systemContractHashName_ != null) hash ^= SystemContractHashName.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (systemContractHashName_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SystemContractHashName); + } + if (address_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (systemContractHashName_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SystemContractHashName); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValidateSystemContractAddressInput other) { + if (other == null) { + return; + } + if (other.systemContractHashName_ != null) { + if (systemContractHashName_ == null) { + SystemContractHashName = new global::AElf.Types.Hash(); + } + SystemContractHashName.MergeFrom(other.SystemContractHashName); + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (systemContractHashName_ == null) { + SystemContractHashName = new global::AElf.Types.Hash(); + } + input.ReadMessage(SystemContractHashName); + break; + } + case 18: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + + } + + internal sealed partial class ReleaseContractInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReleaseContractInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseContractInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseContractInput(ReleaseContractInput other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + proposedContractInputHash_ = other.proposedContractInputHash_ != null ? other.proposedContractInputHash_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseContractInput Clone() { + return new ReleaseContractInput(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The hash of the proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "proposed_contract_input_hash" field. + public const int ProposedContractInputHashFieldNumber = 2; + private global::AElf.Types.Hash proposedContractInputHash_; + /// + /// The id of the proposed contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposedContractInputHash { + get { return proposedContractInputHash_; } + set { + proposedContractInputHash_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReleaseContractInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReleaseContractInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(ProposedContractInputHash, other.ProposedContractInputHash)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (proposedContractInputHash_ != null) hash ^= ProposedContractInputHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (proposedContractInputHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ProposedContractInputHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (proposedContractInputHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedContractInputHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReleaseContractInput other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.proposedContractInputHash_ != null) { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + ProposedContractInputHash.MergeFrom(other.ProposedContractInputHash); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (proposedContractInputHash_ == null) { + ProposedContractInputHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposedContractInputHash); + break; + } + } + } + } + + } + + internal sealed partial class ContractCodeHashList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractCodeHashList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashList(ContractCodeHashList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashList Clone() { + return new ContractCodeHashList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Types.Hash.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractCodeHashList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractCodeHashList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractCodeHashList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + internal sealed partial class ContractCodeHashMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractCodeHashMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS0.Acs0Reflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashMap(ContractCodeHashMap other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractCodeHashMap Clone() { + return new ContractCodeHashMap(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS0.ContractCodeHashList.Parser), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractCodeHashMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractCodeHashMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _map_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractCodeHashMap other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs1.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs1.g.cs new file mode 100644 index 0000000..28dde5b --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs1.g.cs @@ -0,0 +1,405 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs1.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS1 { + + /// Holder for reflection information generated from acs1.proto + public static partial class Acs1Reflection { + + #region Descriptor + /// File descriptor for acs1.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs1Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgphY3MxLnByb3RvEgRhY3MxGhJhZWxmL29wdGlvbnMucHJvdG8aG2dvb2ds", + "ZS9wcm90b2J1Zi9lbXB0eS5wcm90bxoeZ29vZ2xlL3Byb3RvYnVmL3dyYXBw", + "ZXJzLnByb3RvGg9hZWxmL2NvcmUucHJvdG8aFGF1dGhvcml0eV9pbmZvLnBy", + "b3RvIloKCk1ldGhvZEZlZXMSEwoLbWV0aG9kX25hbWUYASABKAkSHQoEZmVl", + "cxgCIAMoCzIPLmFjczEuTWV0aG9kRmVlEhgKEGlzX3NpemVfZmVlX2ZyZWUY", + "AyABKAgiLgoJTWV0aG9kRmVlEg4KBnN5bWJvbBgBIAEoCRIRCgliYXNpY19m", + "ZWUYAiABKAMyrgIKGU1ldGhvZEZlZVByb3ZpZGVyQ29udHJhY3QSOgoMU2V0", + "TWV0aG9kRmVlEhAuYWNzMS5NZXRob2RGZWVzGhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASRQoZQ2hhbmdlTWV0aG9kRmVlQ29udHJvbGxlchIOLkF1dGhv", + "cml0eUluZm8aFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJFCgxHZXRNZXRo", + "b2RGZWUSHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUaEC5hY3MxLk1l", + "dGhvZEZlZXMiBYiJ9wEBEkcKFkdldE1ldGhvZEZlZUNvbnRyb2xsZXISFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkaDi5BdXRob3JpdHlJbmZvIgWIifcBAUIf", + "qgITQUVsZi5TdGFuZGFyZHMuQUNTMYqS9AEEYWNzMVAAUAFQAmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::AElf.Types.CoreReflection.Descriptor, global::AuthorityInfoReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS1.MethodFees), global::AElf.Standards.ACS1.MethodFees.Parser, new[]{ "MethodName", "Fees", "IsSizeFeeFree" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS1.MethodFee), global::AElf.Standards.ACS1.MethodFee.Parser, new[]{ "Symbol", "BasicFee" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class MethodFees : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodFees()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS1.Acs1Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFees() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFees(MethodFees other) : this() { + methodName_ = other.methodName_; + fees_ = other.fees_.Clone(); + isSizeFeeFree_ = other.isSizeFeeFree_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFees Clone() { + return new MethodFees(this); + } + + /// Field number for the "method_name" field. + public const int MethodNameFieldNumber = 1; + private string methodName_ = ""; + /// + /// The name of the method to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MethodName { + get { return methodName_; } + set { + methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "fees" field. + public const int FeesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_fees_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS1.MethodFee.Parser); + private readonly pbc::RepeatedField fees_ = new pbc::RepeatedField(); + /// + /// List of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Fees { + get { return fees_; } + } + + /// Field number for the "is_size_fee_free" field. + public const int IsSizeFeeFreeFieldNumber = 3; + private bool isSizeFeeFree_; + /// + /// Optional based on the implementation of SetMethodFee method. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsSizeFeeFree { + get { return isSizeFeeFree_; } + set { + isSizeFeeFree_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MethodFees); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MethodFees other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MethodName != other.MethodName) return false; + if(!fees_.Equals(other.fees_)) return false; + if (IsSizeFeeFree != other.IsSizeFeeFree) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (MethodName.Length != 0) hash ^= MethodName.GetHashCode(); + hash ^= fees_.GetHashCode(); + if (IsSizeFeeFree != false) hash ^= IsSizeFeeFree.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (MethodName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(MethodName); + } + fees_.WriteTo(output, _repeated_fees_codec); + if (IsSizeFeeFree != false) { + output.WriteRawTag(24); + output.WriteBool(IsSizeFeeFree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (MethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName); + } + size += fees_.CalculateSize(_repeated_fees_codec); + if (IsSizeFeeFree != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MethodFees other) { + if (other == null) { + return; + } + if (other.MethodName.Length != 0) { + MethodName = other.MethodName; + } + fees_.Add(other.fees_); + if (other.IsSizeFeeFree != false) { + IsSizeFeeFree = other.IsSizeFeeFree; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MethodName = input.ReadString(); + break; + } + case 18: { + fees_.AddEntriesFrom(input, _repeated_fees_codec); + break; + } + case 24: { + IsSizeFeeFree = input.ReadBool(); + break; + } + } + } + } + + } + + public sealed partial class MethodFee : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS1.Acs1Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFee(MethodFee other) : this() { + symbol_ = other.symbol_; + basicFee_ = other.basicFee_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MethodFee Clone() { + return new MethodFee(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The token symbol of the method fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "basic_fee" field. + public const int BasicFeeFieldNumber = 2; + private long basicFee_; + /// + /// The amount of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BasicFee { + get { return basicFee_; } + set { + basicFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MethodFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MethodFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (BasicFee != other.BasicFee) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (BasicFee != 0L) hash ^= BasicFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (BasicFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(BasicFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (BasicFee != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BasicFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MethodFee other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.BasicFee != 0L) { + BasicFee = other.BasicFee; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + BasicFee = input.ReadInt64(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.c.cs new file mode 100644 index 0000000..5628f3f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.c.cs @@ -0,0 +1,82 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs11.proto +// +// Original file comments: +// * +// AElf Standards ACS11(Consensus Standard) +// +// Used to customize consensus mechanisms for cross chain. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Standards.ACS11 { + + #region Events + #endregion + internal static partial class CrossChainInteractionContractContainer + { + static readonly string __ServiceName = "acs11.CrossChainInteractionContract"; + + #region Marshallers + static readonly aelf::Marshaller __Marshaller_google_protobuf_BytesValue = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.BytesValue.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_Empty = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_Address = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.Address.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_BoolValue = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.BoolValue.Parser.ParseFrom); + #endregion + + #region Methods + static readonly aelf::Method __Method_UpdateInformationFromCrossChain = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "UpdateInformationFromCrossChain", + __Marshaller_google_protobuf_BytesValue, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetChainInitializationInformation = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetChainInitializationInformation", + __Marshaller_google_protobuf_BytesValue, + __Marshaller_google_protobuf_BytesValue); + + static readonly aelf::Method __Method_CheckCrossChainIndexingPermission = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "CheckCrossChainIndexingPermission", + __Marshaller_aelf_Address, + __Marshaller_google_protobuf_BoolValue); + + #endregion + + #region Descriptors + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::AElf.Standards.ACS11.Acs11Reflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS11.Acs11Reflection.Descriptor.Services[0], + }; + } + } + #endregion + + public class CrossChainInteractionContractReferenceState : global::AElf.Sdk.CSharp.State.ContractReferenceState + { + internal global::AElf.Sdk.CSharp.State.MethodReference UpdateInformationFromCrossChain { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetChainInitializationInformation { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference CheckCrossChainIndexingPermission { get; set; } + } + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.g.cs new file mode 100644 index 0000000..185c260 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs11.g.cs @@ -0,0 +1,47 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs11.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS11 { + + /// Holder for reflection information generated from acs11.proto + internal static partial class Acs11Reflection { + + #region Descriptor + /// File descriptor for acs11.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs11Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgthY3MxMS5wcm90bxIFYWNzMTEaEmFlbGYvb3B0aW9ucy5wcm90bxoPYWVs", + "Zi9jb3JlLnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8a", + "G2dvb2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90bzK2AgodQ3Jvc3NDaGFpbklu", + "dGVyYWN0aW9uQ29udHJhY3QSWAofVXBkYXRlSW5mb3JtYXRpb25Gcm9tQ3Jv", + "c3NDaGFpbhIbLmdvb2dsZS5wcm90b2J1Zi5CeXRlc1ZhbHVlGhYuZ29vZ2xl", + "LnByb3RvYnVmLkVtcHR5IgASZAohR2V0Q2hhaW5Jbml0aWFsaXphdGlvbklu", + "Zm9ybWF0aW9uEhsuZ29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFsdWUaGy5nb29n", + "bGUucHJvdG9idWYuQnl0ZXNWYWx1ZSIFiIn3AQESVQohQ2hlY2tDcm9zc0No", + "YWluSW5kZXhpbmdQZXJtaXNzaW9uEg0uYWVsZi5BZGRyZXNzGhouZ29vZ2xl", + "LnByb3RvYnVmLkJvb2xWYWx1ZSIFiIn3AQFCIaoCFEFFbGYuU3RhbmRhcmRz", + "LkFDUzExipL0AQVhY3MxMWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.OptionsReflection.Descriptor, global::AElf.Types.CoreReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, null)); + } + #endregion + + } +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs12.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs12.g.cs new file mode 100644 index 0000000..e039976 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs12.g.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs12.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS12 { + + /// Holder for reflection information generated from acs12.proto + public static partial class Acs12Reflection { + + #region Descriptor + /// File descriptor for acs12.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs12Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgthY3MxMi5wcm90bxIFYWNzMTIaEmFlbGYvb3B0aW9ucy5wcm90bxobZ29v", + "Z2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3Jh", + "cHBlcnMucHJvdG8aD2FlbGYvY29yZS5wcm90byJeChZVc2VyQ29udHJhY3RN", + "ZXRob2RGZWVzEioKBGZlZXMYAiADKAsyHC5hY3MxMi5Vc2VyQ29udHJhY3RN", + "ZXRob2RGZWUSGAoQaXNfc2l6ZV9mZWVfZnJlZRgDIAEoCCI6ChVVc2VyQ29u", + "dHJhY3RNZXRob2RGZWUSDgoGc3ltYm9sGAEgASgJEhEKCWJhc2ljX2ZlZRgC", + "IAEoAzIOCgxVc2VyQ29udHJhY3RCIaoCFEFFbGYuU3RhbmRhcmRzLkFDUzEy", + "ipL0AQVhY3MxMlAAUAFQAmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::AElf.Types.CoreReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS12.UserContractMethodFees), global::AElf.Standards.ACS12.UserContractMethodFees.Parser, new[]{ "Fees", "IsSizeFeeFree" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS12.UserContractMethodFee), global::AElf.Standards.ACS12.UserContractMethodFee.Parser, new[]{ "Symbol", "BasicFee" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///Specified method fee for user contract. + /// + public sealed partial class UserContractMethodFees : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UserContractMethodFees()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees(UserContractMethodFees other) : this() { + fees_ = other.fees_.Clone(); + isSizeFeeFree_ = other.isSizeFeeFree_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees Clone() { + return new UserContractMethodFees(this); + } + + /// Field number for the "fees" field. + public const int FeesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_fees_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS12.UserContractMethodFee.Parser); + private readonly pbc::RepeatedField fees_ = new pbc::RepeatedField(); + /// + /// List of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Fees { + get { return fees_; } + } + + /// Field number for the "is_size_fee_free" field. + public const int IsSizeFeeFreeFieldNumber = 3; + private bool isSizeFeeFree_; + /// + /// Optional based on the implementation of SetConfiguration method. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsSizeFeeFree { + get { return isSizeFeeFree_; } + set { + isSizeFeeFree_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UserContractMethodFees); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UserContractMethodFees other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!fees_.Equals(other.fees_)) return false; + if (IsSizeFeeFree != other.IsSizeFeeFree) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= fees_.GetHashCode(); + if (IsSizeFeeFree != false) hash ^= IsSizeFeeFree.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + fees_.WriteTo(output, _repeated_fees_codec); + if (IsSizeFeeFree != false) { + output.WriteRawTag(24); + output.WriteBool(IsSizeFeeFree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + fees_.WriteTo(ref output, _repeated_fees_codec); + if (IsSizeFeeFree != false) { + output.WriteRawTag(24); + output.WriteBool(IsSizeFeeFree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += fees_.CalculateSize(_repeated_fees_codec); + if (IsSizeFeeFree != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UserContractMethodFees other) { + if (other == null) { + return; + } + fees_.Add(other.fees_); + if (other.IsSizeFeeFree != false) { + IsSizeFeeFree = other.IsSizeFeeFree; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 18: { + fees_.AddEntriesFrom(input, _repeated_fees_codec); + break; + } + case 24: { + IsSizeFeeFree = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 18: { + fees_.AddEntriesFrom(ref input, _repeated_fees_codec); + break; + } + case 24: { + IsSizeFeeFree = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class UserContractMethodFee : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UserContractMethodFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee(UserContractMethodFee other) : this() { + symbol_ = other.symbol_; + basicFee_ = other.basicFee_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee Clone() { + return new UserContractMethodFee(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The token symbol of the method fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "basic_fee" field. + public const int BasicFeeFieldNumber = 2; + private long basicFee_; + /// + /// The amount of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long BasicFee { + get { return basicFee_; } + set { + basicFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UserContractMethodFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UserContractMethodFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (BasicFee != other.BasicFee) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (BasicFee != 0L) hash ^= BasicFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (BasicFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(BasicFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (BasicFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(BasicFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (BasicFee != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BasicFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UserContractMethodFee other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.BasicFee != 0L) { + BasicFee = other.BasicFee; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + BasicFee = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + BasicFee = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.c.cs new file mode 100644 index 0000000..ee36bd3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.c.cs @@ -0,0 +1,285 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs3.proto +// +// Original file comments: +// * +// AElf Standards ACS3(Contract Proposal Standard) +// +// Used for governance through proposals. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Standards.ACS3 { + + #region Events + internal partial class ProposalCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ProposalCreated + { + OrganizationAddress = OrganizationAddress + }, + }; + } + + public ProposalCreated GetNonIndexed() + { + return new ProposalCreated + { + ProposalId = ProposalId, + }; + } + } + + internal partial class ProposalReleased : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ProposalReleased + { + OrganizationAddress = OrganizationAddress + }, + }; + } + + public ProposalReleased GetNonIndexed() + { + return new ProposalReleased + { + ProposalId = ProposalId, + }; + } + } + + internal partial class OrganizationCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public OrganizationCreated GetNonIndexed() + { + return new OrganizationCreated + { + OrganizationAddress = OrganizationAddress, + }; + } + } + + internal partial class ReceiptCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ReceiptCreated + { + OrganizationAddress = OrganizationAddress + }, + }; + } + + public ReceiptCreated GetNonIndexed() + { + return new ReceiptCreated + { + ProposalId = ProposalId, + Address = Address, + ReceiptType = ReceiptType, + Time = Time, + }; + } + } + + internal partial class OrganizationWhiteListChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public OrganizationWhiteListChanged GetNonIndexed() + { + return new OrganizationWhiteListChanged + { + OrganizationAddress = OrganizationAddress, + ProposerWhiteList = ProposerWhiteList, + }; + } + } + + internal partial class OrganizationThresholdChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public OrganizationThresholdChanged GetNonIndexed() + { + return new OrganizationThresholdChanged + { + OrganizationAddress = OrganizationAddress, + ProposerReleaseThreshold = ProposerReleaseThreshold, + }; + } + } + + #endregion + internal static partial class AuthorizationContractContainer + { + static readonly string __ServiceName = "acs3.AuthorizationContract"; + + #region Marshallers + static readonly aelf::Marshaller __Marshaller_acs3_CreateProposalInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.CreateProposalInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_Hash = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.Hash.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_Empty = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs3_ProposalReleaseThreshold = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.ProposalReleaseThreshold.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs3_ProposerWhiteList = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.ProposerWhiteList.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs3_CreateProposalBySystemContractInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.CreateProposalBySystemContractInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs3_ProposalOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.ProposalOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_aelf_Address = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Types.Address.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_BoolValue = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.BoolValue.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_acs3_ValidateProposerInWhiteListInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::AElf.Standards.ACS3.ValidateProposerInWhiteListInput.Parser.ParseFrom); + #endregion + + #region Methods + static readonly aelf::Method __Method_CreateProposal = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "CreateProposal", + __Marshaller_acs3_CreateProposalInput, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_Approve = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Approve", + __Marshaller_aelf_Hash, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_Reject = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Reject", + __Marshaller_aelf_Hash, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_Abstain = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Abstain", + __Marshaller_aelf_Hash, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_Release = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Release", + __Marshaller_aelf_Hash, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ChangeOrganizationThreshold = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ChangeOrganizationThreshold", + __Marshaller_acs3_ProposalReleaseThreshold, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ChangeOrganizationProposerWhiteList = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ChangeOrganizationProposerWhiteList", + __Marshaller_acs3_ProposerWhiteList, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_CreateProposalBySystemContract = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "CreateProposalBySystemContract", + __Marshaller_acs3_CreateProposalBySystemContractInput, + __Marshaller_aelf_Hash); + + static readonly aelf::Method __Method_ClearProposal = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ClearProposal", + __Marshaller_aelf_Hash, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetProposal = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetProposal", + __Marshaller_aelf_Hash, + __Marshaller_acs3_ProposalOutput); + + static readonly aelf::Method __Method_ValidateOrganizationExist = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "ValidateOrganizationExist", + __Marshaller_aelf_Address, + __Marshaller_google_protobuf_BoolValue); + + static readonly aelf::Method __Method_ValidateProposerInWhiteList = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "ValidateProposerInWhiteList", + __Marshaller_acs3_ValidateProposerInWhiteListInput, + __Marshaller_google_protobuf_BoolValue); + + #endregion + + #region Descriptors + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.Services[0], + }; + } + } + #endregion + + public class AuthorizationContractReferenceState : global::AElf.Sdk.CSharp.State.ContractReferenceState + { + internal global::AElf.Sdk.CSharp.State.MethodReference CreateProposal { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference Approve { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference Reject { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference Abstain { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference Release { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ChangeOrganizationThreshold { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ChangeOrganizationProposerWhiteList { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference CreateProposalBySystemContract { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ClearProposal { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference GetProposal { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ValidateOrganizationExist { get; set; } + internal global::AElf.Sdk.CSharp.State.MethodReference ValidateProposerInWhiteList { get; set; } + } + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.g.cs new file mode 100644 index 0000000..ac99af4 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs3.g.cs @@ -0,0 +1,2927 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs3.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS3 { + + /// Holder for reflection information generated from acs3.proto + internal static partial class Acs3Reflection { + + #region Descriptor + /// File descriptor for acs3.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs3Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgphY3MzLnByb3RvEgRhY3MzGg9hZWxmL2NvcmUucHJvdG8aEmFlbGYvb3B0", + "aW9ucy5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGh9nb29n", + "bGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvGh5nb29nbGUvcHJvdG9idWYv", + "d3JhcHBlcnMucHJvdG8iggIKE0NyZWF0ZVByb3Bvc2FsSW5wdXQSHAoUY29u", + "dHJhY3RfbWV0aG9kX25hbWUYASABKAkSIQoKdG9fYWRkcmVzcxgCIAEoCzIN", + "LmFlbGYuQWRkcmVzcxIOCgZwYXJhbXMYAyABKAwSMAoMZXhwaXJlZF90aW1l", + "GAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIrChRvcmdhbml6", + "YXRpb25fYWRkcmVzcxgFIAEoCzINLmFlbGYuQWRkcmVzcxIgChhwcm9wb3Nh", + "bF9kZXNjcmlwdGlvbl91cmwYBiABKAkSGQoFdG9rZW4YByABKAsyCi5hZWxm", + "Lkhhc2gi5QIKDlByb3Bvc2FsT3V0cHV0Eh8KC3Byb3Bvc2FsX2lkGAEgASgL", + "MgouYWVsZi5IYXNoEhwKFGNvbnRyYWN0X21ldGhvZF9uYW1lGAIgASgJEiEK", + "CnRvX2FkZHJlc3MYAyABKAsyDS5hZWxmLkFkZHJlc3MSDgoGcGFyYW1zGAQg", + "ASgMEjAKDGV4cGlyZWRfdGltZRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5U", + "aW1lc3RhbXASKwoUb3JnYW5pemF0aW9uX2FkZHJlc3MYBiABKAsyDS5hZWxm", + "LkFkZHJlc3MSHwoIcHJvcG9zZXIYByABKAsyDS5hZWxmLkFkZHJlc3MSFgoO", + "dG9fYmVfcmVsZWFzZWQYCCABKAgSFgoOYXBwcm92YWxfY291bnQYCSABKAMS", + "FwoPcmVqZWN0aW9uX2NvdW50GAogASgDEhgKEGFic3RlbnRpb25fY291bnQY", + "CyABKAMiqQEKGFByb3Bvc2FsUmVsZWFzZVRocmVzaG9sZBIiChptaW5pbWFs", + "X2FwcHJvdmFsX3RocmVzaG9sZBgBIAEoAxIjChttYXhpbWFsX3JlamVjdGlv", + "bl90aHJlc2hvbGQYAiABKAMSJAocbWF4aW1hbF9hYnN0ZW50aW9uX3RocmVz", + "aG9sZBgDIAEoAxIeChZtaW5pbWFsX3ZvdGVfdGhyZXNob2xkGAQgASgDIjUK", + "EVByb3Bvc2VyV2hpdGVMaXN0EiAKCXByb3Bvc2VycxgBIAMoCzINLmFlbGYu", + "QWRkcmVzcyJxChtPcmdhbml6YXRpb25IYXNoQWRkcmVzc1BhaXISJQoRb3Jn", + "YW5pemF0aW9uX2hhc2gYASABKAsyCi5hZWxmLkhhc2gSKwoUb3JnYW5pemF0", + "aW9uX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MigAEKI0NyZWF0ZVBy", + "b3Bvc2FsQnlTeXN0ZW1Db250cmFjdElucHV0EjEKDnByb3Bvc2FsX2lucHV0", + "GAEgASgLMhkuYWNzMy5DcmVhdGVQcm9wb3NhbElucHV0EiYKD29yaWdpbl9w", + "cm9wb3NlchgCIAEoCzINLmFlbGYuQWRkcmVzcyJwCiBWYWxpZGF0ZVByb3Bv", + "c2VySW5XaGl0ZUxpc3RJbnB1dBIfCghwcm9wb3NlchgBIAEoCzINLmFlbGYu", + "QWRkcmVzcxIrChRvcmdhbml6YXRpb25fYWRkcmVzcxgCIAEoCzINLmFlbGYu", + "QWRkcmVzcyJsCg9Qcm9wb3NhbENyZWF0ZWQSHwoLcHJvcG9zYWxfaWQYASAB", + "KAsyCi5hZWxmLkhhc2gSMgoUb3JnYW5pemF0aW9uX2FkZHJlc3MYAiABKAsy", + "DS5hZWxmLkFkZHJlc3NCBYiP9QEBOgSguxgBIm0KEFByb3Bvc2FsUmVsZWFz", + "ZWQSHwoLcHJvcG9zYWxfaWQYASABKAsyCi5hZWxmLkhhc2gSMgoUb3JnYW5p", + "emF0aW9uX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBOgSg", + "uxgBIkgKE09yZ2FuaXphdGlvbkNyZWF0ZWQSKwoUb3JnYW5pemF0aW9uX2Fk", + "ZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3M6BKC7GAEiywEKDlJlY2VpcHRD", + "cmVhdGVkEh8KC3Byb3Bvc2FsX2lkGAEgASgLMgouYWVsZi5IYXNoEh4KB2Fk", + "ZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSFAoMcmVjZWlwdF90eXBlGAMg", + "ASgJEigKBHRpbWUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1w", + "EjIKFG9yZ2FuaXphdGlvbl9hZGRyZXNzGAUgASgLMg0uYWVsZi5BZGRyZXNz", + "QgWIj/UBAToEoLsYASKHAQocT3JnYW5pemF0aW9uV2hpdGVMaXN0Q2hhbmdl", + "ZBIrChRvcmdhbml6YXRpb25fYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRkcmVz", + "cxI0ChNwcm9wb3Nlcl93aGl0ZV9saXN0GAIgASgLMhcuYWNzMy5Qcm9wb3Nl", + "cldoaXRlTGlzdDoEoLsYASKVAQocT3JnYW5pemF0aW9uVGhyZXNob2xkQ2hh", + "bmdlZBIrChRvcmdhbml6YXRpb25fYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRk", + "cmVzcxJCChpwcm9wb3Nlcl9yZWxlYXNlX3RocmVzaG9sZBgCIAEoCzIeLmFj", + "czMuUHJvcG9zYWxSZWxlYXNlVGhyZXNob2xkOgSguxgBMssGChVBdXRob3Jp", + "emF0aW9uQ29udHJhY3QSOQoOQ3JlYXRlUHJvcG9zYWwSGS5hY3MzLkNyZWF0", + "ZVByb3Bvc2FsSW5wdXQaCi5hZWxmLkhhc2giABIvCgdBcHByb3ZlEgouYWVs", + "Zi5IYXNoGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASLgoGUmVqZWN0Egou", + "YWVsZi5IYXNoGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASLwoHQWJzdGFp", + "bhIKLmFlbGYuSGFzaBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEi8KB1Jl", + "bGVhc2USCi5hZWxmLkhhc2gaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJX", + "ChtDaGFuZ2VPcmdhbml6YXRpb25UaHJlc2hvbGQSHi5hY3MzLlByb3Bvc2Fs", + "UmVsZWFzZVRocmVzaG9sZBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElgK", + "I0NoYW5nZU9yZ2FuaXphdGlvblByb3Bvc2VyV2hpdGVMaXN0EhcuYWNzMy5Q", + "cm9wb3NlcldoaXRlTGlzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElkK", + "HkNyZWF0ZVByb3Bvc2FsQnlTeXN0ZW1Db250cmFjdBIpLmFjczMuQ3JlYXRl", + "UHJvcG9zYWxCeVN5c3RlbUNvbnRyYWN0SW5wdXQaCi5hZWxmLkhhc2giABI1", + "Cg1DbGVhclByb3Bvc2FsEgouYWVsZi5IYXNoGhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASNgoLR2V0UHJvcG9zYWwSCi5hZWxmLkhhc2gaFC5hY3MzLlBy", + "b3Bvc2FsT3V0cHV0IgWIifcBARJNChlWYWxpZGF0ZU9yZ2FuaXphdGlvbkV4", + "aXN0Eg0uYWVsZi5BZGRyZXNzGhouZ29vZ2xlLnByb3RvYnVmLkJvb2xWYWx1", + "ZSIFiIn3AQESaAobVmFsaWRhdGVQcm9wb3NlckluV2hpdGVMaXN0EiYuYWNz", + "My5WYWxpZGF0ZVByb3Bvc2VySW5XaGl0ZUxpc3RJbnB1dBoaLmdvb2dsZS5w", + "cm90b2J1Zi5Cb29sVmFsdWUiBYiJ9wEBQh+qAhNBRWxmLlN0YW5kYXJkcy5B", + "Q1MzipL0AQRhY3MzUABQA2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.CreateProposalInput), global::AElf.Standards.ACS3.CreateProposalInput.Parser, new[]{ "ContractMethodName", "ToAddress", "Params", "ExpiredTime", "OrganizationAddress", "ProposalDescriptionUrl", "Token" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ProposalOutput), global::AElf.Standards.ACS3.ProposalOutput.Parser, new[]{ "ProposalId", "ContractMethodName", "ToAddress", "Params", "ExpiredTime", "OrganizationAddress", "Proposer", "ToBeReleased", "ApprovalCount", "RejectionCount", "AbstentionCount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ProposalReleaseThreshold), global::AElf.Standards.ACS3.ProposalReleaseThreshold.Parser, new[]{ "MinimalApprovalThreshold", "MaximalRejectionThreshold", "MaximalAbstentionThreshold", "MinimalVoteThreshold" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ProposerWhiteList), global::AElf.Standards.ACS3.ProposerWhiteList.Parser, new[]{ "Proposers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.OrganizationHashAddressPair), global::AElf.Standards.ACS3.OrganizationHashAddressPair.Parser, new[]{ "OrganizationHash", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.CreateProposalBySystemContractInput), global::AElf.Standards.ACS3.CreateProposalBySystemContractInput.Parser, new[]{ "ProposalInput", "OriginProposer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ValidateProposerInWhiteListInput), global::AElf.Standards.ACS3.ValidateProposerInWhiteListInput.Parser, new[]{ "Proposer", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ProposalCreated), global::AElf.Standards.ACS3.ProposalCreated.Parser, new[]{ "ProposalId", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ProposalReleased), global::AElf.Standards.ACS3.ProposalReleased.Parser, new[]{ "ProposalId", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.OrganizationCreated), global::AElf.Standards.ACS3.OrganizationCreated.Parser, new[]{ "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.ReceiptCreated), global::AElf.Standards.ACS3.ReceiptCreated.Parser, new[]{ "ProposalId", "Address", "ReceiptType", "Time", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.OrganizationWhiteListChanged), global::AElf.Standards.ACS3.OrganizationWhiteListChanged.Parser, new[]{ "OrganizationAddress", "ProposerWhiteList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS3.OrganizationThresholdChanged), global::AElf.Standards.ACS3.OrganizationThresholdChanged.Parser, new[]{ "OrganizationAddress", "ProposerReleaseThreshold" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + internal sealed partial class CreateProposalInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateProposalInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalInput(CreateProposalInput other) : this() { + contractMethodName_ = other.contractMethodName_; + toAddress_ = other.toAddress_ != null ? other.toAddress_.Clone() : null; + params_ = other.params_; + expiredTime_ = other.expiredTime_ != null ? other.expiredTime_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + proposalDescriptionUrl_ = other.proposalDescriptionUrl_; + token_ = other.token_ != null ? other.token_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalInput Clone() { + return new CreateProposalInput(this); + } + + /// Field number for the "contract_method_name" field. + public const int ContractMethodNameFieldNumber = 1; + private string contractMethodName_ = ""; + /// + /// The name of the method to call after release. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ContractMethodName { + get { return contractMethodName_; } + set { + contractMethodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_address" field. + public const int ToAddressFieldNumber = 2; + private global::AElf.Types.Address toAddress_; + /// + /// The address of the contract to call after release. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ToAddress { + get { return toAddress_; } + set { + toAddress_ = value; + } + } + + /// Field number for the "params" field. + public const int ParamsFieldNumber = 3; + private pb::ByteString params_ = pb::ByteString.Empty; + /// + /// The parameter of the method to be called after the release. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Params { + get { return params_; } + set { + params_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "expired_time" field. + public const int ExpiredTimeFieldNumber = 4; + private global::Google.Protobuf.WellKnownTypes.Timestamp expiredTime_; + /// + /// The timestamp at which this proposal will expire. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp ExpiredTime { + get { return expiredTime_; } + set { + expiredTime_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 5; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of the organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + /// Field number for the "proposal_description_url" field. + public const int ProposalDescriptionUrlFieldNumber = 6; + private string proposalDescriptionUrl_ = ""; + /// + /// Url is used for proposal describing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ProposalDescriptionUrl { + get { return proposalDescriptionUrl_; } + set { + proposalDescriptionUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "token" field. + public const int TokenFieldNumber = 7; + private global::AElf.Types.Hash token_; + /// + /// The token is for proposal id generation and with this token, proposal id can be calculated before proposing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash Token { + get { return token_; } + set { + token_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateProposalInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateProposalInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ContractMethodName != other.ContractMethodName) return false; + if (!object.Equals(ToAddress, other.ToAddress)) return false; + if (Params != other.Params) return false; + if (!object.Equals(ExpiredTime, other.ExpiredTime)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + if (ProposalDescriptionUrl != other.ProposalDescriptionUrl) return false; + if (!object.Equals(Token, other.Token)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ContractMethodName.Length != 0) hash ^= ContractMethodName.GetHashCode(); + if (toAddress_ != null) hash ^= ToAddress.GetHashCode(); + if (Params.Length != 0) hash ^= Params.GetHashCode(); + if (expiredTime_ != null) hash ^= ExpiredTime.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (ProposalDescriptionUrl.Length != 0) hash ^= ProposalDescriptionUrl.GetHashCode(); + if (token_ != null) hash ^= Token.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ContractMethodName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ContractMethodName); + } + if (toAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ToAddress); + } + if (Params.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Params); + } + if (expiredTime_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ExpiredTime); + } + if (organizationAddress_ != null) { + output.WriteRawTag(42); + output.WriteMessage(OrganizationAddress); + } + if (ProposalDescriptionUrl.Length != 0) { + output.WriteRawTag(50); + output.WriteString(ProposalDescriptionUrl); + } + if (token_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Token); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ContractMethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ContractMethodName); + } + if (toAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ToAddress); + } + if (Params.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Params); + } + if (expiredTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpiredTime); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (ProposalDescriptionUrl.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ProposalDescriptionUrl); + } + if (token_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Token); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateProposalInput other) { + if (other == null) { + return; + } + if (other.ContractMethodName.Length != 0) { + ContractMethodName = other.ContractMethodName; + } + if (other.toAddress_ != null) { + if (toAddress_ == null) { + ToAddress = new global::AElf.Types.Address(); + } + ToAddress.MergeFrom(other.ToAddress); + } + if (other.Params.Length != 0) { + Params = other.Params; + } + if (other.expiredTime_ != null) { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ExpiredTime.MergeFrom(other.ExpiredTime); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + if (other.ProposalDescriptionUrl.Length != 0) { + ProposalDescriptionUrl = other.ProposalDescriptionUrl; + } + if (other.token_ != null) { + if (token_ == null) { + Token = new global::AElf.Types.Hash(); + } + Token.MergeFrom(other.Token); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ContractMethodName = input.ReadString(); + break; + } + case 18: { + if (toAddress_ == null) { + ToAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ToAddress); + break; + } + case 26: { + Params = input.ReadBytes(); + break; + } + case 34: { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ExpiredTime); + break; + } + case 42: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + case 50: { + ProposalDescriptionUrl = input.ReadString(); + break; + } + case 58: { + if (token_ == null) { + Token = new global::AElf.Types.Hash(); + } + input.ReadMessage(Token); + break; + } + } + } + } + + } + + internal sealed partial class ProposalOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposalOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalOutput(ProposalOutput other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + contractMethodName_ = other.contractMethodName_; + toAddress_ = other.toAddress_ != null ? other.toAddress_.Clone() : null; + params_ = other.params_; + expiredTime_ = other.expiredTime_ != null ? other.expiredTime_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + toBeReleased_ = other.toBeReleased_; + approvalCount_ = other.approvalCount_; + rejectionCount_ = other.rejectionCount_; + abstentionCount_ = other.abstentionCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalOutput Clone() { + return new ProposalOutput(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of the proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "contract_method_name" field. + public const int ContractMethodNameFieldNumber = 2; + private string contractMethodName_ = ""; + /// + /// The method that this proposal will call when being released. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ContractMethodName { + get { return contractMethodName_; } + set { + contractMethodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_address" field. + public const int ToAddressFieldNumber = 3; + private global::AElf.Types.Address toAddress_; + /// + /// The address of the target contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ToAddress { + get { return toAddress_; } + set { + toAddress_ = value; + } + } + + /// Field number for the "params" field. + public const int ParamsFieldNumber = 4; + private pb::ByteString params_ = pb::ByteString.Empty; + /// + /// The parameters of the release transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Params { + get { return params_; } + set { + params_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "expired_time" field. + public const int ExpiredTimeFieldNumber = 5; + private global::Google.Protobuf.WellKnownTypes.Timestamp expiredTime_; + /// + /// The date at which this proposal will expire. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp ExpiredTime { + get { return expiredTime_; } + set { + expiredTime_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 6; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of this proposals organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 7; + private global::AElf.Types.Address proposer_; + /// + /// The address of the proposer of this proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "to_be_released" field. + public const int ToBeReleasedFieldNumber = 8; + private bool toBeReleased_; + /// + /// Indicates if this proposal is releasable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ToBeReleased { + get { return toBeReleased_; } + set { + toBeReleased_ = value; + } + } + + /// Field number for the "approval_count" field. + public const int ApprovalCountFieldNumber = 9; + private long approvalCount_; + /// + /// Approval count for this proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ApprovalCount { + get { return approvalCount_; } + set { + approvalCount_ = value; + } + } + + /// Field number for the "rejection_count" field. + public const int RejectionCountFieldNumber = 10; + private long rejectionCount_; + /// + /// Rejection count for this proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long RejectionCount { + get { return rejectionCount_; } + set { + rejectionCount_ = value; + } + } + + /// Field number for the "abstention_count" field. + public const int AbstentionCountFieldNumber = 11; + private long abstentionCount_; + /// + /// Abstention count for this proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AbstentionCount { + get { return abstentionCount_; } + set { + abstentionCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposalOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposalOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (ContractMethodName != other.ContractMethodName) return false; + if (!object.Equals(ToAddress, other.ToAddress)) return false; + if (Params != other.Params) return false; + if (!object.Equals(ExpiredTime, other.ExpiredTime)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + if (ToBeReleased != other.ToBeReleased) return false; + if (ApprovalCount != other.ApprovalCount) return false; + if (RejectionCount != other.RejectionCount) return false; + if (AbstentionCount != other.AbstentionCount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (ContractMethodName.Length != 0) hash ^= ContractMethodName.GetHashCode(); + if (toAddress_ != null) hash ^= ToAddress.GetHashCode(); + if (Params.Length != 0) hash ^= Params.GetHashCode(); + if (expiredTime_ != null) hash ^= ExpiredTime.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (ToBeReleased != false) hash ^= ToBeReleased.GetHashCode(); + if (ApprovalCount != 0L) hash ^= ApprovalCount.GetHashCode(); + if (RejectionCount != 0L) hash ^= RejectionCount.GetHashCode(); + if (AbstentionCount != 0L) hash ^= AbstentionCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (ContractMethodName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ContractMethodName); + } + if (toAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ToAddress); + } + if (Params.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(Params); + } + if (expiredTime_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ExpiredTime); + } + if (organizationAddress_ != null) { + output.WriteRawTag(50); + output.WriteMessage(OrganizationAddress); + } + if (proposer_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Proposer); + } + if (ToBeReleased != false) { + output.WriteRawTag(64); + output.WriteBool(ToBeReleased); + } + if (ApprovalCount != 0L) { + output.WriteRawTag(72); + output.WriteInt64(ApprovalCount); + } + if (RejectionCount != 0L) { + output.WriteRawTag(80); + output.WriteInt64(RejectionCount); + } + if (AbstentionCount != 0L) { + output.WriteRawTag(88); + output.WriteInt64(AbstentionCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (ContractMethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ContractMethodName); + } + if (toAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ToAddress); + } + if (Params.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Params); + } + if (expiredTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpiredTime); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (ToBeReleased != false) { + size += 1 + 1; + } + if (ApprovalCount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ApprovalCount); + } + if (RejectionCount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(RejectionCount); + } + if (AbstentionCount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AbstentionCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposalOutput other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.ContractMethodName.Length != 0) { + ContractMethodName = other.ContractMethodName; + } + if (other.toAddress_ != null) { + if (toAddress_ == null) { + ToAddress = new global::AElf.Types.Address(); + } + ToAddress.MergeFrom(other.ToAddress); + } + if (other.Params.Length != 0) { + Params = other.Params; + } + if (other.expiredTime_ != null) { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ExpiredTime.MergeFrom(other.ExpiredTime); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.ToBeReleased != false) { + ToBeReleased = other.ToBeReleased; + } + if (other.ApprovalCount != 0L) { + ApprovalCount = other.ApprovalCount; + } + if (other.RejectionCount != 0L) { + RejectionCount = other.RejectionCount; + } + if (other.AbstentionCount != 0L) { + AbstentionCount = other.AbstentionCount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + ContractMethodName = input.ReadString(); + break; + } + case 26: { + if (toAddress_ == null) { + ToAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ToAddress); + break; + } + case 34: { + Params = input.ReadBytes(); + break; + } + case 42: { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ExpiredTime); + break; + } + case 50: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + case 58: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 64: { + ToBeReleased = input.ReadBool(); + break; + } + case 72: { + ApprovalCount = input.ReadInt64(); + break; + } + case 80: { + RejectionCount = input.ReadInt64(); + break; + } + case 88: { + AbstentionCount = input.ReadInt64(); + break; + } + } + } + } + + } + + internal sealed partial class ProposalReleaseThreshold : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposalReleaseThreshold()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleaseThreshold() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleaseThreshold(ProposalReleaseThreshold other) : this() { + minimalApprovalThreshold_ = other.minimalApprovalThreshold_; + maximalRejectionThreshold_ = other.maximalRejectionThreshold_; + maximalAbstentionThreshold_ = other.maximalAbstentionThreshold_; + minimalVoteThreshold_ = other.minimalVoteThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleaseThreshold Clone() { + return new ProposalReleaseThreshold(this); + } + + /// Field number for the "minimal_approval_threshold" field. + public const int MinimalApprovalThresholdFieldNumber = 1; + private long minimalApprovalThreshold_; + /// + /// The value for the minimum approval threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MinimalApprovalThreshold { + get { return minimalApprovalThreshold_; } + set { + minimalApprovalThreshold_ = value; + } + } + + /// Field number for the "maximal_rejection_threshold" field. + public const int MaximalRejectionThresholdFieldNumber = 2; + private long maximalRejectionThreshold_; + /// + /// The value for the maximal rejection threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MaximalRejectionThreshold { + get { return maximalRejectionThreshold_; } + set { + maximalRejectionThreshold_ = value; + } + } + + /// Field number for the "maximal_abstention_threshold" field. + public const int MaximalAbstentionThresholdFieldNumber = 3; + private long maximalAbstentionThreshold_; + /// + /// The value for the maximal abstention threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MaximalAbstentionThreshold { + get { return maximalAbstentionThreshold_; } + set { + maximalAbstentionThreshold_ = value; + } + } + + /// Field number for the "minimal_vote_threshold" field. + public const int MinimalVoteThresholdFieldNumber = 4; + private long minimalVoteThreshold_; + /// + /// The value for the minimal vote threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MinimalVoteThreshold { + get { return minimalVoteThreshold_; } + set { + minimalVoteThreshold_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposalReleaseThreshold); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposalReleaseThreshold other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MinimalApprovalThreshold != other.MinimalApprovalThreshold) return false; + if (MaximalRejectionThreshold != other.MaximalRejectionThreshold) return false; + if (MaximalAbstentionThreshold != other.MaximalAbstentionThreshold) return false; + if (MinimalVoteThreshold != other.MinimalVoteThreshold) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (MinimalApprovalThreshold != 0L) hash ^= MinimalApprovalThreshold.GetHashCode(); + if (MaximalRejectionThreshold != 0L) hash ^= MaximalRejectionThreshold.GetHashCode(); + if (MaximalAbstentionThreshold != 0L) hash ^= MaximalAbstentionThreshold.GetHashCode(); + if (MinimalVoteThreshold != 0L) hash ^= MinimalVoteThreshold.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (MinimalApprovalThreshold != 0L) { + output.WriteRawTag(8); + output.WriteInt64(MinimalApprovalThreshold); + } + if (MaximalRejectionThreshold != 0L) { + output.WriteRawTag(16); + output.WriteInt64(MaximalRejectionThreshold); + } + if (MaximalAbstentionThreshold != 0L) { + output.WriteRawTag(24); + output.WriteInt64(MaximalAbstentionThreshold); + } + if (MinimalVoteThreshold != 0L) { + output.WriteRawTag(32); + output.WriteInt64(MinimalVoteThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (MinimalApprovalThreshold != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MinimalApprovalThreshold); + } + if (MaximalRejectionThreshold != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MaximalRejectionThreshold); + } + if (MaximalAbstentionThreshold != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MaximalAbstentionThreshold); + } + if (MinimalVoteThreshold != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MinimalVoteThreshold); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposalReleaseThreshold other) { + if (other == null) { + return; + } + if (other.MinimalApprovalThreshold != 0L) { + MinimalApprovalThreshold = other.MinimalApprovalThreshold; + } + if (other.MaximalRejectionThreshold != 0L) { + MaximalRejectionThreshold = other.MaximalRejectionThreshold; + } + if (other.MaximalAbstentionThreshold != 0L) { + MaximalAbstentionThreshold = other.MaximalAbstentionThreshold; + } + if (other.MinimalVoteThreshold != 0L) { + MinimalVoteThreshold = other.MinimalVoteThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MinimalApprovalThreshold = input.ReadInt64(); + break; + } + case 16: { + MaximalRejectionThreshold = input.ReadInt64(); + break; + } + case 24: { + MaximalAbstentionThreshold = input.ReadInt64(); + break; + } + case 32: { + MinimalVoteThreshold = input.ReadInt64(); + break; + } + } + } + } + + } + + internal sealed partial class ProposerWhiteList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposerWhiteList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposerWhiteList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposerWhiteList(ProposerWhiteList other) : this() { + proposers_ = other.proposers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposerWhiteList Clone() { + return new ProposerWhiteList(this); + } + + /// Field number for the "proposers" field. + public const int ProposersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_proposers_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField proposers_ = new pbc::RepeatedField(); + /// + /// The address of the proposers + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Proposers { + get { return proposers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposerWhiteList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposerWhiteList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!proposers_.Equals(other.proposers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= proposers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + proposers_.WriteTo(output, _repeated_proposers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += proposers_.CalculateSize(_repeated_proposers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposerWhiteList other) { + if (other == null) { + return; + } + proposers_.Add(other.proposers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + proposers_.AddEntriesFrom(input, _repeated_proposers_codec); + break; + } + } + } + } + + } + + internal sealed partial class OrganizationHashAddressPair : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrganizationHashAddressPair()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationHashAddressPair() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationHashAddressPair(OrganizationHashAddressPair other) : this() { + organizationHash_ = other.organizationHash_ != null ? other.organizationHash_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationHashAddressPair Clone() { + return new OrganizationHashAddressPair(this); + } + + /// Field number for the "organization_hash" field. + public const int OrganizationHashFieldNumber = 1; + private global::AElf.Types.Hash organizationHash_; + /// + /// The id of organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash OrganizationHash { + get { return organizationHash_; } + set { + organizationHash_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 2; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrganizationHashAddressPair); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrganizationHashAddressPair other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(OrganizationHash, other.OrganizationHash)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (organizationHash_ != null) hash ^= OrganizationHash.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (organizationHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OrganizationHash); + } + if (organizationAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (organizationHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationHash); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrganizationHashAddressPair other) { + if (other == null) { + return; + } + if (other.organizationHash_ != null) { + if (organizationHash_ == null) { + OrganizationHash = new global::AElf.Types.Hash(); + } + OrganizationHash.MergeFrom(other.OrganizationHash); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (organizationHash_ == null) { + OrganizationHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(OrganizationHash); + break; + } + case 18: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class CreateProposalBySystemContractInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateProposalBySystemContractInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalBySystemContractInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalBySystemContractInput(CreateProposalBySystemContractInput other) : this() { + proposalInput_ = other.proposalInput_ != null ? other.proposalInput_.Clone() : null; + originProposer_ = other.originProposer_ != null ? other.originProposer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateProposalBySystemContractInput Clone() { + return new CreateProposalBySystemContractInput(this); + } + + /// Field number for the "proposal_input" field. + public const int ProposalInputFieldNumber = 1; + private global::AElf.Standards.ACS3.CreateProposalInput proposalInput_; + /// + /// The parameters of creating proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS3.CreateProposalInput ProposalInput { + get { return proposalInput_; } + set { + proposalInput_ = value; + } + } + + /// Field number for the "origin_proposer" field. + public const int OriginProposerFieldNumber = 2; + private global::AElf.Types.Address originProposer_; + /// + /// The actor that trigger the call. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OriginProposer { + get { return originProposer_; } + set { + originProposer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateProposalBySystemContractInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateProposalBySystemContractInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalInput, other.ProposalInput)) return false; + if (!object.Equals(OriginProposer, other.OriginProposer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalInput_ != null) hash ^= ProposalInput.GetHashCode(); + if (originProposer_ != null) hash ^= OriginProposer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalInput_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalInput); + } + if (originProposer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OriginProposer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalInput_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalInput); + } + if (originProposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OriginProposer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateProposalBySystemContractInput other) { + if (other == null) { + return; + } + if (other.proposalInput_ != null) { + if (proposalInput_ == null) { + ProposalInput = new global::AElf.Standards.ACS3.CreateProposalInput(); + } + ProposalInput.MergeFrom(other.ProposalInput); + } + if (other.originProposer_ != null) { + if (originProposer_ == null) { + OriginProposer = new global::AElf.Types.Address(); + } + OriginProposer.MergeFrom(other.OriginProposer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalInput_ == null) { + ProposalInput = new global::AElf.Standards.ACS3.CreateProposalInput(); + } + input.ReadMessage(ProposalInput); + break; + } + case 18: { + if (originProposer_ == null) { + OriginProposer = new global::AElf.Types.Address(); + } + input.ReadMessage(OriginProposer); + break; + } + } + } + } + + } + + internal sealed partial class ValidateProposerInWhiteListInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateProposerInWhiteListInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateProposerInWhiteListInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateProposerInWhiteListInput(ValidateProposerInWhiteListInput other) : this() { + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateProposerInWhiteListInput Clone() { + return new ValidateProposerInWhiteListInput(this); + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 1; + private global::AElf.Types.Address proposer_; + /// + /// The address to search/check. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 2; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of the organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValidateProposerInWhiteListInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValidateProposerInWhiteListInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Proposer, other.Proposer)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Proposer); + } + if (organizationAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValidateProposerInWhiteListInput other) { + if (other == null) { + return; + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 18: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class ProposalCreated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposalCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalCreated(ProposalCreated other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalCreated Clone() { + return new ProposalCreated(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of the created proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 2; + private global::AElf.Types.Address organizationAddress_; + /// + /// The organization address of the created proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposalCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposalCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (organizationAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposalCreated other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class ProposalReleased : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposalReleased()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleased() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleased(ProposalReleased other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposalReleased Clone() { + return new ProposalReleased(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of the released proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 2; + private global::AElf.Types.Address organizationAddress_; + /// + /// The organization address of the released proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposalReleased); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposalReleased other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (organizationAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposalReleased other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class OrganizationCreated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrganizationCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationCreated(OrganizationCreated other) : this() { + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationCreated Clone() { + return new OrganizationCreated(this); + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 1; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of the created organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrganizationCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrganizationCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (organizationAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrganizationCreated other) { + if (other == null) { + return; + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class ReceiptCreated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReceiptCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReceiptCreated(ReceiptCreated other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + address_ = other.address_ != null ? other.address_.Clone() : null; + receiptType_ = other.receiptType_; + time_ = other.time_ != null ? other.time_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReceiptCreated Clone() { + return new ReceiptCreated(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of the proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 2; + private global::AElf.Types.Address address_; + /// + /// The sender address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "receipt_type" field. + public const int ReceiptTypeFieldNumber = 3; + private string receiptType_ = ""; + /// + /// The type of receipt(Approve, Reject or Abstain). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ReceiptType { + get { return receiptType_; } + set { + receiptType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "time" field. + public const int TimeFieldNumber = 4; + private global::Google.Protobuf.WellKnownTypes.Timestamp time_; + /// + /// The timestamp of this method call. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp Time { + get { return time_; } + set { + time_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 5; + private global::AElf.Types.Address organizationAddress_; + /// + /// The address of the organization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReceiptCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReceiptCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(Address, other.Address)) return false; + if (ReceiptType != other.ReceiptType) return false; + if (!object.Equals(Time, other.Time)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (ReceiptType.Length != 0) hash ^= ReceiptType.GetHashCode(); + if (time_ != null) hash ^= Time.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (address_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Address); + } + if (ReceiptType.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ReceiptType); + } + if (time_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Time); + } + if (organizationAddress_ != null) { + output.WriteRawTag(42); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (ReceiptType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptType); + } + if (time_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Time); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReceiptCreated other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.ReceiptType.Length != 0) { + ReceiptType = other.ReceiptType; + } + if (other.time_ != null) { + if (time_ == null) { + Time = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + Time.MergeFrom(other.Time); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 26: { + ReceiptType = input.ReadString(); + break; + } + case 34: { + if (time_ == null) { + Time = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(Time); + break; + } + case 42: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + + } + + internal sealed partial class OrganizationWhiteListChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrganizationWhiteListChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationWhiteListChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationWhiteListChanged(OrganizationWhiteListChanged other) : this() { + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + proposerWhiteList_ = other.proposerWhiteList_ != null ? other.proposerWhiteList_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationWhiteListChanged Clone() { + return new OrganizationWhiteListChanged(this); + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 1; + private global::AElf.Types.Address organizationAddress_; + /// + /// The organization address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + /// Field number for the "proposer_white_list" field. + public const int ProposerWhiteListFieldNumber = 2; + private global::AElf.Standards.ACS3.ProposerWhiteList proposerWhiteList_; + /// + /// The new proposer whitelist. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS3.ProposerWhiteList ProposerWhiteList { + get { return proposerWhiteList_; } + set { + proposerWhiteList_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrganizationWhiteListChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrganizationWhiteListChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + if (!object.Equals(ProposerWhiteList, other.ProposerWhiteList)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (proposerWhiteList_ != null) hash ^= ProposerWhiteList.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (organizationAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OrganizationAddress); + } + if (proposerWhiteList_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ProposerWhiteList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (proposerWhiteList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposerWhiteList); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrganizationWhiteListChanged other) { + if (other == null) { + return; + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + if (other.proposerWhiteList_ != null) { + if (proposerWhiteList_ == null) { + ProposerWhiteList = new global::AElf.Standards.ACS3.ProposerWhiteList(); + } + ProposerWhiteList.MergeFrom(other.ProposerWhiteList); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + case 18: { + if (proposerWhiteList_ == null) { + ProposerWhiteList = new global::AElf.Standards.ACS3.ProposerWhiteList(); + } + input.ReadMessage(ProposerWhiteList); + break; + } + } + } + } + + } + + internal sealed partial class OrganizationThresholdChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrganizationThresholdChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS3.Acs3Reflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationThresholdChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationThresholdChanged(OrganizationThresholdChanged other) : this() { + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + proposerReleaseThreshold_ = other.proposerReleaseThreshold_ != null ? other.proposerReleaseThreshold_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrganizationThresholdChanged Clone() { + return new OrganizationThresholdChanged(this); + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 1; + private global::AElf.Types.Address organizationAddress_; + /// + /// The organization address + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + /// Field number for the "proposer_release_threshold" field. + public const int ProposerReleaseThresholdFieldNumber = 2; + private global::AElf.Standards.ACS3.ProposalReleaseThreshold proposerReleaseThreshold_; + /// + /// The new release threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS3.ProposalReleaseThreshold ProposerReleaseThreshold { + get { return proposerReleaseThreshold_; } + set { + proposerReleaseThreshold_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrganizationThresholdChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrganizationThresholdChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + if (!object.Equals(ProposerReleaseThreshold, other.ProposerReleaseThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (proposerReleaseThreshold_ != null) hash ^= ProposerReleaseThreshold.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (organizationAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OrganizationAddress); + } + if (proposerReleaseThreshold_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ProposerReleaseThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (proposerReleaseThreshold_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposerReleaseThreshold); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrganizationThresholdChanged other) { + if (other == null) { + return; + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + if (other.proposerReleaseThreshold_ != null) { + if (proposerReleaseThreshold_ == null) { + ProposerReleaseThreshold = new global::AElf.Standards.ACS3.ProposalReleaseThreshold(); + } + ProposerReleaseThreshold.MergeFrom(other.ProposerReleaseThreshold); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + case 18: { + if (proposerReleaseThreshold_ == null) { + ProposerReleaseThreshold = new global::AElf.Standards.ACS3.ProposalReleaseThreshold(); + } + input.ReadMessage(ProposerReleaseThreshold); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.c.cs new file mode 100644 index 0000000..1f78def --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.c.cs @@ -0,0 +1,58 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs7.proto +// +// Original file comments: +// * +// AElf Standards ACS7(Contract CrossChain Standard) +// +// ACS7 is for cross chain related contract implementation. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Standards.ACS7 { + + #region Events + public partial class SideChainBlockDataIndexed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public SideChainBlockDataIndexed GetNonIndexed() + { + return new SideChainBlockDataIndexed + { + }; + } + } + + public partial class CrossChainIndexingDataProposedEvent : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CrossChainIndexingDataProposedEvent GetNonIndexed() + { + return new CrossChainIndexingDataProposedEvent + { + ProposedCrossChainData = ProposedCrossChainData, + ProposalId = ProposalId, + }; + } + } + + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.g.cs new file mode 100644 index 0000000..b1da9ad --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/Acs7.g.cs @@ -0,0 +1,4686 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs7.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS7 { + + /// Holder for reflection information generated from acs7.proto + public static partial class Acs7Reflection { + + #region Descriptor + /// File descriptor for acs7.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs7Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgphY3M3LnByb3RvEgRhY3M3Gg9hZWxmL2NvcmUucHJvdG8aEmFlbGYvb3B0", + "aW9ucy5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGh5nb29n", + "bGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8aH2dvb2dsZS9wcm90b2J1Zi90", + "aW1lc3RhbXAucHJvdG8ilgEKElNpZGVDaGFpbkJsb2NrRGF0YRIOCgZoZWln", + "aHQYASABKAMSJQoRYmxvY2tfaGVhZGVyX2hhc2gYAiABKAsyCi5hZWxmLkhh", + "c2gSNwojdHJhbnNhY3Rpb25fc3RhdHVzX21lcmtsZV90cmVlX3Jvb3QYAyAB", + "KAsyCi5hZWxmLkhhc2gSEAoIY2hhaW5faWQYBCABKAUiMQoNUmVjaGFyZ2VJ", + "bnB1dBIQCghjaGFpbl9pZBgBIAEoBRIOCgZhbW91bnQYAiABKAMiuQMKFFBh", + "cmVudENoYWluQmxvY2tEYXRhEg4KBmhlaWdodBgBIAEoAxI5ChZjcm9zc19j", + "aGFpbl9leHRyYV9kYXRhGAIgASgLMhkuYWNzNy5Dcm9zc0NoYWluRXh0cmFE", + "YXRhEhAKCGNoYWluX2lkGAMgASgFEjcKI3RyYW5zYWN0aW9uX3N0YXR1c19t", + "ZXJrbGVfdHJlZV9yb290GAQgASgLMgouYWVsZi5IYXNoEk4KE2luZGV4ZWRf", + "bWVya2xlX3BhdGgYBSADKAsyMS5hY3M3LlBhcmVudENoYWluQmxvY2tEYXRh", + "LkluZGV4ZWRNZXJrbGVQYXRoRW50cnkSPQoKZXh0cmFfZGF0YRgGIAMoCzIp", + "LmFjczcuUGFyZW50Q2hhaW5CbG9ja0RhdGEuRXh0cmFEYXRhRW50cnkaSgoW", + "SW5kZXhlZE1lcmtsZVBhdGhFbnRyeRILCgNrZXkYASABKAMSHwoFdmFsdWUY", + "AiABKAsyEC5hZWxmLk1lcmtsZVBhdGg6AjgBGjAKDkV4dHJhRGF0YUVudHJ5", + "EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEiTgoTQ3Jvc3NDaGFp", + "bkV4dHJhRGF0YRI3CiN0cmFuc2FjdGlvbl9zdGF0dXNfbWVya2xlX3RyZWVf", + "cm9vdBgBIAEoCzIKLmFlbGYuSGFzaCKRAQoUQ2hhaW5JZEFuZEhlaWdodERp", + "Y3QSRAoOaWRfaGVpZ2h0X2RpY3QYASADKAsyLC5hY3M3LkNoYWluSWRBbmRI", + "ZWlnaHREaWN0LklkSGVpZ2h0RGljdEVudHJ5GjMKEUlkSGVpZ2h0RGljdEVu", + "dHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEoAzoCOAEiaQogU2lkZUNo", + "YWluSW5kZXhpbmdJbmZvcm1hdGlvbkxpc3QSRQoZaW5kZXhpbmdfaW5mb3Jt", + "YXRpb25fbGlzdBgBIAMoCzIiLmFjczcuU2lkZUNoYWluSW5kZXhpbmdJbmZv", + "cm1hdGlvbiJIChxTaWRlQ2hhaW5JbmRleGluZ0luZm9ybWF0aW9uEhAKCGNo", + "YWluX2lkGAEgASgFEhYKDmluZGV4ZWRfaGVpZ2h0GAIgASgDIpUBChNDcm9z", + "c0NoYWluQmxvY2tEYXRhEjwKGnNpZGVfY2hhaW5fYmxvY2tfZGF0YV9saXN0", + "GAEgAygLMhguYWNzNy5TaWRlQ2hhaW5CbG9ja0RhdGESQAoccGFyZW50X2No", + "YWluX2Jsb2NrX2RhdGFfbGlzdBgCIAMoCzIaLmFjczcuUGFyZW50Q2hhaW5C", + "bG9ja0RhdGEiegocQ3Jvc3NDaGFpbk1lcmtsZVByb29mQ29udGV4dBIhChli", + "b3VuZF9wYXJlbnRfY2hhaW5faGVpZ2h0GAEgASgDEjcKHW1lcmtsZV9wYXRo", + "X2Zyb21fcGFyZW50X2NoYWluGAIgASgLMhAuYWVsZi5NZXJrbGVQYXRoIv0D", + "ChdDaGFpbkluaXRpYWxpemF0aW9uRGF0YRIQCghjaGFpbl9pZBgBIAEoBRIe", + "CgdjcmVhdG9yGAIgASgLMg0uYWVsZi5BZGRyZXNzEjYKEmNyZWF0aW9uX3Rp", + "bWVzdGFtcBgDIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASJwof", + "Y3JlYXRpb25faGVpZ2h0X29uX3BhcmVudF9jaGFpbhgEIAEoAxIpCiFjaGFp", + "bl9jcmVhdG9yX3ByaXZpbGVnZV9wcmVzZXJ2ZWQYBSABKAgSOgojcGFyZW50", + "X2NoYWluX3Rva2VuX2NvbnRyYWN0X2FkZHJlc3MYBiABKAsyDS5hZWxmLkFk", + "ZHJlc3MSUwojY2hhaW5faW5pdGlhbGl6YXRpb25fY29uc2Vuc3VzX2luZm8Y", + "ByABKAsyJi5hY3M3LkNoYWluSW5pdGlhbGl6YXRpb25Db25zZW5zdXNJbmZv", + "Eh4KFm5hdGl2ZV90b2tlbl9pbmZvX2RhdGEYCCABKAwSNAoTcmVzb3VyY2Vf", + "dG9rZW5faW5mbxgJIAEoCzIXLmFjczcuUmVzb3VyY2VUb2tlbkluZm8SPQoY", + "Y2hhaW5fcHJpbWFyeV90b2tlbl9pbmZvGAogASgLMhsuYWNzNy5DaGFpblBy", + "aW1hcnlUb2tlbkluZm8iyAEKEVJlc291cmNlVG9rZW5JbmZvEiAKGHJlc291", + "cmNlX3Rva2VuX2xpc3RfZGF0YRgBIAEoDBJTChdpbml0aWFsX3Jlc291cmNl", + "X2Ftb3VudBgCIAMoCzIyLmFjczcuUmVzb3VyY2VUb2tlbkluZm8uSW5pdGlh", + "bFJlc291cmNlQW1vdW50RW50cnkaPAoaSW5pdGlhbFJlc291cmNlQW1vdW50", + "RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgFOgI4ASKIAQoVQ2hh", + "aW5QcmltYXJ5VG9rZW5JbmZvEiAKGGNoYWluX3ByaW1hcnlfdG9rZW5fZGF0", + "YRgBIAEoDBJNCiNzaWRlX2NoYWluX3Rva2VuX2luaXRpYWxfaXNzdWVfbGlz", + "dBgCIAMoCzIgLmFjczcuU2lkZUNoYWluVG9rZW5Jbml0aWFsSXNzdWUiQgog", + "Q2hhaW5Jbml0aWFsaXphdGlvbkNvbnNlbnN1c0luZm8SHgoWaW5pdGlhbF9j", + "b25zZW5zdXNfZGF0YRgBIAEoDCKoAwoYU2lkZUNoYWluQ3JlYXRpb25SZXF1", + "ZXN0EhYKDmluZGV4aW5nX3ByaWNlGAEgASgDEhsKE2xvY2tlZF90b2tlbl9h", + "bW91bnQYAiABKAMSHgoWaXNfcHJpdmlsZWdlX3ByZXNlcnZlZBgDIAEoCBJO", + "CiFzaWRlX2NoYWluX3Rva2VuX2NyZWF0aW9uX3JlcXVlc3QYBCABKAsyIy5h", + "Y3M3LlNpZGVDaGFpblRva2VuQ3JlYXRpb25SZXF1ZXN0Ek0KI3NpZGVfY2hh", + "aW5fdG9rZW5faW5pdGlhbF9pc3N1ZV9saXN0GAUgAygLMiAuYWNzNy5TaWRl", + "Q2hhaW5Ub2tlbkluaXRpYWxJc3N1ZRJaChdpbml0aWFsX3Jlc291cmNlX2Ft", + "b3VudBgGIAMoCzI5LmFjczcuU2lkZUNoYWluQ3JlYXRpb25SZXF1ZXN0Lklu", + "aXRpYWxSZXNvdXJjZUFtb3VudEVudHJ5GjwKGkluaXRpYWxSZXNvdXJjZUFt", + "b3VudEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoBToCOAEiqQEK", + "HVNpZGVDaGFpblRva2VuQ3JlYXRpb25SZXF1ZXN0Eh8KF3NpZGVfY2hhaW5f", + "dG9rZW5fc3ltYm9sGAEgASgJEh0KFXNpZGVfY2hhaW5fdG9rZW5fbmFtZRgC", + "IAEoCRIlCh1zaWRlX2NoYWluX3Rva2VuX3RvdGFsX3N1cHBseRgDIAEoAxIh", + "ChlzaWRlX2NoYWluX3Rva2VuX2RlY2ltYWxzGAQgASgFIkwKGlNpZGVDaGFp", + "blRva2VuSW5pdGlhbElzc3VlEh4KB2FkZHJlc3MYASABKAsyDS5hZWxmLkFk", + "ZHJlc3MSDgoGYW1vdW50GAIgASgDInsKG0luZGV4ZWRQYXJlbnRDaGFpbkJs", + "b2NrRGF0YRIaChJsb2NhbF9jaGFpbl9oZWlnaHQYASABKAMSQAoccGFyZW50", + "X2NoYWluX2Jsb2NrX2RhdGFfbGlzdBgCIAMoCzIaLmFjczcuUGFyZW50Q2hh", + "aW5CbG9ja0RhdGEiWQoZSW5kZXhlZFNpZGVDaGFpbkJsb2NrRGF0YRI8Chpz", + "aWRlX2NoYWluX2Jsb2NrX2RhdGFfbGlzdBgBIAMoCzIYLmFjczcuU2lkZUNo", + "YWluQmxvY2tEYXRhIj8KJlJlbGVhc2VDcm9zc0NoYWluSW5kZXhpbmdQcm9w", + "b3NhbElucHV0EhUKDWNoYWluX2lkX2xpc3QYASADKAUifAoUQ3JlYXRlU2lk", + "ZUNoYWluSW5wdXQSQwobc2lkZV9jaGFpbl9jcmVhdGlvbl9yZXF1ZXN0GAEg", + "ASgLMh4uYWNzNy5TaWRlQ2hhaW5DcmVhdGlvblJlcXVlc3QSHwoIcHJvcG9z", + "ZXIYAiABKAsyDS5hZWxmLkFkZHJlc3MiQAodUmVsZWFzZVNpZGVDaGFpbkNy", + "ZWF0aW9uSW5wdXQSHwoLcHJvcG9zYWxfaWQYASABKAsyCi5hZWxmLkhhc2gi", + "RQoWQWRqdXN0SW5kZXhpbmdGZWVJbnB1dBIVCg1zaWRlX2NoYWluX2lkGAEg", + "ASgFEhQKDGluZGV4aW5nX2ZlZRgCIAEoAyIhChlTaWRlQ2hhaW5CbG9ja0Rh", + "dGFJbmRleGVkOgSguxgBIooBCiNDcm9zc0NoYWluSW5kZXhpbmdEYXRhUHJv", + "cG9zZWRFdmVudBI8Chlwcm9wb3NlZF9jcm9zc19jaGFpbl9kYXRhGAEgASgL", + "MhkuYWNzNy5Dcm9zc0NoYWluQmxvY2tEYXRhEh8KC3Byb3Bvc2FsX2lkGAIg", + "ASgLMgouYWVsZi5IYXNoOgSguxgBIpQBChZWZXJpZnlUcmFuc2FjdGlvbklu", + "cHV0EiIKDnRyYW5zYWN0aW9uX2lkGAEgASgLMgouYWVsZi5IYXNoEh4KBHBh", + "dGgYAiABKAsyEC5hZWxmLk1lcmtsZVBhdGgSGwoTcGFyZW50X2NoYWluX2hl", + "aWdodBgDIAEoAxIZChF2ZXJpZmllZF9jaGFpbl9pZBgEIAEoBTLZCgoEQUNT", + "NxJQChlQcm9wb3NlQ3Jvc3NDaGFpbkluZGV4aW5nEhkuYWNzNy5Dcm9zc0No", + "YWluQmxvY2tEYXRhGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASawohUmVs", + "ZWFzZUNyb3NzQ2hhaW5JbmRleGluZ1Byb3Bvc2FsEiwuYWNzNy5SZWxlYXNl", + "Q3Jvc3NDaGFpbkluZGV4aW5nUHJvcG9zYWxJbnB1dBoWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eSIAElQKGFJlcXVlc3RTaWRlQ2hhaW5DcmVhdGlvbhIeLmFj", + "czcuU2lkZUNoYWluQ3JlYXRpb25SZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASWQoYUmVsZWFzZVNpZGVDaGFpbkNyZWF0aW9uEiMuYWNzNy5S", + "ZWxlYXNlU2lkZUNoYWluQ3JlYXRpb25JbnB1dBoWLmdvb2dsZS5wcm90b2J1", + "Zi5FbXB0eSIAEkwKD0NyZWF0ZVNpZGVDaGFpbhIaLmFjczcuQ3JlYXRlU2lk", + "ZUNoYWluSW5wdXQaGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZSIAEjkK", + "CFJlY2hhcmdlEhMuYWNzNy5SZWNoYXJnZUlucHV0GhYuZ29vZ2xlLnByb3Rv", + "YnVmLkVtcHR5IgASTgoQRGlzcG9zZVNpZGVDaGFpbhIbLmdvb2dsZS5wcm90", + "b2J1Zi5JbnQzMlZhbHVlGhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUi", + "ABJQChZBZGp1c3RJbmRleGluZ0ZlZVByaWNlEhwuYWNzNy5BZGp1c3RJbmRl", + "eGluZ0ZlZUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASVAoRVmVy", + "aWZ5VHJhbnNhY3Rpb24SHC5hY3M3LlZlcmlmeVRyYW5zYWN0aW9uSW5wdXQa", + "Gi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlIgWIifcBARJUChdHZXRTaWRl", + "Q2hhaW5JZEFuZEhlaWdodBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoaLmFj", + "czcuQ2hhaW5JZEFuZEhlaWdodERpY3QiBYiJ9wEBEmwKI0dldFNpZGVDaGFp", + "bkluZGV4aW5nSW5mb3JtYXRpb25MaXN0EhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5GiYuYWNzNy5TaWRlQ2hhaW5JbmRleGluZ0luZm9ybWF0aW9uTGlzdCIF", + "iIn3AQESVAoXR2V0QWxsQ2hhaW5zSWRBbmRIZWlnaHQSFi5nb29nbGUucHJv", + "dG9idWYuRW1wdHkaGi5hY3M3LkNoYWluSWRBbmRIZWlnaHREaWN0IgWIifcB", + "ARJrCiRHZXRJbmRleGVkU2lkZUNoYWluQmxvY2tEYXRhQnlIZWlnaHQSGy5n", + "b29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRofLmFjczcuSW5kZXhlZFNpZGVD", + "aGFpbkJsb2NrRGF0YSIFiIn3AQESeAouR2V0Qm91bmRQYXJlbnRDaGFpbkhl", + "aWdodEFuZE1lcmtsZVBhdGhCeUhlaWdodBIbLmdvb2dsZS5wcm90b2J1Zi5J", + "bnQ2NFZhbHVlGiIuYWNzNy5Dcm9zc0NoYWluTWVya2xlUHJvb2ZDb250ZXh0", + "IgWIifcBARJfChpHZXRDaGFpbkluaXRpYWxpemF0aW9uRGF0YRIbLmdvb2ds", + "ZS5wcm90b2J1Zi5JbnQzMlZhbHVlGh0uYWNzNy5DaGFpbkluaXRpYWxpemF0", + "aW9uRGF0YSIFiIn3AQFCH6oCE0FFbGYuU3RhbmRhcmRzLkFDUzeKkvQBBGFj", + "czdQAFAEYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainBlockData), global::AElf.Standards.ACS7.SideChainBlockData.Parser, new[]{ "Height", "BlockHeaderHash", "TransactionStatusMerkleTreeRoot", "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.RechargeInput), global::AElf.Standards.ACS7.RechargeInput.Parser, new[]{ "ChainId", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ParentChainBlockData), global::AElf.Standards.ACS7.ParentChainBlockData.Parser, new[]{ "Height", "CrossChainExtraData", "ChainId", "TransactionStatusMerkleTreeRoot", "IndexedMerklePath", "ExtraData" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.CrossChainExtraData), global::AElf.Standards.ACS7.CrossChainExtraData.Parser, new[]{ "TransactionStatusMerkleTreeRoot" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ChainIdAndHeightDict), global::AElf.Standards.ACS7.ChainIdAndHeightDict.Parser, new[]{ "IdHeightDict" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainIndexingInformationList), global::AElf.Standards.ACS7.SideChainIndexingInformationList.Parser, new[]{ "IndexingInformationList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainIndexingInformation), global::AElf.Standards.ACS7.SideChainIndexingInformation.Parser, new[]{ "ChainId", "IndexedHeight" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.CrossChainBlockData), global::AElf.Standards.ACS7.CrossChainBlockData.Parser, new[]{ "SideChainBlockDataList", "ParentChainBlockDataList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.CrossChainMerkleProofContext), global::AElf.Standards.ACS7.CrossChainMerkleProofContext.Parser, new[]{ "BoundParentChainHeight", "MerklePathFromParentChain" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ChainInitializationData), global::AElf.Standards.ACS7.ChainInitializationData.Parser, new[]{ "ChainId", "Creator", "CreationTimestamp", "CreationHeightOnParentChain", "ChainCreatorPrivilegePreserved", "ParentChainTokenContractAddress", "ChainInitializationConsensusInfo", "NativeTokenInfoData", "ResourceTokenInfo", "ChainPrimaryTokenInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ResourceTokenInfo), global::AElf.Standards.ACS7.ResourceTokenInfo.Parser, new[]{ "ResourceTokenListData", "InitialResourceAmount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ChainPrimaryTokenInfo), global::AElf.Standards.ACS7.ChainPrimaryTokenInfo.Parser, new[]{ "ChainPrimaryTokenData", "SideChainTokenInitialIssueList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ChainInitializationConsensusInfo), global::AElf.Standards.ACS7.ChainInitializationConsensusInfo.Parser, new[]{ "InitialConsensusData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainCreationRequest), global::AElf.Standards.ACS7.SideChainCreationRequest.Parser, new[]{ "IndexingPrice", "LockedTokenAmount", "IsPrivilegePreserved", "SideChainTokenCreationRequest", "SideChainTokenInitialIssueList", "InitialResourceAmount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainTokenCreationRequest), global::AElf.Standards.ACS7.SideChainTokenCreationRequest.Parser, new[]{ "SideChainTokenSymbol", "SideChainTokenName", "SideChainTokenTotalSupply", "SideChainTokenDecimals" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainTokenInitialIssue), global::AElf.Standards.ACS7.SideChainTokenInitialIssue.Parser, new[]{ "Address", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.IndexedParentChainBlockData), global::AElf.Standards.ACS7.IndexedParentChainBlockData.Parser, new[]{ "LocalChainHeight", "ParentChainBlockDataList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.IndexedSideChainBlockData), global::AElf.Standards.ACS7.IndexedSideChainBlockData.Parser, new[]{ "SideChainBlockDataList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ReleaseCrossChainIndexingProposalInput), global::AElf.Standards.ACS7.ReleaseCrossChainIndexingProposalInput.Parser, new[]{ "ChainIdList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.CreateSideChainInput), global::AElf.Standards.ACS7.CreateSideChainInput.Parser, new[]{ "SideChainCreationRequest", "Proposer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.ReleaseSideChainCreationInput), global::AElf.Standards.ACS7.ReleaseSideChainCreationInput.Parser, new[]{ "ProposalId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.AdjustIndexingFeeInput), global::AElf.Standards.ACS7.AdjustIndexingFeeInput.Parser, new[]{ "SideChainId", "IndexingFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.SideChainBlockDataIndexed), global::AElf.Standards.ACS7.SideChainBlockDataIndexed.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.CrossChainIndexingDataProposedEvent), global::AElf.Standards.ACS7.CrossChainIndexingDataProposedEvent.Parser, new[]{ "ProposedCrossChainData", "ProposalId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS7.VerifyTransactionInput), global::AElf.Standards.ACS7.VerifyTransactionInput.Parser, new[]{ "TransactionId", "Path", "ParentChainHeight", "VerifiedChainId" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SideChainBlockData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainBlockData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockData(SideChainBlockData other) : this() { + height_ = other.height_; + blockHeaderHash_ = other.blockHeaderHash_ != null ? other.blockHeaderHash_.Clone() : null; + transactionStatusMerkleTreeRoot_ = other.transactionStatusMerkleTreeRoot_ != null ? other.transactionStatusMerkleTreeRoot_.Clone() : null; + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockData Clone() { + return new SideChainBlockData(this); + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 1; + private long height_; + /// + /// The height of side chain block. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Height { + get { return height_; } + set { + height_ = value; + } + } + + /// Field number for the "block_header_hash" field. + public const int BlockHeaderHashFieldNumber = 2; + private global::AElf.Types.Hash blockHeaderHash_; + /// + /// The hash of side chain block. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash BlockHeaderHash { + get { return blockHeaderHash_; } + set { + blockHeaderHash_ = value; + } + } + + /// Field number for the "transaction_status_merkle_tree_root" field. + public const int TransactionStatusMerkleTreeRootFieldNumber = 3; + private global::AElf.Types.Hash transactionStatusMerkleTreeRoot_; + /// + /// The merkle tree root computing from transactions status in side chain block. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash TransactionStatusMerkleTreeRoot { + get { return transactionStatusMerkleTreeRoot_; } + set { + transactionStatusMerkleTreeRoot_ = value; + } + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 4; + private int chainId_; + /// + /// The id of side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainBlockData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainBlockData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Height != other.Height) return false; + if (!object.Equals(BlockHeaderHash, other.BlockHeaderHash)) return false; + if (!object.Equals(TransactionStatusMerkleTreeRoot, other.TransactionStatusMerkleTreeRoot)) return false; + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Height != 0L) hash ^= Height.GetHashCode(); + if (blockHeaderHash_ != null) hash ^= BlockHeaderHash.GetHashCode(); + if (transactionStatusMerkleTreeRoot_ != null) hash ^= TransactionStatusMerkleTreeRoot.GetHashCode(); + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Height != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Height); + } + if (blockHeaderHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BlockHeaderHash); + } + if (transactionStatusMerkleTreeRoot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(TransactionStatusMerkleTreeRoot); + } + if (ChainId != 0) { + output.WriteRawTag(32); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Height != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Height); + } + if (blockHeaderHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlockHeaderHash); + } + if (transactionStatusMerkleTreeRoot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionStatusMerkleTreeRoot); + } + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainBlockData other) { + if (other == null) { + return; + } + if (other.Height != 0L) { + Height = other.Height; + } + if (other.blockHeaderHash_ != null) { + if (blockHeaderHash_ == null) { + BlockHeaderHash = new global::AElf.Types.Hash(); + } + BlockHeaderHash.MergeFrom(other.BlockHeaderHash); + } + if (other.transactionStatusMerkleTreeRoot_ != null) { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + TransactionStatusMerkleTreeRoot.MergeFrom(other.TransactionStatusMerkleTreeRoot); + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Height = input.ReadInt64(); + break; + } + case 18: { + if (blockHeaderHash_ == null) { + BlockHeaderHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(BlockHeaderHash); + break; + } + case 26: { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + input.ReadMessage(TransactionStatusMerkleTreeRoot); + break; + } + case 32: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class RechargeInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RechargeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RechargeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RechargeInput(RechargeInput other) : this() { + chainId_ = other.chainId_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RechargeInput Clone() { + return new RechargeInput(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The chain id to recharge. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount to recharge. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RechargeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RechargeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RechargeInput other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class ParentChainBlockData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ParentChainBlockData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainBlockData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainBlockData(ParentChainBlockData other) : this() { + height_ = other.height_; + crossChainExtraData_ = other.crossChainExtraData_ != null ? other.crossChainExtraData_.Clone() : null; + chainId_ = other.chainId_; + transactionStatusMerkleTreeRoot_ = other.transactionStatusMerkleTreeRoot_ != null ? other.transactionStatusMerkleTreeRoot_.Clone() : null; + indexedMerklePath_ = other.indexedMerklePath_.Clone(); + extraData_ = other.extraData_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainBlockData Clone() { + return new ParentChainBlockData(this); + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 1; + private long height_; + /// + /// The height of parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Height { + get { return height_; } + set { + height_ = value; + } + } + + /// Field number for the "cross_chain_extra_data" field. + public const int CrossChainExtraDataFieldNumber = 2; + private global::AElf.Standards.ACS7.CrossChainExtraData crossChainExtraData_; + /// + /// The merkle tree root computing from side chain roots. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.CrossChainExtraData CrossChainExtraData { + get { return crossChainExtraData_; } + set { + crossChainExtraData_ = value; + } + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 3; + private int chainId_; + /// + /// The parent chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "transaction_status_merkle_tree_root" field. + public const int TransactionStatusMerkleTreeRootFieldNumber = 4; + private global::AElf.Types.Hash transactionStatusMerkleTreeRoot_; + /// + /// The merkle tree root computing from transactions status in parent chain block. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash TransactionStatusMerkleTreeRoot { + get { return transactionStatusMerkleTreeRoot_; } + set { + transactionStatusMerkleTreeRoot_ = value; + } + } + + /// Field number for the "indexed_merkle_path" field. + public const int IndexedMerklePathFieldNumber = 5; + private static readonly pbc::MapField.Codec _map_indexedMerklePath_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForMessage(18, global::AElf.Types.MerklePath.Parser), 42); + private readonly pbc::MapField indexedMerklePath_ = new pbc::MapField(); + /// + /// Indexed block height from side chain and merkle path for this side chain block + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField IndexedMerklePath { + get { return indexedMerklePath_; } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 6; + private static readonly pbc::MapField.Codec _map_extraData_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 50); + private readonly pbc::MapField extraData_ = new pbc::MapField(); + /// + /// Extra data map. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ExtraData { + get { return extraData_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ParentChainBlockData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ParentChainBlockData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Height != other.Height) return false; + if (!object.Equals(CrossChainExtraData, other.CrossChainExtraData)) return false; + if (ChainId != other.ChainId) return false; + if (!object.Equals(TransactionStatusMerkleTreeRoot, other.TransactionStatusMerkleTreeRoot)) return false; + if (!IndexedMerklePath.Equals(other.IndexedMerklePath)) return false; + if (!ExtraData.Equals(other.ExtraData)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Height != 0L) hash ^= Height.GetHashCode(); + if (crossChainExtraData_ != null) hash ^= CrossChainExtraData.GetHashCode(); + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (transactionStatusMerkleTreeRoot_ != null) hash ^= TransactionStatusMerkleTreeRoot.GetHashCode(); + hash ^= IndexedMerklePath.GetHashCode(); + hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Height != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Height); + } + if (crossChainExtraData_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CrossChainExtraData); + } + if (ChainId != 0) { + output.WriteRawTag(24); + output.WriteInt32(ChainId); + } + if (transactionStatusMerkleTreeRoot_ != null) { + output.WriteRawTag(34); + output.WriteMessage(TransactionStatusMerkleTreeRoot); + } + indexedMerklePath_.WriteTo(output, _map_indexedMerklePath_codec); + extraData_.WriteTo(output, _map_extraData_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Height != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Height); + } + if (crossChainExtraData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CrossChainExtraData); + } + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (transactionStatusMerkleTreeRoot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionStatusMerkleTreeRoot); + } + size += indexedMerklePath_.CalculateSize(_map_indexedMerklePath_codec); + size += extraData_.CalculateSize(_map_extraData_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ParentChainBlockData other) { + if (other == null) { + return; + } + if (other.Height != 0L) { + Height = other.Height; + } + if (other.crossChainExtraData_ != null) { + if (crossChainExtraData_ == null) { + CrossChainExtraData = new global::AElf.Standards.ACS7.CrossChainExtraData(); + } + CrossChainExtraData.MergeFrom(other.CrossChainExtraData); + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.transactionStatusMerkleTreeRoot_ != null) { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + TransactionStatusMerkleTreeRoot.MergeFrom(other.TransactionStatusMerkleTreeRoot); + } + indexedMerklePath_.Add(other.indexedMerklePath_); + extraData_.Add(other.extraData_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Height = input.ReadInt64(); + break; + } + case 18: { + if (crossChainExtraData_ == null) { + CrossChainExtraData = new global::AElf.Standards.ACS7.CrossChainExtraData(); + } + input.ReadMessage(CrossChainExtraData); + break; + } + case 24: { + ChainId = input.ReadInt32(); + break; + } + case 34: { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + input.ReadMessage(TransactionStatusMerkleTreeRoot); + break; + } + case 42: { + indexedMerklePath_.AddEntriesFrom(input, _map_indexedMerklePath_codec); + break; + } + case 50: { + extraData_.AddEntriesFrom(input, _map_extraData_codec); + break; + } + } + } + } + + } + + public sealed partial class CrossChainExtraData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainExtraData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainExtraData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainExtraData(CrossChainExtraData other) : this() { + transactionStatusMerkleTreeRoot_ = other.transactionStatusMerkleTreeRoot_ != null ? other.transactionStatusMerkleTreeRoot_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainExtraData Clone() { + return new CrossChainExtraData(this); + } + + /// Field number for the "transaction_status_merkle_tree_root" field. + public const int TransactionStatusMerkleTreeRootFieldNumber = 1; + private global::AElf.Types.Hash transactionStatusMerkleTreeRoot_; + /// + /// Merkle tree root of side chain block transaction status root. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash TransactionStatusMerkleTreeRoot { + get { return transactionStatusMerkleTreeRoot_; } + set { + transactionStatusMerkleTreeRoot_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainExtraData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainExtraData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TransactionStatusMerkleTreeRoot, other.TransactionStatusMerkleTreeRoot)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (transactionStatusMerkleTreeRoot_ != null) hash ^= TransactionStatusMerkleTreeRoot.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (transactionStatusMerkleTreeRoot_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TransactionStatusMerkleTreeRoot); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (transactionStatusMerkleTreeRoot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionStatusMerkleTreeRoot); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainExtraData other) { + if (other == null) { + return; + } + if (other.transactionStatusMerkleTreeRoot_ != null) { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + TransactionStatusMerkleTreeRoot.MergeFrom(other.TransactionStatusMerkleTreeRoot); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (transactionStatusMerkleTreeRoot_ == null) { + TransactionStatusMerkleTreeRoot = new global::AElf.Types.Hash(); + } + input.ReadMessage(TransactionStatusMerkleTreeRoot); + break; + } + } + } + } + + } + + public sealed partial class ChainIdAndHeightDict : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainIdAndHeightDict()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIdAndHeightDict() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIdAndHeightDict(ChainIdAndHeightDict other) : this() { + idHeightDict_ = other.idHeightDict_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIdAndHeightDict Clone() { + return new ChainIdAndHeightDict(this); + } + + /// Field number for the "id_height_dict" field. + public const int IdHeightDictFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_idHeightDict_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField idHeightDict_ = new pbc::MapField(); + /// + /// A collection of chain ids and heights, where the key is the chain id and the value is the height. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField IdHeightDict { + get { return idHeightDict_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainIdAndHeightDict); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainIdAndHeightDict other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!IdHeightDict.Equals(other.IdHeightDict)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= IdHeightDict.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + idHeightDict_.WriteTo(output, _map_idHeightDict_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += idHeightDict_.CalculateSize(_map_idHeightDict_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainIdAndHeightDict other) { + if (other == null) { + return; + } + idHeightDict_.Add(other.idHeightDict_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + idHeightDict_.AddEntriesFrom(input, _map_idHeightDict_codec); + break; + } + } + } + } + + } + + public sealed partial class SideChainIndexingInformationList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainIndexingInformationList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformationList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformationList(SideChainIndexingInformationList other) : this() { + indexingInformationList_ = other.indexingInformationList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformationList Clone() { + return new SideChainIndexingInformationList(this); + } + + /// Field number for the "indexing_information_list" field. + public const int IndexingInformationListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_indexingInformationList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Standards.ACS7.SideChainIndexingInformation.Parser); + private readonly pbc::RepeatedField indexingInformationList_ = new pbc::RepeatedField(); + /// + /// A list contains indexing information of side chains. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField IndexingInformationList { + get { return indexingInformationList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainIndexingInformationList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainIndexingInformationList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!indexingInformationList_.Equals(other.indexingInformationList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= indexingInformationList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + indexingInformationList_.WriteTo(output, _repeated_indexingInformationList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += indexingInformationList_.CalculateSize(_repeated_indexingInformationList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainIndexingInformationList other) { + if (other == null) { + return; + } + indexingInformationList_.Add(other.indexingInformationList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + indexingInformationList_.AddEntriesFrom(input, _repeated_indexingInformationList_codec); + break; + } + } + } + } + + } + + public sealed partial class SideChainIndexingInformation : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainIndexingInformation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformation(SideChainIndexingInformation other) : this() { + chainId_ = other.chainId_; + indexedHeight_ = other.indexedHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingInformation Clone() { + return new SideChainIndexingInformation(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "indexed_height" field. + public const int IndexedHeightFieldNumber = 2; + private long indexedHeight_; + /// + /// The indexed height. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexedHeight { + get { return indexedHeight_; } + set { + indexedHeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainIndexingInformation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainIndexingInformation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (IndexedHeight != other.IndexedHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (IndexedHeight != 0L) hash ^= IndexedHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (IndexedHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(IndexedHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (IndexedHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexedHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainIndexingInformation other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.IndexedHeight != 0L) { + IndexedHeight = other.IndexedHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 16: { + IndexedHeight = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class CrossChainBlockData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainBlockData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainBlockData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainBlockData(CrossChainBlockData other) : this() { + sideChainBlockDataList_ = other.sideChainBlockDataList_.Clone(); + parentChainBlockDataList_ = other.parentChainBlockDataList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainBlockData Clone() { + return new CrossChainBlockData(this); + } + + /// Field number for the "side_chain_block_data_list" field. + public const int SideChainBlockDataListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_sideChainBlockDataList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Standards.ACS7.SideChainBlockData.Parser); + private readonly pbc::RepeatedField sideChainBlockDataList_ = new pbc::RepeatedField(); + /// + /// The side chain block data list to index. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SideChainBlockDataList { + get { return sideChainBlockDataList_; } + } + + /// Field number for the "parent_chain_block_data_list" field. + public const int ParentChainBlockDataListFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_parentChainBlockDataList_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS7.ParentChainBlockData.Parser); + private readonly pbc::RepeatedField parentChainBlockDataList_ = new pbc::RepeatedField(); + /// + /// The parent chain block data list to index. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ParentChainBlockDataList { + get { return parentChainBlockDataList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainBlockData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainBlockData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!sideChainBlockDataList_.Equals(other.sideChainBlockDataList_)) return false; + if(!parentChainBlockDataList_.Equals(other.parentChainBlockDataList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= sideChainBlockDataList_.GetHashCode(); + hash ^= parentChainBlockDataList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + sideChainBlockDataList_.WriteTo(output, _repeated_sideChainBlockDataList_codec); + parentChainBlockDataList_.WriteTo(output, _repeated_parentChainBlockDataList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += sideChainBlockDataList_.CalculateSize(_repeated_sideChainBlockDataList_codec); + size += parentChainBlockDataList_.CalculateSize(_repeated_parentChainBlockDataList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainBlockData other) { + if (other == null) { + return; + } + sideChainBlockDataList_.Add(other.sideChainBlockDataList_); + parentChainBlockDataList_.Add(other.parentChainBlockDataList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + sideChainBlockDataList_.AddEntriesFrom(input, _repeated_sideChainBlockDataList_codec); + break; + } + case 18: { + parentChainBlockDataList_.AddEntriesFrom(input, _repeated_parentChainBlockDataList_codec); + break; + } + } + } + } + + } + + public sealed partial class CrossChainMerkleProofContext : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainMerkleProofContext()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainMerkleProofContext() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainMerkleProofContext(CrossChainMerkleProofContext other) : this() { + boundParentChainHeight_ = other.boundParentChainHeight_; + merklePathFromParentChain_ = other.merklePathFromParentChain_ != null ? other.merklePathFromParentChain_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainMerkleProofContext Clone() { + return new CrossChainMerkleProofContext(this); + } + + /// Field number for the "bound_parent_chain_height" field. + public const int BoundParentChainHeightFieldNumber = 1; + private long boundParentChainHeight_; + /// + /// The height of parent chain bound up with side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BoundParentChainHeight { + get { return boundParentChainHeight_; } + set { + boundParentChainHeight_ = value; + } + } + + /// Field number for the "merkle_path_from_parent_chain" field. + public const int MerklePathFromParentChainFieldNumber = 2; + private global::AElf.Types.MerklePath merklePathFromParentChain_; + /// + /// The merkle path generated from parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.MerklePath MerklePathFromParentChain { + get { return merklePathFromParentChain_; } + set { + merklePathFromParentChain_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainMerkleProofContext); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainMerkleProofContext other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BoundParentChainHeight != other.BoundParentChainHeight) return false; + if (!object.Equals(MerklePathFromParentChain, other.MerklePathFromParentChain)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BoundParentChainHeight != 0L) hash ^= BoundParentChainHeight.GetHashCode(); + if (merklePathFromParentChain_ != null) hash ^= MerklePathFromParentChain.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (BoundParentChainHeight != 0L) { + output.WriteRawTag(8); + output.WriteInt64(BoundParentChainHeight); + } + if (merklePathFromParentChain_ != null) { + output.WriteRawTag(18); + output.WriteMessage(MerklePathFromParentChain); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BoundParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BoundParentChainHeight); + } + if (merklePathFromParentChain_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerklePathFromParentChain); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainMerkleProofContext other) { + if (other == null) { + return; + } + if (other.BoundParentChainHeight != 0L) { + BoundParentChainHeight = other.BoundParentChainHeight; + } + if (other.merklePathFromParentChain_ != null) { + if (merklePathFromParentChain_ == null) { + MerklePathFromParentChain = new global::AElf.Types.MerklePath(); + } + MerklePathFromParentChain.MergeFrom(other.MerklePathFromParentChain); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BoundParentChainHeight = input.ReadInt64(); + break; + } + case 18: { + if (merklePathFromParentChain_ == null) { + MerklePathFromParentChain = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePathFromParentChain); + break; + } + } + } + } + + } + + public sealed partial class ChainInitializationData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainInitializationData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationData(ChainInitializationData other) : this() { + chainId_ = other.chainId_; + creator_ = other.creator_ != null ? other.creator_.Clone() : null; + creationTimestamp_ = other.creationTimestamp_ != null ? other.creationTimestamp_.Clone() : null; + creationHeightOnParentChain_ = other.creationHeightOnParentChain_; + chainCreatorPrivilegePreserved_ = other.chainCreatorPrivilegePreserved_; + parentChainTokenContractAddress_ = other.parentChainTokenContractAddress_ != null ? other.parentChainTokenContractAddress_.Clone() : null; + chainInitializationConsensusInfo_ = other.chainInitializationConsensusInfo_ != null ? other.chainInitializationConsensusInfo_.Clone() : null; + nativeTokenInfoData_ = other.nativeTokenInfoData_; + resourceTokenInfo_ = other.resourceTokenInfo_ != null ? other.resourceTokenInfo_.Clone() : null; + chainPrimaryTokenInfo_ = other.chainPrimaryTokenInfo_ != null ? other.chainPrimaryTokenInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationData Clone() { + return new ChainInitializationData(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The id of side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "creator" field. + public const int CreatorFieldNumber = 2; + private global::AElf.Types.Address creator_; + /// + /// The side chain creator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Creator { + get { return creator_; } + set { + creator_ = value; + } + } + + /// Field number for the "creation_timestamp" field. + public const int CreationTimestampFieldNumber = 3; + private global::Google.Protobuf.WellKnownTypes.Timestamp creationTimestamp_; + /// + /// The timestamp for side chain creation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp CreationTimestamp { + get { return creationTimestamp_; } + set { + creationTimestamp_ = value; + } + } + + /// Field number for the "creation_height_on_parent_chain" field. + public const int CreationHeightOnParentChainFieldNumber = 4; + private long creationHeightOnParentChain_; + /// + /// The height of side chain creation on parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long CreationHeightOnParentChain { + get { return creationHeightOnParentChain_; } + set { + creationHeightOnParentChain_ = value; + } + } + + /// Field number for the "chain_creator_privilege_preserved" field. + public const int ChainCreatorPrivilegePreservedFieldNumber = 5; + private bool chainCreatorPrivilegePreserved_; + /// + /// Creator privilege boolean flag: True if chain creator privilege preserved, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ChainCreatorPrivilegePreserved { + get { return chainCreatorPrivilegePreserved_; } + set { + chainCreatorPrivilegePreserved_ = value; + } + } + + /// Field number for the "parent_chain_token_contract_address" field. + public const int ParentChainTokenContractAddressFieldNumber = 6; + private global::AElf.Types.Address parentChainTokenContractAddress_; + /// + /// Parent chain token contract address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ParentChainTokenContractAddress { + get { return parentChainTokenContractAddress_; } + set { + parentChainTokenContractAddress_ = value; + } + } + + /// Field number for the "chain_initialization_consensus_info" field. + public const int ChainInitializationConsensusInfoFieldNumber = 7; + private global::AElf.Standards.ACS7.ChainInitializationConsensusInfo chainInitializationConsensusInfo_; + /// + /// Initial consensus information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.ChainInitializationConsensusInfo ChainInitializationConsensusInfo { + get { return chainInitializationConsensusInfo_; } + set { + chainInitializationConsensusInfo_ = value; + } + } + + /// Field number for the "native_token_info_data" field. + public const int NativeTokenInfoDataFieldNumber = 8; + private pb::ByteString nativeTokenInfoData_ = pb::ByteString.Empty; + /// + /// The native token info. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString NativeTokenInfoData { + get { return nativeTokenInfoData_; } + set { + nativeTokenInfoData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "resource_token_info" field. + public const int ResourceTokenInfoFieldNumber = 9; + private global::AElf.Standards.ACS7.ResourceTokenInfo resourceTokenInfo_; + /// + /// The resource token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.ResourceTokenInfo ResourceTokenInfo { + get { return resourceTokenInfo_; } + set { + resourceTokenInfo_ = value; + } + } + + /// Field number for the "chain_primary_token_info" field. + public const int ChainPrimaryTokenInfoFieldNumber = 10; + private global::AElf.Standards.ACS7.ChainPrimaryTokenInfo chainPrimaryTokenInfo_; + /// + /// The chain primary token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.ChainPrimaryTokenInfo ChainPrimaryTokenInfo { + get { return chainPrimaryTokenInfo_; } + set { + chainPrimaryTokenInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainInitializationData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainInitializationData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (!object.Equals(Creator, other.Creator)) return false; + if (!object.Equals(CreationTimestamp, other.CreationTimestamp)) return false; + if (CreationHeightOnParentChain != other.CreationHeightOnParentChain) return false; + if (ChainCreatorPrivilegePreserved != other.ChainCreatorPrivilegePreserved) return false; + if (!object.Equals(ParentChainTokenContractAddress, other.ParentChainTokenContractAddress)) return false; + if (!object.Equals(ChainInitializationConsensusInfo, other.ChainInitializationConsensusInfo)) return false; + if (NativeTokenInfoData != other.NativeTokenInfoData) return false; + if (!object.Equals(ResourceTokenInfo, other.ResourceTokenInfo)) return false; + if (!object.Equals(ChainPrimaryTokenInfo, other.ChainPrimaryTokenInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (creator_ != null) hash ^= Creator.GetHashCode(); + if (creationTimestamp_ != null) hash ^= CreationTimestamp.GetHashCode(); + if (CreationHeightOnParentChain != 0L) hash ^= CreationHeightOnParentChain.GetHashCode(); + if (ChainCreatorPrivilegePreserved != false) hash ^= ChainCreatorPrivilegePreserved.GetHashCode(); + if (parentChainTokenContractAddress_ != null) hash ^= ParentChainTokenContractAddress.GetHashCode(); + if (chainInitializationConsensusInfo_ != null) hash ^= ChainInitializationConsensusInfo.GetHashCode(); + if (NativeTokenInfoData.Length != 0) hash ^= NativeTokenInfoData.GetHashCode(); + if (resourceTokenInfo_ != null) hash ^= ResourceTokenInfo.GetHashCode(); + if (chainPrimaryTokenInfo_ != null) hash ^= ChainPrimaryTokenInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (creator_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Creator); + } + if (creationTimestamp_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CreationTimestamp); + } + if (CreationHeightOnParentChain != 0L) { + output.WriteRawTag(32); + output.WriteInt64(CreationHeightOnParentChain); + } + if (ChainCreatorPrivilegePreserved != false) { + output.WriteRawTag(40); + output.WriteBool(ChainCreatorPrivilegePreserved); + } + if (parentChainTokenContractAddress_ != null) { + output.WriteRawTag(50); + output.WriteMessage(ParentChainTokenContractAddress); + } + if (chainInitializationConsensusInfo_ != null) { + output.WriteRawTag(58); + output.WriteMessage(ChainInitializationConsensusInfo); + } + if (NativeTokenInfoData.Length != 0) { + output.WriteRawTag(66); + output.WriteBytes(NativeTokenInfoData); + } + if (resourceTokenInfo_ != null) { + output.WriteRawTag(74); + output.WriteMessage(ResourceTokenInfo); + } + if (chainPrimaryTokenInfo_ != null) { + output.WriteRawTag(82); + output.WriteMessage(ChainPrimaryTokenInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (creator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); + } + if (creationTimestamp_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreationTimestamp); + } + if (CreationHeightOnParentChain != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreationHeightOnParentChain); + } + if (ChainCreatorPrivilegePreserved != false) { + size += 1 + 1; + } + if (parentChainTokenContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ParentChainTokenContractAddress); + } + if (chainInitializationConsensusInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChainInitializationConsensusInfo); + } + if (NativeTokenInfoData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(NativeTokenInfoData); + } + if (resourceTokenInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResourceTokenInfo); + } + if (chainPrimaryTokenInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChainPrimaryTokenInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainInitializationData other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.creator_ != null) { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + Creator.MergeFrom(other.Creator); + } + if (other.creationTimestamp_ != null) { + if (creationTimestamp_ == null) { + CreationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + CreationTimestamp.MergeFrom(other.CreationTimestamp); + } + if (other.CreationHeightOnParentChain != 0L) { + CreationHeightOnParentChain = other.CreationHeightOnParentChain; + } + if (other.ChainCreatorPrivilegePreserved != false) { + ChainCreatorPrivilegePreserved = other.ChainCreatorPrivilegePreserved; + } + if (other.parentChainTokenContractAddress_ != null) { + if (parentChainTokenContractAddress_ == null) { + ParentChainTokenContractAddress = new global::AElf.Types.Address(); + } + ParentChainTokenContractAddress.MergeFrom(other.ParentChainTokenContractAddress); + } + if (other.chainInitializationConsensusInfo_ != null) { + if (chainInitializationConsensusInfo_ == null) { + ChainInitializationConsensusInfo = new global::AElf.Standards.ACS7.ChainInitializationConsensusInfo(); + } + ChainInitializationConsensusInfo.MergeFrom(other.ChainInitializationConsensusInfo); + } + if (other.NativeTokenInfoData.Length != 0) { + NativeTokenInfoData = other.NativeTokenInfoData; + } + if (other.resourceTokenInfo_ != null) { + if (resourceTokenInfo_ == null) { + ResourceTokenInfo = new global::AElf.Standards.ACS7.ResourceTokenInfo(); + } + ResourceTokenInfo.MergeFrom(other.ResourceTokenInfo); + } + if (other.chainPrimaryTokenInfo_ != null) { + if (chainPrimaryTokenInfo_ == null) { + ChainPrimaryTokenInfo = new global::AElf.Standards.ACS7.ChainPrimaryTokenInfo(); + } + ChainPrimaryTokenInfo.MergeFrom(other.ChainPrimaryTokenInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 18: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 26: { + if (creationTimestamp_ == null) { + CreationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(CreationTimestamp); + break; + } + case 32: { + CreationHeightOnParentChain = input.ReadInt64(); + break; + } + case 40: { + ChainCreatorPrivilegePreserved = input.ReadBool(); + break; + } + case 50: { + if (parentChainTokenContractAddress_ == null) { + ParentChainTokenContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ParentChainTokenContractAddress); + break; + } + case 58: { + if (chainInitializationConsensusInfo_ == null) { + ChainInitializationConsensusInfo = new global::AElf.Standards.ACS7.ChainInitializationConsensusInfo(); + } + input.ReadMessage(ChainInitializationConsensusInfo); + break; + } + case 66: { + NativeTokenInfoData = input.ReadBytes(); + break; + } + case 74: { + if (resourceTokenInfo_ == null) { + ResourceTokenInfo = new global::AElf.Standards.ACS7.ResourceTokenInfo(); + } + input.ReadMessage(ResourceTokenInfo); + break; + } + case 82: { + if (chainPrimaryTokenInfo_ == null) { + ChainPrimaryTokenInfo = new global::AElf.Standards.ACS7.ChainPrimaryTokenInfo(); + } + input.ReadMessage(ChainPrimaryTokenInfo); + break; + } + } + } + } + + } + + public sealed partial class ResourceTokenInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceTokenInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceTokenInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceTokenInfo(ResourceTokenInfo other) : this() { + resourceTokenListData_ = other.resourceTokenListData_; + initialResourceAmount_ = other.initialResourceAmount_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceTokenInfo Clone() { + return new ResourceTokenInfo(this); + } + + /// Field number for the "resource_token_list_data" field. + public const int ResourceTokenListDataFieldNumber = 1; + private pb::ByteString resourceTokenListData_ = pb::ByteString.Empty; + /// + /// The resource token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString ResourceTokenListData { + get { return resourceTokenListData_; } + set { + resourceTokenListData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "initial_resource_amount" field. + public const int InitialResourceAmountFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_initialResourceAmount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt32(16, 0), 18); + private readonly pbc::MapField initialResourceAmount_ = new pbc::MapField(); + /// + /// The initial resource token amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField InitialResourceAmount { + get { return initialResourceAmount_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ResourceTokenInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ResourceTokenInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ResourceTokenListData != other.ResourceTokenListData) return false; + if (!InitialResourceAmount.Equals(other.InitialResourceAmount)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ResourceTokenListData.Length != 0) hash ^= ResourceTokenListData.GetHashCode(); + hash ^= InitialResourceAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ResourceTokenListData.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(ResourceTokenListData); + } + initialResourceAmount_.WriteTo(output, _map_initialResourceAmount_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ResourceTokenListData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(ResourceTokenListData); + } + size += initialResourceAmount_.CalculateSize(_map_initialResourceAmount_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ResourceTokenInfo other) { + if (other == null) { + return; + } + if (other.ResourceTokenListData.Length != 0) { + ResourceTokenListData = other.ResourceTokenListData; + } + initialResourceAmount_.Add(other.initialResourceAmount_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ResourceTokenListData = input.ReadBytes(); + break; + } + case 18: { + initialResourceAmount_.AddEntriesFrom(input, _map_initialResourceAmount_codec); + break; + } + } + } + } + + } + + public sealed partial class ChainPrimaryTokenInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainPrimaryTokenInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenInfo(ChainPrimaryTokenInfo other) : this() { + chainPrimaryTokenData_ = other.chainPrimaryTokenData_; + sideChainTokenInitialIssueList_ = other.sideChainTokenInitialIssueList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenInfo Clone() { + return new ChainPrimaryTokenInfo(this); + } + + /// Field number for the "chain_primary_token_data" field. + public const int ChainPrimaryTokenDataFieldNumber = 1; + private pb::ByteString chainPrimaryTokenData_ = pb::ByteString.Empty; + /// + /// The side chain primary token data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString ChainPrimaryTokenData { + get { return chainPrimaryTokenData_; } + set { + chainPrimaryTokenData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "side_chain_token_initial_issue_list" field. + public const int SideChainTokenInitialIssueListFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_sideChainTokenInitialIssueList_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS7.SideChainTokenInitialIssue.Parser); + private readonly pbc::RepeatedField sideChainTokenInitialIssueList_ = new pbc::RepeatedField(); + /// + /// The side chain primary token initial issue list. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SideChainTokenInitialIssueList { + get { return sideChainTokenInitialIssueList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainPrimaryTokenInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainPrimaryTokenInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainPrimaryTokenData != other.ChainPrimaryTokenData) return false; + if(!sideChainTokenInitialIssueList_.Equals(other.sideChainTokenInitialIssueList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainPrimaryTokenData.Length != 0) hash ^= ChainPrimaryTokenData.GetHashCode(); + hash ^= sideChainTokenInitialIssueList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainPrimaryTokenData.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(ChainPrimaryTokenData); + } + sideChainTokenInitialIssueList_.WriteTo(output, _repeated_sideChainTokenInitialIssueList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainPrimaryTokenData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(ChainPrimaryTokenData); + } + size += sideChainTokenInitialIssueList_.CalculateSize(_repeated_sideChainTokenInitialIssueList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainPrimaryTokenInfo other) { + if (other == null) { + return; + } + if (other.ChainPrimaryTokenData.Length != 0) { + ChainPrimaryTokenData = other.ChainPrimaryTokenData; + } + sideChainTokenInitialIssueList_.Add(other.sideChainTokenInitialIssueList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainPrimaryTokenData = input.ReadBytes(); + break; + } + case 18: { + sideChainTokenInitialIssueList_.AddEntriesFrom(input, _repeated_sideChainTokenInitialIssueList_codec); + break; + } + } + } + } + + } + + public sealed partial class ChainInitializationConsensusInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainInitializationConsensusInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationConsensusInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationConsensusInfo(ChainInitializationConsensusInfo other) : this() { + initialConsensusData_ = other.initialConsensusData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainInitializationConsensusInfo Clone() { + return new ChainInitializationConsensusInfo(this); + } + + /// Field number for the "initial_consensus_data" field. + public const int InitialConsensusDataFieldNumber = 1; + private pb::ByteString initialConsensusData_ = pb::ByteString.Empty; + /// + /// Initial consensus data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString InitialConsensusData { + get { return initialConsensusData_; } + set { + initialConsensusData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainInitializationConsensusInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainInitializationConsensusInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InitialConsensusData != other.InitialConsensusData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (InitialConsensusData.Length != 0) hash ^= InitialConsensusData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (InitialConsensusData.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(InitialConsensusData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (InitialConsensusData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(InitialConsensusData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainInitializationConsensusInfo other) { + if (other == null) { + return; + } + if (other.InitialConsensusData.Length != 0) { + InitialConsensusData = other.InitialConsensusData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + InitialConsensusData = input.ReadBytes(); + break; + } + } + } + } + + } + + public sealed partial class SideChainCreationRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainCreationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequest(SideChainCreationRequest other) : this() { + indexingPrice_ = other.indexingPrice_; + lockedTokenAmount_ = other.lockedTokenAmount_; + isPrivilegePreserved_ = other.isPrivilegePreserved_; + sideChainTokenCreationRequest_ = other.sideChainTokenCreationRequest_ != null ? other.sideChainTokenCreationRequest_.Clone() : null; + sideChainTokenInitialIssueList_ = other.sideChainTokenInitialIssueList_.Clone(); + initialResourceAmount_ = other.initialResourceAmount_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequest Clone() { + return new SideChainCreationRequest(this); + } + + /// Field number for the "indexing_price" field. + public const int IndexingPriceFieldNumber = 1; + private long indexingPrice_; + /// + /// The cross chain indexing price. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexingPrice { + get { return indexingPrice_; } + set { + indexingPrice_ = value; + } + } + + /// Field number for the "locked_token_amount" field. + public const int LockedTokenAmountFieldNumber = 2; + private long lockedTokenAmount_; + /// + /// Initial locked balance for a new side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long LockedTokenAmount { + get { return lockedTokenAmount_; } + set { + lockedTokenAmount_ = value; + } + } + + /// Field number for the "is_privilege_preserved" field. + public const int IsPrivilegePreservedFieldNumber = 3; + private bool isPrivilegePreserved_; + /// + /// Creator privilege boolean flag: True if chain creator privilege preserved, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsPrivilegePreserved { + get { return isPrivilegePreserved_; } + set { + isPrivilegePreserved_ = value; + } + } + + /// Field number for the "side_chain_token_creation_request" field. + public const int SideChainTokenCreationRequestFieldNumber = 4; + private global::AElf.Standards.ACS7.SideChainTokenCreationRequest sideChainTokenCreationRequest_; + /// + /// Side chain token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.SideChainTokenCreationRequest SideChainTokenCreationRequest { + get { return sideChainTokenCreationRequest_; } + set { + sideChainTokenCreationRequest_ = value; + } + } + + /// Field number for the "side_chain_token_initial_issue_list" field. + public const int SideChainTokenInitialIssueListFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_sideChainTokenInitialIssueList_codec + = pb::FieldCodec.ForMessage(42, global::AElf.Standards.ACS7.SideChainTokenInitialIssue.Parser); + private readonly pbc::RepeatedField sideChainTokenInitialIssueList_ = new pbc::RepeatedField(); + /// + /// A list of accounts and amounts that will be issued when the chain starts. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SideChainTokenInitialIssueList { + get { return sideChainTokenInitialIssueList_; } + } + + /// Field number for the "initial_resource_amount" field. + public const int InitialResourceAmountFieldNumber = 6; + private static readonly pbc::MapField.Codec _map_initialResourceAmount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt32(16, 0), 50); + private readonly pbc::MapField initialResourceAmount_ = new pbc::MapField(); + /// + /// The initial rent resources. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField InitialResourceAmount { + get { return initialResourceAmount_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainCreationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainCreationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IndexingPrice != other.IndexingPrice) return false; + if (LockedTokenAmount != other.LockedTokenAmount) return false; + if (IsPrivilegePreserved != other.IsPrivilegePreserved) return false; + if (!object.Equals(SideChainTokenCreationRequest, other.SideChainTokenCreationRequest)) return false; + if(!sideChainTokenInitialIssueList_.Equals(other.sideChainTokenInitialIssueList_)) return false; + if (!InitialResourceAmount.Equals(other.InitialResourceAmount)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (IndexingPrice != 0L) hash ^= IndexingPrice.GetHashCode(); + if (LockedTokenAmount != 0L) hash ^= LockedTokenAmount.GetHashCode(); + if (IsPrivilegePreserved != false) hash ^= IsPrivilegePreserved.GetHashCode(); + if (sideChainTokenCreationRequest_ != null) hash ^= SideChainTokenCreationRequest.GetHashCode(); + hash ^= sideChainTokenInitialIssueList_.GetHashCode(); + hash ^= InitialResourceAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (IndexingPrice != 0L) { + output.WriteRawTag(8); + output.WriteInt64(IndexingPrice); + } + if (LockedTokenAmount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(LockedTokenAmount); + } + if (IsPrivilegePreserved != false) { + output.WriteRawTag(24); + output.WriteBool(IsPrivilegePreserved); + } + if (sideChainTokenCreationRequest_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SideChainTokenCreationRequest); + } + sideChainTokenInitialIssueList_.WriteTo(output, _repeated_sideChainTokenInitialIssueList_codec); + initialResourceAmount_.WriteTo(output, _map_initialResourceAmount_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (IndexingPrice != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexingPrice); + } + if (LockedTokenAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(LockedTokenAmount); + } + if (IsPrivilegePreserved != false) { + size += 1 + 1; + } + if (sideChainTokenCreationRequest_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SideChainTokenCreationRequest); + } + size += sideChainTokenInitialIssueList_.CalculateSize(_repeated_sideChainTokenInitialIssueList_codec); + size += initialResourceAmount_.CalculateSize(_map_initialResourceAmount_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainCreationRequest other) { + if (other == null) { + return; + } + if (other.IndexingPrice != 0L) { + IndexingPrice = other.IndexingPrice; + } + if (other.LockedTokenAmount != 0L) { + LockedTokenAmount = other.LockedTokenAmount; + } + if (other.IsPrivilegePreserved != false) { + IsPrivilegePreserved = other.IsPrivilegePreserved; + } + if (other.sideChainTokenCreationRequest_ != null) { + if (sideChainTokenCreationRequest_ == null) { + SideChainTokenCreationRequest = new global::AElf.Standards.ACS7.SideChainTokenCreationRequest(); + } + SideChainTokenCreationRequest.MergeFrom(other.SideChainTokenCreationRequest); + } + sideChainTokenInitialIssueList_.Add(other.sideChainTokenInitialIssueList_); + initialResourceAmount_.Add(other.initialResourceAmount_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IndexingPrice = input.ReadInt64(); + break; + } + case 16: { + LockedTokenAmount = input.ReadInt64(); + break; + } + case 24: { + IsPrivilegePreserved = input.ReadBool(); + break; + } + case 34: { + if (sideChainTokenCreationRequest_ == null) { + SideChainTokenCreationRequest = new global::AElf.Standards.ACS7.SideChainTokenCreationRequest(); + } + input.ReadMessage(SideChainTokenCreationRequest); + break; + } + case 42: { + sideChainTokenInitialIssueList_.AddEntriesFrom(input, _repeated_sideChainTokenInitialIssueList_codec); + break; + } + case 50: { + initialResourceAmount_.AddEntriesFrom(input, _map_initialResourceAmount_codec); + break; + } + } + } + } + + } + + public sealed partial class SideChainTokenCreationRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainTokenCreationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenCreationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenCreationRequest(SideChainTokenCreationRequest other) : this() { + sideChainTokenSymbol_ = other.sideChainTokenSymbol_; + sideChainTokenName_ = other.sideChainTokenName_; + sideChainTokenTotalSupply_ = other.sideChainTokenTotalSupply_; + sideChainTokenDecimals_ = other.sideChainTokenDecimals_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenCreationRequest Clone() { + return new SideChainTokenCreationRequest(this); + } + + /// Field number for the "side_chain_token_symbol" field. + public const int SideChainTokenSymbolFieldNumber = 1; + private string sideChainTokenSymbol_ = ""; + /// + /// Token symbol of the side chain to be created + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SideChainTokenSymbol { + get { return sideChainTokenSymbol_; } + set { + sideChainTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "side_chain_token_name" field. + public const int SideChainTokenNameFieldNumber = 2; + private string sideChainTokenName_ = ""; + /// + /// Token name of the side chain to be created + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SideChainTokenName { + get { return sideChainTokenName_; } + set { + sideChainTokenName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "side_chain_token_total_supply" field. + public const int SideChainTokenTotalSupplyFieldNumber = 3; + private long sideChainTokenTotalSupply_; + /// + /// Token total supply of the side chain to be created + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long SideChainTokenTotalSupply { + get { return sideChainTokenTotalSupply_; } + set { + sideChainTokenTotalSupply_ = value; + } + } + + /// Field number for the "side_chain_token_decimals" field. + public const int SideChainTokenDecimalsFieldNumber = 4; + private int sideChainTokenDecimals_; + /// + /// Token decimals of the side chain to be created + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SideChainTokenDecimals { + get { return sideChainTokenDecimals_; } + set { + sideChainTokenDecimals_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainTokenCreationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainTokenCreationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SideChainTokenSymbol != other.SideChainTokenSymbol) return false; + if (SideChainTokenName != other.SideChainTokenName) return false; + if (SideChainTokenTotalSupply != other.SideChainTokenTotalSupply) return false; + if (SideChainTokenDecimals != other.SideChainTokenDecimals) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (SideChainTokenSymbol.Length != 0) hash ^= SideChainTokenSymbol.GetHashCode(); + if (SideChainTokenName.Length != 0) hash ^= SideChainTokenName.GetHashCode(); + if (SideChainTokenTotalSupply != 0L) hash ^= SideChainTokenTotalSupply.GetHashCode(); + if (SideChainTokenDecimals != 0) hash ^= SideChainTokenDecimals.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (SideChainTokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SideChainTokenSymbol); + } + if (SideChainTokenName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SideChainTokenName); + } + if (SideChainTokenTotalSupply != 0L) { + output.WriteRawTag(24); + output.WriteInt64(SideChainTokenTotalSupply); + } + if (SideChainTokenDecimals != 0) { + output.WriteRawTag(32); + output.WriteInt32(SideChainTokenDecimals); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (SideChainTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SideChainTokenSymbol); + } + if (SideChainTokenName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SideChainTokenName); + } + if (SideChainTokenTotalSupply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(SideChainTokenTotalSupply); + } + if (SideChainTokenDecimals != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SideChainTokenDecimals); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainTokenCreationRequest other) { + if (other == null) { + return; + } + if (other.SideChainTokenSymbol.Length != 0) { + SideChainTokenSymbol = other.SideChainTokenSymbol; + } + if (other.SideChainTokenName.Length != 0) { + SideChainTokenName = other.SideChainTokenName; + } + if (other.SideChainTokenTotalSupply != 0L) { + SideChainTokenTotalSupply = other.SideChainTokenTotalSupply; + } + if (other.SideChainTokenDecimals != 0) { + SideChainTokenDecimals = other.SideChainTokenDecimals; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SideChainTokenSymbol = input.ReadString(); + break; + } + case 18: { + SideChainTokenName = input.ReadString(); + break; + } + case 24: { + SideChainTokenTotalSupply = input.ReadInt64(); + break; + } + case 32: { + SideChainTokenDecimals = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class SideChainTokenInitialIssue : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainTokenInitialIssue()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenInitialIssue() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenInitialIssue(SideChainTokenInitialIssue other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainTokenInitialIssue Clone() { + return new SideChainTokenInitialIssue(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The account that will be issued. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount that will be issued. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainTokenInitialIssue); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainTokenInitialIssue other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainTokenInitialIssue other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class IndexedParentChainBlockData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IndexedParentChainBlockData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedParentChainBlockData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedParentChainBlockData(IndexedParentChainBlockData other) : this() { + localChainHeight_ = other.localChainHeight_; + parentChainBlockDataList_ = other.parentChainBlockDataList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedParentChainBlockData Clone() { + return new IndexedParentChainBlockData(this); + } + + /// Field number for the "local_chain_height" field. + public const int LocalChainHeightFieldNumber = 1; + private long localChainHeight_; + /// + /// The height of the local chain when indexing the parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long LocalChainHeight { + get { return localChainHeight_; } + set { + localChainHeight_ = value; + } + } + + /// Field number for the "parent_chain_block_data_list" field. + public const int ParentChainBlockDataListFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_parentChainBlockDataList_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS7.ParentChainBlockData.Parser); + private readonly pbc::RepeatedField parentChainBlockDataList_ = new pbc::RepeatedField(); + /// + /// Parent chain block data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ParentChainBlockDataList { + get { return parentChainBlockDataList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IndexedParentChainBlockData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IndexedParentChainBlockData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LocalChainHeight != other.LocalChainHeight) return false; + if(!parentChainBlockDataList_.Equals(other.parentChainBlockDataList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (LocalChainHeight != 0L) hash ^= LocalChainHeight.GetHashCode(); + hash ^= parentChainBlockDataList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (LocalChainHeight != 0L) { + output.WriteRawTag(8); + output.WriteInt64(LocalChainHeight); + } + parentChainBlockDataList_.WriteTo(output, _repeated_parentChainBlockDataList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (LocalChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(LocalChainHeight); + } + size += parentChainBlockDataList_.CalculateSize(_repeated_parentChainBlockDataList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IndexedParentChainBlockData other) { + if (other == null) { + return; + } + if (other.LocalChainHeight != 0L) { + LocalChainHeight = other.LocalChainHeight; + } + parentChainBlockDataList_.Add(other.parentChainBlockDataList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + LocalChainHeight = input.ReadInt64(); + break; + } + case 18: { + parentChainBlockDataList_.AddEntriesFrom(input, _repeated_parentChainBlockDataList_codec); + break; + } + } + } + } + + } + + public sealed partial class IndexedSideChainBlockData : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IndexedSideChainBlockData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedSideChainBlockData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedSideChainBlockData(IndexedSideChainBlockData other) : this() { + sideChainBlockDataList_ = other.sideChainBlockDataList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IndexedSideChainBlockData Clone() { + return new IndexedSideChainBlockData(this); + } + + /// Field number for the "side_chain_block_data_list" field. + public const int SideChainBlockDataListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_sideChainBlockDataList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Standards.ACS7.SideChainBlockData.Parser); + private readonly pbc::RepeatedField sideChainBlockDataList_ = new pbc::RepeatedField(); + /// + /// Side chain block data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SideChainBlockDataList { + get { return sideChainBlockDataList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IndexedSideChainBlockData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IndexedSideChainBlockData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!sideChainBlockDataList_.Equals(other.sideChainBlockDataList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= sideChainBlockDataList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + sideChainBlockDataList_.WriteTo(output, _repeated_sideChainBlockDataList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += sideChainBlockDataList_.CalculateSize(_repeated_sideChainBlockDataList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IndexedSideChainBlockData other) { + if (other == null) { + return; + } + sideChainBlockDataList_.Add(other.sideChainBlockDataList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + sideChainBlockDataList_.AddEntriesFrom(input, _repeated_sideChainBlockDataList_codec); + break; + } + } + } + } + + } + + public sealed partial class ReleaseCrossChainIndexingProposalInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReleaseCrossChainIndexingProposalInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseCrossChainIndexingProposalInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseCrossChainIndexingProposalInput(ReleaseCrossChainIndexingProposalInput other) : this() { + chainIdList_ = other.chainIdList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseCrossChainIndexingProposalInput Clone() { + return new ReleaseCrossChainIndexingProposalInput(this); + } + + /// Field number for the "chain_id_list" field. + public const int ChainIdListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_chainIdList_codec + = pb::FieldCodec.ForInt32(10); + private readonly pbc::RepeatedField chainIdList_ = new pbc::RepeatedField(); + /// + /// List of chain ids to release. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ChainIdList { + get { return chainIdList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReleaseCrossChainIndexingProposalInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReleaseCrossChainIndexingProposalInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!chainIdList_.Equals(other.chainIdList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= chainIdList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + chainIdList_.WriteTo(output, _repeated_chainIdList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += chainIdList_.CalculateSize(_repeated_chainIdList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReleaseCrossChainIndexingProposalInput other) { + if (other == null) { + return; + } + chainIdList_.Add(other.chainIdList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + chainIdList_.AddEntriesFrom(input, _repeated_chainIdList_codec); + break; + } + } + } + } + + } + + public sealed partial class CreateSideChainInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateSideChainInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateSideChainInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateSideChainInput(CreateSideChainInput other) : this() { + sideChainCreationRequest_ = other.sideChainCreationRequest_ != null ? other.sideChainCreationRequest_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateSideChainInput Clone() { + return new CreateSideChainInput(this); + } + + /// Field number for the "side_chain_creation_request" field. + public const int SideChainCreationRequestFieldNumber = 1; + private global::AElf.Standards.ACS7.SideChainCreationRequest sideChainCreationRequest_; + /// + /// The request information of the side chain creation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.SideChainCreationRequest SideChainCreationRequest { + get { return sideChainCreationRequest_; } + set { + sideChainCreationRequest_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 2; + private global::AElf.Types.Address proposer_; + /// + /// The proposer of the side chain creation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateSideChainInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateSideChainInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SideChainCreationRequest, other.SideChainCreationRequest)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (sideChainCreationRequest_ != null) hash ^= SideChainCreationRequest.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (sideChainCreationRequest_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SideChainCreationRequest); + } + if (proposer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Proposer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (sideChainCreationRequest_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SideChainCreationRequest); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateSideChainInput other) { + if (other == null) { + return; + } + if (other.sideChainCreationRequest_ != null) { + if (sideChainCreationRequest_ == null) { + SideChainCreationRequest = new global::AElf.Standards.ACS7.SideChainCreationRequest(); + } + SideChainCreationRequest.MergeFrom(other.SideChainCreationRequest); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (sideChainCreationRequest_ == null) { + SideChainCreationRequest = new global::AElf.Standards.ACS7.SideChainCreationRequest(); + } + input.ReadMessage(SideChainCreationRequest); + break; + } + case 18: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + } + } + } + + } + + public sealed partial class ReleaseSideChainCreationInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReleaseSideChainCreationInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseSideChainCreationInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseSideChainCreationInput(ReleaseSideChainCreationInput other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReleaseSideChainCreationInput Clone() { + return new ReleaseSideChainCreationInput(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The proposal id of side chain creation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReleaseSideChainCreationInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReleaseSideChainCreationInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReleaseSideChainCreationInput other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + } + } + } + + } + + public sealed partial class AdjustIndexingFeeInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdjustIndexingFeeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdjustIndexingFeeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdjustIndexingFeeInput(AdjustIndexingFeeInput other) : this() { + sideChainId_ = other.sideChainId_; + indexingFee_ = other.indexingFee_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdjustIndexingFeeInput Clone() { + return new AdjustIndexingFeeInput(this); + } + + /// Field number for the "side_chain_id" field. + public const int SideChainIdFieldNumber = 1; + private int sideChainId_; + /// + /// The side chain id to adjust. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SideChainId { + get { return sideChainId_; } + set { + sideChainId_ = value; + } + } + + /// Field number for the "indexing_fee" field. + public const int IndexingFeeFieldNumber = 2; + private long indexingFee_; + /// + /// The new price of indexing fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexingFee { + get { return indexingFee_; } + set { + indexingFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AdjustIndexingFeeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AdjustIndexingFeeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SideChainId != other.SideChainId) return false; + if (IndexingFee != other.IndexingFee) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (SideChainId != 0) hash ^= SideChainId.GetHashCode(); + if (IndexingFee != 0L) hash ^= IndexingFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (SideChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(SideChainId); + } + if (IndexingFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(IndexingFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (SideChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SideChainId); + } + if (IndexingFee != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexingFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AdjustIndexingFeeInput other) { + if (other == null) { + return; + } + if (other.SideChainId != 0) { + SideChainId = other.SideChainId; + } + if (other.IndexingFee != 0L) { + IndexingFee = other.IndexingFee; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SideChainId = input.ReadInt32(); + break; + } + case 16: { + IndexingFee = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class SideChainBlockDataIndexed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainBlockDataIndexed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockDataIndexed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockDataIndexed(SideChainBlockDataIndexed other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainBlockDataIndexed Clone() { + return new SideChainBlockDataIndexed(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainBlockDataIndexed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainBlockDataIndexed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainBlockDataIndexed other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + } + + } + + public sealed partial class CrossChainIndexingDataProposedEvent : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainIndexingDataProposedEvent()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[23]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingDataProposedEvent() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingDataProposedEvent(CrossChainIndexingDataProposedEvent other) : this() { + proposedCrossChainData_ = other.proposedCrossChainData_ != null ? other.proposedCrossChainData_.Clone() : null; + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingDataProposedEvent Clone() { + return new CrossChainIndexingDataProposedEvent(this); + } + + /// Field number for the "proposed_cross_chain_data" field. + public const int ProposedCrossChainDataFieldNumber = 1; + private global::AElf.Standards.ACS7.CrossChainBlockData proposedCrossChainData_; + /// + /// Proposed cross chain data to be indexed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.CrossChainBlockData ProposedCrossChainData { + get { return proposedCrossChainData_; } + set { + proposedCrossChainData_ = value; + } + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 2; + private global::AElf.Types.Hash proposalId_; + /// + /// The proposal id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainIndexingDataProposedEvent); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainIndexingDataProposedEvent other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposedCrossChainData, other.ProposedCrossChainData)) return false; + if (!object.Equals(ProposalId, other.ProposalId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposedCrossChainData_ != null) hash ^= ProposedCrossChainData.GetHashCode(); + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposedCrossChainData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposedCrossChainData); + } + if (proposalId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ProposalId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposedCrossChainData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedCrossChainData); + } + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainIndexingDataProposedEvent other) { + if (other == null) { + return; + } + if (other.proposedCrossChainData_ != null) { + if (proposedCrossChainData_ == null) { + ProposedCrossChainData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + ProposedCrossChainData.MergeFrom(other.ProposedCrossChainData); + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposedCrossChainData_ == null) { + ProposedCrossChainData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + input.ReadMessage(ProposedCrossChainData); + break; + } + case 18: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + } + } + } + + } + + public sealed partial class VerifyTransactionInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifyTransactionInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS7.Acs7Reflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VerifyTransactionInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VerifyTransactionInput(VerifyTransactionInput other) : this() { + transactionId_ = other.transactionId_ != null ? other.transactionId_.Clone() : null; + path_ = other.path_ != null ? other.path_.Clone() : null; + parentChainHeight_ = other.parentChainHeight_; + verifiedChainId_ = other.verifiedChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VerifyTransactionInput Clone() { + return new VerifyTransactionInput(this); + } + + /// Field number for the "transaction_id" field. + public const int TransactionIdFieldNumber = 1; + private global::AElf.Types.Hash transactionId_; + /// + /// The cross chain transaction id to verify. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash TransactionId { + get { return transactionId_; } + set { + transactionId_ = value; + } + } + + /// Field number for the "path" field. + public const int PathFieldNumber = 2; + private global::AElf.Types.MerklePath path_; + /// + /// The merkle path of the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.MerklePath Path { + get { return path_; } + set { + path_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 3; + private long parentChainHeight_; + /// + /// The height of parent chain that indexing this transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "verified_chain_id" field. + public const int VerifiedChainIdFieldNumber = 4; + private int verifiedChainId_; + /// + /// The chain if to verify. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int VerifiedChainId { + get { return verifiedChainId_; } + set { + verifiedChainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as VerifyTransactionInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(VerifyTransactionInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TransactionId, other.TransactionId)) return false; + if (!object.Equals(Path, other.Path)) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (VerifiedChainId != other.VerifiedChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (transactionId_ != null) hash ^= TransactionId.GetHashCode(); + if (path_ != null) hash ^= Path.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (VerifiedChainId != 0) hash ^= VerifiedChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (transactionId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TransactionId); + } + if (path_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Path); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(24); + output.WriteInt64(ParentChainHeight); + } + if (VerifiedChainId != 0) { + output.WriteRawTag(32); + output.WriteInt32(VerifiedChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (transactionId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionId); + } + if (path_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Path); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (VerifiedChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VerifiedChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(VerifyTransactionInput other) { + if (other == null) { + return; + } + if (other.transactionId_ != null) { + if (transactionId_ == null) { + TransactionId = new global::AElf.Types.Hash(); + } + TransactionId.MergeFrom(other.TransactionId); + } + if (other.path_ != null) { + if (path_ == null) { + Path = new global::AElf.Types.MerklePath(); + } + Path.MergeFrom(other.Path); + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.VerifiedChainId != 0) { + VerifiedChainId = other.VerifiedChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (transactionId_ == null) { + TransactionId = new global::AElf.Types.Hash(); + } + input.ReadMessage(TransactionId); + break; + } + case 18: { + if (path_ == null) { + Path = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(Path); + break; + } + case 24: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 32: { + VerifiedChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/AuthorityInfo.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/AuthorityInfo.g.cs new file mode 100644 index 0000000..cddfa74 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/AuthorityInfo.g.cs @@ -0,0 +1,217 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: authority_info.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from authority_info.proto +public static partial class AuthorityInfoReflection { + + #region Descriptor + /// File descriptor for authority_info.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AuthorityInfoReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRhdXRob3JpdHlfaW5mby5wcm90bxoPYWVsZi9jb3JlLnByb3RvIl4KDUF1", + "dGhvcml0eUluZm8SJwoQY29udHJhY3RfYWRkcmVzcxgBIAEoCzINLmFlbGYu", + "QWRkcmVzcxIkCg1vd25lcl9hZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNz", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AuthorityInfo), global::AuthorityInfo.Parser, new[]{ "ContractAddress", "OwnerAddress" }, null, null, null, null) + })); + } + #endregion + +} +#region Messages +public sealed partial class AuthorityInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AuthorityInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AuthorityInfoReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AuthorityInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AuthorityInfo(AuthorityInfo other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + ownerAddress_ = other.ownerAddress_ != null ? other.ownerAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AuthorityInfo Clone() { + return new AuthorityInfo(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address of the controller. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "owner_address" field. + public const int OwnerAddressFieldNumber = 2; + private global::AElf.Types.Address ownerAddress_; + /// + /// The address of the owner of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address OwnerAddress { + get { return ownerAddress_; } + set { + ownerAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AuthorityInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AuthorityInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (!object.Equals(OwnerAddress, other.OwnerAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (ownerAddress_ != null) hash ^= OwnerAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (ownerAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OwnerAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (ownerAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OwnerAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AuthorityInfo other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.ownerAddress_ != null) { + if (ownerAddress_ == null) { + OwnerAddress = new global::AElf.Types.Address(); + } + OwnerAddress.MergeFrom(other.OwnerAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + if (ownerAddress_ == null) { + OwnerAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OwnerAddress); + break; + } + } + } + } + +} + +#endregion + + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.c.cs new file mode 100644 index 0000000..868be47 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.c.cs @@ -0,0 +1,138 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bridge_contract.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Contracts.Bridge { + + #region Events + public partial class SwapRatioChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public SwapRatioChanged GetNonIndexed() + { + return new SwapRatioChanged + { + SwapId = SwapId, + NewSwapRatio = NewSwapRatio, + TargetTokenSymbol = TargetTokenSymbol, + }; + } + } + + public partial class TokenSwapped : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public TokenSwapped GetNonIndexed() + { + return new TokenSwapped + { + Address = Address, + Amount = Amount, + Symbol = Symbol, + ReceiptId = ReceiptId, + FromChainId = FromChainId, + }; + } + } + + public partial class SwapInfoAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public SwapInfoAdded GetNonIndexed() + { + return new SwapInfoAdded + { + SwapId = SwapId, + FromChainId = FromChainId, + Symbol = Symbol, + }; + } + } + + public partial class TokenWhitelistAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public TokenWhitelistAdded GetNonIndexed() + { + return new TokenWhitelistAdded + { + ChainTokenList = ChainTokenList, + }; + } + } + + public partial class TokenWhitelistRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public TokenWhitelistRemoved GetNonIndexed() + { + return new TokenWhitelistRemoved + { + ChainTokenList = ChainTokenList, + }; + } + } + + public partial class ReceiptCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public ReceiptCreated GetNonIndexed() + { + return new ReceiptCreated + { + ReceiptId = ReceiptId, + Symbol = Symbol, + Owner = Owner, + TargetAddress = TargetAddress, + Amount = Amount, + TargetChainId = TargetChainId, + }; + } + } + + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.g.cs new file mode 100644 index 0000000..78e60d8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContract.g.cs @@ -0,0 +1,12480 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bridge_contract.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Contracts.Bridge { + + /// Holder for reflection information generated from bridge_contract.proto + public static partial class BridgeContractReflection { + + #region Descriptor + /// File descriptor for bridge_contract.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BridgeContractReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChVicmlkZ2VfY29udHJhY3QucHJvdG8aD2FlbGYvY29yZS5wcm90bxoSYWVs", + "Zi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8a", + "H2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8aHmdvb2dsZS9wcm90", + "b2J1Zi93cmFwcGVycy5wcm90bxoUY2FsbGJhY2tfaW5wdXQucHJvdG8aC2Fj", + "czEzLnByb3RvGhNyZWNlaXB0X21ha2VyLnByb3RvGhRhdXRob3JpdHlfaW5m", + "by5wcm90byLGAgoPSW5pdGlhbGl6ZUlucHV0Ei4KF29yYWNsZV9jb250cmFj", + "dF9hZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEjMKHG1lcmtsZV90cmVl", + "X2NvbnRyYWN0X2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSMAoZcmVn", + "aW1lbnRfY29udHJhY3RfYWRkcmVzcxgDIAEoCzINLmFlbGYuQWRkcmVzcxIu", + "ChdyZXBvcnRfY29udHJhY3RfYWRkcmVzcxgEIAEoCzINLmFlbGYuQWRkcmVz", + "cxIcCgVhZG1pbhgFIAEoCzINLmFlbGYuQWRkcmVzcxIhCgpjb250cm9sbGVy", + "GAYgASgLMg0uYWVsZi5BZGRyZXNzEisKFG9yZ2FuaXphdGlvbl9hZGRyZXNz", + "GAcgASgLMg0uYWVsZi5BZGRyZXNzIjsKFVNldE1heGltdW1BbW91bnRJbnB1", + "dBIiCgV2YWx1ZRgBIAMoCzITLlRva2VuTWF4aW11bUFtb3VudCI8ChJUb2tl", + "bk1heGltdW1BbW91bnQSDgoGc3ltYm9sGAEgASgJEhYKDm1heGltdW1fYW1v", + "dW50GAIgASgDIioKFEFwcHJvdmVUcmFuc2ZlcklucHV0EhIKCnJlY2VpcHRf", + "aWQYASABKAkiOwoZSXNUcmFuc2ZlckNhblJlY2VpdmVJbnB1dBIOCgZzeW1i", + "b2wYASABKAkSDgoGYW1vdW50GAIgASgJIjcKCVN3YXBSYXRpbxIUCgxvcmln", + "aW5fc2hhcmUYASABKAMSFAoMdGFyZ2V0X3NoYXJlGAIgASgDIlgKD1N3YXBU", + "YXJnZXRUb2tlbhIOCgZzeW1ib2wYASABKAkSHgoKc3dhcF9yYXRpbxgCIAEo", + "CzIKLlN3YXBSYXRpbxIVCg1mcm9tX2NoYWluX2lkGAMgASgJIpgBCghTd2Fw", + "SW5mbxIbCgdzd2FwX2lkGAEgASgLMgouYWVsZi5IYXNoEjAKFnN3YXBfdGFy", + "Z2V0X3Rva2VuX2xpc3QYAiADKAsyEC5Td2FwVGFyZ2V0VG9rZW4SHwoLcmVn", + "aW1lbnRfaWQYAyABKAsyCi5hZWxmLkhhc2gSHAoIc3BhY2VfaWQYBCABKAsy", + "Ci5hZWxmLkhhc2giVQoMU3dhcFBhaXJJbmZvEhYKDnN3YXBwZWRfYW1vdW50", + "GAEgASgDEhUKDXN3YXBwZWRfdGltZXMYAiABKAMSFgoOZGVwb3NpdF9hbW91", + "bnQYAyABKAMiowEKC1N3YXBBbW91bnRzEh8KCHJlY2VpdmVyGAEgASgLMg0u", + "YWVsZi5BZGRyZXNzEjsKEHJlY2VpdmVkX2Ftb3VudHMYAiADKAsyIS5Td2Fw", + "QW1vdW50cy5SZWNlaXZlZEFtb3VudHNFbnRyeRo2ChRSZWNlaXZlZEFtb3Vu", + "dHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAM6AjgBIt0BCgtS", + "ZWNlaXB0SW5mbxISCgpyZWNlaXB0X2lkGAEgASgJEiMKD3JlY2VpdmluZ190", + "eF9pZBgCIAEoCzIKLmFlbGYuSGFzaBIyCg5yZWNlaXZpbmdfdGltZRgDIAEo", + "CzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLwoKYW1vdW50X21hcBgE", + "IAMoCzIbLlJlY2VpcHRJbmZvLkFtb3VudE1hcEVudHJ5GjAKDkFtb3VudE1h", + "cEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoAzoCOAEiLgoPUmVj", + "ZWlwdEluZm9MaXN0EhsKBXZhbHVlGAEgAygLMgwuUmVjZWlwdEluZm8iegoO", + "UmVjZWlwdEhhc2hNYXASKQoFdmFsdWUYASADKAsyGi5SZWNlaXB0SGFzaE1h", + "cC5WYWx1ZUVudHJ5Eg8KB3N3YXBfaWQYAiABKAkaLAoKVmFsdWVFbnRyeRIL", + "CgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIh4KDVJlY2VpcHRJZExp", + "c3QSDQoFdmFsdWUYASADKAkiMQoNUmVjZWlwdElkSW5mbxIQCghjaGFpbl9p", + "ZBgBIAEoCRIOCgZzeW1ib2wYAiABKAkiTgoLU2VuZGluZ0luZm8SEgoKcmVj", + "ZWlwdF9pZBgBIAEoAxIVCg1zZW5kaW5nX3R4X2lkGAIgASgJEhQKDHNlbmRp", + "bmdfdGltZRgDIAEoCSKEAQoPQ3JlYXRlU3dhcElucHV0EjAKFnN3YXBfdGFy", + "Z2V0X3Rva2VuX2xpc3QYASADKAsyEC5Td2FwVGFyZ2V0VG9rZW4SHwoLcmVn", + "aW1lbnRfaWQYAiABKAsyCi5hZWxmLkhhc2gSHgoWbWVya2xlX3RyZWVfbGVh", + "Zl9saW1pdBgDIAEoBSJYCgxEZXBvc2l0SW5wdXQSGwoHc3dhcF9pZBgBIAEo", + "CzIKLmFlbGYuSGFzaBIbChN0YXJnZXRfdG9rZW5fc3ltYm9sGAIgASgJEg4K", + "BmFtb3VudBgDIAEoAyJwChRDaGFuZ2VTd2FwUmF0aW9JbnB1dBIbCgdzd2Fw", + "X2lkGAEgASgLMgouYWVsZi5IYXNoEh4KCnN3YXBfcmF0aW8YAiABKAsyCi5T", + "d2FwUmF0aW8SGwoTdGFyZ2V0X3Rva2VuX3N5bWJvbBgDIAEoCSKBAQoOU3dh", + "cFRva2VuSW5wdXQSGwoHc3dhcF9pZBgBIAEoCzIKLmFlbGYuSGFzaBISCgpy", + "ZWNlaXB0X2lkGAIgASgJEhUKDW9yaWdpbl9hbW91bnQYAyABKAkSJwoQcmVj", + "ZWl2ZXJfYWRkcmVzcxgEIAEoCzINLmFlbGYuQWRkcmVzcyJZCg1XaXRoZHJh", + "d0lucHV0EhsKB3N3YXBfaWQYASABKAsyCi5hZWxmLkhhc2gSGwoTdGFyZ2V0", + "X3Rva2VuX3N5bWJvbBgCIAEoCRIOCgZhbW91bnQYAyABKAMiRgoTR2V0U3dh", + "cEFtb3VudHNJbnB1dBIbCgdzd2FwX2lkGAEgASgLMgouYWVsZi5IYXNoEhIK", + "CnJlY2VpcHRfaWQYAiABKAkiQwoUR2V0U3dhcFBhaXJJbmZvSW5wdXQSGwoH", + "c3dhcF9pZBgBIAEoCzIKLmFlbGYuSGFzaBIOCgZzeW1ib2wYAiABKAkiZAoc", + "R2V0U3dhcHBlZFJlY2VpcHRJZExpc3RJbnB1dBIbCgdzd2FwX2lkGAEgASgL", + "MgouYWVsZi5IYXNoEicKEHJlY2VpdmVyX2FkZHJlc3MYAiABKAsyDS5hZWxm", + "LkFkZHJlc3MiZgoeR2V0U3dhcHBlZFJlY2VpcHRJbmZvTGlzdElucHV0EhsK", + "B3N3YXBfaWQYASABKAsyCi5hZWxmLkhhc2gSJwoQcmVjZWl2ZXJfYWRkcmVz", + "cxgCIAEoCzINLmFlbGYuQWRkcmVzcyJeCgdSZWNlaXB0Eg4KBnN5bWJvbBgB", + "IAEoCRIcCgVvd25lchgCIAEoCzINLmFlbGYuQWRkcmVzcxIVCg10YXJnZXRB", + "ZGRyZXNzGAMgASgJEg4KBmFtb3VudBgEIAEoAyImCgtSZWNlaXB0TGlzdBIX", + "CgV2YWx1ZRgBIAMoCzIILlJlY2VpcHQiLgoKQ2hhaW5Ub2tlbhIQCghjaGFp", + "bl9pZBgBIAEoCRIOCgZzeW1ib2wYAiABKAkiLAoOQ2hhaW5Ub2tlbkxpc3QS", + "GgoFdmFsdWUYASADKAsyCy5DaGFpblRva2VuIiEKD1Rva2VuU3ltYm9sTGlz", + "dBIOCgZzeW1ib2wYASADKAkiLwoIR2FzUHJpY2USEAoIY2hhaW5faWQYASAB", + "KAkSEQoJZ2FzX3ByaWNlGAIgASgDIi8KCEdhc0xpbWl0EhAKCGNoYWluX2lk", + "GAEgASgJEhEKCWdhc19saW1pdBgCIAEoAyI6CgpQcmljZVJhdGlvEhcKD3Rh", + "cmdldF9jaGFpbl9pZBgBIAEoCRITCgtwcmljZV9yYXRpbxgCIAEoAyIrCghG", + "ZWVSYXRpbxIQCghjaGFpbl9pZBgBIAEoCRINCgVyYXRpbxgCIAEoAyIrCg1B", + "ZGRUb2tlbklucHV0EhoKBXZhbHVlGAEgAygLMgsuQ2hhaW5Ub2tlbiIuChBS", + "ZW1vdmVUb2tlbklucHV0EhoKBXZhbHVlGAEgAygLMgsuQ2hhaW5Ub2tlbiKC", + "AQoSQ3JlYXRlUmVjZWlwdElucHV0Eg4KBnN5bWJvbBgBIAEoCRIcCgVvd25l", + "chgCIAEoCzINLmFlbGYuQWRkcmVzcxIVCg10YXJnZXRBZGRyZXNzGAMgASgJ", + "Eg4KBmFtb3VudBgEIAEoAxIXCg90YXJnZXRfY2hhaW5faWQYBSABKAkiNQoQ", + "U2V0R2FzTGltaXRJbnB1dBIhCg5nYXNfbGltaXRfbGlzdBgBIAMoCzIJLkdh", + "c0xpbWl0IjUKEFNldEdhc1ByaWNlSW5wdXQSIQoOZ2FzX3ByaWNlX2xpc3QY", + "ASADKAsyCS5HYXNQcmljZSIwChJTZXRQcmljZVJhdGlvSW5wdXQSGgoFdmFs", + "dWUYASADKAsyCy5QcmljZVJhdGlvIjQKGFNldEZlZUZsb2F0aW5nUmF0aW9J", + "bnB1dBIYCgV2YWx1ZRgBIAMoCzIJLkZlZVJhdGlvIikKE0dldFJlY2VpcHRJ", + "bmZvSW5wdXQSEgoKcmVjZWlwdF9pZBgBIAEoCSI4ChhHZXRPd25lckxvY2tS", + "ZWNlaXB0SW5wdXQSHAoFb3duZXIYASABKAsyDS5hZWxmLkFkZHJlc3MiMgoS", + "R2V0TG9ja1Rva2Vuc0lucHV0EhwKBW93bmVyGAEgASgLMg0uYWVsZi5BZGRy", + "ZXNzIjkKFUdldFN3YXBJZEJ5VG9rZW5JbnB1dBIQCghjaGFpbl9pZBgBIAEo", + "CRIOCgZzeW1ib2wYAiABKAkidgoQU3dhcFJhdGlvQ2hhbmdlZBIbCgdzd2Fw", + "X2lkGAEgASgLMgouYWVsZi5IYXNoEiIKDm5ld19zd2FwX3JhdGlvGAIgASgL", + "MgouU3dhcFJhdGlvEhsKE3RhcmdldF90b2tlbl9zeW1ib2wYAyABKAk6BKC7", + "GAEifwoMVG9rZW5Td2FwcGVkEh4KB2FkZHJlc3MYASABKAsyDS5hZWxmLkFk", + "ZHJlc3MSDgoGYW1vdW50GAIgASgDEg4KBnN5bWJvbBgDIAEoCRISCgpyZWNl", + "aXB0X2lkGAQgASgJEhUKDWZyb21fY2hhaW5faWQYBSABKAk6BKC7GAEiWQoN", + "U3dhcEluZm9BZGRlZBIbCgdzd2FwX2lkGAEgASgLMgouYWVsZi5IYXNoEhUK", + "DWZyb21fY2hhaW5faWQYAiABKAkSDgoGc3ltYm9sGAMgASgJOgSguxgBIkYK", + "E1Rva2VuV2hpdGVsaXN0QWRkZWQSKQoQY2hhaW5fdG9rZW5fbGlzdBgBIAEo", + "CzIPLkNoYWluVG9rZW5MaXN0OgSguxgBIkgKFVRva2VuV2hpdGVsaXN0UmVt", + "b3ZlZBIpChBjaGFpbl90b2tlbl9saXN0GAEgASgLMg8uQ2hhaW5Ub2tlbkxp", + "c3Q6BKC7GAEimAEKDlJlY2VpcHRDcmVhdGVkEhIKCnJlY2VpcHRfaWQYASAB", + "KAkSDgoGc3ltYm9sGAIgASgJEhwKBW93bmVyGAMgASgLMg0uYWVsZi5BZGRy", + "ZXNzEhUKDXRhcmdldEFkZHJlc3MYBCABKAkSDgoGYW1vdW50GAUgASgDEhcK", + "D3RhcmdldF9jaGFpbl9pZBgGIAEoCToEoLsYATLDHAoOQnJpZGdlQ29udHJh", + "Y3QSOAoKSW5pdGlhbGl6ZRIQLkluaXRpYWxpemVJbnB1dBoWLmdvb2dsZS5w", + "cm90b2J1Zi5FbXB0eSIAEjsKEENoYW5nZUNvbnRyb2xsZXISDS5hZWxmLkFk", + "ZHJlc3MaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI2CgtDaGFuZ2VBZG1p", + "bhINLmFlbGYuQWRkcmVzcxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkoK", + "HkNoYW5nZVRyYW5zYWN0aW9uRmVlQ29udHJvbGxlchIOLkF1dGhvcml0eUlu", + "Zm8aFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJEChlDaGFuZ2VSZXN0YXJ0", + "T3JnYW5pemF0aW9uEg0uYWVsZi5BZGRyZXNzGhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASQAoVQ2hhbmdlUGF1c2VDb250cm9sbGVyEg0uYWVsZi5BZGRy", + "ZXNzGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASOQoFUGF1c2USFi5nb29n", + "bGUucHJvdG9idWYuRW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI7", + "CgdSZXN0YXJ0EhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhYuZ29vZ2xlLnBy", + "b3RvYnVmLkVtcHR5IgASSQoVU2V0VG9rZW5NYXhpbXVtQW1vdW50EhYuU2V0", + "TWF4aW11bUFtb3VudElucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS", + "QgoPQXBwcm92ZVRyYW5zZmVyEhUuQXBwcm92ZVRyYW5zZmVySW5wdXQaFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkiABJQChRJc1RyYW5zZmVyQ2FuUmVjZWl2", + "ZRIaLklzVHJhbnNmZXJDYW5SZWNlaXZlSW5wdXQaGi5nb29nbGUucHJvdG9i", + "dWYuQm9vbFZhbHVlIgASRQoVR2V0Q29udHJhY3RDb250cm9sbGVyEhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5Gg0uYWVsZi5BZGRyZXNzIgWIifcBARJAChBH", + "ZXRDb250cmFjdEFkbWluEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Gg0uYWVs", + "Zi5BZGRyZXNzIgWIifcBARJRCiBHZXRUcmFuc2FjdGlvbkZlZVJhdGlvQ29u", + "dHJvbGxlchIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoOLkF1dGhvcml0eUlu", + "Zm8iBYiJ9wEBEkwKD0lzQ29udHJhY3RQYXVzZRIWLmdvb2dsZS5wcm90b2J1", + "Zi5FbXB0eRoaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUiBYiJ9wEBEkIK", + "EkdldFBhdXNlQ29udHJvbGxlchIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoN", + "LmFlbGYuQWRkcmVzcyIFiIn3AQESRgoWR2V0UmVzdGFydE9yZ2FuaXphdGlv", + "bhIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoNLmFlbGYuQWRkcmVzcyIFiIn3", + "AQESWQoVR2V0VG9rZW5NYXhpbXVtQW1vdW50EhwuZ29vZ2xlLnByb3RvYnVm", + "LlN0cmluZ1ZhbHVlGhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUiBYiJ", + "9wEBEkgKF0dldEFwcHJvdmVSZWNlaXB0SWRMaXN0EhYuZ29vZ2xlLnByb3Rv", + "YnVmLkVtcHR5Gg4uUmVjZWlwdElkTGlzdCIFiIn3AQESLAoKQ3JlYXRlU3dh", + "cBIQLkNyZWF0ZVN3YXBJbnB1dBoKLmFlbGYuSGFzaCIAEjYKCVN3YXBUb2tl", + "bhIPLlN3YXBUb2tlbklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS", + "QgoPQ2hhbmdlU3dhcFJhdGlvEhUuQ2hhbmdlU3dhcFJhdGlvSW5wdXQaFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkiABIyCgdEZXBvc2l0Eg0uRGVwb3NpdElu", + "cHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASNAoIV2l0aGRyYXcSDi5X", + "aXRoZHJhd0lucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASPQoRUmVj", + "b3JkUmVjZWlwdEhhc2gSDi5DYWxsYmFja0lucHV0GhYuZ29vZ2xlLnByb3Rv", + "YnVmLkVtcHR5IgASPQoQR2V0U3dhcElkQnlUb2tlbhIWLkdldFN3YXBJZEJ5", + "VG9rZW5JbnB1dBoKLmFlbGYuSGFzaCIFiIn3AQESKwoLR2V0U3dhcEluZm8S", + "Ci5hZWxmLkhhc2gaCS5Td2FwSW5mbyIFiIn3AQESPgoPR2V0U3dhcFBhaXJJ", + "bmZvEhUuR2V0U3dhcFBhaXJJbmZvSW5wdXQaDS5Td2FwUGFpckluZm8iBYiJ", + "9wEBEjsKDkdldFN3YXBBbW91bnRzEhQuR2V0U3dhcEFtb3VudHNJbnB1dBoM", + "LlN3YXBBbW91bnRzIgWIifcBARI3ChZHZXRSZWdpbWVudElkQnlTcGFjZUlk", + "EgouYWVsZi5IYXNoGgouYWVsZi5IYXNoIgWIifcBARJPChdHZXRTd2FwcGVk", + "UmVjZWlwdElkTGlzdBIdLkdldFN3YXBwZWRSZWNlaXB0SWRMaXN0SW5wdXQa", + "Di5SZWNlaXB0SWRMaXN0IgWIifcBARJVChlHZXRTd2FwcGVkUmVjZWlwdElu", + "Zm9MaXN0Eh8uR2V0U3dhcHBlZFJlY2VpcHRJbmZvTGlzdElucHV0GhAuUmVj", + "ZWlwdEluZm9MaXN0IgWIifcBARIzChJHZXRTcGFjZUlkQnlTd2FwSWQSCi5h", + "ZWxmLkhhc2gaCi5hZWxmLkhhc2giBYiJ9wEBEjQKCEFkZFRva2VuEg4uQWRk", + "VG9rZW5JbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjoKC1JlbW92", + "ZVRva2VuEhEuUmVtb3ZlVG9rZW5JbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5F", + "bXB0eSIAEj4KDUNyZWF0ZVJlY2VpcHQSEy5DcmVhdGVSZWNlaXB0SW5wdXQa", + "Fi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI6CgtTZXRHYXNMaW1pdBIRLlNl", + "dEdhc0xpbWl0SW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI6CgtT", + "ZXRHYXNQcmljZRIRLlNldEdhc1ByaWNlSW5wdXQaFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkiABI+Cg1TZXRQcmljZVJhdGlvEhMuU2V0UHJpY2VSYXRpb0lu", + "cHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASSgoTU2V0RmVlRmxvYXRp", + "bmdSYXRpbxIZLlNldEZlZUZsb2F0aW5nUmF0aW9JbnB1dBoWLmdvb2dsZS5w", + "cm90b2J1Zi5FbXB0eSIAEk8KFldpdGhkcmF3VHJhbnNhY3Rpb25GZWUSGy5n", + "b29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRoWLmdvb2dsZS5wcm90b2J1Zi5F", + "bXB0eSIAEk8KC0dldEdhc0xpbWl0EhwuZ29vZ2xlLnByb3RvYnVmLlN0cmlu", + "Z1ZhbHVlGhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUiBYiJ9wEBEk8K", + "C0dldEdhc1ByaWNlEhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlGhsu", + "Z29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUiBYiJ9wEBElEKDUdldFByaWNl", + "UmF0aW8SHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUaGy5nb29nbGUu", + "cHJvdG9idWYuSW50NjRWYWx1ZSIFiIn3AQESWAoTR2V0RmVlRmxvYXRpbmdS", + "YXRpbxIcLmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdWYWx1ZRocLmdvb2dsZS5w", + "cm90b2J1Zi5TdHJpbmdWYWx1ZSIFiIn3AQESUwoPR2V0RmVlQnlDaGFpbklk", + "EhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlGhsuZ29vZ2xlLnByb3Rv", + "YnVmLkludDY0VmFsdWUiBYiJ9wEBElYKGEdldEN1cnJlbnRUcmFuc2FjdGlv", + "bkZlZRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRobLmdvb2dsZS5wcm90b2J1", + "Zi5JbnQ2NFZhbHVlIgWIifcBARI1ChBHZXRSZWNlaXB0SWRJbmZvEgouYWVs", + "Zi5IYXNoGg4uUmVjZWlwdElkSW5mbyIFiIn3AQESRwoTR2V0T3duZXJMb2Nr", + "UmVjZWlwdBIZLkdldE93bmVyTG9ja1JlY2VpcHRJbnB1dBoOLlJlY2VpcHRJ", + "ZExpc3QiBYiJ9wEBEkgKDUdldExvY2tUb2tlbnMSEy5HZXRMb2NrVG9rZW5z", + "SW5wdXQaGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZSIFiIn3AQESNwoO", + "R2V0UmVjZWlwdEluZm8SFC5HZXRSZWNlaXB0SW5mb0lucHV0GgguUmVjZWlw", + "dCIFiIn3AQESSgoRR2V0VG9rZW5XaGl0ZWxpc3QSHC5nb29nbGUucHJvdG9i", + "dWYuU3RyaW5nVmFsdWUaEC5Ub2tlblN5bWJvbExpc3QiBYiJ9wEBGlayzPYB", + "KUFFbGYuQ29udHJhY3RzLkJyaWRnZS5CcmlkZ2VDb250cmFjdFN0YXRlysr2", + "AQthY3MxMy5wcm90b8rK9gETcmVjZWlwdF9tYWtlci5wcm90b0IYqgIVQUVs", + "Zi5Db250cmFjdHMuQnJpZGdlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.InitializeInput), global::AElf.Contracts.Bridge.InitializeInput.Parser, new[]{ "OracleContractAddress", "MerkleTreeContractAddress", "RegimentContractAddress", "ReportContractAddress", "Admin", "Controller", "OrganizationAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SetMaximumAmountInput), global::AElf.Contracts.Bridge.SetMaximumAmountInput.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.TokenMaximumAmount), global::AElf.Contracts.Bridge.TokenMaximumAmount.Parser, new[]{ "Symbol", "MaximumAmount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ApproveTransferInput), global::AElf.Contracts.Bridge.ApproveTransferInput.Parser, new[]{ "ReceiptId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.IsTransferCanReceiveInput), global::AElf.Contracts.Bridge.IsTransferCanReceiveInput.Parser, new[]{ "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapRatio), global::AElf.Contracts.Bridge.SwapRatio.Parser, new[]{ "OriginShare", "TargetShare" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapTargetToken), global::AElf.Contracts.Bridge.SwapTargetToken.Parser, new[]{ "Symbol", "SwapRatio", "FromChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapInfo), global::AElf.Contracts.Bridge.SwapInfo.Parser, new[]{ "SwapId", "SwapTargetTokenList", "RegimentId", "SpaceId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapPairInfo), global::AElf.Contracts.Bridge.SwapPairInfo.Parser, new[]{ "SwappedAmount", "SwappedTimes", "DepositAmount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapAmounts), global::AElf.Contracts.Bridge.SwapAmounts.Parser, new[]{ "Receiver", "ReceivedAmounts" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptInfo), global::AElf.Contracts.Bridge.ReceiptInfo.Parser, new[]{ "ReceiptId", "ReceivingTxId", "ReceivingTime", "AmountMap" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptInfoList), global::AElf.Contracts.Bridge.ReceiptInfoList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptHashMap), global::AElf.Contracts.Bridge.ReceiptHashMap.Parser, new[]{ "Value", "SwapId" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptIdList), global::AElf.Contracts.Bridge.ReceiptIdList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptIdInfo), global::AElf.Contracts.Bridge.ReceiptIdInfo.Parser, new[]{ "ChainId", "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SendingInfo), global::AElf.Contracts.Bridge.SendingInfo.Parser, new[]{ "ReceiptId", "SendingTxId", "SendingTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.CreateSwapInput), global::AElf.Contracts.Bridge.CreateSwapInput.Parser, new[]{ "SwapTargetTokenList", "RegimentId", "MerkleTreeLeafLimit" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.DepositInput), global::AElf.Contracts.Bridge.DepositInput.Parser, new[]{ "SwapId", "TargetTokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ChangeSwapRatioInput), global::AElf.Contracts.Bridge.ChangeSwapRatioInput.Parser, new[]{ "SwapId", "SwapRatio", "TargetTokenSymbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapTokenInput), global::AElf.Contracts.Bridge.SwapTokenInput.Parser, new[]{ "SwapId", "ReceiptId", "OriginAmount", "ReceiverAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.WithdrawInput), global::AElf.Contracts.Bridge.WithdrawInput.Parser, new[]{ "SwapId", "TargetTokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetSwapAmountsInput), global::AElf.Contracts.Bridge.GetSwapAmountsInput.Parser, new[]{ "SwapId", "ReceiptId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetSwapPairInfoInput), global::AElf.Contracts.Bridge.GetSwapPairInfoInput.Parser, new[]{ "SwapId", "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetSwappedReceiptIdListInput), global::AElf.Contracts.Bridge.GetSwappedReceiptIdListInput.Parser, new[]{ "SwapId", "ReceiverAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetSwappedReceiptInfoListInput), global::AElf.Contracts.Bridge.GetSwappedReceiptInfoListInput.Parser, new[]{ "SwapId", "ReceiverAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.Receipt), global::AElf.Contracts.Bridge.Receipt.Parser, new[]{ "Symbol", "Owner", "TargetAddress", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptList), global::AElf.Contracts.Bridge.ReceiptList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ChainToken), global::AElf.Contracts.Bridge.ChainToken.Parser, new[]{ "ChainId", "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ChainTokenList), global::AElf.Contracts.Bridge.ChainTokenList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.TokenSymbolList), global::AElf.Contracts.Bridge.TokenSymbolList.Parser, new[]{ "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GasPrice), global::AElf.Contracts.Bridge.GasPrice.Parser, new[]{ "ChainId", "GasPrice_" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GasLimit), global::AElf.Contracts.Bridge.GasLimit.Parser, new[]{ "ChainId", "GasLimit_" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.PriceRatio), global::AElf.Contracts.Bridge.PriceRatio.Parser, new[]{ "TargetChainId", "PriceRatio_" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.FeeRatio), global::AElf.Contracts.Bridge.FeeRatio.Parser, new[]{ "ChainId", "Ratio" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.AddTokenInput), global::AElf.Contracts.Bridge.AddTokenInput.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.RemoveTokenInput), global::AElf.Contracts.Bridge.RemoveTokenInput.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.CreateReceiptInput), global::AElf.Contracts.Bridge.CreateReceiptInput.Parser, new[]{ "Symbol", "Owner", "TargetAddress", "Amount", "TargetChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SetGasLimitInput), global::AElf.Contracts.Bridge.SetGasLimitInput.Parser, new[]{ "GasLimitList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SetGasPriceInput), global::AElf.Contracts.Bridge.SetGasPriceInput.Parser, new[]{ "GasPriceList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SetPriceRatioInput), global::AElf.Contracts.Bridge.SetPriceRatioInput.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SetFeeFloatingRatioInput), global::AElf.Contracts.Bridge.SetFeeFloatingRatioInput.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetReceiptInfoInput), global::AElf.Contracts.Bridge.GetReceiptInfoInput.Parser, new[]{ "ReceiptId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetOwnerLockReceiptInput), global::AElf.Contracts.Bridge.GetOwnerLockReceiptInput.Parser, new[]{ "Owner" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetLockTokensInput), global::AElf.Contracts.Bridge.GetLockTokensInput.Parser, new[]{ "Owner" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.GetSwapIdByTokenInput), global::AElf.Contracts.Bridge.GetSwapIdByTokenInput.Parser, new[]{ "ChainId", "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapRatioChanged), global::AElf.Contracts.Bridge.SwapRatioChanged.Parser, new[]{ "SwapId", "NewSwapRatio", "TargetTokenSymbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.TokenSwapped), global::AElf.Contracts.Bridge.TokenSwapped.Parser, new[]{ "Address", "Amount", "Symbol", "ReceiptId", "FromChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.SwapInfoAdded), global::AElf.Contracts.Bridge.SwapInfoAdded.Parser, new[]{ "SwapId", "FromChainId", "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.TokenWhitelistAdded), global::AElf.Contracts.Bridge.TokenWhitelistAdded.Parser, new[]{ "ChainTokenList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.TokenWhitelistRemoved), global::AElf.Contracts.Bridge.TokenWhitelistRemoved.Parser, new[]{ "ChainTokenList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Bridge.ReceiptCreated), global::AElf.Contracts.Bridge.ReceiptCreated.Parser, new[]{ "ReceiptId", "Symbol", "Owner", "TargetAddress", "Amount", "TargetChainId" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class InitializeInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitializeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput(InitializeInput other) : this() { + oracleContractAddress_ = other.oracleContractAddress_ != null ? other.oracleContractAddress_.Clone() : null; + merkleTreeContractAddress_ = other.merkleTreeContractAddress_ != null ? other.merkleTreeContractAddress_.Clone() : null; + regimentContractAddress_ = other.regimentContractAddress_ != null ? other.regimentContractAddress_.Clone() : null; + reportContractAddress_ = other.reportContractAddress_ != null ? other.reportContractAddress_.Clone() : null; + admin_ = other.admin_ != null ? other.admin_.Clone() : null; + controller_ = other.controller_ != null ? other.controller_.Clone() : null; + organizationAddress_ = other.organizationAddress_ != null ? other.organizationAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput Clone() { + return new InitializeInput(this); + } + + /// Field number for the "oracle_contract_address" field. + public const int OracleContractAddressFieldNumber = 1; + private global::AElf.Types.Address oracleContractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address OracleContractAddress { + get { return oracleContractAddress_; } + set { + oracleContractAddress_ = value; + } + } + + /// Field number for the "merkle_tree_contract_address" field. + public const int MerkleTreeContractAddressFieldNumber = 2; + private global::AElf.Types.Address merkleTreeContractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address MerkleTreeContractAddress { + get { return merkleTreeContractAddress_; } + set { + merkleTreeContractAddress_ = value; + } + } + + /// Field number for the "regiment_contract_address" field. + public const int RegimentContractAddressFieldNumber = 3; + private global::AElf.Types.Address regimentContractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address RegimentContractAddress { + get { return regimentContractAddress_; } + set { + regimentContractAddress_ = value; + } + } + + /// Field number for the "report_contract_address" field. + public const int ReportContractAddressFieldNumber = 4; + private global::AElf.Types.Address reportContractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ReportContractAddress { + get { return reportContractAddress_; } + set { + reportContractAddress_ = value; + } + } + + /// Field number for the "admin" field. + public const int AdminFieldNumber = 5; + private global::AElf.Types.Address admin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Admin { + get { return admin_; } + set { + admin_ = value; + } + } + + /// Field number for the "controller" field. + public const int ControllerFieldNumber = 6; + private global::AElf.Types.Address controller_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Controller { + get { return controller_; } + set { + controller_ = value; + } + } + + /// Field number for the "organization_address" field. + public const int OrganizationAddressFieldNumber = 7; + private global::AElf.Types.Address organizationAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address OrganizationAddress { + get { return organizationAddress_; } + set { + organizationAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InitializeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InitializeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(OracleContractAddress, other.OracleContractAddress)) return false; + if (!object.Equals(MerkleTreeContractAddress, other.MerkleTreeContractAddress)) return false; + if (!object.Equals(RegimentContractAddress, other.RegimentContractAddress)) return false; + if (!object.Equals(ReportContractAddress, other.ReportContractAddress)) return false; + if (!object.Equals(Admin, other.Admin)) return false; + if (!object.Equals(Controller, other.Controller)) return false; + if (!object.Equals(OrganizationAddress, other.OrganizationAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (oracleContractAddress_ != null) hash ^= OracleContractAddress.GetHashCode(); + if (merkleTreeContractAddress_ != null) hash ^= MerkleTreeContractAddress.GetHashCode(); + if (regimentContractAddress_ != null) hash ^= RegimentContractAddress.GetHashCode(); + if (reportContractAddress_ != null) hash ^= ReportContractAddress.GetHashCode(); + if (admin_ != null) hash ^= Admin.GetHashCode(); + if (controller_ != null) hash ^= Controller.GetHashCode(); + if (organizationAddress_ != null) hash ^= OrganizationAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (oracleContractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OracleContractAddress); + } + if (merkleTreeContractAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(MerkleTreeContractAddress); + } + if (regimentContractAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RegimentContractAddress); + } + if (reportContractAddress_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ReportContractAddress); + } + if (admin_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Admin); + } + if (controller_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Controller); + } + if (organizationAddress_ != null) { + output.WriteRawTag(58); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (oracleContractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OracleContractAddress); + } + if (merkleTreeContractAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(MerkleTreeContractAddress); + } + if (regimentContractAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RegimentContractAddress); + } + if (reportContractAddress_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ReportContractAddress); + } + if (admin_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Admin); + } + if (controller_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Controller); + } + if (organizationAddress_ != null) { + output.WriteRawTag(58); + output.WriteMessage(OrganizationAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (oracleContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleContractAddress); + } + if (merkleTreeContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerkleTreeContractAddress); + } + if (regimentContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentContractAddress); + } + if (reportContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReportContractAddress); + } + if (admin_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Admin); + } + if (controller_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Controller); + } + if (organizationAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OrganizationAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InitializeInput other) { + if (other == null) { + return; + } + if (other.oracleContractAddress_ != null) { + if (oracleContractAddress_ == null) { + OracleContractAddress = new global::AElf.Types.Address(); + } + OracleContractAddress.MergeFrom(other.OracleContractAddress); + } + if (other.merkleTreeContractAddress_ != null) { + if (merkleTreeContractAddress_ == null) { + MerkleTreeContractAddress = new global::AElf.Types.Address(); + } + MerkleTreeContractAddress.MergeFrom(other.MerkleTreeContractAddress); + } + if (other.regimentContractAddress_ != null) { + if (regimentContractAddress_ == null) { + RegimentContractAddress = new global::AElf.Types.Address(); + } + RegimentContractAddress.MergeFrom(other.RegimentContractAddress); + } + if (other.reportContractAddress_ != null) { + if (reportContractAddress_ == null) { + ReportContractAddress = new global::AElf.Types.Address(); + } + ReportContractAddress.MergeFrom(other.ReportContractAddress); + } + if (other.admin_ != null) { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + Admin.MergeFrom(other.Admin); + } + if (other.controller_ != null) { + if (controller_ == null) { + Controller = new global::AElf.Types.Address(); + } + Controller.MergeFrom(other.Controller); + } + if (other.organizationAddress_ != null) { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + OrganizationAddress.MergeFrom(other.OrganizationAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (oracleContractAddress_ == null) { + OracleContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OracleContractAddress); + break; + } + case 18: { + if (merkleTreeContractAddress_ == null) { + MerkleTreeContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(MerkleTreeContractAddress); + break; + } + case 26: { + if (regimentContractAddress_ == null) { + RegimentContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(RegimentContractAddress); + break; + } + case 34: { + if (reportContractAddress_ == null) { + ReportContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReportContractAddress); + break; + } + case 42: { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + input.ReadMessage(Admin); + break; + } + case 50: { + if (controller_ == null) { + Controller = new global::AElf.Types.Address(); + } + input.ReadMessage(Controller); + break; + } + case 58: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (oracleContractAddress_ == null) { + OracleContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OracleContractAddress); + break; + } + case 18: { + if (merkleTreeContractAddress_ == null) { + MerkleTreeContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(MerkleTreeContractAddress); + break; + } + case 26: { + if (regimentContractAddress_ == null) { + RegimentContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(RegimentContractAddress); + break; + } + case 34: { + if (reportContractAddress_ == null) { + ReportContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReportContractAddress); + break; + } + case 42: { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + input.ReadMessage(Admin); + break; + } + case 50: { + if (controller_ == null) { + Controller = new global::AElf.Types.Address(); + } + input.ReadMessage(Controller); + break; + } + case 58: { + if (organizationAddress_ == null) { + OrganizationAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OrganizationAddress); + break; + } + } + } + } + #endif + + } + + public sealed partial class SetMaximumAmountInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetMaximumAmountInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetMaximumAmountInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetMaximumAmountInput(SetMaximumAmountInput other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetMaximumAmountInput Clone() { + return new SetMaximumAmountInput(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.TokenMaximumAmount.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetMaximumAmountInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetMaximumAmountInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetMaximumAmountInput other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenMaximumAmount : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenMaximumAmount()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenMaximumAmount() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenMaximumAmount(TokenMaximumAmount other) : this() { + symbol_ = other.symbol_; + maximumAmount_ = other.maximumAmount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenMaximumAmount Clone() { + return new TokenMaximumAmount(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "maximum_amount" field. + public const int MaximumAmountFieldNumber = 2; + private long maximumAmount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long MaximumAmount { + get { return maximumAmount_; } + set { + maximumAmount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenMaximumAmount); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenMaximumAmount other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (MaximumAmount != other.MaximumAmount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (MaximumAmount != 0L) hash ^= MaximumAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (MaximumAmount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(MaximumAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (MaximumAmount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(MaximumAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (MaximumAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MaximumAmount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenMaximumAmount other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.MaximumAmount != 0L) { + MaximumAmount = other.MaximumAmount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + MaximumAmount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + MaximumAmount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ApproveTransferInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApproveTransferInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ApproveTransferInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ApproveTransferInput(ApproveTransferInput other) : this() { + receiptId_ = other.receiptId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ApproveTransferInput Clone() { + return new ApproveTransferInput(this); + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 1; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ApproveTransferInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ApproveTransferInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReceiptId != other.ReceiptId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ApproveTransferInput other) { + if (other == null) { + return; + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class IsTransferCanReceiveInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IsTransferCanReceiveInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IsTransferCanReceiveInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IsTransferCanReceiveInput(IsTransferCanReceiveInput other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IsTransferCanReceiveInput Clone() { + return new IsTransferCanReceiveInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private string amount_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Amount { + get { return amount_; } + set { + amount_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IsTransferCanReceiveInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IsTransferCanReceiveInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount.Length != 0) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IsTransferCanReceiveInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount.Length != 0) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + Amount = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + Amount = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + ///To AElf message. + /// + public sealed partial class SwapRatio : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapRatio()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatio() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatio(SwapRatio other) : this() { + originShare_ = other.originShare_; + targetShare_ = other.targetShare_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatio Clone() { + return new SwapRatio(this); + } + + /// Field number for the "origin_share" field. + public const int OriginShareFieldNumber = 1; + private long originShare_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long OriginShare { + get { return originShare_; } + set { + originShare_ = value; + } + } + + /// Field number for the "target_share" field. + public const int TargetShareFieldNumber = 2; + private long targetShare_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TargetShare { + get { return targetShare_; } + set { + targetShare_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapRatio); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapRatio other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OriginShare != other.OriginShare) return false; + if (TargetShare != other.TargetShare) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (OriginShare != 0L) hash ^= OriginShare.GetHashCode(); + if (TargetShare != 0L) hash ^= TargetShare.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (OriginShare != 0L) { + output.WriteRawTag(8); + output.WriteInt64(OriginShare); + } + if (TargetShare != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TargetShare); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (OriginShare != 0L) { + output.WriteRawTag(8); + output.WriteInt64(OriginShare); + } + if (TargetShare != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TargetShare); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (OriginShare != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OriginShare); + } + if (TargetShare != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetShare); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapRatio other) { + if (other == null) { + return; + } + if (other.OriginShare != 0L) { + OriginShare = other.OriginShare; + } + if (other.TargetShare != 0L) { + TargetShare = other.TargetShare; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OriginShare = input.ReadInt64(); + break; + } + case 16: { + TargetShare = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OriginShare = input.ReadInt64(); + break; + } + case 16: { + TargetShare = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapTargetToken : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapTargetToken()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTargetToken() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTargetToken(SwapTargetToken other) : this() { + symbol_ = other.symbol_; + swapRatio_ = other.swapRatio_ != null ? other.swapRatio_.Clone() : null; + fromChainId_ = other.fromChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTargetToken Clone() { + return new SwapTargetToken(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "swap_ratio" field. + public const int SwapRatioFieldNumber = 2; + private global::AElf.Contracts.Bridge.SwapRatio swapRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Contracts.Bridge.SwapRatio SwapRatio { + get { return swapRatio_; } + set { + swapRatio_ = value; + } + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 3; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapTargetToken); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapTargetToken other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(SwapRatio, other.SwapRatio)) return false; + if (FromChainId != other.FromChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (swapRatio_ != null) hash ^= SwapRatio.GetHashCode(); + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (swapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(SwapRatio); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FromChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (swapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(SwapRatio); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FromChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (swapRatio_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapRatio); + } + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapTargetToken other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.swapRatio_ != null) { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + SwapRatio.MergeFrom(other.SwapRatio); + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(SwapRatio); + break; + } + case 26: { + FromChainId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(SwapRatio); + break; + } + case 26: { + FromChainId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfo(SwapInfo other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + swapTargetTokenList_ = other.swapTargetTokenList_.Clone(); + regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; + spaceId_ = other.spaceId_ != null ? other.spaceId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfo Clone() { + return new SwapInfo(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "swap_target_token_list" field. + public const int SwapTargetTokenListFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_swapTargetTokenList_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Contracts.Bridge.SwapTargetToken.Parser); + private readonly pbc::RepeatedField swapTargetTokenList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SwapTargetTokenList { + get { return swapTargetTokenList_; } + } + + /// Field number for the "regiment_id" field. + public const int RegimentIdFieldNumber = 3; + private global::AElf.Types.Hash regimentId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash RegimentId { + get { return regimentId_; } + set { + regimentId_ = value; + } + } + + /// Field number for the "space_id" field. + public const int SpaceIdFieldNumber = 4; + private global::AElf.Types.Hash spaceId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SpaceId { + get { return spaceId_; } + set { + spaceId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if(!swapTargetTokenList_.Equals(other.swapTargetTokenList_)) return false; + if (!object.Equals(RegimentId, other.RegimentId)) return false; + if (!object.Equals(SpaceId, other.SpaceId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + hash ^= swapTargetTokenList_.GetHashCode(); + if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); + if (spaceId_ != null) hash ^= SpaceId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + swapTargetTokenList_.WriteTo(output, _repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RegimentId); + } + if (spaceId_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SpaceId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + swapTargetTokenList_.WriteTo(ref output, _repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RegimentId); + } + if (spaceId_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SpaceId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + size += swapTargetTokenList_.CalculateSize(_repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); + } + if (spaceId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SpaceId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapInfo other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + swapTargetTokenList_.Add(other.swapTargetTokenList_); + if (other.regimentId_ != null) { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + RegimentId.MergeFrom(other.RegimentId); + } + if (other.spaceId_ != null) { + if (spaceId_ == null) { + SpaceId = new global::AElf.Types.Hash(); + } + SpaceId.MergeFrom(other.SpaceId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + swapTargetTokenList_.AddEntriesFrom(input, _repeated_swapTargetTokenList_codec); + break; + } + case 26: { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + input.ReadMessage(RegimentId); + break; + } + case 34: { + if (spaceId_ == null) { + SpaceId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SpaceId); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + swapTargetTokenList_.AddEntriesFrom(ref input, _repeated_swapTargetTokenList_codec); + break; + } + case 26: { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + input.ReadMessage(RegimentId); + break; + } + case 34: { + if (spaceId_ == null) { + SpaceId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SpaceId); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapPairInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapPairInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapPairInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapPairInfo(SwapPairInfo other) : this() { + swappedAmount_ = other.swappedAmount_; + swappedTimes_ = other.swappedTimes_; + depositAmount_ = other.depositAmount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapPairInfo Clone() { + return new SwapPairInfo(this); + } + + /// Field number for the "swapped_amount" field. + public const int SwappedAmountFieldNumber = 1; + private long swappedAmount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long SwappedAmount { + get { return swappedAmount_; } + set { + swappedAmount_ = value; + } + } + + /// Field number for the "swapped_times" field. + public const int SwappedTimesFieldNumber = 2; + private long swappedTimes_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long SwappedTimes { + get { return swappedTimes_; } + set { + swappedTimes_ = value; + } + } + + /// Field number for the "deposit_amount" field. + public const int DepositAmountFieldNumber = 3; + private long depositAmount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long DepositAmount { + get { return depositAmount_; } + set { + depositAmount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapPairInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapPairInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SwappedAmount != other.SwappedAmount) return false; + if (SwappedTimes != other.SwappedTimes) return false; + if (DepositAmount != other.DepositAmount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SwappedAmount != 0L) hash ^= SwappedAmount.GetHashCode(); + if (SwappedTimes != 0L) hash ^= SwappedTimes.GetHashCode(); + if (DepositAmount != 0L) hash ^= DepositAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SwappedAmount != 0L) { + output.WriteRawTag(8); + output.WriteInt64(SwappedAmount); + } + if (SwappedTimes != 0L) { + output.WriteRawTag(16); + output.WriteInt64(SwappedTimes); + } + if (DepositAmount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(DepositAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SwappedAmount != 0L) { + output.WriteRawTag(8); + output.WriteInt64(SwappedAmount); + } + if (SwappedTimes != 0L) { + output.WriteRawTag(16); + output.WriteInt64(SwappedTimes); + } + if (DepositAmount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(DepositAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SwappedAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(SwappedAmount); + } + if (SwappedTimes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(SwappedTimes); + } + if (DepositAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DepositAmount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapPairInfo other) { + if (other == null) { + return; + } + if (other.SwappedAmount != 0L) { + SwappedAmount = other.SwappedAmount; + } + if (other.SwappedTimes != 0L) { + SwappedTimes = other.SwappedTimes; + } + if (other.DepositAmount != 0L) { + DepositAmount = other.DepositAmount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SwappedAmount = input.ReadInt64(); + break; + } + case 16: { + SwappedTimes = input.ReadInt64(); + break; + } + case 24: { + DepositAmount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SwappedAmount = input.ReadInt64(); + break; + } + case 16: { + SwappedTimes = input.ReadInt64(); + break; + } + case 24: { + DepositAmount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapAmounts : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapAmounts()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapAmounts() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapAmounts(SwapAmounts other) : this() { + receiver_ = other.receiver_ != null ? other.receiver_.Clone() : null; + receivedAmounts_ = other.receivedAmounts_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapAmounts Clone() { + return new SwapAmounts(this); + } + + /// Field number for the "receiver" field. + public const int ReceiverFieldNumber = 1; + private global::AElf.Types.Address receiver_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Receiver { + get { return receiver_; } + set { + receiver_ = value; + } + } + + /// Field number for the "received_amounts" field. + public const int ReceivedAmountsFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_receivedAmounts_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 18); + private readonly pbc::MapField receivedAmounts_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField ReceivedAmounts { + get { return receivedAmounts_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapAmounts); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapAmounts other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Receiver, other.Receiver)) return false; + if (!ReceivedAmounts.Equals(other.ReceivedAmounts)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (receiver_ != null) hash ^= Receiver.GetHashCode(); + hash ^= ReceivedAmounts.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (receiver_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Receiver); + } + receivedAmounts_.WriteTo(output, _map_receivedAmounts_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (receiver_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Receiver); + } + receivedAmounts_.WriteTo(ref output, _map_receivedAmounts_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (receiver_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Receiver); + } + size += receivedAmounts_.CalculateSize(_map_receivedAmounts_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapAmounts other) { + if (other == null) { + return; + } + if (other.receiver_ != null) { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + Receiver.MergeFrom(other.Receiver); + } + receivedAmounts_.Add(other.receivedAmounts_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + case 18: { + receivedAmounts_.AddEntriesFrom(input, _map_receivedAmounts_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + case 18: { + receivedAmounts_.AddEntriesFrom(ref input, _map_receivedAmounts_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfo(ReceiptInfo other) : this() { + receiptId_ = other.receiptId_; + receivingTxId_ = other.receivingTxId_ != null ? other.receivingTxId_.Clone() : null; + receivingTime_ = other.receivingTime_ != null ? other.receivingTime_.Clone() : null; + amountMap_ = other.amountMap_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfo Clone() { + return new ReceiptInfo(this); + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 1; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "receiving_tx_id" field. + public const int ReceivingTxIdFieldNumber = 2; + private global::AElf.Types.Hash receivingTxId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash ReceivingTxId { + get { return receivingTxId_; } + set { + receivingTxId_ = value; + } + } + + /// Field number for the "receiving_time" field. + public const int ReceivingTimeFieldNumber = 3; + private global::Google.Protobuf.WellKnownTypes.Timestamp receivingTime_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Protobuf.WellKnownTypes.Timestamp ReceivingTime { + get { return receivingTime_; } + set { + receivingTime_ = value; + } + } + + /// Field number for the "amount_map" field. + public const int AmountMapFieldNumber = 4; + private static readonly pbc::MapField.Codec _map_amountMap_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 34); + private readonly pbc::MapField amountMap_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField AmountMap { + get { return amountMap_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReceiptId != other.ReceiptId) return false; + if (!object.Equals(ReceivingTxId, other.ReceivingTxId)) return false; + if (!object.Equals(ReceivingTime, other.ReceivingTime)) return false; + if (!AmountMap.Equals(other.AmountMap)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (receivingTxId_ != null) hash ^= ReceivingTxId.GetHashCode(); + if (receivingTime_ != null) hash ^= ReceivingTime.GetHashCode(); + hash ^= AmountMap.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (receivingTxId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceivingTxId); + } + if (receivingTime_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ReceivingTime); + } + amountMap_.WriteTo(output, _map_amountMap_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (receivingTxId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceivingTxId); + } + if (receivingTime_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ReceivingTime); + } + amountMap_.WriteTo(ref output, _map_amountMap_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (receivingTxId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReceivingTxId); + } + if (receivingTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReceivingTime); + } + size += amountMap_.CalculateSize(_map_amountMap_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptInfo other) { + if (other == null) { + return; + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + if (other.receivingTxId_ != null) { + if (receivingTxId_ == null) { + ReceivingTxId = new global::AElf.Types.Hash(); + } + ReceivingTxId.MergeFrom(other.ReceivingTxId); + } + if (other.receivingTime_ != null) { + if (receivingTime_ == null) { + ReceivingTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ReceivingTime.MergeFrom(other.ReceivingTime); + } + amountMap_.Add(other.amountMap_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + case 18: { + if (receivingTxId_ == null) { + ReceivingTxId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ReceivingTxId); + break; + } + case 26: { + if (receivingTime_ == null) { + ReceivingTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ReceivingTime); + break; + } + case 34: { + amountMap_.AddEntriesFrom(input, _map_amountMap_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + case 18: { + if (receivingTxId_ == null) { + ReceivingTxId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ReceivingTxId); + break; + } + case 26: { + if (receivingTime_ == null) { + ReceivingTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ReceivingTime); + break; + } + case 34: { + amountMap_.AddEntriesFrom(ref input, _map_amountMap_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptInfoList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptInfoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfoList(ReceiptInfoList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptInfoList Clone() { + return new ReceiptInfoList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.ReceiptInfo.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptInfoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptInfoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptInfoList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptHashMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptHashMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptHashMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptHashMap(ReceiptHashMap other) : this() { + value_ = other.value_.Clone(); + swapId_ = other.swapId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptHashMap Clone() { + return new ReceiptHashMap(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField Value { + get { return value_; } + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 2; + private string swapId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SwapId { + get { return swapId_; } + set { + swapId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptHashMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptHashMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + if (SwapId != other.SwapId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (SwapId.Length != 0) hash ^= SwapId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _map_value_codec); + if (SwapId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SwapId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _map_value_codec); + if (SwapId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SwapId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (SwapId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SwapId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptHashMap other) { + if (other == null) { + return; + } + value_.Add(other.value_); + if (other.SwapId.Length != 0) { + SwapId = other.SwapId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + case 18: { + SwapId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _map_value_codec); + break; + } + case 18: { + SwapId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptIdList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptIdList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdList(ReceiptIdList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdList Clone() { + return new ReceiptIdList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptIdList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptIdList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptIdList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptIdInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptIdInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdInfo(ReceiptIdInfo other) : this() { + chainId_ = other.chainId_; + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptIdInfo Clone() { + return new ReceiptIdInfo(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptIdInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptIdInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptIdInfo other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SendingInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SendingInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SendingInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SendingInfo(SendingInfo other) : this() { + receiptId_ = other.receiptId_; + sendingTxId_ = other.sendingTxId_; + sendingTime_ = other.sendingTime_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SendingInfo Clone() { + return new SendingInfo(this); + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 1; + private long receiptId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ReceiptId { + get { return receiptId_; } + set { + receiptId_ = value; + } + } + + /// Field number for the "sending_tx_id" field. + public const int SendingTxIdFieldNumber = 2; + private string sendingTxId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SendingTxId { + get { return sendingTxId_; } + set { + sendingTxId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "sending_time" field. + public const int SendingTimeFieldNumber = 3; + private string sendingTime_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SendingTime { + get { return sendingTime_; } + set { + sendingTime_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SendingInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SendingInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReceiptId != other.ReceiptId) return false; + if (SendingTxId != other.SendingTxId) return false; + if (SendingTime != other.SendingTime) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReceiptId != 0L) hash ^= ReceiptId.GetHashCode(); + if (SendingTxId.Length != 0) hash ^= SendingTxId.GetHashCode(); + if (SendingTime.Length != 0) hash ^= SendingTime.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReceiptId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(ReceiptId); + } + if (SendingTxId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SendingTxId); + } + if (SendingTime.Length != 0) { + output.WriteRawTag(26); + output.WriteString(SendingTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReceiptId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(ReceiptId); + } + if (SendingTxId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SendingTxId); + } + if (SendingTime.Length != 0) { + output.WriteRawTag(26); + output.WriteString(SendingTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReceiptId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ReceiptId); + } + if (SendingTxId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SendingTxId); + } + if (SendingTime.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SendingTime); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SendingInfo other) { + if (other == null) { + return; + } + if (other.ReceiptId != 0L) { + ReceiptId = other.ReceiptId; + } + if (other.SendingTxId.Length != 0) { + SendingTxId = other.SendingTxId; + } + if (other.SendingTime.Length != 0) { + SendingTime = other.SendingTime; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ReceiptId = input.ReadInt64(); + break; + } + case 18: { + SendingTxId = input.ReadString(); + break; + } + case 26: { + SendingTime = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ReceiptId = input.ReadInt64(); + break; + } + case 18: { + SendingTxId = input.ReadString(); + break; + } + case 26: { + SendingTime = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class CreateSwapInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateSwapInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateSwapInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateSwapInput(CreateSwapInput other) : this() { + swapTargetTokenList_ = other.swapTargetTokenList_.Clone(); + regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; + merkleTreeLeafLimit_ = other.merkleTreeLeafLimit_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateSwapInput Clone() { + return new CreateSwapInput(this); + } + + /// Field number for the "swap_target_token_list" field. + public const int SwapTargetTokenListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_swapTargetTokenList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.SwapTargetToken.Parser); + private readonly pbc::RepeatedField swapTargetTokenList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SwapTargetTokenList { + get { return swapTargetTokenList_; } + } + + /// Field number for the "regiment_id" field. + public const int RegimentIdFieldNumber = 2; + private global::AElf.Types.Hash regimentId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash RegimentId { + get { return regimentId_; } + set { + regimentId_ = value; + } + } + + /// Field number for the "merkle_tree_leaf_limit" field. + public const int MerkleTreeLeafLimitFieldNumber = 3; + private int merkleTreeLeafLimit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MerkleTreeLeafLimit { + get { return merkleTreeLeafLimit_; } + set { + merkleTreeLeafLimit_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CreateSwapInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CreateSwapInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!swapTargetTokenList_.Equals(other.swapTargetTokenList_)) return false; + if (!object.Equals(RegimentId, other.RegimentId)) return false; + if (MerkleTreeLeafLimit != other.MerkleTreeLeafLimit) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= swapTargetTokenList_.GetHashCode(); + if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); + if (MerkleTreeLeafLimit != 0) hash ^= MerkleTreeLeafLimit.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + swapTargetTokenList_.WriteTo(output, _repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(RegimentId); + } + if (MerkleTreeLeafLimit != 0) { + output.WriteRawTag(24); + output.WriteInt32(MerkleTreeLeafLimit); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + swapTargetTokenList_.WriteTo(ref output, _repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(RegimentId); + } + if (MerkleTreeLeafLimit != 0) { + output.WriteRawTag(24); + output.WriteInt32(MerkleTreeLeafLimit); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += swapTargetTokenList_.CalculateSize(_repeated_swapTargetTokenList_codec); + if (regimentId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); + } + if (MerkleTreeLeafLimit != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MerkleTreeLeafLimit); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CreateSwapInput other) { + if (other == null) { + return; + } + swapTargetTokenList_.Add(other.swapTargetTokenList_); + if (other.regimentId_ != null) { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + RegimentId.MergeFrom(other.RegimentId); + } + if (other.MerkleTreeLeafLimit != 0) { + MerkleTreeLeafLimit = other.MerkleTreeLeafLimit; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + swapTargetTokenList_.AddEntriesFrom(input, _repeated_swapTargetTokenList_codec); + break; + } + case 18: { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + input.ReadMessage(RegimentId); + break; + } + case 24: { + MerkleTreeLeafLimit = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + swapTargetTokenList_.AddEntriesFrom(ref input, _repeated_swapTargetTokenList_codec); + break; + } + case 18: { + if (regimentId_ == null) { + RegimentId = new global::AElf.Types.Hash(); + } + input.ReadMessage(RegimentId); + break; + } + case 24: { + MerkleTreeLeafLimit = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class DepositInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DepositInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DepositInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DepositInput(DepositInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DepositInput Clone() { + return new DepositInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 2; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DepositInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DepositInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DepositInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ChangeSwapRatioInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChangeSwapRatioInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChangeSwapRatioInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChangeSwapRatioInput(ChangeSwapRatioInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + swapRatio_ = other.swapRatio_ != null ? other.swapRatio_.Clone() : null; + targetTokenSymbol_ = other.targetTokenSymbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChangeSwapRatioInput Clone() { + return new ChangeSwapRatioInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "swap_ratio" field. + public const int SwapRatioFieldNumber = 2; + private global::AElf.Contracts.Bridge.SwapRatio swapRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Contracts.Bridge.SwapRatio SwapRatio { + get { return swapRatio_; } + set { + swapRatio_ = value; + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 3; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChangeSwapRatioInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChangeSwapRatioInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (!object.Equals(SwapRatio, other.SwapRatio)) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (swapRatio_ != null) hash ^= SwapRatio.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (swapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(SwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (swapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(SwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (swapRatio_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChangeSwapRatioInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.swapRatio_ != null) { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + SwapRatio.MergeFrom(other.SwapRatio); + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(SwapRatio); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (swapRatio_ == null) { + SwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(SwapRatio); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapTokenInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTokenInput(SwapTokenInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + receiptId_ = other.receiptId_; + originAmount_ = other.originAmount_; + receiverAddress_ = other.receiverAddress_ != null ? other.receiverAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapTokenInput Clone() { + return new SwapTokenInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 2; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "origin_amount" field. + public const int OriginAmountFieldNumber = 3; + private string originAmount_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OriginAmount { + get { return originAmount_; } + set { + originAmount_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "receiver_address" field. + public const int ReceiverAddressFieldNumber = 4; + private global::AElf.Types.Address receiverAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ReceiverAddress { + get { return receiverAddress_; } + set { + receiverAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (ReceiptId != other.ReceiptId) return false; + if (OriginAmount != other.OriginAmount) return false; + if (!object.Equals(ReceiverAddress, other.ReceiverAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (OriginAmount.Length != 0) hash ^= OriginAmount.GetHashCode(); + if (receiverAddress_ != null) hash ^= ReceiverAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ReceiptId); + } + if (OriginAmount.Length != 0) { + output.WriteRawTag(26); + output.WriteString(OriginAmount); + } + if (receiverAddress_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ReceiptId); + } + if (OriginAmount.Length != 0) { + output.WriteRawTag(26); + output.WriteString(OriginAmount); + } + if (receiverAddress_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (OriginAmount.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OriginAmount); + } + if (receiverAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReceiverAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapTokenInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + if (other.OriginAmount.Length != 0) { + OriginAmount = other.OriginAmount; + } + if (other.receiverAddress_ != null) { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + ReceiverAddress.MergeFrom(other.ReceiverAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + ReceiptId = input.ReadString(); + break; + } + case 26: { + OriginAmount = input.ReadString(); + break; + } + case 34: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + ReceiptId = input.ReadString(); + break; + } + case 26: { + OriginAmount = input.ReadString(); + break; + } + case 34: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + } + #endif + + } + + public sealed partial class WithdrawInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WithdrawInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WithdrawInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WithdrawInput(WithdrawInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WithdrawInput Clone() { + return new WithdrawInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 2; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WithdrawInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WithdrawInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WithdrawInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetSwapAmountsInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSwapAmountsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapAmountsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapAmountsInput(GetSwapAmountsInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + receiptId_ = other.receiptId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapAmountsInput Clone() { + return new GetSwapAmountsInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 2; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetSwapAmountsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetSwapAmountsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (ReceiptId != other.ReceiptId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetSwapAmountsInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + ReceiptId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + ReceiptId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetSwapPairInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSwapPairInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapPairInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapPairInfoInput(GetSwapPairInfoInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapPairInfoInput Clone() { + return new GetSwapPairInfoInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetSwapPairInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetSwapPairInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetSwapPairInfoInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetSwappedReceiptIdListInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSwappedReceiptIdListInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[23]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptIdListInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptIdListInput(GetSwappedReceiptIdListInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + receiverAddress_ = other.receiverAddress_ != null ? other.receiverAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptIdListInput Clone() { + return new GetSwappedReceiptIdListInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "receiver_address" field. + public const int ReceiverAddressFieldNumber = 2; + private global::AElf.Types.Address receiverAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ReceiverAddress { + get { return receiverAddress_; } + set { + receiverAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetSwappedReceiptIdListInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetSwappedReceiptIdListInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (!object.Equals(ReceiverAddress, other.ReceiverAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (receiverAddress_ != null) hash ^= ReceiverAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (receiverAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (receiverAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (receiverAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReceiverAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetSwappedReceiptIdListInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.receiverAddress_ != null) { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + ReceiverAddress.MergeFrom(other.ReceiverAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetSwappedReceiptInfoListInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSwappedReceiptInfoListInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptInfoListInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptInfoListInput(GetSwappedReceiptInfoListInput other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + receiverAddress_ = other.receiverAddress_ != null ? other.receiverAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwappedReceiptInfoListInput Clone() { + return new GetSwappedReceiptInfoListInput(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "receiver_address" field. + public const int ReceiverAddressFieldNumber = 2; + private global::AElf.Types.Address receiverAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ReceiverAddress { + get { return receiverAddress_; } + set { + receiverAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetSwappedReceiptInfoListInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetSwappedReceiptInfoListInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (!object.Equals(ReceiverAddress, other.ReceiverAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (receiverAddress_ != null) hash ^= ReceiverAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (receiverAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (receiverAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ReceiverAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (receiverAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ReceiverAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetSwappedReceiptInfoListInput other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.receiverAddress_ != null) { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + ReceiverAddress.MergeFrom(other.ReceiverAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (receiverAddress_ == null) { + ReceiverAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ReceiverAddress); + break; + } + } + } + } + #endif + + } + + /// + ///AElf to others message. + /// + public sealed partial class Receipt : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Receipt()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[25]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Receipt() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Receipt(Receipt other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + targetAddress_ = other.targetAddress_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Receipt Clone() { + return new Receipt(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "targetAddress" field. + public const int TargetAddressFieldNumber = 3; + private string targetAddress_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetAddress { + get { return targetAddress_; } + set { + targetAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Receipt); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Receipt other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (TargetAddress != other.TargetAddress) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (TargetAddress.Length != 0) hash ^= TargetAddress.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (TargetAddress.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetAddress); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Receipt other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.TargetAddress.Length != 0) { + TargetAddress = other.TargetAddress; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + TargetAddress = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + TargetAddress = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[26]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptList(ReceiptList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptList Clone() { + return new ReceiptList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.Receipt.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class ChainToken : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainToken()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[27]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainToken() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainToken(ChainToken other) : this() { + chainId_ = other.chainId_; + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainToken Clone() { + return new ChainToken(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChainToken); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChainToken other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChainToken other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ChainTokenList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainTokenList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[28]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainTokenList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainTokenList(ChainTokenList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChainTokenList Clone() { + return new ChainTokenList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.ChainToken.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChainTokenList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChainTokenList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChainTokenList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenSymbolList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenSymbolList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[29]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSymbolList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSymbolList(TokenSymbolList other) : this() { + symbol_ = other.symbol_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSymbolList Clone() { + return new TokenSymbolList(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_symbol_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField symbol_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Symbol { + get { return symbol_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenSymbolList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenSymbolList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!symbol_.Equals(other.symbol_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= symbol_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + symbol_.WriteTo(output, _repeated_symbol_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + symbol_.WriteTo(ref output, _repeated_symbol_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += symbol_.CalculateSize(_repeated_symbol_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenSymbolList other) { + if (other == null) { + return; + } + symbol_.Add(other.symbol_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + symbol_.AddEntriesFrom(input, _repeated_symbol_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + symbol_.AddEntriesFrom(ref input, _repeated_symbol_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class GasPrice : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GasPrice()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[30]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasPrice() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasPrice(GasPrice other) : this() { + chainId_ = other.chainId_; + gasPrice_ = other.gasPrice_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasPrice Clone() { + return new GasPrice(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "gas_price" field. + public const int GasPrice_FieldNumber = 2; + private long gasPrice_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long GasPrice_ { + get { return gasPrice_; } + set { + gasPrice_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GasPrice); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GasPrice other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (GasPrice_ != other.GasPrice_) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (GasPrice_ != 0L) hash ^= GasPrice_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (GasPrice_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GasPrice_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (GasPrice_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GasPrice_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (GasPrice_ != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(GasPrice_); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GasPrice other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.GasPrice_ != 0L) { + GasPrice_ = other.GasPrice_; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + GasPrice_ = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + GasPrice_ = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GasLimit : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GasLimit()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[31]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasLimit() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasLimit(GasLimit other) : this() { + chainId_ = other.chainId_; + gasLimit_ = other.gasLimit_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GasLimit Clone() { + return new GasLimit(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "gas_limit" field. + public const int GasLimit_FieldNumber = 2; + private long gasLimit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long GasLimit_ { + get { return gasLimit_; } + set { + gasLimit_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GasLimit); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GasLimit other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (GasLimit_ != other.GasLimit_) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (GasLimit_ != 0L) hash ^= GasLimit_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (GasLimit_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GasLimit_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (GasLimit_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GasLimit_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (GasLimit_ != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(GasLimit_); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GasLimit other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.GasLimit_ != 0L) { + GasLimit_ = other.GasLimit_; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + GasLimit_ = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + GasLimit_ = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class PriceRatio : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PriceRatio()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[32]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PriceRatio() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PriceRatio(PriceRatio other) : this() { + targetChainId_ = other.targetChainId_; + priceRatio_ = other.priceRatio_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PriceRatio Clone() { + return new PriceRatio(this); + } + + /// Field number for the "target_chain_id" field. + public const int TargetChainIdFieldNumber = 1; + private string targetChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetChainId { + get { return targetChainId_; } + set { + targetChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "price_ratio" field. + public const int PriceRatio_FieldNumber = 2; + private long priceRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long PriceRatio_ { + get { return priceRatio_; } + set { + priceRatio_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PriceRatio); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PriceRatio other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TargetChainId != other.TargetChainId) return false; + if (PriceRatio_ != other.PriceRatio_) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TargetChainId.Length != 0) hash ^= TargetChainId.GetHashCode(); + if (PriceRatio_ != 0L) hash ^= PriceRatio_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TargetChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TargetChainId); + } + if (PriceRatio_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PriceRatio_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TargetChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TargetChainId); + } + if (PriceRatio_ != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PriceRatio_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TargetChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetChainId); + } + if (PriceRatio_ != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PriceRatio_); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PriceRatio other) { + if (other == null) { + return; + } + if (other.TargetChainId.Length != 0) { + TargetChainId = other.TargetChainId; + } + if (other.PriceRatio_ != 0L) { + PriceRatio_ = other.PriceRatio_; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TargetChainId = input.ReadString(); + break; + } + case 16: { + PriceRatio_ = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TargetChainId = input.ReadString(); + break; + } + case 16: { + PriceRatio_ = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class FeeRatio : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeeRatio()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[33]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeeRatio() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeeRatio(FeeRatio other) : this() { + chainId_ = other.chainId_; + ratio_ = other.ratio_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeeRatio Clone() { + return new FeeRatio(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "ratio" field. + public const int RatioFieldNumber = 2; + private long ratio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Ratio { + get { return ratio_; } + set { + ratio_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FeeRatio); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FeeRatio other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (Ratio != other.Ratio) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (Ratio != 0L) hash ^= Ratio.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Ratio != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Ratio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Ratio != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Ratio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (Ratio != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Ratio); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FeeRatio other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.Ratio != 0L) { + Ratio = other.Ratio; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + Ratio = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 16: { + Ratio = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class AddTokenInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[34]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddTokenInput(AddTokenInput other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddTokenInput Clone() { + return new AddTokenInput(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.ChainToken.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddTokenInput other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class RemoveTokenInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[35]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveTokenInput(RemoveTokenInput other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveTokenInput Clone() { + return new RemoveTokenInput(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.ChainToken.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveTokenInput other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class CreateReceiptInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateReceiptInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateReceiptInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateReceiptInput(CreateReceiptInput other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + targetAddress_ = other.targetAddress_; + amount_ = other.amount_; + targetChainId_ = other.targetChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateReceiptInput Clone() { + return new CreateReceiptInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "targetAddress" field. + public const int TargetAddressFieldNumber = 3; + private string targetAddress_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetAddress { + get { return targetAddress_; } + set { + targetAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "target_chain_id" field. + public const int TargetChainIdFieldNumber = 5; + private string targetChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetChainId { + get { return targetChainId_; } + set { + targetChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CreateReceiptInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CreateReceiptInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (TargetAddress != other.TargetAddress) return false; + if (Amount != other.Amount) return false; + if (TargetChainId != other.TargetChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (TargetAddress.Length != 0) hash ^= TargetAddress.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (TargetChainId.Length != 0) hash ^= TargetChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (TargetChainId.Length != 0) { + output.WriteRawTag(42); + output.WriteString(TargetChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (TargetChainId.Length != 0) { + output.WriteRawTag(42); + output.WriteString(TargetChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (TargetAddress.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetAddress); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (TargetChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CreateReceiptInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.TargetAddress.Length != 0) { + TargetAddress = other.TargetAddress; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.TargetChainId.Length != 0) { + TargetChainId = other.TargetChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + TargetAddress = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + TargetChainId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + TargetAddress = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + TargetChainId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SetGasLimitInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetGasLimitInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasLimitInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasLimitInput(SetGasLimitInput other) : this() { + gasLimitList_ = other.gasLimitList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasLimitInput Clone() { + return new SetGasLimitInput(this); + } + + /// Field number for the "gas_limit_list" field. + public const int GasLimitListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_gasLimitList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.GasLimit.Parser); + private readonly pbc::RepeatedField gasLimitList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GasLimitList { + get { return gasLimitList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetGasLimitInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetGasLimitInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!gasLimitList_.Equals(other.gasLimitList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= gasLimitList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + gasLimitList_.WriteTo(output, _repeated_gasLimitList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + gasLimitList_.WriteTo(ref output, _repeated_gasLimitList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += gasLimitList_.CalculateSize(_repeated_gasLimitList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetGasLimitInput other) { + if (other == null) { + return; + } + gasLimitList_.Add(other.gasLimitList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + gasLimitList_.AddEntriesFrom(input, _repeated_gasLimitList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + gasLimitList_.AddEntriesFrom(ref input, _repeated_gasLimitList_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class SetGasPriceInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetGasPriceInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[38]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasPriceInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasPriceInput(SetGasPriceInput other) : this() { + gasPriceList_ = other.gasPriceList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGasPriceInput Clone() { + return new SetGasPriceInput(this); + } + + /// Field number for the "gas_price_list" field. + public const int GasPriceListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_gasPriceList_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.GasPrice.Parser); + private readonly pbc::RepeatedField gasPriceList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GasPriceList { + get { return gasPriceList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetGasPriceInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetGasPriceInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!gasPriceList_.Equals(other.gasPriceList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= gasPriceList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + gasPriceList_.WriteTo(output, _repeated_gasPriceList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + gasPriceList_.WriteTo(ref output, _repeated_gasPriceList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += gasPriceList_.CalculateSize(_repeated_gasPriceList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetGasPriceInput other) { + if (other == null) { + return; + } + gasPriceList_.Add(other.gasPriceList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + gasPriceList_.AddEntriesFrom(input, _repeated_gasPriceList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + gasPriceList_.AddEntriesFrom(ref input, _repeated_gasPriceList_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class SetPriceRatioInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetPriceRatioInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[39]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetPriceRatioInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetPriceRatioInput(SetPriceRatioInput other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetPriceRatioInput Clone() { + return new SetPriceRatioInput(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.PriceRatio.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetPriceRatioInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetPriceRatioInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetPriceRatioInput other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class SetFeeFloatingRatioInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetFeeFloatingRatioInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[40]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetFeeFloatingRatioInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetFeeFloatingRatioInput(SetFeeFloatingRatioInput other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetFeeFloatingRatioInput Clone() { + return new SetFeeFloatingRatioInput(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.Bridge.FeeRatio.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetFeeFloatingRatioInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetFeeFloatingRatioInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetFeeFloatingRatioInput other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetReceiptInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetReceiptInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[41]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetReceiptInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetReceiptInfoInput(GetReceiptInfoInput other) : this() { + receiptId_ = other.receiptId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetReceiptInfoInput Clone() { + return new GetReceiptInfoInput(this); + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 1; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetReceiptInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetReceiptInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReceiptId != other.ReceiptId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetReceiptInfoInput other) { + if (other == null) { + return; + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetOwnerLockReceiptInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetOwnerLockReceiptInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[42]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetOwnerLockReceiptInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetOwnerLockReceiptInput(GetOwnerLockReceiptInput other) : this() { + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetOwnerLockReceiptInput Clone() { + return new GetOwnerLockReceiptInput(this); + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 1; + private global::AElf.Types.Address owner_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetOwnerLockReceiptInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetOwnerLockReceiptInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Owner, other.Owner)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetOwnerLockReceiptInput other) { + if (other == null) { + return; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetLockTokensInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetLockTokensInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[43]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLockTokensInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLockTokensInput(GetLockTokensInput other) : this() { + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLockTokensInput Clone() { + return new GetLockTokensInput(this); + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 1; + private global::AElf.Types.Address owner_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetLockTokensInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetLockTokensInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Owner, other.Owner)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetLockTokensInput other) { + if (other == null) { + return; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetSwapIdByTokenInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSwapIdByTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[44]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapIdByTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapIdByTokenInput(GetSwapIdByTokenInput other) : this() { + chainId_ = other.chainId_; + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetSwapIdByTokenInput Clone() { + return new GetSwapIdByTokenInput(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private string chainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ChainId { + get { return chainId_; } + set { + chainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetSwapIdByTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetSwapIdByTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetSwapIdByTokenInput other) { + if (other == null) { + return; + } + if (other.ChainId.Length != 0) { + ChainId = other.ChainId; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ChainId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapRatioChanged : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapRatioChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[45]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatioChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatioChanged(SwapRatioChanged other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + newSwapRatio_ = other.newSwapRatio_ != null ? other.newSwapRatio_.Clone() : null; + targetTokenSymbol_ = other.targetTokenSymbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapRatioChanged Clone() { + return new SwapRatioChanged(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "new_swap_ratio" field. + public const int NewSwapRatioFieldNumber = 2; + private global::AElf.Contracts.Bridge.SwapRatio newSwapRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Contracts.Bridge.SwapRatio NewSwapRatio { + get { return newSwapRatio_; } + set { + newSwapRatio_ = value; + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 3; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapRatioChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapRatioChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (!object.Equals(NewSwapRatio, other.NewSwapRatio)) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (newSwapRatio_ != null) hash ^= NewSwapRatio.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (newSwapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(NewSwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (newSwapRatio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(NewSwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (newSwapRatio_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewSwapRatio); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapRatioChanged other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.newSwapRatio_ != null) { + if (newSwapRatio_ == null) { + NewSwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + NewSwapRatio.MergeFrom(other.NewSwapRatio); + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (newSwapRatio_ == null) { + NewSwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(NewSwapRatio); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + if (newSwapRatio_ == null) { + NewSwapRatio = new global::AElf.Contracts.Bridge.SwapRatio(); + } + input.ReadMessage(NewSwapRatio); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenSwapped : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenSwapped()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[46]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSwapped() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSwapped(TokenSwapped other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + amount_ = other.amount_; + symbol_ = other.symbol_; + receiptId_ = other.receiptId_; + fromChainId_ = other.fromChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenSwapped Clone() { + return new TokenSwapped(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 4; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 5; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenSwapped); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenSwapped other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (Amount != other.Amount) return false; + if (Symbol != other.Symbol) return false; + if (ReceiptId != other.ReceiptId) return false; + if (FromChainId != other.FromChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ReceiptId); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(42); + output.WriteString(FromChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (ReceiptId.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ReceiptId); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(42); + output.WriteString(FromChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenSwapped other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 34: { + ReceiptId = input.ReadString(); + break; + } + case 42: { + FromChainId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 34: { + ReceiptId = input.ReadString(); + break; + } + case 42: { + FromChainId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SwapInfoAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SwapInfoAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[47]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfoAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfoAdded(SwapInfoAdded other) : this() { + swapId_ = other.swapId_ != null ? other.swapId_.Clone() : null; + fromChainId_ = other.fromChainId_; + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SwapInfoAdded Clone() { + return new SwapInfoAdded(this); + } + + /// Field number for the "swap_id" field. + public const int SwapIdFieldNumber = 1; + private global::AElf.Types.Hash swapId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash SwapId { + get { return swapId_; } + set { + swapId_ = value; + } + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 2; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SwapInfoAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SwapInfoAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SwapId, other.SwapId)) return false; + if (FromChainId != other.FromChainId) return false; + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (swapId_ != null) hash ^= SwapId.GetHashCode(); + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(FromChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (swapId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SwapId); + } + if (FromChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(FromChainId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (swapId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SwapId); + } + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SwapInfoAdded other) { + if (other == null) { + return; + } + if (other.swapId_ != null) { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + SwapId.MergeFrom(other.SwapId); + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + FromChainId = input.ReadString(); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (swapId_ == null) { + SwapId = new global::AElf.Types.Hash(); + } + input.ReadMessage(SwapId); + break; + } + case 18: { + FromChainId = input.ReadString(); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenWhitelistAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenWhitelistAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[48]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistAdded(TokenWhitelistAdded other) : this() { + chainTokenList_ = other.chainTokenList_ != null ? other.chainTokenList_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistAdded Clone() { + return new TokenWhitelistAdded(this); + } + + /// Field number for the "chain_token_list" field. + public const int ChainTokenListFieldNumber = 1; + private global::AElf.Contracts.Bridge.ChainTokenList chainTokenList_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Contracts.Bridge.ChainTokenList ChainTokenList { + get { return chainTokenList_; } + set { + chainTokenList_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenWhitelistAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenWhitelistAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ChainTokenList, other.ChainTokenList)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (chainTokenList_ != null) hash ^= ChainTokenList.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (chainTokenList_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ChainTokenList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (chainTokenList_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ChainTokenList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (chainTokenList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChainTokenList); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenWhitelistAdded other) { + if (other == null) { + return; + } + if (other.chainTokenList_ != null) { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + ChainTokenList.MergeFrom(other.ChainTokenList); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + input.ReadMessage(ChainTokenList); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + input.ReadMessage(ChainTokenList); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenWhitelistRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenWhitelistRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[49]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistRemoved(TokenWhitelistRemoved other) : this() { + chainTokenList_ = other.chainTokenList_ != null ? other.chainTokenList_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenWhitelistRemoved Clone() { + return new TokenWhitelistRemoved(this); + } + + /// Field number for the "chain_token_list" field. + public const int ChainTokenListFieldNumber = 1; + private global::AElf.Contracts.Bridge.ChainTokenList chainTokenList_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Contracts.Bridge.ChainTokenList ChainTokenList { + get { return chainTokenList_; } + set { + chainTokenList_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenWhitelistRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenWhitelistRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ChainTokenList, other.ChainTokenList)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (chainTokenList_ != null) hash ^= ChainTokenList.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (chainTokenList_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ChainTokenList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (chainTokenList_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ChainTokenList); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (chainTokenList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChainTokenList); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenWhitelistRemoved other) { + if (other == null) { + return; + } + if (other.chainTokenList_ != null) { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + ChainTokenList.MergeFrom(other.ChainTokenList); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + input.ReadMessage(ChainTokenList); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (chainTokenList_ == null) { + ChainTokenList = new global::AElf.Contracts.Bridge.ChainTokenList(); + } + input.ReadMessage(ChainTokenList); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReceiptCreated : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReceiptCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.Bridge.BridgeContractReflection.Descriptor.MessageTypes[50]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptCreated(ReceiptCreated other) : this() { + receiptId_ = other.receiptId_; + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + targetAddress_ = other.targetAddress_; + amount_ = other.amount_; + targetChainId_ = other.targetChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReceiptCreated Clone() { + return new ReceiptCreated(this); + } + + /// Field number for the "receipt_id" field. + public const int ReceiptIdFieldNumber = 1; + private string receiptId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ReceiptId { + get { return receiptId_; } + set { + receiptId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 3; + private global::AElf.Types.Address owner_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "targetAddress" field. + public const int TargetAddressFieldNumber = 4; + private string targetAddress_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetAddress { + get { return targetAddress_; } + set { + targetAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 5; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "target_chain_id" field. + public const int TargetChainIdFieldNumber = 6; + private string targetChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetChainId { + get { return targetChainId_; } + set { + targetChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReceiptCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReceiptCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReceiptId != other.ReceiptId) return false; + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (TargetAddress != other.TargetAddress) return false; + if (Amount != other.Amount) return false; + if (TargetChainId != other.TargetChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReceiptId.Length != 0) hash ^= ReceiptId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (TargetAddress.Length != 0) hash ^= TargetAddress.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (TargetChainId.Length != 0) hash ^= TargetChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(34); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (TargetChainId.Length != 0) { + output.WriteRawTag(50); + output.WriteString(TargetChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReceiptId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ReceiptId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Owner); + } + if (TargetAddress.Length != 0) { + output.WriteRawTag(34); + output.WriteString(TargetAddress); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (TargetChainId.Length != 0) { + output.WriteRawTag(50); + output.WriteString(TargetChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReceiptId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ReceiptId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (TargetAddress.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetAddress); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (TargetChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReceiptCreated other) { + if (other == null) { + return; + } + if (other.ReceiptId.Length != 0) { + ReceiptId = other.ReceiptId; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.TargetAddress.Length != 0) { + TargetAddress = other.TargetAddress; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.TargetChainId.Length != 0) { + TargetChainId = other.TargetChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 26: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 34: { + TargetAddress = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + case 50: { + TargetChainId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ReceiptId = input.ReadString(); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 26: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 34: { + TargetAddress = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + case 50: { + TargetChainId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.c.cs new file mode 100644 index 0000000..de03c4b --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.c.cs @@ -0,0 +1,159 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cross_chain_contract.proto +// +// Original file comments: +// * +// Cross-Chain contract. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Contracts.CrossChain { + + #region Events + public partial class SideChainCreatedEvent : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public SideChainCreatedEvent GetNonIndexed() + { + return new SideChainCreatedEvent + { + Creator = Creator, + ChainId = ChainId, + }; + } + } + + public partial class Disposed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public Disposed GetNonIndexed() + { + return new Disposed + { + ChainId = ChainId, + }; + } + } + + public partial class SideChainLifetimeControllerChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public SideChainLifetimeControllerChanged GetNonIndexed() + { + return new SideChainLifetimeControllerChanged + { + AuthorityInfo = AuthorityInfo, + }; + } + } + + public partial class CrossChainIndexingControllerChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CrossChainIndexingControllerChanged GetNonIndexed() + { + return new CrossChainIndexingControllerChanged + { + AuthorityInfo = AuthorityInfo, + }; + } + } + + public partial class SideChainIndexingFeeControllerChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new SideChainIndexingFeeControllerChanged + { + ChainId = ChainId + }, + }; + } + + public SideChainIndexingFeeControllerChanged GetNonIndexed() + { + return new SideChainIndexingFeeControllerChanged + { + AuthorityInfo = AuthorityInfo, + }; + } + } + + public partial class SideChainIndexed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new SideChainIndexed + { + ChainId = ChainId + }, + }; + } + + public SideChainIndexed GetNonIndexed() + { + return new SideChainIndexed + { + IndexedHeight = IndexedHeight, + }; + } + } + + public partial class ParentChainIndexed : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ParentChainIndexed + { + ChainId = ChainId + }, + }; + } + + public ParentChainIndexed GetNonIndexed() + { + return new ParentChainIndexed + { + IndexedHeight = IndexedHeight, + }; + } + } + + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.g.cs new file mode 100644 index 0000000..364fe48 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/CrossChainContract.g.cs @@ -0,0 +1,3573 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cross_chain_contract.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Contracts.CrossChain { + + /// Holder for reflection information generated from cross_chain_contract.proto + public static partial class CrossChainContractReflection { + + #region Descriptor + /// File descriptor for cross_chain_contract.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CrossChainContractReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chpjcm9zc19jaGFpbl9jb250cmFjdC5wcm90bxIKQ3Jvc3NDaGFpbhoKYWNz", + "Ny5wcm90bxoSYWVsZi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYv", + "ZW1wdHkucHJvdG8aHmdvb2dsZS9wcm90b2J1Zi93cmFwcGVycy5wcm90bxoU", + "YXV0aG9yaXR5X2luZm8ucHJvdG8icwoPSW5pdGlhbGl6ZUlucHV0EhcKD3Bh", + "cmVudF9jaGFpbl9pZBgBIAEoBRInCh9jcmVhdGlvbl9oZWlnaHRfb25fcGFy", + "ZW50X2NoYWluGAIgASgDEh4KFmlzX3ByaXZpbGVnZV9wcmVzZXJ2ZWQYAyAB", + "KAgiTgoVU2lkZUNoYWluQ3JlYXRlZEV2ZW50Eh4KB2NyZWF0b3IYASABKAsy", + "DS5hZWxmLkFkZHJlc3MSDwoHY2hhaW5JZBgCIAEoBToEoLsYASIiCghEaXNw", + "b3NlZBIQCghjaGFpbl9pZBgBIAEoBToEoLsYASKDAgoaUHJvcG9zZWRDcm9z", + "c0NoYWluSW5kZXhpbmcSeQojY2hhaW5faW5kZXhpbmdfcHJvcG9zYWxfY29s", + "bGVjdGlvbnMYASADKAsyTC5Dcm9zc0NoYWluLlByb3Bvc2VkQ3Jvc3NDaGFp", + "bkluZGV4aW5nLkNoYWluSW5kZXhpbmdQcm9wb3NhbENvbGxlY3Rpb25zRW50", + "cnkaagolQ2hhaW5JbmRleGluZ1Byb3Bvc2FsQ29sbGVjdGlvbnNFbnRyeRIL", + "CgNrZXkYASABKAUSMAoFdmFsdWUYAiABKAsyIS5Dcm9zc0NoYWluLkNoYWlu", + "SW5kZXhpbmdQcm9wb3NhbDoCOAEi7QEKFUNoYWluSW5kZXhpbmdQcm9wb3Nh", + "bBIfCgtwcm9wb3NhbF9pZBgBIAEoCzIKLmFlbGYuSGFzaBIfCghwcm9wb3Nl", + "chgCIAEoCzINLmFlbGYuQWRkcmVzcxJCCh9wcm9wb3NlZF9jcm9zc19jaGFp", + "bl9ibG9ja19kYXRhGAMgASgLMhkuYWNzNy5Dcm9zc0NoYWluQmxvY2tEYXRh", + "EjwKBnN0YXR1cxgEIAEoDjIsLkNyb3NzQ2hhaW4uQ3Jvc3NDaGFpbkluZGV4", + "aW5nUHJvcG9zYWxTdGF0dXMSEAoIY2hhaW5faWQYBSABKAUiiwIKH0dldElu", + "ZGV4aW5nUHJvcG9zYWxTdGF0dXNPdXRwdXQSdAoeY2hhaW5faW5kZXhpbmdf", + "cHJvcG9zYWxfc3RhdHVzGAEgAygLMkwuQ3Jvc3NDaGFpbi5HZXRJbmRleGlu", + "Z1Byb3Bvc2FsU3RhdHVzT3V0cHV0LkNoYWluSW5kZXhpbmdQcm9wb3NhbFN0", + "YXR1c0VudHJ5GnIKIENoYWluSW5kZXhpbmdQcm9wb3NhbFN0YXR1c0VudHJ5", + "EgsKA2tleRgBIAEoBRI9CgV2YWx1ZRgCIAEoCzIuLkNyb3NzQ2hhaW4uUGVu", + "ZGluZ0NoYWluSW5kZXhpbmdQcm9wb3NhbFN0YXR1czoCOAEi9AEKIlBlbmRp", + "bmdDaGFpbkluZGV4aW5nUHJvcG9zYWxTdGF0dXMSHwoLcHJvcG9zYWxfaWQY", + "ASABKAsyCi5hZWxmLkhhc2gSHwoIcHJvcG9zZXIYAiABKAsyDS5hZWxmLkFk", + "ZHJlc3MSFgoOdG9fYmVfcmVsZWFzZWQYAyABKAgSQgofcHJvcG9zZWRfY3Jv", + "c3NfY2hhaW5fYmxvY2tfZGF0YRgEIAEoCzIZLmFjczcuQ3Jvc3NDaGFpbkJs", + "b2NrRGF0YRIwCgxleHBpcmVkX3RpbWUYBSABKAsyGi5nb29nbGUucHJvdG9i", + "dWYuVGltZXN0YW1wIvwBCipHZXRQZW5kaW5nQ3Jvc3NDaGFpbkluZGV4aW5n", + "UHJvcG9zYWxPdXRwdXQSHwoLcHJvcG9zYWxfaWQYASABKAsyCi5hZWxmLkhh", + "c2gSHwoIcHJvcG9zZXIYAiABKAsyDS5hZWxmLkFkZHJlc3MSFgoOdG9fYmVf", + "cmVsZWFzZWQYAyABKAgSQgofcHJvcG9zZWRfY3Jvc3NfY2hhaW5fYmxvY2tf", + "ZGF0YRgEIAEoCzIZLmFjczcuQ3Jvc3NDaGFpbkJsb2NrRGF0YRIwCgxleHBp", + "cmVkX3RpbWUYBSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIr8D", + "Cg1TaWRlQ2hhaW5JbmZvEh8KCHByb3Bvc2VyGAEgASgLMg0uYWVsZi5BZGRy", + "ZXNzEjYKEXNpZGVfY2hhaW5fc3RhdHVzGAIgASgOMhsuQ3Jvc3NDaGFpbi5T", + "aWRlQ2hhaW5TdGF0dXMSFQoNc2lkZV9jaGFpbl9pZBgDIAEoBRI2ChJjcmVh", + "dGlvbl90aW1lc3RhbXAYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0", + "YW1wEicKH2NyZWF0aW9uX2hlaWdodF9vbl9wYXJlbnRfY2hhaW4YBSABKAMS", + "FgoOaW5kZXhpbmdfcHJpY2UYBiABKAMSHgoWaXNfcHJpdmlsZWdlX3ByZXNl", + "cnZlZBgHIAEoCBJACgxhcnJlYXJzX2luZm8YCCADKAsyKi5Dcm9zc0NoYWlu", + "LlNpZGVDaGFpbkluZm8uQXJyZWFyc0luZm9FbnRyeRIvChdpbmRleGluZ19m", + "ZWVfY29udHJvbGxlchgJIAEoCzIOLkF1dGhvcml0eUluZm8aMgoQQXJyZWFy", + "c0luZm9FbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAM6AjgBIkMK", + "FEdldENoYWluU3RhdHVzT3V0cHV0EisKBnN0YXR1cxgBIAEoDjIbLkNyb3Nz", + "Q2hhaW4uU2lkZUNoYWluU3RhdHVzIrcBCh1TaWRlQ2hhaW5DcmVhdGlvblJl", + "cXVlc3RTdGF0ZRJDChtzaWRlX2NoYWluX2NyZWF0aW9uX3JlcXVlc3QYASAB", + "KAsyHi5hY3M3LlNpZGVDaGFpbkNyZWF0aW9uUmVxdWVzdBIwCgxleHBpcmVk", + "X3RpbWUYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEh8KCHBy", + "b3Bvc2VyGAMgASgLMg0uYWVsZi5BZGRyZXNzImUKKUNoYW5nZVNpZGVDaGFp", + "bkluZGV4aW5nRmVlQ29udHJvbGxlcklucHV0EhAKCGNoYWluX2lkGAEgASgF", + "EiYKDmF1dGhvcml0eV9pbmZvGAIgASgLMg4uQXV0aG9yaXR5SW5mbyJSCiJT", + "aWRlQ2hhaW5MaWZldGltZUNvbnRyb2xsZXJDaGFuZ2VkEiYKDmF1dGhvcml0", + "eV9pbmZvGAEgASgLMg4uQXV0aG9yaXR5SW5mbzoEoLsYASJTCiNDcm9zc0No", + "YWluSW5kZXhpbmdDb250cm9sbGVyQ2hhbmdlZBImCg5hdXRob3JpdHlfaW5m", + "bxgBIAEoCzIOLkF1dGhvcml0eUluZm86BKC7GAEibgolU2lkZUNoYWluSW5k", + "ZXhpbmdGZWVDb250cm9sbGVyQ2hhbmdlZBIXCghjaGFpbl9pZBgBIAEoBUIF", + "iI/1AQESJgoOYXV0aG9yaXR5X2luZm8YAiABKAsyDi5BdXRob3JpdHlJbmZv", + "OgSguxgBIjkKJUFjY2VwdENyb3NzQ2hhaW5JbmRleGluZ1Byb3Bvc2FsSW5w", + "dXQSEAoIY2hhaW5faWQYASABKAUiSQoQU2lkZUNoYWluSW5kZXhlZBIXCghj", + "aGFpbl9pZBgBIAEoBUIFiI/1AQESFgoOaW5kZXhlZF9oZWlnaHQYAiABKAM6", + "BKC7GAEiSwoSUGFyZW50Q2hhaW5JbmRleGVkEhcKCGNoYWluX2lkGAEgASgF", + "QgWIj/UBARIWCg5pbmRleGVkX2hlaWdodBgCIAEoAzoEoLsYASpPCiBDcm9z", + "c0NoYWluSW5kZXhpbmdQcm9wb3NhbFN0YXR1cxIQCgxOT05fUFJPUE9TRUQQ", + "ABILCgdQRU5ESU5HEAESDAoIQUNDRVBURUQQAipPCg9TaWRlQ2hhaW5TdGF0", + "dXMSCQoFRkFUQUwQABIKCgZBQ1RJVkUQARIVChFJTkRFWElOR19GRUVfREVC", + "VBACEg4KClRFUk1JTkFURUQQAzLeDQoSQ3Jvc3NDaGFpbkNvbnRyYWN0EkMK", + "CkluaXRpYWxpemUSGy5Dcm9zc0NoYWluLkluaXRpYWxpemVJbnB1dBoWLmdv", + "b2dsZS5wcm90b2J1Zi5FbXB0eSIAElcKLFNldEluaXRpYWxTaWRlQ2hhaW5M", + "aWZldGltZUNvbnRyb2xsZXJBZGRyZXNzEg0uYWVsZi5BZGRyZXNzGhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5IgASTgojU2V0SW5pdGlhbEluZGV4aW5nQ29u", + "dHJvbGxlckFkZHJlc3MSDS5hZWxmLkFkZHJlc3MaFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkiABJOCiJDaGFuZ2VDcm9zc0NoYWluSW5kZXhpbmdDb250cm9s", + "bGVyEg4uQXV0aG9yaXR5SW5mbxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIA", + "Ek0KIUNoYW5nZVNpZGVDaGFpbkxpZmV0aW1lQ29udHJvbGxlchIOLkF1dGhv", + "cml0eUluZm8aFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJ3CiRDaGFuZ2VT", + "aWRlQ2hhaW5JbmRleGluZ0ZlZUNvbnRyb2xsZXISNS5Dcm9zc0NoYWluLkNo", + "YW5nZVNpZGVDaGFpbkluZGV4aW5nRmVlQ29udHJvbGxlcklucHV0GhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5IgASbwogQWNjZXB0Q3Jvc3NDaGFpbkluZGV4", + "aW5nUHJvcG9zYWwSMS5Dcm9zc0NoYWluLkFjY2VwdENyb3NzQ2hhaW5JbmRl", + "eGluZ1Byb3Bvc2FsSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJI", + "ChNHZXRTaWRlQ2hhaW5DcmVhdG9yEhsuZ29vZ2xlLnByb3RvYnVmLkludDMy", + "VmFsdWUaDS5hZWxmLkFkZHJlc3MiBYiJ9wEBElYKDkdldENoYWluU3RhdHVz", + "EhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaIC5Dcm9zc0NoYWluLkdl", + "dENoYWluU3RhdHVzT3V0cHV0IgWIifcBARJVChJHZXRTaWRlQ2hhaW5IZWln", + "aHQSGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRobLmdvb2dsZS5wcm90", + "b2J1Zi5JbnQ2NFZhbHVlIgWIifcBARJSChRHZXRQYXJlbnRDaGFpbkhlaWdo", + "dBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRobLmdvb2dsZS5wcm90b2J1Zi5J", + "bnQ2NFZhbHVlIgWIifcBARJOChBHZXRQYXJlbnRDaGFpbklkEhYuZ29vZ2xl", + "LnByb3RvYnVmLkVtcHR5GhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUi", + "BYiJ9wEBElYKE0dldFNpZGVDaGFpbkJhbGFuY2USGy5nb29nbGUucHJvdG9i", + "dWYuSW50MzJWYWx1ZRobLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlIgWI", + "ifcBARJeChtHZXRTaWRlQ2hhaW5JbmRleGluZ0ZlZURlYnQSGy5nb29nbGUu", + "cHJvdG9idWYuSW50MzJWYWx1ZRobLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZh", + "bHVlIgWIifcBARJnChlHZXRJbmRleGluZ1Byb3Bvc2FsU3RhdHVzEhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5GisuQ3Jvc3NDaGFpbi5HZXRJbmRleGluZ1By", + "b3Bvc2FsU3RhdHVzT3V0cHV0IgWIifcBARJfChxHZXRTaWRlQ2hhaW5JbmRl", + "eGluZ0ZlZVByaWNlEhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaGy5n", + "b29nbGUucHJvdG9idWYuSW50NjRWYWx1ZSIFiIn3AQESTwoeR2V0U2lkZUNo", + "YWluTGlmZXRpbWVDb250cm9sbGVyEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5", + "Gg4uQXV0aG9yaXR5SW5mbyIFiIn3AQESUAofR2V0Q3Jvc3NDaGFpbkluZGV4", + "aW5nQ29udHJvbGxlchIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoOLkF1dGhv", + "cml0eUluZm8iBYiJ9wEBElcKIUdldFNpZGVDaGFpbkluZGV4aW5nRmVlQ29u", + "dHJvbGxlchIbLmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlGg4uQXV0aG9y", + "aXR5SW5mbyIFiIn3AQEaNrLM9gExQUVsZi5Db250cmFjdHMuQ3Jvc3NDaGFp", + "bi5Dcm9zc0NoYWluQ29udHJhY3RTdGF0ZUIcqgIZQUVsZi5Db250cmFjdHMu", + "Q3Jvc3NDaGFpbmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Standards.ACS7.Acs7Reflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::AuthorityInfoReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus), typeof(global::AElf.Contracts.CrossChain.SideChainStatus), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.InitializeInput), global::AElf.Contracts.CrossChain.InitializeInput.Parser, new[]{ "ParentChainId", "CreationHeightOnParentChain", "IsPrivilegePreserved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainCreatedEvent), global::AElf.Contracts.CrossChain.SideChainCreatedEvent.Parser, new[]{ "Creator", "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.Disposed), global::AElf.Contracts.CrossChain.Disposed.Parser, new[]{ "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.ProposedCrossChainIndexing), global::AElf.Contracts.CrossChain.ProposedCrossChainIndexing.Parser, new[]{ "ChainIndexingProposalCollections" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.ChainIndexingProposal), global::AElf.Contracts.CrossChain.ChainIndexingProposal.Parser, new[]{ "ProposalId", "Proposer", "ProposedCrossChainBlockData", "Status", "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.GetIndexingProposalStatusOutput), global::AElf.Contracts.CrossChain.GetIndexingProposalStatusOutput.Parser, new[]{ "ChainIndexingProposalStatus" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.PendingChainIndexingProposalStatus), global::AElf.Contracts.CrossChain.PendingChainIndexingProposalStatus.Parser, new[]{ "ProposalId", "Proposer", "ToBeReleased", "ProposedCrossChainBlockData", "ExpiredTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.GetPendingCrossChainIndexingProposalOutput), global::AElf.Contracts.CrossChain.GetPendingCrossChainIndexingProposalOutput.Parser, new[]{ "ProposalId", "Proposer", "ToBeReleased", "ProposedCrossChainBlockData", "ExpiredTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainInfo), global::AElf.Contracts.CrossChain.SideChainInfo.Parser, new[]{ "Proposer", "SideChainStatus", "SideChainId", "CreationTimestamp", "CreationHeightOnParentChain", "IndexingPrice", "IsPrivilegePreserved", "ArrearsInfo", "IndexingFeeController" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.GetChainStatusOutput), global::AElf.Contracts.CrossChain.GetChainStatusOutput.Parser, new[]{ "Status" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainCreationRequestState), global::AElf.Contracts.CrossChain.SideChainCreationRequestState.Parser, new[]{ "SideChainCreationRequest", "ExpiredTime", "Proposer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.ChangeSideChainIndexingFeeControllerInput), global::AElf.Contracts.CrossChain.ChangeSideChainIndexingFeeControllerInput.Parser, new[]{ "ChainId", "AuthorityInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainLifetimeControllerChanged), global::AElf.Contracts.CrossChain.SideChainLifetimeControllerChanged.Parser, new[]{ "AuthorityInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.CrossChainIndexingControllerChanged), global::AElf.Contracts.CrossChain.CrossChainIndexingControllerChanged.Parser, new[]{ "AuthorityInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainIndexingFeeControllerChanged), global::AElf.Contracts.CrossChain.SideChainIndexingFeeControllerChanged.Parser, new[]{ "ChainId", "AuthorityInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.AcceptCrossChainIndexingProposalInput), global::AElf.Contracts.CrossChain.AcceptCrossChainIndexingProposalInput.Parser, new[]{ "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.SideChainIndexed), global::AElf.Contracts.CrossChain.SideChainIndexed.Parser, new[]{ "ChainId", "IndexedHeight" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.CrossChain.ParentChainIndexed), global::AElf.Contracts.CrossChain.ParentChainIndexed.Parser, new[]{ "ChainId", "IndexedHeight" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum CrossChainIndexingProposalStatus { + [pbr::OriginalName("NON_PROPOSED")] NonProposed = 0, + /// + /// The proposal is pending. + /// + [pbr::OriginalName("PENDING")] Pending = 1, + /// + /// The proposal has been released. + /// + [pbr::OriginalName("ACCEPTED")] Accepted = 2, + } + + public enum SideChainStatus { + /// + /// Currently no meaning. + /// + [pbr::OriginalName("FATAL")] Fatal = 0, + /// + /// The side chain is being indexed. + /// + [pbr::OriginalName("ACTIVE")] Active = 1, + /// + /// The side chain is in debt for indexing fee. + /// + [pbr::OriginalName("INDEXING_FEE_DEBT")] IndexingFeeDebt = 2, + /// + /// The side chain is disposed. + /// + [pbr::OriginalName("TERMINATED")] Terminated = 3, + } + + #endregion + + #region Messages + public sealed partial class InitializeInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitializeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeInput(InitializeInput other) : this() { + parentChainId_ = other.parentChainId_; + creationHeightOnParentChain_ = other.creationHeightOnParentChain_; + isPrivilegePreserved_ = other.isPrivilegePreserved_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeInput Clone() { + return new InitializeInput(this); + } + + /// Field number for the "parent_chain_id" field. + public const int ParentChainIdFieldNumber = 1; + private int parentChainId_; + /// + /// The id of parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ParentChainId { + get { return parentChainId_; } + set { + parentChainId_ = value; + } + } + + /// Field number for the "creation_height_on_parent_chain" field. + public const int CreationHeightOnParentChainFieldNumber = 2; + private long creationHeightOnParentChain_; + /// + /// The height of side chain created on parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long CreationHeightOnParentChain { + get { return creationHeightOnParentChain_; } + set { + creationHeightOnParentChain_ = value; + } + } + + /// Field number for the "is_privilege_preserved" field. + public const int IsPrivilegePreservedFieldNumber = 3; + private bool isPrivilegePreserved_; + /// + /// True if chain privilege needed, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsPrivilegePreserved { + get { return isPrivilegePreserved_; } + set { + isPrivilegePreserved_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as InitializeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(InitializeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ParentChainId != other.ParentChainId) return false; + if (CreationHeightOnParentChain != other.CreationHeightOnParentChain) return false; + if (IsPrivilegePreserved != other.IsPrivilegePreserved) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ParentChainId != 0) hash ^= ParentChainId.GetHashCode(); + if (CreationHeightOnParentChain != 0L) hash ^= CreationHeightOnParentChain.GetHashCode(); + if (IsPrivilegePreserved != false) hash ^= IsPrivilegePreserved.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ParentChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ParentChainId); + } + if (CreationHeightOnParentChain != 0L) { + output.WriteRawTag(16); + output.WriteInt64(CreationHeightOnParentChain); + } + if (IsPrivilegePreserved != false) { + output.WriteRawTag(24); + output.WriteBool(IsPrivilegePreserved); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ParentChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentChainId); + } + if (CreationHeightOnParentChain != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreationHeightOnParentChain); + } + if (IsPrivilegePreserved != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(InitializeInput other) { + if (other == null) { + return; + } + if (other.ParentChainId != 0) { + ParentChainId = other.ParentChainId; + } + if (other.CreationHeightOnParentChain != 0L) { + CreationHeightOnParentChain = other.CreationHeightOnParentChain; + } + if (other.IsPrivilegePreserved != false) { + IsPrivilegePreserved = other.IsPrivilegePreserved; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ParentChainId = input.ReadInt32(); + break; + } + case 16: { + CreationHeightOnParentChain = input.ReadInt64(); + break; + } + case 24: { + IsPrivilegePreserved = input.ReadBool(); + break; + } + } + } + } + + } + + public sealed partial class SideChainCreatedEvent : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainCreatedEvent()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreatedEvent() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreatedEvent(SideChainCreatedEvent other) : this() { + creator_ = other.creator_ != null ? other.creator_.Clone() : null; + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreatedEvent Clone() { + return new SideChainCreatedEvent(this); + } + + /// Field number for the "creator" field. + public const int CreatorFieldNumber = 1; + private global::AElf.Types.Address creator_; + /// + /// The proposer who propose to create the side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Creator { + get { return creator_; } + set { + creator_ = value; + } + } + + /// Field number for the "chainId" field. + public const int ChainIdFieldNumber = 2; + private int chainId_; + /// + /// The created side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainCreatedEvent); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainCreatedEvent other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Creator, other.Creator)) return false; + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (creator_ != null) hash ^= Creator.GetHashCode(); + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (creator_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Creator); + } + if (ChainId != 0) { + output.WriteRawTag(16); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (creator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); + } + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainCreatedEvent other) { + if (other == null) { + return; + } + if (other.creator_ != null) { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + Creator.MergeFrom(other.Creator); + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 16: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class Disposed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Disposed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Disposed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Disposed(Disposed other) : this() { + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Disposed Clone() { + return new Disposed(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The disposed side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Disposed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Disposed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Disposed other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class ProposedCrossChainIndexing : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProposedCrossChainIndexing()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposedCrossChainIndexing() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposedCrossChainIndexing(ProposedCrossChainIndexing other) : this() { + chainIndexingProposalCollections_ = other.chainIndexingProposalCollections_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ProposedCrossChainIndexing Clone() { + return new ProposedCrossChainIndexing(this); + } + + /// Field number for the "chain_indexing_proposal_collections" field. + public const int ChainIndexingProposalCollectionsFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_chainIndexingProposalCollections_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::AElf.Contracts.CrossChain.ChainIndexingProposal.Parser), 10); + private readonly pbc::MapField chainIndexingProposalCollections_ = new pbc::MapField(); + /// + /// The collection of chain indexing proposal, the key is chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ChainIndexingProposalCollections { + get { return chainIndexingProposalCollections_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ProposedCrossChainIndexing); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ProposedCrossChainIndexing other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ChainIndexingProposalCollections.Equals(other.ChainIndexingProposalCollections)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ChainIndexingProposalCollections.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + chainIndexingProposalCollections_.WriteTo(output, _map_chainIndexingProposalCollections_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += chainIndexingProposalCollections_.CalculateSize(_map_chainIndexingProposalCollections_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ProposedCrossChainIndexing other) { + if (other == null) { + return; + } + chainIndexingProposalCollections_.Add(other.chainIndexingProposalCollections_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + chainIndexingProposalCollections_.AddEntriesFrom(input, _map_chainIndexingProposalCollections_codec); + break; + } + } + } + } + + } + + public sealed partial class ChainIndexingProposal : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainIndexingProposal()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIndexingProposal() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIndexingProposal(ChainIndexingProposal other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + proposedCrossChainBlockData_ = other.proposedCrossChainBlockData_ != null ? other.proposedCrossChainBlockData_.Clone() : null; + status_ = other.status_; + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainIndexingProposal Clone() { + return new ChainIndexingProposal(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of cross chain indexing proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 2; + private global::AElf.Types.Address proposer_; + /// + /// The proposer of cross chain indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "proposed_cross_chain_block_data" field. + public const int ProposedCrossChainBlockDataFieldNumber = 3; + private global::AElf.Standards.ACS7.CrossChainBlockData proposedCrossChainBlockData_; + /// + /// The cross chain data proposed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.CrossChainBlockData ProposedCrossChainBlockData { + get { return proposedCrossChainBlockData_; } + set { + proposedCrossChainBlockData_ = value; + } + } + + /// Field number for the "status" field. + public const int StatusFieldNumber = 4; + private global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus status_ = global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus.NonProposed; + /// + /// The status of of cross chain indexing proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus Status { + get { return status_; } + set { + status_ = value; + } + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 5; + private int chainId_; + /// + /// The chain id of the indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainIndexingProposal); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainIndexingProposal other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + if (!object.Equals(ProposedCrossChainBlockData, other.ProposedCrossChainBlockData)) return false; + if (Status != other.Status) return false; + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (proposedCrossChainBlockData_ != null) hash ^= ProposedCrossChainBlockData.GetHashCode(); + if (Status != global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus.NonProposed) hash ^= Status.GetHashCode(); + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (proposer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Proposer); + } + if (proposedCrossChainBlockData_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ProposedCrossChainBlockData); + } + if (Status != global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus.NonProposed) { + output.WriteRawTag(32); + output.WriteEnum((int) Status); + } + if (ChainId != 0) { + output.WriteRawTag(40); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (proposedCrossChainBlockData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedCrossChainBlockData); + } + if (Status != global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus.NonProposed) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); + } + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainIndexingProposal other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.proposedCrossChainBlockData_ != null) { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + ProposedCrossChainBlockData.MergeFrom(other.ProposedCrossChainBlockData); + } + if (other.Status != global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus.NonProposed) { + Status = other.Status; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 26: { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + input.ReadMessage(ProposedCrossChainBlockData); + break; + } + case 32: { + Status = (global::AElf.Contracts.CrossChain.CrossChainIndexingProposalStatus) input.ReadEnum(); + break; + } + case 40: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class GetIndexingProposalStatusOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetIndexingProposalStatusOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetIndexingProposalStatusOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetIndexingProposalStatusOutput(GetIndexingProposalStatusOutput other) : this() { + chainIndexingProposalStatus_ = other.chainIndexingProposalStatus_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetIndexingProposalStatusOutput Clone() { + return new GetIndexingProposalStatusOutput(this); + } + + /// Field number for the "chain_indexing_proposal_status" field. + public const int ChainIndexingProposalStatusFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_chainIndexingProposalStatus_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::AElf.Contracts.CrossChain.PendingChainIndexingProposalStatus.Parser), 10); + private readonly pbc::MapField chainIndexingProposalStatus_ = new pbc::MapField(); + /// + /// The collection of pending indexing proposal, the key is chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ChainIndexingProposalStatus { + get { return chainIndexingProposalStatus_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetIndexingProposalStatusOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetIndexingProposalStatusOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ChainIndexingProposalStatus.Equals(other.ChainIndexingProposalStatus)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ChainIndexingProposalStatus.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + chainIndexingProposalStatus_.WriteTo(output, _map_chainIndexingProposalStatus_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += chainIndexingProposalStatus_.CalculateSize(_map_chainIndexingProposalStatus_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetIndexingProposalStatusOutput other) { + if (other == null) { + return; + } + chainIndexingProposalStatus_.Add(other.chainIndexingProposalStatus_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + chainIndexingProposalStatus_.AddEntriesFrom(input, _map_chainIndexingProposalStatus_codec); + break; + } + } + } + } + + } + + public sealed partial class PendingChainIndexingProposalStatus : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PendingChainIndexingProposalStatus()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PendingChainIndexingProposalStatus() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PendingChainIndexingProposalStatus(PendingChainIndexingProposalStatus other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + toBeReleased_ = other.toBeReleased_; + proposedCrossChainBlockData_ = other.proposedCrossChainBlockData_ != null ? other.proposedCrossChainBlockData_.Clone() : null; + expiredTime_ = other.expiredTime_ != null ? other.expiredTime_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PendingChainIndexingProposalStatus Clone() { + return new PendingChainIndexingProposalStatus(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The id of cross chain indexing proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 2; + private global::AElf.Types.Address proposer_; + /// + /// The proposer of cross chain indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "to_be_released" field. + public const int ToBeReleasedFieldNumber = 3; + private bool toBeReleased_; + /// + /// True if the proposal can be released, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ToBeReleased { + get { return toBeReleased_; } + set { + toBeReleased_ = value; + } + } + + /// Field number for the "proposed_cross_chain_block_data" field. + public const int ProposedCrossChainBlockDataFieldNumber = 4; + private global::AElf.Standards.ACS7.CrossChainBlockData proposedCrossChainBlockData_; + /// + /// The cross chain data proposed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.CrossChainBlockData ProposedCrossChainBlockData { + get { return proposedCrossChainBlockData_; } + set { + proposedCrossChainBlockData_ = value; + } + } + + /// Field number for the "expired_time" field. + public const int ExpiredTimeFieldNumber = 5; + private global::Google.Protobuf.WellKnownTypes.Timestamp expiredTime_; + /// + /// The proposal expiration time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp ExpiredTime { + get { return expiredTime_; } + set { + expiredTime_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PendingChainIndexingProposalStatus); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PendingChainIndexingProposalStatus other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + if (ToBeReleased != other.ToBeReleased) return false; + if (!object.Equals(ProposedCrossChainBlockData, other.ProposedCrossChainBlockData)) return false; + if (!object.Equals(ExpiredTime, other.ExpiredTime)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (ToBeReleased != false) hash ^= ToBeReleased.GetHashCode(); + if (proposedCrossChainBlockData_ != null) hash ^= ProposedCrossChainBlockData.GetHashCode(); + if (expiredTime_ != null) hash ^= ExpiredTime.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (proposer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Proposer); + } + if (ToBeReleased != false) { + output.WriteRawTag(24); + output.WriteBool(ToBeReleased); + } + if (proposedCrossChainBlockData_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ProposedCrossChainBlockData); + } + if (expiredTime_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ExpiredTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (ToBeReleased != false) { + size += 1 + 1; + } + if (proposedCrossChainBlockData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedCrossChainBlockData); + } + if (expiredTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpiredTime); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PendingChainIndexingProposalStatus other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.ToBeReleased != false) { + ToBeReleased = other.ToBeReleased; + } + if (other.proposedCrossChainBlockData_ != null) { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + ProposedCrossChainBlockData.MergeFrom(other.ProposedCrossChainBlockData); + } + if (other.expiredTime_ != null) { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ExpiredTime.MergeFrom(other.ExpiredTime); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 24: { + ToBeReleased = input.ReadBool(); + break; + } + case 34: { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + input.ReadMessage(ProposedCrossChainBlockData); + break; + } + case 42: { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ExpiredTime); + break; + } + } + } + } + + } + + public sealed partial class GetPendingCrossChainIndexingProposalOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetPendingCrossChainIndexingProposalOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetPendingCrossChainIndexingProposalOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetPendingCrossChainIndexingProposalOutput(GetPendingCrossChainIndexingProposalOutput other) : this() { + proposalId_ = other.proposalId_ != null ? other.proposalId_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + toBeReleased_ = other.toBeReleased_; + proposedCrossChainBlockData_ = other.proposedCrossChainBlockData_ != null ? other.proposedCrossChainBlockData_.Clone() : null; + expiredTime_ = other.expiredTime_ != null ? other.expiredTime_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetPendingCrossChainIndexingProposalOutput Clone() { + return new GetPendingCrossChainIndexingProposalOutput(this); + } + + /// Field number for the "proposal_id" field. + public const int ProposalIdFieldNumber = 1; + private global::AElf.Types.Hash proposalId_; + /// + /// The proposal id of cross chain indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash ProposalId { + get { return proposalId_; } + set { + proposalId_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 2; + private global::AElf.Types.Address proposer_; + /// + /// The proposer of cross chain indexing proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "to_be_released" field. + public const int ToBeReleasedFieldNumber = 3; + private bool toBeReleased_; + /// + /// True if the proposal can be released, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ToBeReleased { + get { return toBeReleased_; } + set { + toBeReleased_ = value; + } + } + + /// Field number for the "proposed_cross_chain_block_data" field. + public const int ProposedCrossChainBlockDataFieldNumber = 4; + private global::AElf.Standards.ACS7.CrossChainBlockData proposedCrossChainBlockData_; + /// + /// The cross chain data proposed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.CrossChainBlockData ProposedCrossChainBlockData { + get { return proposedCrossChainBlockData_; } + set { + proposedCrossChainBlockData_ = value; + } + } + + /// Field number for the "expired_time" field. + public const int ExpiredTimeFieldNumber = 5; + private global::Google.Protobuf.WellKnownTypes.Timestamp expiredTime_; + /// + /// The proposal expiration time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp ExpiredTime { + get { return expiredTime_; } + set { + expiredTime_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetPendingCrossChainIndexingProposalOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetPendingCrossChainIndexingProposalOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ProposalId, other.ProposalId)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + if (ToBeReleased != other.ToBeReleased) return false; + if (!object.Equals(ProposedCrossChainBlockData, other.ProposedCrossChainBlockData)) return false; + if (!object.Equals(ExpiredTime, other.ExpiredTime)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposalId_ != null) hash ^= ProposalId.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (ToBeReleased != false) hash ^= ToBeReleased.GetHashCode(); + if (proposedCrossChainBlockData_ != null) hash ^= ProposedCrossChainBlockData.GetHashCode(); + if (expiredTime_ != null) hash ^= ExpiredTime.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposalId_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ProposalId); + } + if (proposer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Proposer); + } + if (ToBeReleased != false) { + output.WriteRawTag(24); + output.WriteBool(ToBeReleased); + } + if (proposedCrossChainBlockData_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ProposedCrossChainBlockData); + } + if (expiredTime_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ExpiredTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposalId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposalId); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (ToBeReleased != false) { + size += 1 + 1; + } + if (proposedCrossChainBlockData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProposedCrossChainBlockData); + } + if (expiredTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpiredTime); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetPendingCrossChainIndexingProposalOutput other) { + if (other == null) { + return; + } + if (other.proposalId_ != null) { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + ProposalId.MergeFrom(other.ProposalId); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.ToBeReleased != false) { + ToBeReleased = other.ToBeReleased; + } + if (other.proposedCrossChainBlockData_ != null) { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + ProposedCrossChainBlockData.MergeFrom(other.ProposedCrossChainBlockData); + } + if (other.expiredTime_ != null) { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ExpiredTime.MergeFrom(other.ExpiredTime); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposalId_ == null) { + ProposalId = new global::AElf.Types.Hash(); + } + input.ReadMessage(ProposalId); + break; + } + case 18: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 24: { + ToBeReleased = input.ReadBool(); + break; + } + case 34: { + if (proposedCrossChainBlockData_ == null) { + ProposedCrossChainBlockData = new global::AElf.Standards.ACS7.CrossChainBlockData(); + } + input.ReadMessage(ProposedCrossChainBlockData); + break; + } + case 42: { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ExpiredTime); + break; + } + } + } + } + + } + + public sealed partial class SideChainInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainInfo(SideChainInfo other) : this() { + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + sideChainStatus_ = other.sideChainStatus_; + sideChainId_ = other.sideChainId_; + creationTimestamp_ = other.creationTimestamp_ != null ? other.creationTimestamp_.Clone() : null; + creationHeightOnParentChain_ = other.creationHeightOnParentChain_; + indexingPrice_ = other.indexingPrice_; + isPrivilegePreserved_ = other.isPrivilegePreserved_; + arrearsInfo_ = other.arrearsInfo_.Clone(); + indexingFeeController_ = other.indexingFeeController_ != null ? other.indexingFeeController_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainInfo Clone() { + return new SideChainInfo(this); + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 1; + private global::AElf.Types.Address proposer_; + /// + /// The proposer who propose to create the side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + /// Field number for the "side_chain_status" field. + public const int SideChainStatusFieldNumber = 2; + private global::AElf.Contracts.CrossChain.SideChainStatus sideChainStatus_ = global::AElf.Contracts.CrossChain.SideChainStatus.Fatal; + /// + /// The status of side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.CrossChain.SideChainStatus SideChainStatus { + get { return sideChainStatus_; } + set { + sideChainStatus_ = value; + } + } + + /// Field number for the "side_chain_id" field. + public const int SideChainIdFieldNumber = 3; + private int sideChainId_; + /// + /// The side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SideChainId { + get { return sideChainId_; } + set { + sideChainId_ = value; + } + } + + /// Field number for the "creation_timestamp" field. + public const int CreationTimestampFieldNumber = 4; + private global::Google.Protobuf.WellKnownTypes.Timestamp creationTimestamp_; + /// + /// The time of side chain created. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp CreationTimestamp { + get { return creationTimestamp_; } + set { + creationTimestamp_ = value; + } + } + + /// Field number for the "creation_height_on_parent_chain" field. + public const int CreationHeightOnParentChainFieldNumber = 5; + private long creationHeightOnParentChain_; + /// + /// The height of side chain created on parent chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long CreationHeightOnParentChain { + get { return creationHeightOnParentChain_; } + set { + creationHeightOnParentChain_ = value; + } + } + + /// Field number for the "indexing_price" field. + public const int IndexingPriceFieldNumber = 6; + private long indexingPrice_; + /// + /// The price of indexing fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexingPrice { + get { return indexingPrice_; } + set { + indexingPrice_ = value; + } + } + + /// Field number for the "is_privilege_preserved" field. + public const int IsPrivilegePreservedFieldNumber = 7; + private bool isPrivilegePreserved_; + /// + /// True if chain privilege needed, otherwise false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsPrivilegePreserved { + get { return isPrivilegePreserved_; } + set { + isPrivilegePreserved_ = value; + } + } + + /// Field number for the "arrears_info" field. + public const int ArrearsInfoFieldNumber = 8; + private static readonly pbc::MapField.Codec _map_arrearsInfo_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 66); + private readonly pbc::MapField arrearsInfo_ = new pbc::MapField(); + /// + /// creditor and amounts for the chain indexing fee debt + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ArrearsInfo { + get { return arrearsInfo_; } + } + + /// Field number for the "indexing_fee_controller" field. + public const int IndexingFeeControllerFieldNumber = 9; + private global::AuthorityInfo indexingFeeController_; + /// + /// The controller of indexing fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AuthorityInfo IndexingFeeController { + get { return indexingFeeController_; } + set { + indexingFeeController_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Proposer, other.Proposer)) return false; + if (SideChainStatus != other.SideChainStatus) return false; + if (SideChainId != other.SideChainId) return false; + if (!object.Equals(CreationTimestamp, other.CreationTimestamp)) return false; + if (CreationHeightOnParentChain != other.CreationHeightOnParentChain) return false; + if (IndexingPrice != other.IndexingPrice) return false; + if (IsPrivilegePreserved != other.IsPrivilegePreserved) return false; + if (!ArrearsInfo.Equals(other.ArrearsInfo)) return false; + if (!object.Equals(IndexingFeeController, other.IndexingFeeController)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (SideChainStatus != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) hash ^= SideChainStatus.GetHashCode(); + if (SideChainId != 0) hash ^= SideChainId.GetHashCode(); + if (creationTimestamp_ != null) hash ^= CreationTimestamp.GetHashCode(); + if (CreationHeightOnParentChain != 0L) hash ^= CreationHeightOnParentChain.GetHashCode(); + if (IndexingPrice != 0L) hash ^= IndexingPrice.GetHashCode(); + if (IsPrivilegePreserved != false) hash ^= IsPrivilegePreserved.GetHashCode(); + hash ^= ArrearsInfo.GetHashCode(); + if (indexingFeeController_ != null) hash ^= IndexingFeeController.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (proposer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Proposer); + } + if (SideChainStatus != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + output.WriteRawTag(16); + output.WriteEnum((int) SideChainStatus); + } + if (SideChainId != 0) { + output.WriteRawTag(24); + output.WriteInt32(SideChainId); + } + if (creationTimestamp_ != null) { + output.WriteRawTag(34); + output.WriteMessage(CreationTimestamp); + } + if (CreationHeightOnParentChain != 0L) { + output.WriteRawTag(40); + output.WriteInt64(CreationHeightOnParentChain); + } + if (IndexingPrice != 0L) { + output.WriteRawTag(48); + output.WriteInt64(IndexingPrice); + } + if (IsPrivilegePreserved != false) { + output.WriteRawTag(56); + output.WriteBool(IsPrivilegePreserved); + } + arrearsInfo_.WriteTo(output, _map_arrearsInfo_codec); + if (indexingFeeController_ != null) { + output.WriteRawTag(74); + output.WriteMessage(IndexingFeeController); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (SideChainStatus != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SideChainStatus); + } + if (SideChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SideChainId); + } + if (creationTimestamp_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreationTimestamp); + } + if (CreationHeightOnParentChain != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreationHeightOnParentChain); + } + if (IndexingPrice != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexingPrice); + } + if (IsPrivilegePreserved != false) { + size += 1 + 1; + } + size += arrearsInfo_.CalculateSize(_map_arrearsInfo_codec); + if (indexingFeeController_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IndexingFeeController); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainInfo other) { + if (other == null) { + return; + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + if (other.SideChainStatus != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + SideChainStatus = other.SideChainStatus; + } + if (other.SideChainId != 0) { + SideChainId = other.SideChainId; + } + if (other.creationTimestamp_ != null) { + if (creationTimestamp_ == null) { + CreationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + CreationTimestamp.MergeFrom(other.CreationTimestamp); + } + if (other.CreationHeightOnParentChain != 0L) { + CreationHeightOnParentChain = other.CreationHeightOnParentChain; + } + if (other.IndexingPrice != 0L) { + IndexingPrice = other.IndexingPrice; + } + if (other.IsPrivilegePreserved != false) { + IsPrivilegePreserved = other.IsPrivilegePreserved; + } + arrearsInfo_.Add(other.arrearsInfo_); + if (other.indexingFeeController_ != null) { + if (indexingFeeController_ == null) { + IndexingFeeController = new global::AuthorityInfo(); + } + IndexingFeeController.MergeFrom(other.IndexingFeeController); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + case 16: { + SideChainStatus = (global::AElf.Contracts.CrossChain.SideChainStatus) input.ReadEnum(); + break; + } + case 24: { + SideChainId = input.ReadInt32(); + break; + } + case 34: { + if (creationTimestamp_ == null) { + CreationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(CreationTimestamp); + break; + } + case 40: { + CreationHeightOnParentChain = input.ReadInt64(); + break; + } + case 48: { + IndexingPrice = input.ReadInt64(); + break; + } + case 56: { + IsPrivilegePreserved = input.ReadBool(); + break; + } + case 66: { + arrearsInfo_.AddEntriesFrom(input, _map_arrearsInfo_codec); + break; + } + case 74: { + if (indexingFeeController_ == null) { + IndexingFeeController = new global::AuthorityInfo(); + } + input.ReadMessage(IndexingFeeController); + break; + } + } + } + } + + } + + public sealed partial class GetChainStatusOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetChainStatusOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetChainStatusOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetChainStatusOutput(GetChainStatusOutput other) : this() { + status_ = other.status_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetChainStatusOutput Clone() { + return new GetChainStatusOutput(this); + } + + /// Field number for the "status" field. + public const int StatusFieldNumber = 1; + private global::AElf.Contracts.CrossChain.SideChainStatus status_ = global::AElf.Contracts.CrossChain.SideChainStatus.Fatal; + /// + /// The status of side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.CrossChain.SideChainStatus Status { + get { return status_; } + set { + status_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetChainStatusOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetChainStatusOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Status != other.Status) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Status != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) hash ^= Status.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Status != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + output.WriteRawTag(8); + output.WriteEnum((int) Status); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Status != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetChainStatusOutput other) { + if (other == null) { + return; + } + if (other.Status != global::AElf.Contracts.CrossChain.SideChainStatus.Fatal) { + Status = other.Status; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Status = (global::AElf.Contracts.CrossChain.SideChainStatus) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class SideChainCreationRequestState : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainCreationRequestState()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequestState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequestState(SideChainCreationRequestState other) : this() { + sideChainCreationRequest_ = other.sideChainCreationRequest_ != null ? other.sideChainCreationRequest_.Clone() : null; + expiredTime_ = other.expiredTime_ != null ? other.expiredTime_.Clone() : null; + proposer_ = other.proposer_ != null ? other.proposer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainCreationRequestState Clone() { + return new SideChainCreationRequestState(this); + } + + /// Field number for the "side_chain_creation_request" field. + public const int SideChainCreationRequestFieldNumber = 1; + private global::AElf.Standards.ACS7.SideChainCreationRequest sideChainCreationRequest_; + /// + /// The parameters of creating side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Standards.ACS7.SideChainCreationRequest SideChainCreationRequest { + get { return sideChainCreationRequest_; } + set { + sideChainCreationRequest_ = value; + } + } + + /// Field number for the "expired_time" field. + public const int ExpiredTimeFieldNumber = 2; + private global::Google.Protobuf.WellKnownTypes.Timestamp expiredTime_; + /// + /// The expiration date of the proposal. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Timestamp ExpiredTime { + get { return expiredTime_; } + set { + expiredTime_ = value; + } + } + + /// Field number for the "proposer" field. + public const int ProposerFieldNumber = 3; + private global::AElf.Types.Address proposer_; + /// + /// The proposer who proposed to create the side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Proposer { + get { return proposer_; } + set { + proposer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainCreationRequestState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainCreationRequestState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SideChainCreationRequest, other.SideChainCreationRequest)) return false; + if (!object.Equals(ExpiredTime, other.ExpiredTime)) return false; + if (!object.Equals(Proposer, other.Proposer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (sideChainCreationRequest_ != null) hash ^= SideChainCreationRequest.GetHashCode(); + if (expiredTime_ != null) hash ^= ExpiredTime.GetHashCode(); + if (proposer_ != null) hash ^= Proposer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (sideChainCreationRequest_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SideChainCreationRequest); + } + if (expiredTime_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ExpiredTime); + } + if (proposer_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Proposer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (sideChainCreationRequest_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SideChainCreationRequest); + } + if (expiredTime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpiredTime); + } + if (proposer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Proposer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainCreationRequestState other) { + if (other == null) { + return; + } + if (other.sideChainCreationRequest_ != null) { + if (sideChainCreationRequest_ == null) { + SideChainCreationRequest = new global::AElf.Standards.ACS7.SideChainCreationRequest(); + } + SideChainCreationRequest.MergeFrom(other.SideChainCreationRequest); + } + if (other.expiredTime_ != null) { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + ExpiredTime.MergeFrom(other.ExpiredTime); + } + if (other.proposer_ != null) { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + Proposer.MergeFrom(other.Proposer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (sideChainCreationRequest_ == null) { + SideChainCreationRequest = new global::AElf.Standards.ACS7.SideChainCreationRequest(); + } + input.ReadMessage(SideChainCreationRequest); + break; + } + case 18: { + if (expiredTime_ == null) { + ExpiredTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(ExpiredTime); + break; + } + case 26: { + if (proposer_ == null) { + Proposer = new global::AElf.Types.Address(); + } + input.ReadMessage(Proposer); + break; + } + } + } + } + + } + + public sealed partial class ChangeSideChainIndexingFeeControllerInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChangeSideChainIndexingFeeControllerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeSideChainIndexingFeeControllerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeSideChainIndexingFeeControllerInput(ChangeSideChainIndexingFeeControllerInput other) : this() { + chainId_ = other.chainId_; + authorityInfo_ = other.authorityInfo_ != null ? other.authorityInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeSideChainIndexingFeeControllerInput Clone() { + return new ChangeSideChainIndexingFeeControllerInput(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "authority_info" field. + public const int AuthorityInfoFieldNumber = 2; + private global::AuthorityInfo authorityInfo_; + /// + /// The changed controller of indexing fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AuthorityInfo AuthorityInfo { + get { return authorityInfo_; } + set { + authorityInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChangeSideChainIndexingFeeControllerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChangeSideChainIndexingFeeControllerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (!object.Equals(AuthorityInfo, other.AuthorityInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (authorityInfo_ != null) hash ^= AuthorityInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (authorityInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(AuthorityInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (authorityInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AuthorityInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChangeSideChainIndexingFeeControllerInput other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.authorityInfo_ != null) { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + AuthorityInfo.MergeFrom(other.AuthorityInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 18: { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + input.ReadMessage(AuthorityInfo); + break; + } + } + } + } + + } + + public sealed partial class SideChainLifetimeControllerChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainLifetimeControllerChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainLifetimeControllerChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainLifetimeControllerChanged(SideChainLifetimeControllerChanged other) : this() { + authorityInfo_ = other.authorityInfo_ != null ? other.authorityInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainLifetimeControllerChanged Clone() { + return new SideChainLifetimeControllerChanged(this); + } + + /// Field number for the "authority_info" field. + public const int AuthorityInfoFieldNumber = 1; + private global::AuthorityInfo authorityInfo_; + /// + /// The changed controller of side chain lifetime. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AuthorityInfo AuthorityInfo { + get { return authorityInfo_; } + set { + authorityInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainLifetimeControllerChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainLifetimeControllerChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(AuthorityInfo, other.AuthorityInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (authorityInfo_ != null) hash ^= AuthorityInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (authorityInfo_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AuthorityInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (authorityInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AuthorityInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainLifetimeControllerChanged other) { + if (other == null) { + return; + } + if (other.authorityInfo_ != null) { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + AuthorityInfo.MergeFrom(other.AuthorityInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + input.ReadMessage(AuthorityInfo); + break; + } + } + } + } + + } + + public sealed partial class CrossChainIndexingControllerChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainIndexingControllerChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingControllerChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingControllerChanged(CrossChainIndexingControllerChanged other) : this() { + authorityInfo_ = other.authorityInfo_ != null ? other.authorityInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainIndexingControllerChanged Clone() { + return new CrossChainIndexingControllerChanged(this); + } + + /// Field number for the "authority_info" field. + public const int AuthorityInfoFieldNumber = 1; + private global::AuthorityInfo authorityInfo_; + /// + /// The changed controller of indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AuthorityInfo AuthorityInfo { + get { return authorityInfo_; } + set { + authorityInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainIndexingControllerChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainIndexingControllerChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(AuthorityInfo, other.AuthorityInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (authorityInfo_ != null) hash ^= AuthorityInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (authorityInfo_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AuthorityInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (authorityInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AuthorityInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainIndexingControllerChanged other) { + if (other == null) { + return; + } + if (other.authorityInfo_ != null) { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + AuthorityInfo.MergeFrom(other.AuthorityInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + input.ReadMessage(AuthorityInfo); + break; + } + } + } + } + + } + + public sealed partial class SideChainIndexingFeeControllerChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainIndexingFeeControllerChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingFeeControllerChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingFeeControllerChanged(SideChainIndexingFeeControllerChanged other) : this() { + chainId_ = other.chainId_; + authorityInfo_ = other.authorityInfo_ != null ? other.authorityInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexingFeeControllerChanged Clone() { + return new SideChainIndexingFeeControllerChanged(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The side chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "authority_info" field. + public const int AuthorityInfoFieldNumber = 2; + private global::AuthorityInfo authorityInfo_; + /// + /// The changed controller of side chain indexing fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AuthorityInfo AuthorityInfo { + get { return authorityInfo_; } + set { + authorityInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainIndexingFeeControllerChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainIndexingFeeControllerChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (!object.Equals(AuthorityInfo, other.AuthorityInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (authorityInfo_ != null) hash ^= AuthorityInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (authorityInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(AuthorityInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (authorityInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AuthorityInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainIndexingFeeControllerChanged other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.authorityInfo_ != null) { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + AuthorityInfo.MergeFrom(other.AuthorityInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 18: { + if (authorityInfo_ == null) { + AuthorityInfo = new global::AuthorityInfo(); + } + input.ReadMessage(AuthorityInfo); + break; + } + } + } + } + + } + + public sealed partial class AcceptCrossChainIndexingProposalInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AcceptCrossChainIndexingProposalInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AcceptCrossChainIndexingProposalInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AcceptCrossChainIndexingProposalInput(AcceptCrossChainIndexingProposalInput other) : this() { + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AcceptCrossChainIndexingProposalInput Clone() { + return new AcceptCrossChainIndexingProposalInput(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The chain id of accepted indexing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AcceptCrossChainIndexingProposalInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AcceptCrossChainIndexingProposalInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AcceptCrossChainIndexingProposalInput other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class SideChainIndexed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SideChainIndexed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexed(SideChainIndexed other) : this() { + chainId_ = other.chainId_; + indexedHeight_ = other.indexedHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SideChainIndexed Clone() { + return new SideChainIndexed(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "indexed_height" field. + public const int IndexedHeightFieldNumber = 2; + private long indexedHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexedHeight { + get { return indexedHeight_; } + set { + indexedHeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SideChainIndexed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SideChainIndexed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (IndexedHeight != other.IndexedHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (IndexedHeight != 0L) hash ^= IndexedHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (IndexedHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(IndexedHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (IndexedHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexedHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SideChainIndexed other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.IndexedHeight != 0L) { + IndexedHeight = other.IndexedHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 16: { + IndexedHeight = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class ParentChainIndexed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ParentChainIndexed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.CrossChain.CrossChainContractReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainIndexed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainIndexed(ParentChainIndexed other) : this() { + chainId_ = other.chainId_; + indexedHeight_ = other.indexedHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ParentChainIndexed Clone() { + return new ParentChainIndexed(this); + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + /// Field number for the "indexed_height" field. + public const int IndexedHeightFieldNumber = 2; + private long indexedHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long IndexedHeight { + get { return indexedHeight_; } + set { + indexedHeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ParentChainIndexed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ParentChainIndexed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + if (IndexedHeight != other.IndexedHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (IndexedHeight != 0L) hash ^= IndexedHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (IndexedHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(IndexedHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (IndexedHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IndexedHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ParentChainIndexed other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + if (other.IndexedHeight != 0L) { + IndexedHeight = other.IndexedHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + case 16: { + IndexedHeight = input.ReadInt64(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/DailyLimitDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/DailyLimitDto.cs new file mode 100644 index 0000000..80f5f87 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/DailyLimitDto.cs @@ -0,0 +1,14 @@ +using System; + +namespace AElf.CrossChainServer.Contracts; + +public class DailyLimitDto +{ + public decimal DefaultDailyLimit { get; set; } + + // Refresh Time + public long RefreshTime { get; set; } + + // Current Daily Limit + public decimal CurrentDailyLimit { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/IBridgeContractAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/IBridgeContractAppService.cs new file mode 100644 index 0000000..423251c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/IBridgeContractAppService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.BridgeContract; +using AElf.CrossChainServer.TokenPool; + +namespace AElf.CrossChainServer.Contracts; + +public interface IBridgeContractAppService +{ + Task GetDailyLimitAsync(string chainId, Guid tokenId, string targetChainId); + Task GetSwapDailyLimitAsync(string chainId, string swapId); + + Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, List tokenIds, List targetChainIds); + Task> GetCurrentSwapTokenBucketStatesAsync(string chainId, List tokenIds, List fromChainIds); + + Task> GetPoolLiquidityAsync(string chainId, string contractAddress,List tokenIds); + + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ICrossChainContractAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ICrossChainContractAppService.cs new file mode 100644 index 0000000..155c033 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ICrossChainContractAppService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; +using AElf.Standards.ACS7; + +namespace AElf.CrossChainServer.Contracts; + +public interface ICrossChainContractAppService +{ + Task GetBoundParentChainHeightAndMerklePathByHeightAsync(string chainId, long height); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ITokenContractAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ITokenContractAppService.cs new file mode 100644 index 0000000..8492dd5 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ITokenContractAppService.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using AElf.Types; + +namespace AElf.CrossChainServer.Contracts; + +public interface ITokenContractAppService +{ + Task CrossChainReceiveTokenAsync(string chainId, int fromChainId, long parentChainHeight, + string transferTransaction, MerklePath merklePath); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.c.cs new file mode 100644 index 0000000..7f8c97e --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.c.cs @@ -0,0 +1,38 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: inline_transaction.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Types { + + #region Events + public partial class InlineTransactionCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new InlineTransactionCreated + { + Transaction = Transaction + }, + }; + } + + public InlineTransactionCreated GetNonIndexed() + { + return new InlineTransactionCreated + { + }; + } + } + + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.g.cs new file mode 100644 index 0000000..29d1bad --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/InlineTransaction.g.cs @@ -0,0 +1,244 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: inline_transaction.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Types { + + /// Holder for reflection information generated from inline_transaction.proto + public static partial class InlineTransactionReflection { + + #region Descriptor + /// File descriptor for inline_transaction.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static InlineTransactionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChhpbmxpbmVfdHJhbnNhY3Rpb24ucHJvdG8aD2FlbGYvY29yZS5wcm90bxoS", + "YWVsZi9vcHRpb25zLnByb3RvIk8KGElubGluZVRyYW5zYWN0aW9uQ3JlYXRl", + "ZBItCgt0cmFuc2FjdGlvbhgBIAEoCzIRLmFlbGYuVHJhbnNhY3Rpb25CBYiP", + "9QEBOgSguxgBMhMKEUlubGluZVRyYW5zYWN0aW9uQg2qAgpBRWxmLlR5cGVz", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Types.InlineTransactionCreated), global::AElf.Types.InlineTransactionCreated.Parser, new[]{ "Transaction" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class InlineTransactionCreated : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InlineTransactionCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Types.InlineTransactionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InlineTransactionCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InlineTransactionCreated(InlineTransactionCreated other) : this() { + transaction_ = other.transaction_ != null ? other.transaction_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InlineTransactionCreated Clone() { + return new InlineTransactionCreated(this); + } + + /// Field number for the "transaction" field. + public const int TransactionFieldNumber = 1; + private global::AElf.Types.Transaction transaction_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Transaction Transaction { + get { return transaction_; } + set { + transaction_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InlineTransactionCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InlineTransactionCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Transaction, other.Transaction)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (transaction_ != null) hash ^= Transaction.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (transaction_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Transaction); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (transaction_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Transaction); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (transaction_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Transaction); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InlineTransactionCreated other) { + if (other == null) { + return; + } + if (other.transaction_ != null) { + if (transaction_ == null) { + Transaction = new global::AElf.Types.Transaction(); + } + Transaction.MergeFrom(other.Transaction); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (transaction_ == null) { + Transaction = new global::AElf.Types.Transaction(); + } + input.ReadMessage(Transaction); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (transaction_ == null) { + Transaction = new global::AElf.Types.Transaction(); + } + input.ReadMessage(Transaction); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenBucketDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenBucketDto.cs new file mode 100644 index 0000000..48a3898 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenBucketDto.cs @@ -0,0 +1,11 @@ +namespace AElf.CrossChainServer.Contracts; + +public class TokenBucketDto +{ + public decimal Capacity { get; set; } + public decimal RefillRate { get; set; } + public int MaximumTimeConsumed { get; set; } + public decimal CurrentTokenAmount { get; set; } + public bool IsEnabled { get; set; } + public long LastUpdatedTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.c.cs new file mode 100644 index 0000000..27b05d4 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.c.cs @@ -0,0 +1,344 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_contract.proto +// +// Original file comments: +// * +// MultiToken contract. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Contracts.MultiToken { + + #region Events + public partial class ExtraTokenListModified : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public ExtraTokenListModified GetNonIndexed() + { + return new ExtraTokenListModified + { + SymbolListToPayTxSizeFee = SymbolListToPayTxSizeFee, + }; + } + } + + public partial class Transferred : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new Transferred + { + From = From + }, + new Transferred + { + To = To + }, + new Transferred + { + Symbol = Symbol + }, + }; + } + + public Transferred GetNonIndexed() + { + return new Transferred + { + Amount = Amount, + Memo = Memo, + }; + } + } + + public partial class Approved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new Approved + { + Owner = Owner + }, + new Approved + { + Spender = Spender + }, + new Approved + { + Symbol = Symbol + }, + }; + } + + public Approved GetNonIndexed() + { + return new Approved + { + Amount = Amount, + }; + } + } + + public partial class UnApproved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new UnApproved + { + Owner = Owner + }, + new UnApproved + { + Spender = Spender + }, + new UnApproved + { + Symbol = Symbol + }, + }; + } + + public UnApproved GetNonIndexed() + { + return new UnApproved + { + Amount = Amount, + }; + } + } + + public partial class Burned : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new Burned + { + Burner = Burner + }, + new Burned + { + Symbol = Symbol + }, + }; + } + + public Burned GetNonIndexed() + { + return new Burned + { + Amount = Amount, + }; + } + } + + public partial class ChainPrimaryTokenSymbolSet : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public ChainPrimaryTokenSymbolSet GetNonIndexed() + { + return new ChainPrimaryTokenSymbolSet + { + TokenSymbol = TokenSymbol, + }; + } + } + + public partial class CalculateFeeAlgorithmUpdated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CalculateFeeAlgorithmUpdated GetNonIndexed() + { + return new CalculateFeeAlgorithmUpdated + { + AllTypeFeeCoefficients = AllTypeFeeCoefficients, + }; + } + } + + public partial class RentalCharged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public RentalCharged GetNonIndexed() + { + return new RentalCharged + { + Symbol = Symbol, + Amount = Amount, + }; + } + } + + public partial class RentalAccountBalanceInsufficient : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public RentalAccountBalanceInsufficient GetNonIndexed() + { + return new RentalAccountBalanceInsufficient + { + Symbol = Symbol, + Amount = Amount, + }; + } + } + + public partial class TokenCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public TokenCreated GetNonIndexed() + { + return new TokenCreated + { + Symbol = Symbol, + TokenName = TokenName, + TotalSupply = TotalSupply, + Decimals = Decimals, + Issuer = Issuer, + IsBurnable = IsBurnable, + IssueChainId = IssueChainId, + ExternalInfo = ExternalInfo, + }; + } + } + + public partial class Issued : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public Issued GetNonIndexed() + { + return new Issued + { + Symbol = Symbol, + Amount = Amount, + Memo = Memo, + To = To, + }; + } + } + + public partial class CrossChainTransferred : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CrossChainTransferred GetNonIndexed() + { + return new CrossChainTransferred + { + From = From, + To = To, + Symbol = Symbol, + Amount = Amount, + Memo = Memo, + ToChainId = ToChainId, + IssueChainId = IssueChainId, + }; + } + } + + public partial class CrossChainReceived : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CrossChainReceived GetNonIndexed() + { + return new CrossChainReceived + { + From = From, + To = To, + Symbol = Symbol, + Amount = Amount, + Memo = Memo, + FromChainId = FromChainId, + IssueChainId = IssueChainId, + ParentChainHeight = ParentChainHeight, + TransferTransactionId = TransferTransactionId, + }; + } + } + + public partial class ExternalInfoChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public ExternalInfoChanged GetNonIndexed() + { + return new ExternalInfoChanged + { + Symbol = Symbol, + ExternalInfo = ExternalInfo, + }; + } + } + + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.g.cs new file mode 100644 index 0000000..0d5595e --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContract.g.cs @@ -0,0 +1,12202 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_contract.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Contracts.MultiToken { + + /// Holder for reflection information generated from token_contract.proto + public static partial class TokenContractReflection { + + #region Descriptor + /// File descriptor for token_contract.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TokenContractReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChR0b2tlbl9jb250cmFjdC5wcm90bxIFdG9rZW4aD2FlbGYvY29yZS5wcm90", + "bxoSYWVsZi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHku", + "cHJvdG8aHmdvb2dsZS9wcm90b2J1Zi93cmFwcGVycy5wcm90byLvAQoJVG9r", + "ZW5JbmZvEg4KBnN5bWJvbBgBIAEoCRISCgp0b2tlbl9uYW1lGAIgASgJEg4K", + "BnN1cHBseRgDIAEoAxIUCgx0b3RhbF9zdXBwbHkYBCABKAMSEAoIZGVjaW1h", + "bHMYBSABKAUSHQoGaXNzdWVyGAYgASgLMg0uYWVsZi5BZGRyZXNzEhMKC2lz", + "X2J1cm5hYmxlGAcgASgIEhYKDmlzc3VlX2NoYWluX2lkGAggASgFEg4KBmlz", + "c3VlZBgJIAEoAxIqCg1leHRlcm5hbF9pbmZvGAogASgLMhMudG9rZW4uRXh0", + "ZXJuYWxJbmZvImsKDEV4dGVybmFsSW5mbxItCgV2YWx1ZRgBIAMoCzIeLnRv", + "a2VuLkV4dGVybmFsSW5mby5WYWx1ZUVudHJ5GiwKClZhbHVlRW50cnkSCwoD", + "a2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASL5AQoLQ3JlYXRlSW5wdXQS", + "DgoGc3ltYm9sGAEgASgJEhIKCnRva2VuX25hbWUYAiABKAkSFAoMdG90YWxf", + "c3VwcGx5GAMgASgDEhAKCGRlY2ltYWxzGAQgASgFEh0KBmlzc3VlchgFIAEo", + "CzINLmFlbGYuQWRkcmVzcxITCgtpc19idXJuYWJsZRgGIAEoCBImCg9sb2Nr", + "X3doaXRlX2xpc3QYByADKAsyDS5hZWxmLkFkZHJlc3MSFgoOaXNzdWVfY2hh", + "aW5faWQYCCABKAUSKgoNZXh0ZXJuYWxfaW5mbxgJIAEoCzITLnRva2VuLkV4", + "dGVybmFsSW5mbyIsChpTZXRQcmltYXJ5VG9rZW5TeW1ib2xJbnB1dBIOCgZz", + "eW1ib2wYASABKAkiVQoKSXNzdWVJbnB1dBIOCgZzeW1ib2wYASABKAkSDgoG", + "YW1vdW50GAIgASgDEgwKBG1lbW8YAyABKAkSGQoCdG8YBCABKAsyDS5hZWxm", + "LkFkZHJlc3MiWAoNVHJhbnNmZXJJbnB1dBIZCgJ0bxgBIAEoCzINLmFlbGYu", + "QWRkcmVzcxIOCgZzeW1ib2wYAiABKAkSDgoGYW1vdW50GAMgASgDEgwKBG1l", + "bW8YBCABKAkidwoJTG9ja0lucHV0Eh4KB2FkZHJlc3MYASABKAsyDS5hZWxm", + "LkFkZHJlc3MSGwoHbG9ja19pZBgCIAEoCzIKLmFlbGYuSGFzaBIOCgZzeW1i", + "b2wYAyABKAkSDQoFdXNhZ2UYBCABKAkSDgoGYW1vdW50GAUgASgDInkKC1Vu", + "bG9ja0lucHV0Eh4KB2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSGwoH", + "bG9ja19pZBgCIAEoCzIKLmFlbGYuSGFzaBIOCgZzeW1ib2wYAyABKAkSDQoF", + "dXNhZ2UYBCABKAkSDgoGYW1vdW50GAUgASgDInkKEVRyYW5zZmVyRnJvbUlu", + "cHV0EhsKBGZyb20YASABKAsyDS5hZWxmLkFkZHJlc3MSGQoCdG8YAiABKAsy", + "DS5hZWxmLkFkZHJlc3MSDgoGc3ltYm9sGAMgASgJEg4KBmFtb3VudBgEIAEo", + "AxIMCgRtZW1vGAUgASgJIk4KDEFwcHJvdmVJbnB1dBIeCgdzcGVuZGVyGAEg", + "ASgLMg0uYWVsZi5BZGRyZXNzEg4KBnN5bWJvbBgCIAEoCRIOCgZhbW91bnQY", + "AyABKAMiUAoOVW5BcHByb3ZlSW5wdXQSHgoHc3BlbmRlchgBIAEoCzINLmFl", + "bGYuQWRkcmVzcxIOCgZzeW1ib2wYAiABKAkSDgoGYW1vdW50GAMgASgDIisK", + "CUJ1cm5JbnB1dBIOCgZzeW1ib2wYASABKAkSDgoGYW1vdW50GAIgASgDIqkB", + "ChhDaGFyZ2VSZXNvdXJjZVRva2VuSW5wdXQSPgoIY29zdF9kaWMYASADKAsy", + "LC50b2tlbi5DaGFyZ2VSZXNvdXJjZVRva2VuSW5wdXQuQ29zdERpY0VudHJ5", + "Eh0KBmNhbGxlchgCIAEoCzINLmFlbGYuQWRkcmVzcxouCgxDb3N0RGljRW50", + "cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgDOgI4ASJ+ChJUcmFuc2Fj", + "dGlvbkZlZUJpbGwSOAoIZmVlc19tYXAYASADKAsyJi50b2tlbi5UcmFuc2Fj", + "dGlvbkZlZUJpbGwuRmVlc01hcEVudHJ5Gi4KDEZlZXNNYXBFbnRyeRILCgNr", + "ZXkYASABKAkSDQoFdmFsdWUYAiABKAM6AjgBItoBChNDaGVja1RocmVzaG9s", + "ZElucHV0Eh0KBnNlbmRlchgBIAEoCzINLmFlbGYuQWRkcmVzcxJOChNzeW1i", + "b2xfdG9fdGhyZXNob2xkGAIgAygLMjEudG9rZW4uQ2hlY2tUaHJlc2hvbGRJ", + "bnB1dC5TeW1ib2xUb1RocmVzaG9sZEVudHJ5EhoKEmlzX2NoZWNrX2FsbG93", + "YW5jZRgDIAEoCBo4ChZTeW1ib2xUb1RocmVzaG9sZEVudHJ5EgsKA2tleRgB", + "IAEoCRINCgV2YWx1ZRgCIAEoAzoCOAEiIwoRR2V0VG9rZW5JbmZvSW5wdXQS", + "DgoGc3ltYm9sGAEgASgJIj8KD0dldEJhbGFuY2VJbnB1dBIOCgZzeW1ib2wY", + "ASABKAkSHAoFb3duZXIYAiABKAsyDS5hZWxmLkFkZHJlc3MiUQoQR2V0QmFs", + "YW5jZU91dHB1dBIOCgZzeW1ib2wYASABKAkSHAoFb3duZXIYAiABKAsyDS5h", + "ZWxmLkFkZHJlc3MSDwoHYmFsYW5jZRgDIAEoAyJhChFHZXRBbGxvd2FuY2VJ", + "bnB1dBIOCgZzeW1ib2wYASABKAkSHAoFb3duZXIYAiABKAsyDS5hZWxmLkFk", + "ZHJlc3MSHgoHc3BlbmRlchgDIAEoCzINLmFlbGYuQWRkcmVzcyJ1ChJHZXRB", + "bGxvd2FuY2VPdXRwdXQSDgoGc3ltYm9sGAEgASgJEhwKBW93bmVyGAIgASgL", + "Mg0uYWVsZi5BZGRyZXNzEh4KB3NwZW5kZXIYAyABKAsyDS5hZWxmLkFkZHJl", + "c3MSEQoJYWxsb3dhbmNlGAQgASgDIo8BChdDcm9zc0NoYWluVHJhbnNmZXJJ", + "bnB1dBIZCgJ0bxgBIAEoCzINLmFlbGYuQWRkcmVzcxIOCgZzeW1ib2wYAiAB", + "KAkSDgoGYW1vdW50GAMgASgDEgwKBG1lbW8YBCABKAkSEwoLdG9fY2hhaW5f", + "aWQYBSABKAUSFgoOaXNzdWVfY2hhaW5faWQYBiABKAUinAEKG0Nyb3NzQ2hh", + "aW5SZWNlaXZlVG9rZW5JbnB1dBIVCg1mcm9tX2NoYWluX2lkGAEgASgFEhsK", + "E3BhcmVudF9jaGFpbl9oZWlnaHQYAiABKAMSIgoadHJhbnNmZXJfdHJhbnNh", + "Y3Rpb25fYnl0ZXMYAyABKAwSJQoLbWVya2xlX3BhdGgYBCABKAsyEC5hZWxm", + "Lk1lcmtsZVBhdGgiRAoSSXNJbldoaXRlTGlzdElucHV0Eg4KBnN5bWJvbBgB", + "IAEoCRIeCgdhZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNzImMKFFN5bWJv", + "bFRvUGF5VHhTaXplRmVlEhQKDHRva2VuX3N5bWJvbBgBIAEoCRIZChFiYXNl", + "X3Rva2VuX3dlaWdodBgCIAEoBRIaChJhZGRlZF90b2tlbl93ZWlnaHQYAyAB", + "KAUiWwoYU3ltYm9sTGlzdFRvUGF5VHhTaXplRmVlEj8KGnN5bWJvbHNfdG9f", + "cGF5X3R4X3NpemVfZmVlGAEgAygLMhsudG9rZW4uU3ltYm9sVG9QYXlUeFNp", + "emVGZWUiuQEKGkNoYXJnZVRyYW5zYWN0aW9uRmVlc0lucHV0EhMKC21ldGhv", + "ZF9uYW1lGAEgASgJEicKEGNvbnRyYWN0X2FkZHJlc3MYAiABKAsyDS5hZWxm", + "LkFkZHJlc3MSHAoUdHJhbnNhY3Rpb25fc2l6ZV9mZWUYAyABKAMSPwoac3lt", + "Ym9sc190b19wYXlfdHhfc2l6ZV9mZWUYBCADKAsyGy50b2tlbi5TeW1ib2xU", + "b1BheVR4U2l6ZUZlZSJMChtDaGFyZ2VUcmFuc2FjdGlvbkZlZXNPdXRwdXQS", + "DwoHc3VjY2VzcxgBIAEoCBIcChRjaGFyZ2luZ19pbmZvcm1hdGlvbhgCIAEo", + "CSJMCgxDYWxsYmFja0luZm8SJwoQY29udHJhY3RfYWRkcmVzcxgBIAEoCzIN", + "LmFlbGYuQWRkcmVzcxITCgttZXRob2RfbmFtZRgCIAEoCSJnChZFeHRyYVRv", + "a2VuTGlzdE1vZGlmaWVkEkcKHnN5bWJvbF9saXN0X3RvX3BheV90eF9zaXpl", + "X2ZlZRgBIAEoCzIfLnRva2VuLlN5bWJvbExpc3RUb1BheVR4U2l6ZUZlZToE", + "oLsYASJjChRHZXRMb2NrZWRBbW91bnRJbnB1dBIeCgdhZGRyZXNzGAEgASgL", + "Mg0uYWVsZi5BZGRyZXNzEg4KBnN5bWJvbBgCIAEoCRIbCgdsb2NrX2lkGAMg", + "ASgLMgouYWVsZi5IYXNoInQKFUdldExvY2tlZEFtb3VudE91dHB1dBIeCgdh", + "ZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEg4KBnN5bWJvbBgCIAEoCRIb", + "Cgdsb2NrX2lkGAMgASgLMgouYWVsZi5IYXNoEg4KBmFtb3VudBgEIAEoAyIw", + "Cg1Ub2tlbkluZm9MaXN0Eh8KBXZhbHVlGAEgAygLMhAudG9rZW4uVG9rZW5J", + "bmZvIkEKLkdldENyb3NzQ2hhaW5UcmFuc2ZlclRva2VuQ29udHJhY3RBZGRy", + "ZXNzSW5wdXQSDwoHY2hhaW5JZBgBIAEoBSKSAQoaQ3Jvc3NDaGFpbkNyZWF0", + "ZVRva2VuSW5wdXQSFQoNZnJvbV9jaGFpbl9pZBgBIAEoBRIbChNwYXJlbnRf", + "Y2hhaW5faGVpZ2h0GAIgASgDEhkKEXRyYW5zYWN0aW9uX2J5dGVzGAMgASgM", + "EiUKC21lcmtsZV9wYXRoGAQgASgLMhAuYWVsZi5NZXJrbGVQYXRoIq4DCh5J", + "bml0aWFsaXplRnJvbVBhcmVudENoYWluSW5wdXQSUgoPcmVzb3VyY2VfYW1v", + "dW50GAEgAygLMjkudG9rZW4uSW5pdGlhbGl6ZUZyb21QYXJlbnRDaGFpbklu", + "cHV0LlJlc291cmNlQW1vdW50RW50cnkSgwEKKXJlZ2lzdGVyZWRfb3RoZXJf", + "dG9rZW5fY29udHJhY3RfYWRkcmVzc2VzGAIgAygLMlAudG9rZW4uSW5pdGlh", + "bGl6ZUZyb21QYXJlbnRDaGFpbklucHV0LlJlZ2lzdGVyZWRPdGhlclRva2Vu", + "Q29udHJhY3RBZGRyZXNzZXNFbnRyeRIeCgdjcmVhdG9yGAMgASgLMg0uYWVs", + "Zi5BZGRyZXNzGjUKE1Jlc291cmNlQW1vdW50RW50cnkSCwoDa2V5GAEgASgJ", + "Eg0KBXZhbHVlGAIgASgFOgI4ARpbCipSZWdpc3RlcmVkT3RoZXJUb2tlbkNv", + "bnRyYWN0QWRkcmVzc2VzRW50cnkSCwoDa2V5GAEgASgFEhwKBXZhbHVlGAIg", + "ASgLMg0uYWVsZi5BZGRyZXNzOgI4ASJnChdVcGRhdGVDb2VmZmljaWVudHNJ", + "bnB1dBIVCg1waWVjZV9udW1iZXJzGAEgAygFEjUKDGNvZWZmaWNpZW50cxgC", + "IAEoCzIfLnRva2VuLkNhbGN1bGF0ZUZlZUNvZWZmaWNpZW50cyIuCh1DYWxj", + "dWxhdGVGZWVQaWVjZUNvZWZmaWNpZW50cxINCgV2YWx1ZRgBIAMoBSJ5ChhD", + "YWxjdWxhdGVGZWVDb2VmZmljaWVudHMSFgoOZmVlX3Rva2VuX3R5cGUYASAB", + "KAUSRQoXcGllY2VfY29lZmZpY2llbnRzX2xpc3QYAiADKAsyJC50b2tlbi5D", + "YWxjdWxhdGVGZWVQaWVjZUNvZWZmaWNpZW50cyJNChtBbGxDYWxjdWxhdGVG", + "ZWVDb2VmZmljaWVudHMSLgoFdmFsdWUYASADKAsyHy50b2tlbi5DYWxjdWxh", + "dGVGZWVDb2VmZmljaWVudHMitwEKF1RvdGFsVHJhbnNhY3Rpb25GZWVzTWFw", + "EjgKBXZhbHVlGAEgAygLMikudG9rZW4uVG90YWxUcmFuc2FjdGlvbkZlZXNN", + "YXAuVmFsdWVFbnRyeRIeCgpibG9ja19oYXNoGAIgASgLMgouYWVsZi5IYXNo", + "EhQKDGJsb2NrX2hlaWdodBgDIAEoAxosCgpWYWx1ZUVudHJ5EgsKA2tleRgB", + "IAEoCRINCgV2YWx1ZRgCIAEoAzoCOAEiggEKF1RvdGFsUmVzb3VyY2VUb2tl", + "bnNNYXBzEjEKBXZhbHVlGAEgAygLMiIudG9rZW4uQ29udHJhY3RUb3RhbFJl", + "c291cmNlVG9rZW5zEh4KCmJsb2NrX2hhc2gYAiABKAsyCi5hZWxmLkhhc2gS", + "FAoMYmxvY2tfaGVpZ2h0GAMgASgDInkKG0NvbnRyYWN0VG90YWxSZXNvdXJj", + "ZVRva2VucxInChBjb250cmFjdF9hZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRy", + "ZXNzEjEKCnRva2Vuc19tYXAYAiABKAsyHS50b2tlbi5Ub3RhbFJlc291cmNl", + "VG9rZW5zTWFwIn8KFlRvdGFsUmVzb3VyY2VUb2tlbnNNYXASNwoFdmFsdWUY", + "ASADKAsyKC50b2tlbi5Ub3RhbFJlc291cmNlVG9rZW5zTWFwLlZhbHVlRW50", + "cnkaLAoKVmFsdWVFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAM6", + "AjgBIlEKFkNoYW5nZVRva2VuSXNzdWVySW5wdXQSDgoGc3ltYm9sGAEgASgJ", + "EicKEG5ld190b2tlbl9Jc3N1ZXIYAiABKAsyDS5hZWxmLkFkZHJlc3MiVAoW", + "UmVzZXRFeHRlcm5hbEluZm9JbnB1dBIOCgZzeW1ib2wYASABKAkSKgoNZXh0", + "ZXJuYWxfaW5mbxgCIAEoCzITLnRva2VuLkV4dGVybmFsSW5mbyIbCgpTdHJp", + "bmdMaXN0Eg0KBXZhbHVlGAEgAygJIo4BCgtUcmFuc2ZlcnJlZBIiCgRmcm9t", + "GAEgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIgCgJ0bxgCIAEoCzINLmFl", + "bGYuQWRkcmVzc0IFiI/1AQESFQoGc3ltYm9sGAMgASgJQgWIj/UBARIOCgZh", + "bW91bnQYBCABKAMSDAoEbWVtbxgFIAEoCToEoLsYASKDAQoIQXBwcm92ZWQS", + "IwoFb3duZXIYASABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBEiUKB3NwZW5k", + "ZXIYAiABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBEhUKBnN5bWJvbBgDIAEo", + "CUIFiI/1AQESDgoGYW1vdW50GAQgASgDOgSguxgBIoUBCgpVbkFwcHJvdmVk", + "EiMKBW93bmVyGAEgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIlCgdzcGVu", + "ZGVyGAIgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIVCgZzeW1ib2wYAyAB", + "KAlCBYiP9QEBEg4KBmFtb3VudBgEIAEoAzoEoLsYASJbCgZCdXJuZWQSJAoG", + "YnVybmVyGAEgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIVCgZzeW1ib2wY", + "AiABKAlCBYiP9QEBEg4KBmFtb3VudBgDIAEoAzoEoLsYASI4ChpDaGFpblBy", + "aW1hcnlUb2tlblN5bWJvbFNldBIUCgx0b2tlbl9zeW1ib2wYASABKAk6BKC7", + "GAEiawocQ2FsY3VsYXRlRmVlQWxnb3JpdGhtVXBkYXRlZBJFChlhbGxfdHlw", + "ZV9mZWVfY29lZmZpY2llbnRzGAEgASgLMiIudG9rZW4uQWxsQ2FsY3VsYXRl", + "RmVlQ29lZmZpY2llbnRzOgSguxgBIjUKDVJlbnRhbENoYXJnZWQSDgoGc3lt", + "Ym9sGAEgASgJEg4KBmFtb3VudBgCIAEoAzoEoLsYASJICiBSZW50YWxBY2Nv", + "dW50QmFsYW5jZUluc3VmZmljaWVudBIOCgZzeW1ib2wYASABKAkSDgoGYW1v", + "dW50GAIgASgDOgSguxgBItgBCgxUb2tlbkNyZWF0ZWQSDgoGc3ltYm9sGAEg", + "ASgJEhIKCnRva2VuX25hbWUYAiABKAkSFAoMdG90YWxfc3VwcGx5GAMgASgD", + "EhAKCGRlY2ltYWxzGAQgASgFEh0KBmlzc3VlchgFIAEoCzINLmFlbGYuQWRk", + "cmVzcxITCgtpc19idXJuYWJsZRgGIAEoCBIWCg5pc3N1ZV9jaGFpbl9pZBgH", + "IAEoBRIqCg1leHRlcm5hbF9pbmZvGAggASgLMhMudG9rZW4uRXh0ZXJuYWxJ", + "bmZvOgSguxgBIlcKBklzc3VlZBIOCgZzeW1ib2wYASABKAkSDgoGYW1vdW50", + "GAIgASgDEgwKBG1lbW8YAyABKAkSGQoCdG8YBCABKAsyDS5hZWxmLkFkZHJl", + "c3M6BKC7GAEisAEKFUNyb3NzQ2hhaW5UcmFuc2ZlcnJlZBIbCgRmcm9tGAEg", + "ASgLMg0uYWVsZi5BZGRyZXNzEhkKAnRvGAIgASgLMg0uYWVsZi5BZGRyZXNz", + "Eg4KBnN5bWJvbBgDIAEoCRIOCgZhbW91bnQYBCABKAMSDAoEbWVtbxgFIAEo", + "CRITCgt0b19jaGFpbl9pZBgGIAEoBRIWCg5pc3N1ZV9jaGFpbl9pZBgHIAEo", + "BToEoLsYASL5AQoSQ3Jvc3NDaGFpblJlY2VpdmVkEhsKBGZyb20YASABKAsy", + "DS5hZWxmLkFkZHJlc3MSGQoCdG8YAiABKAsyDS5hZWxmLkFkZHJlc3MSDgoG", + "c3ltYm9sGAMgASgJEg4KBmFtb3VudBgEIAEoAxIMCgRtZW1vGAUgASgJEhUK", + "DWZyb21fY2hhaW5faWQYBiABKAUSFgoOaXNzdWVfY2hhaW5faWQYByABKAUS", + "GwoTcGFyZW50X2NoYWluX2hlaWdodBgIIAEoAxIrChd0cmFuc2Zlcl90cmFu", + "c2FjdGlvbl9pZBgJIAEoCzIKLmFlbGYuSGFzaDoEoLsYASJXChNFeHRlcm5h", + "bEluZm9DaGFuZ2VkEg4KBnN5bWJvbBgBIAEoCRIqCg1leHRlcm5hbF9pbmZv", + "GAIgASgLMhMudG9rZW4uRXh0ZXJuYWxJbmZvOgSguxgBKkQKC0ZlZVR5cGVF", + "bnVtEggKBFJFQUQQABILCgdTVE9SQUdFEAESCQoFV1JJVEUQAhILCgdUUkFG", + "RklDEAMSBgoCVFgQBDLKHAoNVG9rZW5Db250cmFjdBI2CgZDcmVhdGUSEi50", + "b2tlbi5DcmVhdGVJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjQK", + "BUlzc3VlEhEudG9rZW4uSXNzdWVJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5F", + "bXB0eSIAEjoKCFRyYW5zZmVyEhQudG9rZW4uVHJhbnNmZXJJbnB1dBoWLmdv", + "b2dsZS5wcm90b2J1Zi5FbXB0eSIAEkIKDFRyYW5zZmVyRnJvbRIYLnRva2Vu", + "LlRyYW5zZmVyRnJvbUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS", + "OAoHQXBwcm92ZRITLnRva2VuLkFwcHJvdmVJbnB1dBoWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eSIAEjwKCVVuQXBwcm92ZRIVLnRva2VuLlVuQXBwcm92ZUlu", + "cHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASMgoETG9jaxIQLnRva2Vu", + "LkxvY2tJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjYKBlVubG9j", + "axISLnRva2VuLlVubG9ja0lucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5", + "IgASMgoEQnVybhIQLnRva2VuLkJ1cm5JbnB1dBoWLmdvb2dsZS5wcm90b2J1", + "Zi5FbXB0eSIAEkwKEUNoYW5nZVRva2VuSXNzdWVyEh0udG9rZW4uQ2hhbmdl", + "VG9rZW5Jc3N1ZXJJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElQK", + "FVNldFByaW1hcnlUb2tlblN5bWJvbBIhLnRva2VuLlNldFByaW1hcnlUb2tl", + "blN5bWJvbElucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASTgoSQ3Jv", + "c3NDaGFpblRyYW5zZmVyEh4udG9rZW4uQ3Jvc3NDaGFpblRyYW5zZmVySW5w", + "dXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJWChZDcm9zc0NoYWluUmVj", + "ZWl2ZVRva2VuEiIudG9rZW4uQ3Jvc3NDaGFpblJlY2VpdmVUb2tlbklucHV0", + "GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASVAoVQ3Jvc3NDaGFpbkNyZWF0", + "ZVRva2VuEiEudG9rZW4uQ3Jvc3NDaGFpbkNyZWF0ZVRva2VuSW5wdXQaFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkiABJcChlJbml0aWFsaXplRnJvbVBhcmVu", + "dENoYWluEiUudG9rZW4uSW5pdGlhbGl6ZUZyb21QYXJlbnRDaGFpbklucHV0", + "GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASUAoUQ2xhaW1UcmFuc2FjdGlv", + "bkZlZXMSHi50b2tlbi5Ub3RhbFRyYW5zYWN0aW9uRmVlc01hcBoWLmdvb2ds", + "ZS5wcm90b2J1Zi5FbXB0eSIAEmAKFUNoYXJnZVRyYW5zYWN0aW9uRmVlcxIh", + "LnRva2VuLkNoYXJnZVRyYW5zYWN0aW9uRmVlc0lucHV0GiIudG9rZW4uQ2hh", + "cmdlVHJhbnNhY3Rpb25GZWVzT3V0cHV0IgASRgoOQ2hlY2tUaHJlc2hvbGQS", + "Gi50b2tlbi5DaGVja1RocmVzaG9sZElucHV0GhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASRwoTSW5pdGlhbENvZWZmaWNpZW50cxIWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEk8KE0RvbmF0", + "ZVJlc291cmNlVG9rZW4SHi50b2tlbi5Ub3RhbFJlc291cmNlVG9rZW5zTWFw", + "cxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElAKE0NoYXJnZVJlc291cmNl", + "VG9rZW4SHy50b2tlbi5DaGFyZ2VSZXNvdXJjZVRva2VuSW5wdXQaFi5nb29n", + "bGUucHJvdG9idWYuRW1wdHkiABJGChJDaGVja1Jlc291cmNlVG9rZW4SFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHki", + "ABJVChhTZXRTeW1ib2xzVG9QYXlUeFNpemVGZWUSHy50b2tlbi5TeW1ib2xM", + "aXN0VG9QYXlUeFNpemVGZWUaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJX", + "ChtVcGRhdGVDb2VmZmljaWVudHNGb3JTZW5kZXISHi50b2tlbi5VcGRhdGVD", + "b2VmZmljaWVudHNJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElkK", + "HVVwZGF0ZUNvZWZmaWNpZW50c0ZvckNvbnRyYWN0Eh4udG9rZW4uVXBkYXRl", + "Q29lZmZpY2llbnRzSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJS", + "Ch5Jbml0aWFsaXplQXV0aG9yaXplZENvbnRyb2xsZXISFi5nb29nbGUucHJv", + "dG9idWYuRW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJMChFSZXNl", + "dEV4dGVybmFsSW5mbxIdLnRva2VuLlJlc2V0RXh0ZXJuYWxJbmZvSW5wdXQa", + "Fi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJLCiBBZGRBZGRyZXNzVG9DcmVh", + "dGVUb2tlbldoaXRlTGlzdBINLmFlbGYuQWRkcmVzcxoWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eSIAElAKJVJlbW92ZUFkZHJlc3NGcm9tQ3JlYXRlVG9rZW5X", + "aGl0ZUxpc3QSDS5hZWxmLkFkZHJlc3MaFi5nb29nbGUucHJvdG9idWYuRW1w", + "dHkiABJBCgxHZXRUb2tlbkluZm8SGC50b2tlbi5HZXRUb2tlbkluZm9JbnB1", + "dBoQLnRva2VuLlRva2VuSW5mbyIFiIn3AQESRQoSR2V0TmF0aXZlVG9rZW5J", + "bmZvEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhAudG9rZW4uVG9rZW5JbmZv", + "IgWIifcBARJLChRHZXRSZXNvdXJjZVRva2VuSW5mbxIWLmdvb2dsZS5wcm90", + "b2J1Zi5FbXB0eRoULnRva2VuLlRva2VuSW5mb0xpc3QiBYiJ9wEBEkQKCkdl", + "dEJhbGFuY2USFi50b2tlbi5HZXRCYWxhbmNlSW5wdXQaFy50b2tlbi5HZXRC", + "YWxhbmNlT3V0cHV0IgWIifcBARJKCgxHZXRBbGxvd2FuY2USGC50b2tlbi5H", + "ZXRBbGxvd2FuY2VJbnB1dBoZLnRva2VuLkdldEFsbG93YW5jZU91dHB1dCIF", + "iIn3AQESTQoNSXNJbldoaXRlTGlzdBIZLnRva2VuLklzSW5XaGl0ZUxpc3RJ", + "bnB1dBoaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUiBYiJ9wEBElMKD0dl", + "dExvY2tlZEFtb3VudBIbLnRva2VuLkdldExvY2tlZEFtb3VudElucHV0Ghwu", + "dG9rZW4uR2V0TG9ja2VkQW1vdW50T3V0cHV0IgWIifcBARJ4CilHZXRDcm9z", + "c0NoYWluVHJhbnNmZXJUb2tlbkNvbnRyYWN0QWRkcmVzcxI1LnRva2VuLkdl", + "dENyb3NzQ2hhaW5UcmFuc2ZlclRva2VuQ29udHJhY3RBZGRyZXNzSW5wdXQa", + "DS5hZWxmLkFkZHJlc3MiBYiJ9wEBElQKFUdldFByaW1hcnlUb2tlblN5bWJv", + "bBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRocLmdvb2dsZS5wcm90b2J1Zi5T", + "dHJpbmdWYWx1ZSIFiIn3AQESbQomR2V0Q2FsY3VsYXRlRmVlQ29lZmZpY2ll", + "bnRzRm9yQ29udHJhY3QSGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRof", + "LnRva2VuLkNhbGN1bGF0ZUZlZUNvZWZmaWNpZW50cyIFiIn3AQESZgokR2V0", + "Q2FsY3VsYXRlRmVlQ29lZmZpY2llbnRzRm9yU2VuZGVyEhYuZ29vZ2xlLnBy", + "b3RvYnVmLkVtcHR5Gh8udG9rZW4uQ2FsY3VsYXRlRmVlQ29lZmZpY2llbnRz", + "IgWIifcBARJaChhHZXRTeW1ib2xzVG9QYXlUeFNpemVGZWUSFi5nb29nbGUu", + "cHJvdG9idWYuRW1wdHkaHy50b2tlbi5TeW1ib2xMaXN0VG9QYXlUeFNpemVG", + "ZWUiBYiJ9wEBElEKJEdldExhdGVzdFRvdGFsVHJhbnNhY3Rpb25GZWVzTWFw", + "SGFzaBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoKLmFlbGYuSGFzaCIFiIn3", + "AQESUQokR2V0TGF0ZXN0VG90YWxSZXNvdXJjZVRva2Vuc01hcHNIYXNoEhYu", + "Z29vZ2xlLnByb3RvYnVmLkVtcHR5GgouYWVsZi5IYXNoIgWIifcBARJfChxJ", + "c1Rva2VuQXZhaWxhYmxlRm9yTWV0aG9kRmVlEhwuZ29vZ2xlLnByb3RvYnVm", + "LlN0cmluZ1ZhbHVlGhouZ29vZ2xlLnByb3RvYnVmLkJvb2xWYWx1ZSIFiIn3", + "AQESTAoYSXNJbkNyZWF0ZVRva2VuV2hpdGVMaXN0Eg0uYWVsZi5BZGRyZXNz", + "GhouZ29vZ2xlLnByb3RvYnVmLkJvb2xWYWx1ZSIFiIn3AQESUgoeR2V0UmVz", + "ZXJ2ZWRFeHRlcm5hbEluZm9LZXlMaXN0EhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5GhEudG9rZW4uU3RyaW5nTGlzdCIFiIn3AQFCHKoCGUFFbGYuQ29udHJh", + "Y3RzLk11bHRpVG9rZW5iBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AElf.Contracts.MultiToken.FeeTypeEnum), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TokenInfo), global::AElf.Contracts.MultiToken.TokenInfo.Parser, new[]{ "Symbol", "TokenName", "Supply", "TotalSupply", "Decimals", "Issuer", "IsBurnable", "IssueChainId", "Issued", "ExternalInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ExternalInfo), global::AElf.Contracts.MultiToken.ExternalInfo.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CreateInput), global::AElf.Contracts.MultiToken.CreateInput.Parser, new[]{ "Symbol", "TokenName", "TotalSupply", "Decimals", "Issuer", "IsBurnable", "LockWhiteList", "IssueChainId", "ExternalInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.SetPrimaryTokenSymbolInput), global::AElf.Contracts.MultiToken.SetPrimaryTokenSymbolInput.Parser, new[]{ "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.IssueInput), global::AElf.Contracts.MultiToken.IssueInput.Parser, new[]{ "Symbol", "Amount", "Memo", "To" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TransferInput), global::AElf.Contracts.MultiToken.TransferInput.Parser, new[]{ "To", "Symbol", "Amount", "Memo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.LockInput), global::AElf.Contracts.MultiToken.LockInput.Parser, new[]{ "Address", "LockId", "Symbol", "Usage", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UnlockInput), global::AElf.Contracts.MultiToken.UnlockInput.Parser, new[]{ "Address", "LockId", "Symbol", "Usage", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TransferFromInput), global::AElf.Contracts.MultiToken.TransferFromInput.Parser, new[]{ "From", "To", "Symbol", "Amount", "Memo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ApproveInput), global::AElf.Contracts.MultiToken.ApproveInput.Parser, new[]{ "Spender", "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UnApproveInput), global::AElf.Contracts.MultiToken.UnApproveInput.Parser, new[]{ "Spender", "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.BurnInput), global::AElf.Contracts.MultiToken.BurnInput.Parser, new[]{ "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ChargeResourceTokenInput), global::AElf.Contracts.MultiToken.ChargeResourceTokenInput.Parser, new[]{ "CostDic", "Caller" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TransactionFeeBill), global::AElf.Contracts.MultiToken.TransactionFeeBill.Parser, new[]{ "FeesMap" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CheckThresholdInput), global::AElf.Contracts.MultiToken.CheckThresholdInput.Parser, new[]{ "Sender", "SymbolToThreshold", "IsCheckAllowance" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetTokenInfoInput), global::AElf.Contracts.MultiToken.GetTokenInfoInput.Parser, new[]{ "Symbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetBalanceInput), global::AElf.Contracts.MultiToken.GetBalanceInput.Parser, new[]{ "Symbol", "Owner" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetBalanceOutput), global::AElf.Contracts.MultiToken.GetBalanceOutput.Parser, new[]{ "Symbol", "Owner", "Balance" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetAllowanceInput), global::AElf.Contracts.MultiToken.GetAllowanceInput.Parser, new[]{ "Symbol", "Owner", "Spender" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetAllowanceOutput), global::AElf.Contracts.MultiToken.GetAllowanceOutput.Parser, new[]{ "Symbol", "Owner", "Spender", "Allowance" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CrossChainTransferInput), global::AElf.Contracts.MultiToken.CrossChainTransferInput.Parser, new[]{ "To", "Symbol", "Amount", "Memo", "ToChainId", "IssueChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CrossChainReceiveTokenInput), global::AElf.Contracts.MultiToken.CrossChainReceiveTokenInput.Parser, new[]{ "FromChainId", "ParentChainHeight", "TransferTransactionBytes", "MerklePath" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.IsInWhiteListInput), global::AElf.Contracts.MultiToken.IsInWhiteListInput.Parser, new[]{ "Symbol", "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.SymbolToPayTxSizeFee), global::AElf.Contracts.MultiToken.SymbolToPayTxSizeFee.Parser, new[]{ "TokenSymbol", "BaseTokenWeight", "AddedTokenWeight" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee), global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee.Parser, new[]{ "SymbolsToPayTxSizeFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ChargeTransactionFeesInput), global::AElf.Contracts.MultiToken.ChargeTransactionFeesInput.Parser, new[]{ "MethodName", "ContractAddress", "TransactionSizeFee", "SymbolsToPayTxSizeFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ChargeTransactionFeesOutput), global::AElf.Contracts.MultiToken.ChargeTransactionFeesOutput.Parser, new[]{ "Success", "ChargingInformation" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CallbackInfo), global::AElf.Contracts.MultiToken.CallbackInfo.Parser, new[]{ "ContractAddress", "MethodName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ExtraTokenListModified), global::AElf.Contracts.MultiToken.ExtraTokenListModified.Parser, new[]{ "SymbolListToPayTxSizeFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetLockedAmountInput), global::AElf.Contracts.MultiToken.GetLockedAmountInput.Parser, new[]{ "Address", "Symbol", "LockId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetLockedAmountOutput), global::AElf.Contracts.MultiToken.GetLockedAmountOutput.Parser, new[]{ "Address", "Symbol", "LockId", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TokenInfoList), global::AElf.Contracts.MultiToken.TokenInfoList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetCrossChainTransferTokenContractAddressInput), global::AElf.Contracts.MultiToken.GetCrossChainTransferTokenContractAddressInput.Parser, new[]{ "ChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CrossChainCreateTokenInput), global::AElf.Contracts.MultiToken.CrossChainCreateTokenInput.Parser, new[]{ "FromChainId", "ParentChainHeight", "TransactionBytes", "MerklePath" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.InitializeFromParentChainInput), global::AElf.Contracts.MultiToken.InitializeFromParentChainInput.Parser, new[]{ "ResourceAmount", "RegisteredOtherTokenContractAddresses", "Creator" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UpdateCoefficientsInput), global::AElf.Contracts.MultiToken.UpdateCoefficientsInput.Parser, new[]{ "PieceNumbers", "Coefficients" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CalculateFeePieceCoefficients), global::AElf.Contracts.MultiToken.CalculateFeePieceCoefficients.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CalculateFeeCoefficients), global::AElf.Contracts.MultiToken.CalculateFeeCoefficients.Parser, new[]{ "FeeTokenType", "PieceCoefficientsList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients), global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TotalTransactionFeesMap), global::AElf.Contracts.MultiToken.TotalTransactionFeesMap.Parser, new[]{ "Value", "BlockHash", "BlockHeight" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TotalResourceTokensMaps), global::AElf.Contracts.MultiToken.TotalResourceTokensMaps.Parser, new[]{ "Value", "BlockHash", "BlockHeight" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ContractTotalResourceTokens), global::AElf.Contracts.MultiToken.ContractTotalResourceTokens.Parser, new[]{ "ContractAddress", "TokensMap" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TotalResourceTokensMap), global::AElf.Contracts.MultiToken.TotalResourceTokensMap.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ChangeTokenIssuerInput), global::AElf.Contracts.MultiToken.ChangeTokenIssuerInput.Parser, new[]{ "Symbol", "NewTokenIssuer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ResetExternalInfoInput), global::AElf.Contracts.MultiToken.ResetExternalInfoInput.Parser, new[]{ "Symbol", "ExternalInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.StringList), global::AElf.Contracts.MultiToken.StringList.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.Transferred), global::AElf.Contracts.MultiToken.Transferred.Parser, new[]{ "From", "To", "Symbol", "Amount", "Memo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.Approved), global::AElf.Contracts.MultiToken.Approved.Parser, new[]{ "Owner", "Spender", "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UnApproved), global::AElf.Contracts.MultiToken.UnApproved.Parser, new[]{ "Owner", "Spender", "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.Burned), global::AElf.Contracts.MultiToken.Burned.Parser, new[]{ "Burner", "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ChainPrimaryTokenSymbolSet), global::AElf.Contracts.MultiToken.ChainPrimaryTokenSymbolSet.Parser, new[]{ "TokenSymbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CalculateFeeAlgorithmUpdated), global::AElf.Contracts.MultiToken.CalculateFeeAlgorithmUpdated.Parser, new[]{ "AllTypeFeeCoefficients" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.RentalCharged), global::AElf.Contracts.MultiToken.RentalCharged.Parser, new[]{ "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.RentalAccountBalanceInsufficient), global::AElf.Contracts.MultiToken.RentalAccountBalanceInsufficient.Parser, new[]{ "Symbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TokenCreated), global::AElf.Contracts.MultiToken.TokenCreated.Parser, new[]{ "Symbol", "TokenName", "TotalSupply", "Decimals", "Issuer", "IsBurnable", "IssueChainId", "ExternalInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.Issued), global::AElf.Contracts.MultiToken.Issued.Parser, new[]{ "Symbol", "Amount", "Memo", "To" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CrossChainTransferred), global::AElf.Contracts.MultiToken.CrossChainTransferred.Parser, new[]{ "From", "To", "Symbol", "Amount", "Memo", "ToChainId", "IssueChainId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.CrossChainReceived), global::AElf.Contracts.MultiToken.CrossChainReceived.Parser, new[]{ "From", "To", "Symbol", "Amount", "Memo", "FromChainId", "IssueChainId", "ParentChainHeight", "TransferTransactionId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ExternalInfoChanged), global::AElf.Contracts.MultiToken.ExternalInfoChanged.Parser, new[]{ "Symbol", "ExternalInfo" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum FeeTypeEnum { + [pbr::OriginalName("READ")] Read = 0, + [pbr::OriginalName("STORAGE")] Storage = 1, + [pbr::OriginalName("WRITE")] Write = 2, + [pbr::OriginalName("TRAFFIC")] Traffic = 3, + [pbr::OriginalName("TX")] Tx = 4, + } + + #endregion + + #region Messages + public sealed partial class TokenInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfo(TokenInfo other) : this() { + symbol_ = other.symbol_; + tokenName_ = other.tokenName_; + supply_ = other.supply_; + totalSupply_ = other.totalSupply_; + decimals_ = other.decimals_; + issuer_ = other.issuer_ != null ? other.issuer_.Clone() : null; + isBurnable_ = other.isBurnable_; + issueChainId_ = other.issueChainId_; + issued_ = other.issued_; + externalInfo_ = other.externalInfo_ != null ? other.externalInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfo Clone() { + return new TokenInfo(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of the token.f + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "token_name" field. + public const int TokenNameFieldNumber = 2; + private string tokenName_ = ""; + /// + /// The full name of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenName { + get { return tokenName_; } + set { + tokenName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "supply" field. + public const int SupplyFieldNumber = 3; + private long supply_; + /// + /// The current supply of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Supply { + get { return supply_; } + set { + supply_ = value; + } + } + + /// Field number for the "total_supply" field. + public const int TotalSupplyFieldNumber = 4; + private long totalSupply_; + /// + /// The total supply of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TotalSupply { + get { return totalSupply_; } + set { + totalSupply_ = value; + } + } + + /// Field number for the "decimals" field. + public const int DecimalsFieldNumber = 5; + private int decimals_; + /// + /// The precision of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Decimals { + get { return decimals_; } + set { + decimals_ = value; + } + } + + /// Field number for the "issuer" field. + public const int IssuerFieldNumber = 6; + private global::AElf.Types.Address issuer_; + /// + /// The address that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Issuer { + get { return issuer_; } + set { + issuer_ = value; + } + } + + /// Field number for the "is_burnable" field. + public const int IsBurnableFieldNumber = 7; + private bool isBurnable_; + /// + /// A flag indicating if this token is burnable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsBurnable { + get { return isBurnable_; } + set { + isBurnable_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 8; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + /// Field number for the "issued" field. + public const int IssuedFieldNumber = 9; + private long issued_; + /// + /// The amount of issued tokens. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Issued { + get { return issued_; } + set { + issued_ = value; + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 10; + private global::AElf.Contracts.MultiToken.ExternalInfo externalInfo_; + /// + /// The external information of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.ExternalInfo ExternalInfo { + get { return externalInfo_; } + set { + externalInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TokenInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TokenInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (TokenName != other.TokenName) return false; + if (Supply != other.Supply) return false; + if (TotalSupply != other.TotalSupply) return false; + if (Decimals != other.Decimals) return false; + if (!object.Equals(Issuer, other.Issuer)) return false; + if (IsBurnable != other.IsBurnable) return false; + if (IssueChainId != other.IssueChainId) return false; + if (Issued != other.Issued) return false; + if (!object.Equals(ExternalInfo, other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (TokenName.Length != 0) hash ^= TokenName.GetHashCode(); + if (Supply != 0L) hash ^= Supply.GetHashCode(); + if (TotalSupply != 0L) hash ^= TotalSupply.GetHashCode(); + if (Decimals != 0) hash ^= Decimals.GetHashCode(); + if (issuer_ != null) hash ^= Issuer.GetHashCode(); + if (IsBurnable != false) hash ^= IsBurnable.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (Issued != 0L) hash ^= Issued.GetHashCode(); + if (externalInfo_ != null) hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (TokenName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenName); + } + if (Supply != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Supply); + } + if (TotalSupply != 0L) { + output.WriteRawTag(32); + output.WriteInt64(TotalSupply); + } + if (Decimals != 0) { + output.WriteRawTag(40); + output.WriteInt32(Decimals); + } + if (issuer_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Issuer); + } + if (IsBurnable != false) { + output.WriteRawTag(56); + output.WriteBool(IsBurnable); + } + if (IssueChainId != 0) { + output.WriteRawTag(64); + output.WriteInt32(IssueChainId); + } + if (Issued != 0L) { + output.WriteRawTag(72); + output.WriteInt64(Issued); + } + if (externalInfo_ != null) { + output.WriteRawTag(82); + output.WriteMessage(ExternalInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (TokenName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenName); + } + if (Supply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Supply); + } + if (TotalSupply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TotalSupply); + } + if (Decimals != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Decimals); + } + if (issuer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Issuer); + } + if (IsBurnable != false) { + size += 1 + 1; + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (Issued != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Issued); + } + if (externalInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TokenInfo other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.TokenName.Length != 0) { + TokenName = other.TokenName; + } + if (other.Supply != 0L) { + Supply = other.Supply; + } + if (other.TotalSupply != 0L) { + TotalSupply = other.TotalSupply; + } + if (other.Decimals != 0) { + Decimals = other.Decimals; + } + if (other.issuer_ != null) { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + Issuer.MergeFrom(other.Issuer); + } + if (other.IsBurnable != false) { + IsBurnable = other.IsBurnable; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + if (other.Issued != 0L) { + Issued = other.Issued; + } + if (other.externalInfo_ != null) { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + ExternalInfo.MergeFrom(other.ExternalInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + TokenName = input.ReadString(); + break; + } + case 24: { + Supply = input.ReadInt64(); + break; + } + case 32: { + TotalSupply = input.ReadInt64(); + break; + } + case 40: { + Decimals = input.ReadInt32(); + break; + } + case 50: { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + input.ReadMessage(Issuer); + break; + } + case 56: { + IsBurnable = input.ReadBool(); + break; + } + case 64: { + IssueChainId = input.ReadInt32(); + break; + } + case 72: { + Issued = input.ReadInt64(); + break; + } + case 82: { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + input.ReadMessage(ExternalInfo); + break; + } + } + } + } + + } + + public sealed partial class ExternalInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfo(ExternalInfo other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfo Clone() { + return new ExternalInfo(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExternalInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExternalInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _map_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExternalInfo other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + } + } + } + + } + + public sealed partial class CreateInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateInput(CreateInput other) : this() { + symbol_ = other.symbol_; + tokenName_ = other.tokenName_; + totalSupply_ = other.totalSupply_; + decimals_ = other.decimals_; + issuer_ = other.issuer_ != null ? other.issuer_.Clone() : null; + isBurnable_ = other.isBurnable_; + lockWhiteList_ = other.lockWhiteList_.Clone(); + issueChainId_ = other.issueChainId_; + externalInfo_ = other.externalInfo_ != null ? other.externalInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateInput Clone() { + return new CreateInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "token_name" field. + public const int TokenNameFieldNumber = 2; + private string tokenName_ = ""; + /// + /// The full name of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenName { + get { return tokenName_; } + set { + tokenName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "total_supply" field. + public const int TotalSupplyFieldNumber = 3; + private long totalSupply_; + /// + /// The total supply of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TotalSupply { + get { return totalSupply_; } + set { + totalSupply_ = value; + } + } + + /// Field number for the "decimals" field. + public const int DecimalsFieldNumber = 4; + private int decimals_; + /// + /// The precision of the token + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Decimals { + get { return decimals_; } + set { + decimals_ = value; + } + } + + /// Field number for the "issuer" field. + public const int IssuerFieldNumber = 5; + private global::AElf.Types.Address issuer_; + /// + /// The address that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Issuer { + get { return issuer_; } + set { + issuer_ = value; + } + } + + /// Field number for the "is_burnable" field. + public const int IsBurnableFieldNumber = 6; + private bool isBurnable_; + /// + /// A flag indicating if this token is burnable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsBurnable { + get { return isBurnable_; } + set { + isBurnable_ = value; + } + } + + /// Field number for the "lock_white_list" field. + public const int LockWhiteListFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_lockWhiteList_codec + = pb::FieldCodec.ForMessage(58, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField lockWhiteList_ = new pbc::RepeatedField(); + /// + /// A whitelist address list used to lock tokens. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField LockWhiteList { + get { return lockWhiteList_; } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 8; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 9; + private global::AElf.Contracts.MultiToken.ExternalInfo externalInfo_; + /// + /// The external information of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.ExternalInfo ExternalInfo { + get { return externalInfo_; } + set { + externalInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (TokenName != other.TokenName) return false; + if (TotalSupply != other.TotalSupply) return false; + if (Decimals != other.Decimals) return false; + if (!object.Equals(Issuer, other.Issuer)) return false; + if (IsBurnable != other.IsBurnable) return false; + if(!lockWhiteList_.Equals(other.lockWhiteList_)) return false; + if (IssueChainId != other.IssueChainId) return false; + if (!object.Equals(ExternalInfo, other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (TokenName.Length != 0) hash ^= TokenName.GetHashCode(); + if (TotalSupply != 0L) hash ^= TotalSupply.GetHashCode(); + if (Decimals != 0) hash ^= Decimals.GetHashCode(); + if (issuer_ != null) hash ^= Issuer.GetHashCode(); + if (IsBurnable != false) hash ^= IsBurnable.GetHashCode(); + hash ^= lockWhiteList_.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (externalInfo_ != null) hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (TokenName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenName); + } + if (TotalSupply != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TotalSupply); + } + if (Decimals != 0) { + output.WriteRawTag(32); + output.WriteInt32(Decimals); + } + if (issuer_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Issuer); + } + if (IsBurnable != false) { + output.WriteRawTag(48); + output.WriteBool(IsBurnable); + } + lockWhiteList_.WriteTo(output, _repeated_lockWhiteList_codec); + if (IssueChainId != 0) { + output.WriteRawTag(64); + output.WriteInt32(IssueChainId); + } + if (externalInfo_ != null) { + output.WriteRawTag(74); + output.WriteMessage(ExternalInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (TokenName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenName); + } + if (TotalSupply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TotalSupply); + } + if (Decimals != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Decimals); + } + if (issuer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Issuer); + } + if (IsBurnable != false) { + size += 1 + 1; + } + size += lockWhiteList_.CalculateSize(_repeated_lockWhiteList_codec); + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (externalInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.TokenName.Length != 0) { + TokenName = other.TokenName; + } + if (other.TotalSupply != 0L) { + TotalSupply = other.TotalSupply; + } + if (other.Decimals != 0) { + Decimals = other.Decimals; + } + if (other.issuer_ != null) { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + Issuer.MergeFrom(other.Issuer); + } + if (other.IsBurnable != false) { + IsBurnable = other.IsBurnable; + } + lockWhiteList_.Add(other.lockWhiteList_); + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + if (other.externalInfo_ != null) { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + ExternalInfo.MergeFrom(other.ExternalInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + TokenName = input.ReadString(); + break; + } + case 24: { + TotalSupply = input.ReadInt64(); + break; + } + case 32: { + Decimals = input.ReadInt32(); + break; + } + case 42: { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + input.ReadMessage(Issuer); + break; + } + case 48: { + IsBurnable = input.ReadBool(); + break; + } + case 58: { + lockWhiteList_.AddEntriesFrom(input, _repeated_lockWhiteList_codec); + break; + } + case 64: { + IssueChainId = input.ReadInt32(); + break; + } + case 74: { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + input.ReadMessage(ExternalInfo); + break; + } + } + } + } + + } + + public sealed partial class SetPrimaryTokenSymbolInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetPrimaryTokenSymbolInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetPrimaryTokenSymbolInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetPrimaryTokenSymbolInput(SetPrimaryTokenSymbolInput other) : this() { + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetPrimaryTokenSymbolInput Clone() { + return new SetPrimaryTokenSymbolInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SetPrimaryTokenSymbolInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SetPrimaryTokenSymbolInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SetPrimaryTokenSymbolInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class IssueInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IssueInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IssueInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IssueInput(IssueInput other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + to_ = other.to_ != null ? other.to_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IssueInput Clone() { + return new IssueInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The token symbol to issue. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The token amount to issue. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 3; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 4; + private global::AElf.Types.Address to_; + /// + /// The target address to issue. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IssueInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IssueInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + if (!object.Equals(To, other.To)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Memo); + } + if (to_ != null) { + output.WriteRawTag(34); + output.WriteMessage(To); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IssueInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + Memo = input.ReadString(); + break; + } + case 34: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + } + } + } + + } + + public sealed partial class TransferInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransferInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferInput(TransferInput other) : this() { + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferInput Clone() { + return new TransferInput(this); + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 1; + private global::AElf.Types.Address to_; + /// + /// The receiver of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The token symbol to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount to to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 4; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TransferInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TransferInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (to_ != null) { + output.WriteRawTag(10); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TransferInput other) { + if (other == null) { + return; + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + Memo = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class LockInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LockInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LockInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LockInput(LockInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + lockId_ = other.lockId_ != null ? other.lockId_.Clone() : null; + symbol_ = other.symbol_; + usage_ = other.usage_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LockInput Clone() { + return new LockInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The one want to lock his token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "lock_id" field. + public const int LockIdFieldNumber = 2; + private global::AElf.Types.Hash lockId_; + /// + /// Id of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash LockId { + get { return lockId_; } + set { + lockId_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the token to lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "usage" field. + public const int UsageFieldNumber = 4; + private string usage_ = ""; + /// + /// a memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Usage { + get { return usage_; } + set { + usage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 5; + private long amount_; + /// + /// The amount of tokens to lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as LockInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(LockInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (!object.Equals(LockId, other.LockId)) return false; + if (Symbol != other.Symbol) return false; + if (Usage != other.Usage) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (lockId_ != null) hash ^= LockId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Usage.Length != 0) hash ^= Usage.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (lockId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LockId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Usage.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Usage); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (lockId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LockId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Usage.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Usage); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(LockInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.lockId_ != null) { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + LockId.MergeFrom(other.LockId); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Usage.Length != 0) { + Usage = other.Usage; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + input.ReadMessage(LockId); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 34: { + Usage = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class UnlockInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnlockInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnlockInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnlockInput(UnlockInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + lockId_ = other.lockId_ != null ? other.lockId_.Clone() : null; + symbol_ = other.symbol_; + usage_ = other.usage_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnlockInput Clone() { + return new UnlockInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The one want to un-lock his token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "lock_id" field. + public const int LockIdFieldNumber = 2; + private global::AElf.Types.Hash lockId_; + /// + /// Id of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash LockId { + get { return lockId_; } + set { + lockId_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the token to un-lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "usage" field. + public const int UsageFieldNumber = 4; + private string usage_ = ""; + /// + /// a memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Usage { + get { return usage_; } + set { + usage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 5; + private long amount_; + /// + /// The amount of tokens to un-lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UnlockInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UnlockInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (!object.Equals(LockId, other.LockId)) return false; + if (Symbol != other.Symbol) return false; + if (Usage != other.Usage) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (lockId_ != null) hash ^= LockId.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Usage.Length != 0) hash ^= Usage.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (lockId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LockId); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Usage.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Usage); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (lockId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LockId); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Usage.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Usage); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UnlockInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.lockId_ != null) { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + LockId.MergeFrom(other.LockId); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Usage.Length != 0) { + Usage = other.Usage; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + input.ReadMessage(LockId); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 34: { + Usage = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class TransferFromInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransferFromInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferFromInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferFromInput(TransferFromInput other) : this() { + from_ = other.from_ != null ? other.from_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferFromInput Clone() { + return new TransferFromInput(this); + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 1; + private global::AElf.Types.Address from_; + /// + /// The source address of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 2; + private global::AElf.Types.Address to_; + /// + /// The destination address of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the token to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 5; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TransferFromInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TransferFromInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(From, other.From)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (from_ != null) hash ^= From.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TransferFromInput other) { + if (other == null) { + return; + } + if (other.from_ != null) { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + From.MergeFrom(other.From); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class ApproveInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApproveInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApproveInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApproveInput(ApproveInput other) : this() { + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApproveInput Clone() { + return new ApproveInput(this); + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 1; + private global::AElf.Types.Address spender_; + /// + /// The address that allowance will be increased. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The symbol of token to approve. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of token to approve. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ApproveInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ApproveInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Spender, other.Spender)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (spender_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Spender); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ApproveInput other) { + if (other == null) { + return; + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class UnApproveInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnApproveInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproveInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproveInput(UnApproveInput other) : this() { + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproveInput Clone() { + return new UnApproveInput(this); + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 1; + private global::AElf.Types.Address spender_; + /// + /// The address that allowance will be decreased. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The symbol of token to un-approve. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of token to un-approve. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UnApproveInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UnApproveInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Spender, other.Spender)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (spender_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Spender); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UnApproveInput other) { + if (other == null) { + return; + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class BurnInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BurnInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BurnInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BurnInput(BurnInput other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BurnInput Clone() { + return new BurnInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token to burn. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount of token to burn. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as BurnInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(BurnInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(BurnInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class ChargeResourceTokenInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChargeResourceTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResourceTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResourceTokenInput(ChargeResourceTokenInput other) : this() { + costDic_ = other.costDic_.Clone(); + caller_ = other.caller_ != null ? other.caller_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResourceTokenInput Clone() { + return new ChargeResourceTokenInput(this); + } + + /// Field number for the "cost_dic" field. + public const int CostDicFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_costDic_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField costDic_ = new pbc::MapField(); + /// + /// Collection of charge resource token, Symbol->Amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField CostDic { + get { return costDic_; } + } + + /// Field number for the "caller" field. + public const int CallerFieldNumber = 2; + private global::AElf.Types.Address caller_; + /// + /// The sender of the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Caller { + get { return caller_; } + set { + caller_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChargeResourceTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChargeResourceTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!CostDic.Equals(other.CostDic)) return false; + if (!object.Equals(Caller, other.Caller)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= CostDic.GetHashCode(); + if (caller_ != null) hash ^= Caller.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + costDic_.WriteTo(output, _map_costDic_codec); + if (caller_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Caller); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += costDic_.CalculateSize(_map_costDic_codec); + if (caller_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Caller); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChargeResourceTokenInput other) { + if (other == null) { + return; + } + costDic_.Add(other.costDic_); + if (other.caller_ != null) { + if (caller_ == null) { + Caller = new global::AElf.Types.Address(); + } + Caller.MergeFrom(other.Caller); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + costDic_.AddEntriesFrom(input, _map_costDic_codec); + break; + } + case 18: { + if (caller_ == null) { + Caller = new global::AElf.Types.Address(); + } + input.ReadMessage(Caller); + break; + } + } + } + } + + } + + public sealed partial class TransactionFeeBill : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransactionFeeBill()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransactionFeeBill() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransactionFeeBill(TransactionFeeBill other) : this() { + feesMap_ = other.feesMap_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransactionFeeBill Clone() { + return new TransactionFeeBill(this); + } + + /// Field number for the "fees_map" field. + public const int FeesMapFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_feesMap_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField feesMap_ = new pbc::MapField(); + /// + /// The transaction fee dictionary, Symbol->fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField FeesMap { + get { return feesMap_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TransactionFeeBill); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TransactionFeeBill other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!FeesMap.Equals(other.FeesMap)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= FeesMap.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + feesMap_.WriteTo(output, _map_feesMap_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += feesMap_.CalculateSize(_map_feesMap_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TransactionFeeBill other) { + if (other == null) { + return; + } + feesMap_.Add(other.feesMap_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + feesMap_.AddEntriesFrom(input, _map_feesMap_codec); + break; + } + } + } + } + + } + + public sealed partial class CheckThresholdInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CheckThresholdInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CheckThresholdInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CheckThresholdInput(CheckThresholdInput other) : this() { + sender_ = other.sender_ != null ? other.sender_.Clone() : null; + symbolToThreshold_ = other.symbolToThreshold_.Clone(); + isCheckAllowance_ = other.isCheckAllowance_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CheckThresholdInput Clone() { + return new CheckThresholdInput(this); + } + + /// Field number for the "sender" field. + public const int SenderFieldNumber = 1; + private global::AElf.Types.Address sender_; + /// + /// The sender of the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Sender { + get { return sender_; } + set { + sender_ = value; + } + } + + /// Field number for the "symbol_to_threshold" field. + public const int SymbolToThresholdFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_symbolToThreshold_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 18); + private readonly pbc::MapField symbolToThreshold_ = new pbc::MapField(); + /// + /// The threshold to set, Symbol->Threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField SymbolToThreshold { + get { return symbolToThreshold_; } + } + + /// Field number for the "is_check_allowance" field. + public const int IsCheckAllowanceFieldNumber = 3; + private bool isCheckAllowance_; + /// + /// Whether to check the allowance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsCheckAllowance { + get { return isCheckAllowance_; } + set { + isCheckAllowance_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CheckThresholdInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CheckThresholdInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Sender, other.Sender)) return false; + if (!SymbolToThreshold.Equals(other.SymbolToThreshold)) return false; + if (IsCheckAllowance != other.IsCheckAllowance) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (sender_ != null) hash ^= Sender.GetHashCode(); + hash ^= SymbolToThreshold.GetHashCode(); + if (IsCheckAllowance != false) hash ^= IsCheckAllowance.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (sender_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Sender); + } + symbolToThreshold_.WriteTo(output, _map_symbolToThreshold_codec); + if (IsCheckAllowance != false) { + output.WriteRawTag(24); + output.WriteBool(IsCheckAllowance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (sender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sender); + } + size += symbolToThreshold_.CalculateSize(_map_symbolToThreshold_codec); + if (IsCheckAllowance != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CheckThresholdInput other) { + if (other == null) { + return; + } + if (other.sender_ != null) { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + Sender.MergeFrom(other.Sender); + } + symbolToThreshold_.Add(other.symbolToThreshold_); + if (other.IsCheckAllowance != false) { + IsCheckAllowance = other.IsCheckAllowance; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + input.ReadMessage(Sender); + break; + } + case 18: { + symbolToThreshold_.AddEntriesFrom(input, _map_symbolToThreshold_codec); + break; + } + case 24: { + IsCheckAllowance = input.ReadBool(); + break; + } + } + } + } + + } + + public sealed partial class GetTokenInfoInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetTokenInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetTokenInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetTokenInfoInput(GetTokenInfoInput other) : this() { + symbol_ = other.symbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetTokenInfoInput Clone() { + return new GetTokenInfoInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetTokenInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetTokenInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetTokenInfoInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class GetBalanceInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetBalanceInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceInput(GetBalanceInput other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceInput Clone() { + return new GetBalanceInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + /// + /// The target address of the query. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetBalanceInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetBalanceInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetBalanceInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + } + } + } + + } + + public sealed partial class GetBalanceOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetBalanceOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceOutput(GetBalanceOutput other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + balance_ = other.balance_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetBalanceOutput Clone() { + return new GetBalanceOutput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + /// + /// The target address of the query. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "balance" field. + public const int BalanceFieldNumber = 3; + private long balance_; + /// + /// The balance of the owner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Balance { + get { return balance_; } + set { + balance_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetBalanceOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetBalanceOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (Balance != other.Balance) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (Balance != 0L) hash ^= Balance.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (Balance != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Balance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (Balance != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Balance); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetBalanceOutput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.Balance != 0L) { + Balance = other.Balance; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 24: { + Balance = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class GetAllowanceInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetAllowanceInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceInput(GetAllowanceInput other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceInput Clone() { + return new GetAllowanceInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + /// + /// The address of the token owner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 3; + private global::AElf.Types.Address spender_; + /// + /// The address of the spender. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetAllowanceInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetAllowanceInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (!object.Equals(Spender, other.Spender)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (spender_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Spender); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetAllowanceInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + } + } + } + + } + + public sealed partial class GetAllowanceOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetAllowanceOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceOutput(GetAllowanceOutput other) : this() { + symbol_ = other.symbol_; + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + allowance_ = other.allowance_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetAllowanceOutput Clone() { + return new GetAllowanceOutput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 2; + private global::AElf.Types.Address owner_; + /// + /// The address of the token owner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 3; + private global::AElf.Types.Address spender_; + /// + /// The address of the spender. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + /// Field number for the "allowance" field. + public const int AllowanceFieldNumber = 4; + private long allowance_; + /// + /// The amount of allowance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Allowance { + get { return allowance_; } + set { + allowance_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetAllowanceOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetAllowanceOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Owner, other.Owner)) return false; + if (!object.Equals(Spender, other.Spender)) return false; + if (Allowance != other.Allowance) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (Allowance != 0L) hash ^= Allowance.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (owner_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Owner); + } + if (spender_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Spender); + } + if (Allowance != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Allowance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (Allowance != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Allowance); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetAllowanceOutput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + if (other.Allowance != 0L) { + Allowance = other.Allowance; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 26: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + case 32: { + Allowance = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class CrossChainTransferInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainTransferInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferInput(CrossChainTransferInput other) : this() { + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + toChainId_ = other.toChainId_; + issueChainId_ = other.issueChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferInput Clone() { + return new CrossChainTransferInput(this); + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 1; + private global::AElf.Types.Address to_; + /// + /// The receiver of transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of token to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 4; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_chain_id" field. + public const int ToChainIdFieldNumber = 5; + private int toChainId_; + /// + /// The destination chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ToChainId { + get { return toChainId_; } + set { + toChainId_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 6; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainTransferInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainTransferInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + if (ToChainId != other.ToChainId) return false; + if (IssueChainId != other.IssueChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (ToChainId != 0) hash ^= ToChainId.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (to_ != null) { + output.WriteRawTag(10); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Memo); + } + if (ToChainId != 0) { + output.WriteRawTag(40); + output.WriteInt32(ToChainId); + } + if (IssueChainId != 0) { + output.WriteRawTag(48); + output.WriteInt32(IssueChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (ToChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ToChainId); + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainTransferInput other) { + if (other == null) { + return; + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + if (other.ToChainId != 0) { + ToChainId = other.ToChainId; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + Memo = input.ReadString(); + break; + } + case 40: { + ToChainId = input.ReadInt32(); + break; + } + case 48: { + IssueChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class CrossChainReceiveTokenInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainReceiveTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceiveTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceiveTokenInput(CrossChainReceiveTokenInput other) : this() { + fromChainId_ = other.fromChainId_; + parentChainHeight_ = other.parentChainHeight_; + transferTransactionBytes_ = other.transferTransactionBytes_; + merklePath_ = other.merklePath_ != null ? other.merklePath_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceiveTokenInput Clone() { + return new CrossChainReceiveTokenInput(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private int fromChainId_; + /// + /// The source chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 2; + private long parentChainHeight_; + /// + /// The height of the transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "transfer_transaction_bytes" field. + public const int TransferTransactionBytesFieldNumber = 3; + private pb::ByteString transferTransactionBytes_ = pb::ByteString.Empty; + /// + /// The raw bytes of the transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString TransferTransactionBytes { + get { return transferTransactionBytes_; } + set { + transferTransactionBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "merkle_path" field. + public const int MerklePathFieldNumber = 4; + private global::AElf.Types.MerklePath merklePath_; + /// + /// The merkle path created from the transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.MerklePath MerklePath { + get { return merklePath_; } + set { + merklePath_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainReceiveTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainReceiveTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (TransferTransactionBytes != other.TransferTransactionBytes) return false; + if (!object.Equals(MerklePath, other.MerklePath)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FromChainId != 0) hash ^= FromChainId.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (TransferTransactionBytes.Length != 0) hash ^= TransferTransactionBytes.GetHashCode(); + if (merklePath_ != null) hash ^= MerklePath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FromChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FromChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(ParentChainHeight); + } + if (TransferTransactionBytes.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(TransferTransactionBytes); + } + if (merklePath_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MerklePath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FromChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FromChainId); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (TransferTransactionBytes.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(TransferTransactionBytes); + } + if (merklePath_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerklePath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainReceiveTokenInput other) { + if (other == null) { + return; + } + if (other.FromChainId != 0) { + FromChainId = other.FromChainId; + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.TransferTransactionBytes.Length != 0) { + TransferTransactionBytes = other.TransferTransactionBytes; + } + if (other.merklePath_ != null) { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + MerklePath.MergeFrom(other.MerklePath); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FromChainId = input.ReadInt32(); + break; + } + case 16: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 26: { + TransferTransactionBytes = input.ReadBytes(); + break; + } + case 34: { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePath); + break; + } + } + } + } + + } + + public sealed partial class IsInWhiteListInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IsInWhiteListInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IsInWhiteListInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IsInWhiteListInput(IsInWhiteListInput other) : this() { + symbol_ = other.symbol_; + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IsInWhiteListInput Clone() { + return new IsInWhiteListInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 2; + private global::AElf.Types.Address address_; + /// + /// The address to check. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IsInWhiteListInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IsInWhiteListInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (address_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IsInWhiteListInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + + } + + public sealed partial class SymbolToPayTxSizeFee : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SymbolToPayTxSizeFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[23]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolToPayTxSizeFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolToPayTxSizeFee(SymbolToPayTxSizeFee other) : this() { + tokenSymbol_ = other.tokenSymbol_; + baseTokenWeight_ = other.baseTokenWeight_; + addedTokenWeight_ = other.addedTokenWeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolToPayTxSizeFee Clone() { + return new SymbolToPayTxSizeFee(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "base_token_weight" field. + public const int BaseTokenWeightFieldNumber = 2; + private int baseTokenWeight_; + /// + /// The charge weight of primary token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int BaseTokenWeight { + get { return baseTokenWeight_; } + set { + baseTokenWeight_ = value; + } + } + + /// Field number for the "added_token_weight" field. + public const int AddedTokenWeightFieldNumber = 3; + private int addedTokenWeight_; + /// + /// The new added token charge weight. For example, the charge weight of primary Token is set to 1. + /// The newly added token charge weight is set to 10. If the transaction requires 1 unit of primary token, + /// the user can also pay for 10 newly added tokens. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int AddedTokenWeight { + get { return addedTokenWeight_; } + set { + addedTokenWeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SymbolToPayTxSizeFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SymbolToPayTxSizeFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + if (BaseTokenWeight != other.BaseTokenWeight) return false; + if (AddedTokenWeight != other.AddedTokenWeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (BaseTokenWeight != 0) hash ^= BaseTokenWeight.GetHashCode(); + if (AddedTokenWeight != 0) hash ^= AddedTokenWeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (BaseTokenWeight != 0) { + output.WriteRawTag(16); + output.WriteInt32(BaseTokenWeight); + } + if (AddedTokenWeight != 0) { + output.WriteRawTag(24); + output.WriteInt32(AddedTokenWeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (BaseTokenWeight != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BaseTokenWeight); + } + if (AddedTokenWeight != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AddedTokenWeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SymbolToPayTxSizeFee other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.BaseTokenWeight != 0) { + BaseTokenWeight = other.BaseTokenWeight; + } + if (other.AddedTokenWeight != 0) { + AddedTokenWeight = other.AddedTokenWeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 16: { + BaseTokenWeight = input.ReadInt32(); + break; + } + case 24: { + AddedTokenWeight = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class SymbolListToPayTxSizeFee : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SymbolListToPayTxSizeFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolListToPayTxSizeFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolListToPayTxSizeFee(SymbolListToPayTxSizeFee other) : this() { + symbolsToPayTxSizeFee_ = other.symbolsToPayTxSizeFee_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SymbolListToPayTxSizeFee Clone() { + return new SymbolListToPayTxSizeFee(this); + } + + /// Field number for the "symbols_to_pay_tx_size_fee" field. + public const int SymbolsToPayTxSizeFeeFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_symbolsToPayTxSizeFee_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.MultiToken.SymbolToPayTxSizeFee.Parser); + private readonly pbc::RepeatedField symbolsToPayTxSizeFee_ = new pbc::RepeatedField(); + /// + /// Transaction fee token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SymbolsToPayTxSizeFee { + get { return symbolsToPayTxSizeFee_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SymbolListToPayTxSizeFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SymbolListToPayTxSizeFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!symbolsToPayTxSizeFee_.Equals(other.symbolsToPayTxSizeFee_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= symbolsToPayTxSizeFee_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + symbolsToPayTxSizeFee_.WriteTo(output, _repeated_symbolsToPayTxSizeFee_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += symbolsToPayTxSizeFee_.CalculateSize(_repeated_symbolsToPayTxSizeFee_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SymbolListToPayTxSizeFee other) { + if (other == null) { + return; + } + symbolsToPayTxSizeFee_.Add(other.symbolsToPayTxSizeFee_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + symbolsToPayTxSizeFee_.AddEntriesFrom(input, _repeated_symbolsToPayTxSizeFee_codec); + break; + } + } + } + } + + } + + public sealed partial class ChargeTransactionFeesInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChargeTransactionFeesInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[25]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesInput(ChargeTransactionFeesInput other) : this() { + methodName_ = other.methodName_; + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + transactionSizeFee_ = other.transactionSizeFee_; + symbolsToPayTxSizeFee_ = other.symbolsToPayTxSizeFee_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesInput Clone() { + return new ChargeTransactionFeesInput(this); + } + + /// Field number for the "method_name" field. + public const int MethodNameFieldNumber = 1; + private string methodName_ = ""; + /// + /// The method name of transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MethodName { + get { return methodName_; } + set { + methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 2; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address of transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "transaction_size_fee" field. + public const int TransactionSizeFeeFieldNumber = 3; + private long transactionSizeFee_; + /// + /// The amount of transaction size fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TransactionSizeFee { + get { return transactionSizeFee_; } + set { + transactionSizeFee_ = value; + } + } + + /// Field number for the "symbols_to_pay_tx_size_fee" field. + public const int SymbolsToPayTxSizeFeeFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_symbolsToPayTxSizeFee_codec + = pb::FieldCodec.ForMessage(34, global::AElf.Contracts.MultiToken.SymbolToPayTxSizeFee.Parser); + private readonly pbc::RepeatedField symbolsToPayTxSizeFee_ = new pbc::RepeatedField(); + /// + /// Transaction fee token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SymbolsToPayTxSizeFee { + get { return symbolsToPayTxSizeFee_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChargeTransactionFeesInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChargeTransactionFeesInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MethodName != other.MethodName) return false; + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (TransactionSizeFee != other.TransactionSizeFee) return false; + if(!symbolsToPayTxSizeFee_.Equals(other.symbolsToPayTxSizeFee_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (MethodName.Length != 0) hash ^= MethodName.GetHashCode(); + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (TransactionSizeFee != 0L) hash ^= TransactionSizeFee.GetHashCode(); + hash ^= symbolsToPayTxSizeFee_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (MethodName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(MethodName); + } + if (contractAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ContractAddress); + } + if (TransactionSizeFee != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TransactionSizeFee); + } + symbolsToPayTxSizeFee_.WriteTo(output, _repeated_symbolsToPayTxSizeFee_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (MethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName); + } + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (TransactionSizeFee != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TransactionSizeFee); + } + size += symbolsToPayTxSizeFee_.CalculateSize(_repeated_symbolsToPayTxSizeFee_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChargeTransactionFeesInput other) { + if (other == null) { + return; + } + if (other.MethodName.Length != 0) { + MethodName = other.MethodName; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.TransactionSizeFee != 0L) { + TransactionSizeFee = other.TransactionSizeFee; + } + symbolsToPayTxSizeFee_.Add(other.symbolsToPayTxSizeFee_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MethodName = input.ReadString(); + break; + } + case 18: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 24: { + TransactionSizeFee = input.ReadInt64(); + break; + } + case 34: { + symbolsToPayTxSizeFee_.AddEntriesFrom(input, _repeated_symbolsToPayTxSizeFee_codec); + break; + } + } + } + } + + } + + public sealed partial class ChargeTransactionFeesOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChargeTransactionFeesOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[26]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesOutput(ChargeTransactionFeesOutput other) : this() { + success_ = other.success_; + chargingInformation_ = other.chargingInformation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeTransactionFeesOutput Clone() { + return new ChargeTransactionFeesOutput(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + /// + /// Whether the charge was successful. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "charging_information" field. + public const int ChargingInformationFieldNumber = 2; + private string chargingInformation_ = ""; + /// + /// The charging information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ChargingInformation { + get { return chargingInformation_; } + set { + chargingInformation_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChargeTransactionFeesOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChargeTransactionFeesOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (ChargingInformation != other.ChargingInformation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (ChargingInformation.Length != 0) hash ^= ChargingInformation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (ChargingInformation.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ChargingInformation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (ChargingInformation.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ChargingInformation); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChargeTransactionFeesOutput other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.ChargingInformation.Length != 0) { + ChargingInformation = other.ChargingInformation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + ChargingInformation = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class CallbackInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CallbackInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[27]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallbackInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallbackInfo(CallbackInfo other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + methodName_ = other.methodName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallbackInfo Clone() { + return new CallbackInfo(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "method_name" field. + public const int MethodNameFieldNumber = 2; + private string methodName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MethodName { + get { return methodName_; } + set { + methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CallbackInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CallbackInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (MethodName != other.MethodName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (MethodName.Length != 0) hash ^= MethodName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (MethodName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(MethodName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (MethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CallbackInfo other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.MethodName.Length != 0) { + MethodName = other.MethodName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + MethodName = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class ExtraTokenListModified : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtraTokenListModified()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[28]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExtraTokenListModified() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExtraTokenListModified(ExtraTokenListModified other) : this() { + symbolListToPayTxSizeFee_ = other.symbolListToPayTxSizeFee_ != null ? other.symbolListToPayTxSizeFee_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExtraTokenListModified Clone() { + return new ExtraTokenListModified(this); + } + + /// Field number for the "symbol_list_to_pay_tx_size_fee" field. + public const int SymbolListToPayTxSizeFeeFieldNumber = 1; + private global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee symbolListToPayTxSizeFee_; + /// + /// Transaction fee token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee SymbolListToPayTxSizeFee { + get { return symbolListToPayTxSizeFee_; } + set { + symbolListToPayTxSizeFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExtraTokenListModified); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExtraTokenListModified other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(SymbolListToPayTxSizeFee, other.SymbolListToPayTxSizeFee)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (symbolListToPayTxSizeFee_ != null) hash ^= SymbolListToPayTxSizeFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (symbolListToPayTxSizeFee_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SymbolListToPayTxSizeFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (symbolListToPayTxSizeFee_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SymbolListToPayTxSizeFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExtraTokenListModified other) { + if (other == null) { + return; + } + if (other.symbolListToPayTxSizeFee_ != null) { + if (symbolListToPayTxSizeFee_ == null) { + SymbolListToPayTxSizeFee = new global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee(); + } + SymbolListToPayTxSizeFee.MergeFrom(other.SymbolListToPayTxSizeFee); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (symbolListToPayTxSizeFee_ == null) { + SymbolListToPayTxSizeFee = new global::AElf.Contracts.MultiToken.SymbolListToPayTxSizeFee(); + } + input.ReadMessage(SymbolListToPayTxSizeFee); + break; + } + } + } + } + + } + + public sealed partial class GetLockedAmountInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetLockedAmountInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[29]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountInput(GetLockedAmountInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + symbol_ = other.symbol_; + lockId_ = other.lockId_ != null ? other.lockId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountInput Clone() { + return new GetLockedAmountInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The address of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The token symbol. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "lock_id" field. + public const int LockIdFieldNumber = 3; + private global::AElf.Types.Hash lockId_; + /// + /// The id of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash LockId { + get { return lockId_; } + set { + lockId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetLockedAmountInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetLockedAmountInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (Symbol != other.Symbol) return false; + if (!object.Equals(LockId, other.LockId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (lockId_ != null) hash ^= LockId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (lockId_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LockId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (lockId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LockId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetLockedAmountInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.lockId_ != null) { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + LockId.MergeFrom(other.LockId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 26: { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + input.ReadMessage(LockId); + break; + } + } + } + } + + } + + public sealed partial class GetLockedAmountOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetLockedAmountOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[30]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountOutput(GetLockedAmountOutput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + symbol_ = other.symbol_; + lockId_ = other.lockId_ != null ? other.lockId_.Clone() : null; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetLockedAmountOutput Clone() { + return new GetLockedAmountOutput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The address of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The token symbol. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "lock_id" field. + public const int LockIdFieldNumber = 3; + private global::AElf.Types.Hash lockId_; + /// + /// The id of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash LockId { + get { return lockId_; } + set { + lockId_ = value; + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The locked amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetLockedAmountOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetLockedAmountOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (Symbol != other.Symbol) return false; + if (!object.Equals(LockId, other.LockId)) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (lockId_ != null) hash ^= LockId.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (lockId_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LockId); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (lockId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LockId); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetLockedAmountOutput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.lockId_ != null) { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + LockId.MergeFrom(other.LockId); + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 26: { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + input.ReadMessage(LockId); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class TokenInfoList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenInfoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[31]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfoList(TokenInfoList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenInfoList Clone() { + return new TokenInfoList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.MultiToken.TokenInfo.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + /// + /// List of token information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TokenInfoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TokenInfoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TokenInfoList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + public sealed partial class GetCrossChainTransferTokenContractAddressInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetCrossChainTransferTokenContractAddressInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[32]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCrossChainTransferTokenContractAddressInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCrossChainTransferTokenContractAddressInput(GetCrossChainTransferTokenContractAddressInput other) : this() { + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCrossChainTransferTokenContractAddressInput Clone() { + return new GetCrossChainTransferTokenContractAddressInput(this); + } + + /// Field number for the "chainId" field. + public const int ChainIdFieldNumber = 1; + private int chainId_; + /// + /// The chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetCrossChainTransferTokenContractAddressInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetCrossChainTransferTokenContractAddressInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetCrossChainTransferTokenContractAddressInput other) { + if (other == null) { + return; + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class CrossChainCreateTokenInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainCreateTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[33]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainCreateTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainCreateTokenInput(CrossChainCreateTokenInput other) : this() { + fromChainId_ = other.fromChainId_; + parentChainHeight_ = other.parentChainHeight_; + transactionBytes_ = other.transactionBytes_; + merklePath_ = other.merklePath_ != null ? other.merklePath_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainCreateTokenInput Clone() { + return new CrossChainCreateTokenInput(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private int fromChainId_; + /// + /// The chain id of the chain on which the token was created. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 2; + private long parentChainHeight_; + /// + /// The height of the transaction that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "transaction_bytes" field. + public const int TransactionBytesFieldNumber = 3; + private pb::ByteString transactionBytes_ = pb::ByteString.Empty; + /// + /// The transaction that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString TransactionBytes { + get { return transactionBytes_; } + set { + transactionBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "merkle_path" field. + public const int MerklePathFieldNumber = 4; + private global::AElf.Types.MerklePath merklePath_; + /// + /// The merkle path created from the transaction that created the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.MerklePath MerklePath { + get { return merklePath_; } + set { + merklePath_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainCreateTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainCreateTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (TransactionBytes != other.TransactionBytes) return false; + if (!object.Equals(MerklePath, other.MerklePath)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FromChainId != 0) hash ^= FromChainId.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (TransactionBytes.Length != 0) hash ^= TransactionBytes.GetHashCode(); + if (merklePath_ != null) hash ^= MerklePath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FromChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FromChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(TransactionBytes); + } + if (merklePath_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MerklePath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FromChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FromChainId); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(TransactionBytes); + } + if (merklePath_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerklePath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainCreateTokenInput other) { + if (other == null) { + return; + } + if (other.FromChainId != 0) { + FromChainId = other.FromChainId; + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.TransactionBytes.Length != 0) { + TransactionBytes = other.TransactionBytes; + } + if (other.merklePath_ != null) { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + MerklePath.MergeFrom(other.MerklePath); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FromChainId = input.ReadInt32(); + break; + } + case 16: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 26: { + TransactionBytes = input.ReadBytes(); + break; + } + case 34: { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePath); + break; + } + } + } + } + + } + + public sealed partial class InitializeFromParentChainInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitializeFromParentChainInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[34]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeFromParentChainInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeFromParentChainInput(InitializeFromParentChainInput other) : this() { + resourceAmount_ = other.resourceAmount_.Clone(); + registeredOtherTokenContractAddresses_ = other.registeredOtherTokenContractAddresses_.Clone(); + creator_ = other.creator_ != null ? other.creator_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InitializeFromParentChainInput Clone() { + return new InitializeFromParentChainInput(this); + } + + /// Field number for the "resource_amount" field. + public const int ResourceAmountFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_resourceAmount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt32(16, 0), 10); + private readonly pbc::MapField resourceAmount_ = new pbc::MapField(); + /// + /// The amount of resource. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ResourceAmount { + get { return resourceAmount_; } + } + + /// Field number for the "registered_other_token_contract_addresses" field. + public const int RegisteredOtherTokenContractAddressesFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_registeredOtherTokenContractAddresses_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::AElf.Types.Address.Parser), 18); + private readonly pbc::MapField registeredOtherTokenContractAddresses_ = new pbc::MapField(); + /// + /// The token contract addresses. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField RegisteredOtherTokenContractAddresses { + get { return registeredOtherTokenContractAddresses_; } + } + + /// Field number for the "creator" field. + public const int CreatorFieldNumber = 3; + private global::AElf.Types.Address creator_; + /// + /// The creator the side chain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Creator { + get { return creator_; } + set { + creator_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as InitializeFromParentChainInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(InitializeFromParentChainInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ResourceAmount.Equals(other.ResourceAmount)) return false; + if (!RegisteredOtherTokenContractAddresses.Equals(other.RegisteredOtherTokenContractAddresses)) return false; + if (!object.Equals(Creator, other.Creator)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ResourceAmount.GetHashCode(); + hash ^= RegisteredOtherTokenContractAddresses.GetHashCode(); + if (creator_ != null) hash ^= Creator.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + resourceAmount_.WriteTo(output, _map_resourceAmount_codec); + registeredOtherTokenContractAddresses_.WriteTo(output, _map_registeredOtherTokenContractAddresses_codec); + if (creator_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Creator); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += resourceAmount_.CalculateSize(_map_resourceAmount_codec); + size += registeredOtherTokenContractAddresses_.CalculateSize(_map_registeredOtherTokenContractAddresses_codec); + if (creator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(InitializeFromParentChainInput other) { + if (other == null) { + return; + } + resourceAmount_.Add(other.resourceAmount_); + registeredOtherTokenContractAddresses_.Add(other.registeredOtherTokenContractAddresses_); + if (other.creator_ != null) { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + Creator.MergeFrom(other.Creator); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + resourceAmount_.AddEntriesFrom(input, _map_resourceAmount_codec); + break; + } + case 18: { + registeredOtherTokenContractAddresses_.AddEntriesFrom(input, _map_registeredOtherTokenContractAddresses_codec); + break; + } + case 26: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + } + } + } + + } + + public sealed partial class UpdateCoefficientsInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UpdateCoefficientsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[35]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateCoefficientsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateCoefficientsInput(UpdateCoefficientsInput other) : this() { + pieceNumbers_ = other.pieceNumbers_.Clone(); + coefficients_ = other.coefficients_ != null ? other.coefficients_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateCoefficientsInput Clone() { + return new UpdateCoefficientsInput(this); + } + + /// Field number for the "piece_numbers" field. + public const int PieceNumbersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_pieceNumbers_codec + = pb::FieldCodec.ForInt32(10); + private readonly pbc::RepeatedField pieceNumbers_ = new pbc::RepeatedField(); + /// + /// The specify pieces gonna update. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PieceNumbers { + get { return pieceNumbers_; } + } + + /// Field number for the "coefficients" field. + public const int CoefficientsFieldNumber = 2; + private global::AElf.Contracts.MultiToken.CalculateFeeCoefficients coefficients_; + /// + /// Coefficients of one single type. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.CalculateFeeCoefficients Coefficients { + get { return coefficients_; } + set { + coefficients_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UpdateCoefficientsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UpdateCoefficientsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!pieceNumbers_.Equals(other.pieceNumbers_)) return false; + if (!object.Equals(Coefficients, other.Coefficients)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= pieceNumbers_.GetHashCode(); + if (coefficients_ != null) hash ^= Coefficients.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + pieceNumbers_.WriteTo(output, _repeated_pieceNumbers_codec); + if (coefficients_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Coefficients); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += pieceNumbers_.CalculateSize(_repeated_pieceNumbers_codec); + if (coefficients_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Coefficients); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UpdateCoefficientsInput other) { + if (other == null) { + return; + } + pieceNumbers_.Add(other.pieceNumbers_); + if (other.coefficients_ != null) { + if (coefficients_ == null) { + Coefficients = new global::AElf.Contracts.MultiToken.CalculateFeeCoefficients(); + } + Coefficients.MergeFrom(other.Coefficients); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + pieceNumbers_.AddEntriesFrom(input, _repeated_pieceNumbers_codec); + break; + } + case 18: { + if (coefficients_ == null) { + Coefficients = new global::AElf.Contracts.MultiToken.CalculateFeeCoefficients(); + } + input.ReadMessage(Coefficients); + break; + } + } + } + } + + } + + public sealed partial class CalculateFeePieceCoefficients : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculateFeePieceCoefficients()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeePieceCoefficients() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeePieceCoefficients(CalculateFeePieceCoefficients other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeePieceCoefficients Clone() { + return new CalculateFeePieceCoefficients(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForInt32(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + /// + /// Coefficients of one single piece. + /// The first char is its type: liner / power. + /// The second char is its piece upper bound. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CalculateFeePieceCoefficients); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CalculateFeePieceCoefficients other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CalculateFeePieceCoefficients other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + public sealed partial class CalculateFeeCoefficients : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculateFeeCoefficients()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeCoefficients() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeCoefficients(CalculateFeeCoefficients other) : this() { + feeTokenType_ = other.feeTokenType_; + pieceCoefficientsList_ = other.pieceCoefficientsList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeCoefficients Clone() { + return new CalculateFeeCoefficients(this); + } + + /// Field number for the "fee_token_type" field. + public const int FeeTokenTypeFieldNumber = 1; + private int feeTokenType_; + /// + /// The resource fee type, like READ, WRITE, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int FeeTokenType { + get { return feeTokenType_; } + set { + feeTokenType_ = value; + } + } + + /// Field number for the "piece_coefficients_list" field. + public const int PieceCoefficientsListFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_pieceCoefficientsList_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Contracts.MultiToken.CalculateFeePieceCoefficients.Parser); + private readonly pbc::RepeatedField pieceCoefficientsList_ = new pbc::RepeatedField(); + /// + /// Coefficients of one single piece. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PieceCoefficientsList { + get { return pieceCoefficientsList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CalculateFeeCoefficients); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CalculateFeeCoefficients other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FeeTokenType != other.FeeTokenType) return false; + if(!pieceCoefficientsList_.Equals(other.pieceCoefficientsList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FeeTokenType != 0) hash ^= FeeTokenType.GetHashCode(); + hash ^= pieceCoefficientsList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FeeTokenType != 0) { + output.WriteRawTag(8); + output.WriteInt32(FeeTokenType); + } + pieceCoefficientsList_.WriteTo(output, _repeated_pieceCoefficientsList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FeeTokenType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FeeTokenType); + } + size += pieceCoefficientsList_.CalculateSize(_repeated_pieceCoefficientsList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CalculateFeeCoefficients other) { + if (other == null) { + return; + } + if (other.FeeTokenType != 0) { + FeeTokenType = other.FeeTokenType; + } + pieceCoefficientsList_.Add(other.pieceCoefficientsList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FeeTokenType = input.ReadInt32(); + break; + } + case 18: { + pieceCoefficientsList_.AddEntriesFrom(input, _repeated_pieceCoefficientsList_codec); + break; + } + } + } + } + + } + + public sealed partial class AllCalculateFeeCoefficients : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AllCalculateFeeCoefficients()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[38]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllCalculateFeeCoefficients() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllCalculateFeeCoefficients(AllCalculateFeeCoefficients other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllCalculateFeeCoefficients Clone() { + return new AllCalculateFeeCoefficients(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.MultiToken.CalculateFeeCoefficients.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + /// + /// The coefficients of fee Calculation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AllCalculateFeeCoefficients); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AllCalculateFeeCoefficients other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AllCalculateFeeCoefficients other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + public sealed partial class TotalTransactionFeesMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TotalTransactionFeesMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[39]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalTransactionFeesMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalTransactionFeesMap(TotalTransactionFeesMap other) : this() { + value_ = other.value_.Clone(); + blockHash_ = other.blockHash_ != null ? other.blockHash_.Clone() : null; + blockHeight_ = other.blockHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalTransactionFeesMap Clone() { + return new TotalTransactionFeesMap(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + /// + /// Token dictionary that charge transaction fee, Symbol->Amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Value { + get { return value_; } + } + + /// Field number for the "block_hash" field. + public const int BlockHashFieldNumber = 2; + private global::AElf.Types.Hash blockHash_; + /// + /// The hash of the block processing the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash BlockHash { + get { return blockHash_; } + set { + blockHash_ = value; + } + } + + /// Field number for the "block_height" field. + public const int BlockHeightFieldNumber = 3; + private long blockHeight_; + /// + /// The height of the block processing the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BlockHeight { + get { return blockHeight_; } + set { + blockHeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TotalTransactionFeesMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TotalTransactionFeesMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + if (!object.Equals(BlockHash, other.BlockHash)) return false; + if (BlockHeight != other.BlockHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (blockHash_ != null) hash ^= BlockHash.GetHashCode(); + if (BlockHeight != 0L) hash ^= BlockHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _map_value_codec); + if (blockHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BlockHash); + } + if (BlockHeight != 0L) { + output.WriteRawTag(24); + output.WriteInt64(BlockHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (blockHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlockHash); + } + if (BlockHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BlockHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TotalTransactionFeesMap other) { + if (other == null) { + return; + } + value_.Add(other.value_); + if (other.blockHash_ != null) { + if (blockHash_ == null) { + BlockHash = new global::AElf.Types.Hash(); + } + BlockHash.MergeFrom(other.BlockHash); + } + if (other.BlockHeight != 0L) { + BlockHeight = other.BlockHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + case 18: { + if (blockHash_ == null) { + BlockHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(BlockHash); + break; + } + case 24: { + BlockHeight = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class TotalResourceTokensMaps : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TotalResourceTokensMaps()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[40]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMaps() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMaps(TotalResourceTokensMaps other) : this() { + value_ = other.value_.Clone(); + blockHash_ = other.blockHash_ != null ? other.blockHash_.Clone() : null; + blockHeight_ = other.blockHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMaps Clone() { + return new TotalResourceTokensMaps(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Contracts.MultiToken.ContractTotalResourceTokens.Parser); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + /// + /// Resource tokens to charge. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + /// Field number for the "block_hash" field. + public const int BlockHashFieldNumber = 2; + private global::AElf.Types.Hash blockHash_; + /// + /// The hash of the block processing the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash BlockHash { + get { return blockHash_; } + set { + blockHash_ = value; + } + } + + /// Field number for the "block_height" field. + public const int BlockHeightFieldNumber = 3; + private long blockHeight_; + /// + /// The height of the block processing the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BlockHeight { + get { return blockHeight_; } + set { + blockHeight_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TotalResourceTokensMaps); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TotalResourceTokensMaps other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + if (!object.Equals(BlockHash, other.BlockHash)) return false; + if (BlockHeight != other.BlockHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (blockHash_ != null) hash ^= BlockHash.GetHashCode(); + if (BlockHeight != 0L) hash ^= BlockHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (blockHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BlockHash); + } + if (BlockHeight != 0L) { + output.WriteRawTag(24); + output.WriteInt64(BlockHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (blockHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlockHash); + } + if (BlockHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BlockHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TotalResourceTokensMaps other) { + if (other == null) { + return; + } + value_.Add(other.value_); + if (other.blockHash_ != null) { + if (blockHash_ == null) { + BlockHash = new global::AElf.Types.Hash(); + } + BlockHash.MergeFrom(other.BlockHash); + } + if (other.BlockHeight != 0L) { + BlockHeight = other.BlockHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + case 18: { + if (blockHash_ == null) { + BlockHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(BlockHash); + break; + } + case 24: { + BlockHeight = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class ContractTotalResourceTokens : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractTotalResourceTokens()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[41]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractTotalResourceTokens() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractTotalResourceTokens(ContractTotalResourceTokens other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + tokensMap_ = other.tokensMap_ != null ? other.tokensMap_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContractTotalResourceTokens Clone() { + return new ContractTotalResourceTokens(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "tokens_map" field. + public const int TokensMapFieldNumber = 2; + private global::AElf.Contracts.MultiToken.TotalResourceTokensMap tokensMap_; + /// + /// Resource tokens to charge. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.TotalResourceTokensMap TokensMap { + get { return tokensMap_; } + set { + tokensMap_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ContractTotalResourceTokens); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ContractTotalResourceTokens other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (!object.Equals(TokensMap, other.TokensMap)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (tokensMap_ != null) hash ^= TokensMap.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (tokensMap_ != null) { + output.WriteRawTag(18); + output.WriteMessage(TokensMap); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (tokensMap_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TokensMap); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ContractTotalResourceTokens other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.tokensMap_ != null) { + if (tokensMap_ == null) { + TokensMap = new global::AElf.Contracts.MultiToken.TotalResourceTokensMap(); + } + TokensMap.MergeFrom(other.TokensMap); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + if (tokensMap_ == null) { + TokensMap = new global::AElf.Contracts.MultiToken.TotalResourceTokensMap(); + } + input.ReadMessage(TokensMap); + break; + } + } + } + } + + } + + public sealed partial class TotalResourceTokensMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TotalResourceTokensMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[42]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMap(TotalResourceTokensMap other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TotalResourceTokensMap Clone() { + return new TotalResourceTokensMap(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + /// + /// Resource token dictionary, Symbol->Amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TotalResourceTokensMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TotalResourceTokensMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _map_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TotalResourceTokensMap other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + } + } + } + + } + + public sealed partial class ChangeTokenIssuerInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChangeTokenIssuerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[43]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeTokenIssuerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeTokenIssuerInput(ChangeTokenIssuerInput other) : this() { + symbol_ = other.symbol_; + newTokenIssuer_ = other.newTokenIssuer_ != null ? other.newTokenIssuer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChangeTokenIssuerInput Clone() { + return new ChangeTokenIssuerInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The token symbol. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "new_token_Issuer" field. + public const int NewTokenIssuerFieldNumber = 2; + private global::AElf.Types.Address newTokenIssuer_; + /// + /// The new token issuer for change. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address NewTokenIssuer { + get { return newTokenIssuer_; } + set { + newTokenIssuer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChangeTokenIssuerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChangeTokenIssuerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(NewTokenIssuer, other.NewTokenIssuer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (newTokenIssuer_ != null) hash ^= NewTokenIssuer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (newTokenIssuer_ != null) { + output.WriteRawTag(18); + output.WriteMessage(NewTokenIssuer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (newTokenIssuer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewTokenIssuer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChangeTokenIssuerInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.newTokenIssuer_ != null) { + if (newTokenIssuer_ == null) { + NewTokenIssuer = new global::AElf.Types.Address(); + } + NewTokenIssuer.MergeFrom(other.NewTokenIssuer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (newTokenIssuer_ == null) { + NewTokenIssuer = new global::AElf.Types.Address(); + } + input.ReadMessage(NewTokenIssuer); + break; + } + } + } + } + + } + + public sealed partial class ResetExternalInfoInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResetExternalInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[44]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResetExternalInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResetExternalInfoInput(ResetExternalInfoInput other) : this() { + symbol_ = other.symbol_; + externalInfo_ = other.externalInfo_ != null ? other.externalInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResetExternalInfoInput Clone() { + return new ResetExternalInfoInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 2; + private global::AElf.Contracts.MultiToken.ExternalInfo externalInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.ExternalInfo ExternalInfo { + get { return externalInfo_; } + set { + externalInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ResetExternalInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ResetExternalInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(ExternalInfo, other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (externalInfo_ != null) hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (externalInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ExternalInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (externalInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ResetExternalInfoInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.externalInfo_ != null) { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + ExternalInfo.MergeFrom(other.ExternalInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + input.ReadMessage(ExternalInfo); + break; + } + } + } + } + + } + + public sealed partial class StringList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StringList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[45]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StringList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StringList(StringList other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StringList Clone() { + return new StringList(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StringList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StringList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StringList other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + } + + } + + public sealed partial class Transferred : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Transferred()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[46]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Transferred() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Transferred(Transferred other) : this() { + from_ = other.from_ != null ? other.from_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Transferred Clone() { + return new Transferred(this); + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 1; + private global::AElf.Types.Address from_; + /// + /// The source address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 2; + private global::AElf.Types.Address to_; + /// + /// The destination address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 5; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Transferred); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Transferred other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(From, other.From)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (from_ != null) hash ^= From.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Transferred other) { + if (other == null) { + return; + } + if (other.from_ != null) { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + From.MergeFrom(other.From); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class Approved : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Approved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[47]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Approved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Approved(Approved other) : this() { + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Approved Clone() { + return new Approved(this); + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 1; + private global::AElf.Types.Address owner_; + /// + /// The address of the token owner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 2; + private global::AElf.Types.Address spender_; + /// + /// The address that allowance be increased. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of approved token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount of approved token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Approved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Approved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Owner, other.Owner)) return false; + if (!object.Equals(Spender, other.Spender)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (spender_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Spender); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Approved other) { + if (other == null) { + return; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 18: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class UnApproved : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnApproved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[48]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproved(UnApproved other) : this() { + owner_ = other.owner_ != null ? other.owner_.Clone() : null; + spender_ = other.spender_ != null ? other.spender_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UnApproved Clone() { + return new UnApproved(this); + } + + /// Field number for the "owner" field. + public const int OwnerFieldNumber = 1; + private global::AElf.Types.Address owner_; + /// + /// The address of the token owner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Owner { + get { return owner_; } + set { + owner_ = value; + } + } + + /// Field number for the "spender" field. + public const int SpenderFieldNumber = 2; + private global::AElf.Types.Address spender_; + /// + /// The address that allowance be decreased. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Spender { + get { return spender_; } + set { + spender_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of un-approved token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount of un-approved token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UnApproved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UnApproved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Owner, other.Owner)) return false; + if (!object.Equals(Spender, other.Spender)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (owner_ != null) hash ^= Owner.GetHashCode(); + if (spender_ != null) hash ^= Spender.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (owner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Owner); + } + if (spender_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Spender); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (owner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Owner); + } + if (spender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Spender); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UnApproved other) { + if (other == null) { + return; + } + if (other.owner_ != null) { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + Owner.MergeFrom(other.Owner); + } + if (other.spender_ != null) { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + Spender.MergeFrom(other.Spender); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (owner_ == null) { + Owner = new global::AElf.Types.Address(); + } + input.ReadMessage(Owner); + break; + } + case 18: { + if (spender_ == null) { + Spender = new global::AElf.Types.Address(); + } + input.ReadMessage(Spender); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class Burned : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Burned()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[49]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Burned() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Burned(Burned other) : this() { + burner_ = other.burner_ != null ? other.burner_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Burned Clone() { + return new Burned(this); + } + + /// Field number for the "burner" field. + public const int BurnerFieldNumber = 1; + private global::AElf.Types.Address burner_; + /// + /// The address who wants to burn token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Burner { + get { return burner_; } + set { + burner_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 2; + private string symbol_ = ""; + /// + /// The symbol of burned token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of burned token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Burned); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Burned other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Burner, other.Burner)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (burner_ != null) hash ^= Burner.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (burner_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Burner); + } + if (Symbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (burner_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Burner); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Burned other) { + if (other == null) { + return; + } + if (other.burner_ != null) { + if (burner_ == null) { + Burner = new global::AElf.Types.Address(); + } + Burner.MergeFrom(other.Burner); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (burner_ == null) { + Burner = new global::AElf.Types.Address(); + } + input.ReadMessage(Burner); + break; + } + case 18: { + Symbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class ChainPrimaryTokenSymbolSet : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChainPrimaryTokenSymbolSet()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[50]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenSymbolSet() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenSymbolSet(ChainPrimaryTokenSymbolSet other) : this() { + tokenSymbol_ = other.tokenSymbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChainPrimaryTokenSymbolSet Clone() { + return new ChainPrimaryTokenSymbolSet(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChainPrimaryTokenSymbolSet); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChainPrimaryTokenSymbolSet other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChainPrimaryTokenSymbolSet other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class CalculateFeeAlgorithmUpdated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculateFeeAlgorithmUpdated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[51]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeAlgorithmUpdated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeAlgorithmUpdated(CalculateFeeAlgorithmUpdated other) : this() { + allTypeFeeCoefficients_ = other.allTypeFeeCoefficients_ != null ? other.allTypeFeeCoefficients_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CalculateFeeAlgorithmUpdated Clone() { + return new CalculateFeeAlgorithmUpdated(this); + } + + /// Field number for the "all_type_fee_coefficients" field. + public const int AllTypeFeeCoefficientsFieldNumber = 1; + private global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients allTypeFeeCoefficients_; + /// + /// All calculate fee coefficients after modification. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients AllTypeFeeCoefficients { + get { return allTypeFeeCoefficients_; } + set { + allTypeFeeCoefficients_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CalculateFeeAlgorithmUpdated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CalculateFeeAlgorithmUpdated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(AllTypeFeeCoefficients, other.AllTypeFeeCoefficients)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (allTypeFeeCoefficients_ != null) hash ^= AllTypeFeeCoefficients.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (allTypeFeeCoefficients_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AllTypeFeeCoefficients); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (allTypeFeeCoefficients_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AllTypeFeeCoefficients); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CalculateFeeAlgorithmUpdated other) { + if (other == null) { + return; + } + if (other.allTypeFeeCoefficients_ != null) { + if (allTypeFeeCoefficients_ == null) { + AllTypeFeeCoefficients = new global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients(); + } + AllTypeFeeCoefficients.MergeFrom(other.AllTypeFeeCoefficients); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (allTypeFeeCoefficients_ == null) { + AllTypeFeeCoefficients = new global::AElf.Contracts.MultiToken.AllCalculateFeeCoefficients(); + } + input.ReadMessage(AllTypeFeeCoefficients); + break; + } + } + } + } + + } + + public sealed partial class RentalCharged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RentalCharged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[52]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalCharged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalCharged(RentalCharged other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalCharged Clone() { + return new RentalCharged(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of rental fee charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount of rental fee charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RentalCharged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RentalCharged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RentalCharged other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class RentalAccountBalanceInsufficient : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RentalAccountBalanceInsufficient()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[53]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalAccountBalanceInsufficient() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalAccountBalanceInsufficient(RentalAccountBalanceInsufficient other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RentalAccountBalanceInsufficient Clone() { + return new RentalAccountBalanceInsufficient(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of insufficient rental account balance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The balance of the account. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RentalAccountBalanceInsufficient); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RentalAccountBalanceInsufficient other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RentalAccountBalanceInsufficient other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class TokenCreated : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[54]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenCreated(TokenCreated other) : this() { + symbol_ = other.symbol_; + tokenName_ = other.tokenName_; + totalSupply_ = other.totalSupply_; + decimals_ = other.decimals_; + issuer_ = other.issuer_ != null ? other.issuer_.Clone() : null; + isBurnable_ = other.isBurnable_; + issueChainId_ = other.issueChainId_; + externalInfo_ = other.externalInfo_ != null ? other.externalInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TokenCreated Clone() { + return new TokenCreated(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "token_name" field. + public const int TokenNameFieldNumber = 2; + private string tokenName_ = ""; + /// + /// The full name of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenName { + get { return tokenName_; } + set { + tokenName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "total_supply" field. + public const int TotalSupplyFieldNumber = 3; + private long totalSupply_; + /// + /// The total supply of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TotalSupply { + get { return totalSupply_; } + set { + totalSupply_ = value; + } + } + + /// Field number for the "decimals" field. + public const int DecimalsFieldNumber = 4; + private int decimals_; + /// + /// The precision of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Decimals { + get { return decimals_; } + set { + decimals_ = value; + } + } + + /// Field number for the "issuer" field. + public const int IssuerFieldNumber = 5; + private global::AElf.Types.Address issuer_; + /// + /// The address that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Issuer { + get { return issuer_; } + set { + issuer_ = value; + } + } + + /// Field number for the "is_burnable" field. + public const int IsBurnableFieldNumber = 6; + private bool isBurnable_; + /// + /// A flag indicating if this token is burnable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsBurnable { + get { return isBurnable_; } + set { + isBurnable_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 7; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 8; + private global::AElf.Contracts.MultiToken.ExternalInfo externalInfo_; + /// + /// The external information of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.ExternalInfo ExternalInfo { + get { return externalInfo_; } + set { + externalInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TokenCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TokenCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (TokenName != other.TokenName) return false; + if (TotalSupply != other.TotalSupply) return false; + if (Decimals != other.Decimals) return false; + if (!object.Equals(Issuer, other.Issuer)) return false; + if (IsBurnable != other.IsBurnable) return false; + if (IssueChainId != other.IssueChainId) return false; + if (!object.Equals(ExternalInfo, other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (TokenName.Length != 0) hash ^= TokenName.GetHashCode(); + if (TotalSupply != 0L) hash ^= TotalSupply.GetHashCode(); + if (Decimals != 0) hash ^= Decimals.GetHashCode(); + if (issuer_ != null) hash ^= Issuer.GetHashCode(); + if (IsBurnable != false) hash ^= IsBurnable.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (externalInfo_ != null) hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (TokenName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenName); + } + if (TotalSupply != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TotalSupply); + } + if (Decimals != 0) { + output.WriteRawTag(32); + output.WriteInt32(Decimals); + } + if (issuer_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Issuer); + } + if (IsBurnable != false) { + output.WriteRawTag(48); + output.WriteBool(IsBurnable); + } + if (IssueChainId != 0) { + output.WriteRawTag(56); + output.WriteInt32(IssueChainId); + } + if (externalInfo_ != null) { + output.WriteRawTag(66); + output.WriteMessage(ExternalInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (TokenName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenName); + } + if (TotalSupply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TotalSupply); + } + if (Decimals != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Decimals); + } + if (issuer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Issuer); + } + if (IsBurnable != false) { + size += 1 + 1; + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (externalInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TokenCreated other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.TokenName.Length != 0) { + TokenName = other.TokenName; + } + if (other.TotalSupply != 0L) { + TotalSupply = other.TotalSupply; + } + if (other.Decimals != 0) { + Decimals = other.Decimals; + } + if (other.issuer_ != null) { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + Issuer.MergeFrom(other.Issuer); + } + if (other.IsBurnable != false) { + IsBurnable = other.IsBurnable; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + if (other.externalInfo_ != null) { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + ExternalInfo.MergeFrom(other.ExternalInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + TokenName = input.ReadString(); + break; + } + case 24: { + TotalSupply = input.ReadInt64(); + break; + } + case 32: { + Decimals = input.ReadInt32(); + break; + } + case 42: { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + input.ReadMessage(Issuer); + break; + } + case 48: { + IsBurnable = input.ReadBool(); + break; + } + case 56: { + IssueChainId = input.ReadInt32(); + break; + } + case 66: { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + input.ReadMessage(ExternalInfo); + break; + } + } + } + } + + } + + public sealed partial class Issued : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issued()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[55]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Issued() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Issued(Issued other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + to_ = other.to_ != null ? other.to_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Issued Clone() { + return new Issued(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of issued token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount of issued token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 3; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 4; + private global::AElf.Types.Address to_; + /// + /// The issued target address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Issued); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Issued other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + if (!object.Equals(To, other.To)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Memo); + } + if (to_ != null) { + output.WriteRawTag(34); + output.WriteMessage(To); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Issued other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + Memo = input.ReadString(); + break; + } + case 34: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + } + } + } + + } + + public sealed partial class CrossChainTransferred : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainTransferred()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[56]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferred() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferred(CrossChainTransferred other) : this() { + from_ = other.from_ != null ? other.from_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + toChainId_ = other.toChainId_; + issueChainId_ = other.issueChainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainTransferred Clone() { + return new CrossChainTransferred(this); + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 1; + private global::AElf.Types.Address from_; + /// + /// The source address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 2; + private global::AElf.Types.Address to_; + /// + /// The destination address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 5; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_chain_id" field. + public const int ToChainIdFieldNumber = 6; + private int toChainId_; + /// + /// The destination chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ToChainId { + get { return toChainId_; } + set { + toChainId_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 7; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainTransferred); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainTransferred other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(From, other.From)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + if (ToChainId != other.ToChainId) return false; + if (IssueChainId != other.IssueChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (from_ != null) hash ^= From.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (ToChainId != 0) hash ^= ToChainId.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (ToChainId != 0) { + output.WriteRawTag(48); + output.WriteInt32(ToChainId); + } + if (IssueChainId != 0) { + output.WriteRawTag(56); + output.WriteInt32(IssueChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (ToChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ToChainId); + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainTransferred other) { + if (other == null) { + return; + } + if (other.from_ != null) { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + From.MergeFrom(other.From); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + if (other.ToChainId != 0) { + ToChainId = other.ToChainId; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + case 48: { + ToChainId = input.ReadInt32(); + break; + } + case 56: { + IssueChainId = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class CrossChainReceived : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CrossChainReceived()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[57]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceived() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceived(CrossChainReceived other) : this() { + from_ = other.from_ != null ? other.from_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + fromChainId_ = other.fromChainId_; + issueChainId_ = other.issueChainId_; + parentChainHeight_ = other.parentChainHeight_; + transferTransactionId_ = other.transferTransactionId_ != null ? other.transferTransactionId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CrossChainReceived Clone() { + return new CrossChainReceived(this); + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 1; + private global::AElf.Types.Address from_; + /// + /// The source address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 2; + private global::AElf.Types.Address to_; + /// + /// The destination address of the transferred token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The symbol of the received token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount of the received token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 5; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 6; + private int fromChainId_; + /// + /// The destination chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 7; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 8; + private long parentChainHeight_; + /// + /// The parent chain height of the transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "transfer_transaction_id" field. + public const int TransferTransactionIdFieldNumber = 9; + private global::AElf.Types.Hash transferTransactionId_; + /// + /// The id of transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash TransferTransactionId { + get { return transferTransactionId_; } + set { + transferTransactionId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CrossChainReceived); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CrossChainReceived other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(From, other.From)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + if (FromChainId != other.FromChainId) return false; + if (IssueChainId != other.IssueChainId) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (!object.Equals(TransferTransactionId, other.TransferTransactionId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (from_ != null) hash ^= From.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (FromChainId != 0) hash ^= FromChainId.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (transferTransactionId_ != null) hash ^= TransferTransactionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (FromChainId != 0) { + output.WriteRawTag(48); + output.WriteInt32(FromChainId); + } + if (IssueChainId != 0) { + output.WriteRawTag(56); + output.WriteInt32(IssueChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(64); + output.WriteInt64(ParentChainHeight); + } + if (transferTransactionId_ != null) { + output.WriteRawTag(74); + output.WriteMessage(TransferTransactionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (FromChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FromChainId); + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (transferTransactionId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransferTransactionId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CrossChainReceived other) { + if (other == null) { + return; + } + if (other.from_ != null) { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + From.MergeFrom(other.From); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + if (other.FromChainId != 0) { + FromChainId = other.FromChainId; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.transferTransactionId_ != null) { + if (transferTransactionId_ == null) { + TransferTransactionId = new global::AElf.Types.Hash(); + } + TransferTransactionId.MergeFrom(other.TransferTransactionId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + case 48: { + FromChainId = input.ReadInt32(); + break; + } + case 56: { + IssueChainId = input.ReadInt32(); + break; + } + case 64: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 74: { + if (transferTransactionId_ == null) { + TransferTransactionId = new global::AElf.Types.Hash(); + } + input.ReadMessage(TransferTransactionId); + break; + } + } + } + } + + } + + public sealed partial class ExternalInfoChanged : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalInfoChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor.MessageTypes[58]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfoChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfoChanged(ExternalInfoChanged other) : this() { + symbol_ = other.symbol_; + externalInfo_ = other.externalInfo_ != null ? other.externalInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalInfoChanged Clone() { + return new ExternalInfoChanged(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 2; + private global::AElf.Contracts.MultiToken.ExternalInfo externalInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Contracts.MultiToken.ExternalInfo ExternalInfo { + get { return externalInfo_; } + set { + externalInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExternalInfoChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExternalInfoChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (!object.Equals(ExternalInfo, other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (externalInfo_ != null) hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (externalInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ExternalInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (externalInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExternalInfoChanged other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.externalInfo_ != null) { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + ExternalInfo.MergeFrom(other.ExternalInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + if (externalInfo_ == null) { + ExternalInfo = new global::AElf.Contracts.MultiToken.ExternalInfo(); + } + input.ReadMessage(ExternalInfo); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.c.cs new file mode 100644 index 0000000..3921b0f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.c.cs @@ -0,0 +1,24 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_contract_impl.proto +// +// Original file comments: +// * +// MultiToken contract. +// +// The MultiToken contract is mainly used to manage the user's account and transaction fees related Settings. +// +// Implement AElf Standards ACS1 and ACS2. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Contracts.MultiToken { + + #region Events + #endregion +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.g.cs new file mode 100644 index 0000000..4125246 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenContractImpl.g.cs @@ -0,0 +1,2151 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_contract_impl.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Contracts.MultiToken { + + /// Holder for reflection information generated from token_contract_impl.proto + public static partial class TokenContractImplReflection { + + #region Descriptor + /// File descriptor for token_contract_impl.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TokenContractImplReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chl0b2tlbl9jb250cmFjdF9pbXBsLnByb3RvEgl0b2tlbmltcGwaD2FlbGYv", + "Y29yZS5wcm90bxoKYWNzMS5wcm90bxoKYWNzMi5wcm90bxoUdG9rZW5fY29u", + "dHJhY3QucHJvdG8aFXRyYW5zYWN0aW9uX2ZlZS5wcm90bxoUYXV0aG9yaXR5", + "X2luZm8ucHJvdG8icwoZQWR2YW5jZVJlc291cmNlVG9rZW5JbnB1dBInChBj", + "b250cmFjdF9hZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEh0KFXJlc291", + "cmNlX3Rva2VuX3N5bWJvbBgCIAEoCRIOCgZhbW91bnQYAyABKAMidAoaVGFr", + "ZVJlc291cmNlVG9rZW5CYWNrSW5wdXQSJwoQY29udHJhY3RfYWRkcmVzcxgB", + "IAEoCzINLmFlbGYuQWRkcmVzcxIdChVyZXNvdXJjZV90b2tlbl9zeW1ib2wY", + "AiABKAkSDgoGYW1vdW50GAMgASgDItIBCitSZWdpc3RlckNyb3NzQ2hhaW5U", + "b2tlbkNvbnRyYWN0QWRkcmVzc0lucHV0EhUKDWZyb21fY2hhaW5faWQYASAB", + "KAUSGwoTcGFyZW50X2NoYWluX2hlaWdodBgCIAEoAxIZChF0cmFuc2FjdGlv", + "bl9ieXRlcxgDIAEoDBIlCgttZXJrbGVfcGF0aBgEIAEoCzIQLmFlbGYuTWVy", + "a2xlUGF0aBItChZ0b2tlbl9jb250cmFjdF9hZGRyZXNzGAUgASgLMg0uYWVs", + "Zi5BZGRyZXNzIr0CChxWYWxpZGF0ZVRva2VuSW5mb0V4aXN0c0lucHV0Eg4K", + "BnN5bWJvbBgBIAEoCRISCgp0b2tlbl9uYW1lGAIgASgJEhQKDHRvdGFsX3N1", + "cHBseRgDIAEoAxIQCghkZWNpbWFscxgEIAEoBRIdCgZpc3N1ZXIYBSABKAsy", + "DS5hZWxmLkFkZHJlc3MSEwoLaXNfYnVybmFibGUYBiABKAgSFgoOaXNzdWVf", + "Y2hhaW5faWQYByABKAUSUAoNZXh0ZXJuYWxfaW5mbxgIIAMoCzI5LnRva2Vu", + "aW1wbC5WYWxpZGF0ZVRva2VuSW5mb0V4aXN0c0lucHV0LkV4dGVybmFsSW5m", + "b0VudHJ5GjMKEUV4dGVybmFsSW5mb0VudHJ5EgsKA2tleRgBIAEoCRINCgV2", + "YWx1ZRgCIAEoCToCOAEifAoRVXBkYXRlUmVudGFsSW5wdXQSOAoGcmVudGFs", + "GAEgAygLMigudG9rZW5pbXBsLlVwZGF0ZVJlbnRhbElucHV0LlJlbnRhbEVu", + "dHJ5Gi0KC1JlbnRhbEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEo", + "AzoCOAEipwEKGlVwZGF0ZVJlbnRlZFJlc291cmNlc0lucHV0ElIKD3Jlc291", + "cmNlX2Ftb3VudBgBIAMoCzI5LnRva2VuaW1wbC5VcGRhdGVSZW50ZWRSZXNv", + "dXJjZXNJbnB1dC5SZXNvdXJjZUFtb3VudEVudHJ5GjUKE1Jlc291cmNlQW1v", + "dW50RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgFOgI4ASJxCg1S", + "ZXNvdXJjZVVzYWdlEjIKBXZhbHVlGAEgAygLMiMudG9rZW5pbXBsLlJlc291", + "cmNlVXNhZ2UuVmFsdWVFbnRyeRosCgpWYWx1ZUVudHJ5EgsKA2tleRgBIAEo", + "CRINCgV2YWx1ZRgCIAEoBToCOAEiXwogR2V0VmlydHVhbEFkZHJlc3NGb3JM", + "b2NraW5nSW5wdXQSHgoHYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRkcmVzcxIb", + "Cgdsb2NrX2lkGAIgASgLMgouYWVsZi5IYXNoIosBCgxPd25pbmdSZW50YWwS", + "RAoPcmVzb3VyY2VfYW1vdW50GAEgAygLMisudG9rZW5pbXBsLk93bmluZ1Jl", + "bnRhbC5SZXNvdXJjZUFtb3VudEVudHJ5GjUKE1Jlc291cmNlQW1vdW50RW50", + "cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgDOgI4ASKnAQoVT3duaW5n", + "UmVudGFsVW5pdFZhbHVlElQKE3Jlc291cmNlX3VuaXRfdmFsdWUYASADKAsy", + "Ny50b2tlbmltcGwuT3duaW5nUmVudGFsVW5pdFZhbHVlLlJlc291cmNlVW5p", + "dFZhbHVlRW50cnkaOAoWUmVzb3VyY2VVbml0VmFsdWVFbnRyeRILCgNrZXkY", + "ASABKAkSDQoFdmFsdWUYAiABKAM6AjgBIkcKF1RyYW5zZmVyVG9Db250cmFj", + "dElucHV0Eg4KBnN5bWJvbBgBIAEoCRIOCgZhbW91bnQYAiABKAMSDAoEbWVt", + "bxgDIAEoCSKaAQoRVXNlckZlZUNvbnRyb2xsZXISJwoPcm9vdF9jb250cm9s", + "bGVyGAEgASgLMg4uQXV0aG9yaXR5SW5mbxItChVwYXJsaWFtZW50X2NvbnRy", + "b2xsZXIYAiABKAsyDi5BdXRob3JpdHlJbmZvEi0KFXJlZmVyZW5kdW1fY29u", + "dHJvbGxlchgDIAEoCzIOLkF1dGhvcml0eUluZm8ingEKFkRldmVsb3BlckZl", + "ZUNvbnRyb2xsZXISJwoPcm9vdF9jb250cm9sbGVyGAEgASgLMg4uQXV0aG9y", + "aXR5SW5mbxItChVwYXJsaWFtZW50X2NvbnRyb2xsZXIYAiABKAsyDi5BdXRo", + "b3JpdHlJbmZvEiwKFGRldmVsb3Blcl9jb250cm9sbGVyGAMgASgLMg4uQXV0", + "aG9yaXR5SW5mbzKjEAoRVG9rZW5Db250cmFjdEltcGwSVgoUQWR2YW5jZVJl", + "c291cmNlVG9rZW4SJC50b2tlbmltcGwuQWR2YW5jZVJlc291cmNlVG9rZW5J", + "bnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElgKFVRha2VSZXNvdXJj", + "ZVRva2VuQmFjaxIlLnRva2VuaW1wbC5UYWtlUmVzb3VyY2VUb2tlbkJhY2tJ", + "bnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEnoKJlJlZ2lzdGVyQ3Jv", + "c3NDaGFpblRva2VuQ29udHJhY3RBZGRyZXNzEjYudG9rZW5pbXBsLlJlZ2lz", + "dGVyQ3Jvc3NDaGFpblRva2VuQ29udHJhY3RBZGRyZXNzSW5wdXQaFi5nb29n", + "bGUucHJvdG9idWYuRW1wdHkiABI5Cg5TZXRGZWVSZWNlaXZlchINLmFlbGYu", + "QWRkcmVzcxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElwKF1ZhbGlkYXRl", + "VG9rZW5JbmZvRXhpc3RzEicudG9rZW5pbXBsLlZhbGlkYXRlVG9rZW5JbmZv", + "RXhpc3RzSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJGCgxVcGRh", + "dGVSZW50YWwSHC50b2tlbmltcGwuVXBkYXRlUmVudGFsSW5wdXQaFi5nb29n", + "bGUucHJvdG9idWYuRW1wdHkiABJYChVVcGRhdGVSZW50ZWRSZXNvdXJjZXMS", + "JS50b2tlbmltcGwuVXBkYXRlUmVudGVkUmVzb3VyY2VzSW5wdXQaFi5nb29n", + "bGUucHJvdG9idWYuRW1wdHkiABJSChJUcmFuc2ZlclRvQ29udHJhY3QSIi50", + "b2tlbmltcGwuVHJhbnNmZXJUb0NvbnRyYWN0SW5wdXQaFi5nb29nbGUucHJv", + "dG9idWYuRW1wdHkiABJLCh9DaGFuZ2VTaWRlQ2hhaW5SZW50YWxDb250cm9s", + "bGVyEg4uQXV0aG9yaXR5SW5mbxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIA", + "ElEKJUNoYW5nZVN5bWJvbHNUb1BheVRYU2l6ZUZlZUNvbnRyb2xsZXISDi5B", + "dXRob3JpdHlJbmZvGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASXwozQ2hh", + "bmdlQ3Jvc3NDaGFpblRva2VuQ29udHJhY3RSZWdpc3RyYXRpb25Db250cm9s", + "bGVyEg4uQXV0aG9yaXR5SW5mbxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIA", + "EkMKF0NoYW5nZVVzZXJGZWVDb250cm9sbGVyEg4uQXV0aG9yaXR5SW5mbxoW", + "Lmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkUKGUNoYW5nZURldmVsb3BlckNv", + "bnRyb2xsZXISDi5BdXRob3JpdHlJbmZvGhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5IgASPgoOR2V0RmVlUmVjZWl2ZXISFi5nb29nbGUucHJvdG9idWYuRW1w", + "dHkaDS5hZWxmLkFkZHJlc3MiBYiJ9wEBEksKEEdldFJlc291cmNlVXNhZ2US", + "Fi5nb29nbGUucHJvdG9idWYuRW1wdHkaGC50b2tlbmltcGwuUmVzb3VyY2VV", + "c2FnZSIFiIn3AQESUwoiR2V0U3ltYm9sc1RvUGF5VFhTaXplRmVlQ29udHJv", + "bGxlchIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoOLkF1dGhvcml0eUluZm8i", + "BYiJ9wEBEmEKMEdldENyb3NzQ2hhaW5Ub2tlbkNvbnRyYWN0UmVnaXN0cmF0", + "aW9uQ29udHJvbGxlchIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoOLkF1dGhv", + "cml0eUluZm8iBYiJ9wEBElMKFEdldFVzZXJGZWVDb250cm9sbGVyEhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5GhwudG9rZW5pbXBsLlVzZXJGZWVDb250cm9s", + "bGVyIgWIifcBARJdChlHZXREZXZlbG9wZXJGZWVDb250cm9sbGVyEhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5GiEudG9rZW5pbXBsLkRldmVsb3BlckZlZUNv", + "bnRyb2xsZXIiBYiJ9wEBElcKJkdldFNpZGVDaGFpblJlbnRhbENvbnRyb2xs", + "ZXJDcmVhdGVJbmZvEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Gg4uQXV0aG9y", + "aXR5SW5mbyIFiIn3AQESYAobR2V0VmlydHVhbEFkZHJlc3NGb3JMb2NraW5n", + "EisudG9rZW5pbXBsLkdldFZpcnR1YWxBZGRyZXNzRm9yTG9ja2luZ0lucHV0", + "Gg0uYWVsZi5BZGRyZXNzIgWIifcBARJJCg9HZXRPd25pbmdSZW50YWwSFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkaFy50b2tlbmltcGwuT3duaW5nUmVudGFs", + "IgWIifcBARJbChhHZXRPd25pbmdSZW50YWxVbml0VmFsdWUSFi5nb29nbGUu", + "cHJvdG9idWYuRW1wdHkaIC50b2tlbmltcGwuT3duaW5nUmVudGFsVW5pdFZh", + "bHVlIgWIifcBARpossz2ASxBRWxmLkNvbnRyYWN0cy5NdWx0aVRva2VuLlRv", + "a2VuQ29udHJhY3RTdGF0ZcrK9gEKYWNzMS5wcm90b8rK9gEKYWNzMi5wcm90", + "b8rK9gEUdG9rZW5fY29udHJhY3QucHJvdG9CHKoCGUFFbGYuQ29udHJhY3Rz", + "Lk11bHRpVG9rZW5iBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.Contracts.MultiToken.TokenContractReflection.Descriptor }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.AdvanceResourceTokenInput), global::AElf.Contracts.MultiToken.AdvanceResourceTokenInput.Parser, new[]{ "ContractAddress", "ResourceTokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TakeResourceTokenBackInput), global::AElf.Contracts.MultiToken.TakeResourceTokenBackInput.Parser, new[]{ "ContractAddress", "ResourceTokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.RegisterCrossChainTokenContractAddressInput), global::AElf.Contracts.MultiToken.RegisterCrossChainTokenContractAddressInput.Parser, new[]{ "FromChainId", "ParentChainHeight", "TransactionBytes", "MerklePath", "TokenContractAddress" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ValidateTokenInfoExistsInput), global::AElf.Contracts.MultiToken.ValidateTokenInfoExistsInput.Parser, new[]{ "Symbol", "TokenName", "TotalSupply", "Decimals", "Issuer", "IsBurnable", "IssueChainId", "ExternalInfo" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UpdateRentalInput), global::AElf.Contracts.MultiToken.UpdateRentalInput.Parser, new[]{ "Rental" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.UpdateRentedResourcesInput), global::AElf.Contracts.MultiToken.UpdateRentedResourcesInput.Parser, new[]{ "ResourceAmount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.ResourceUsage), global::AElf.Contracts.MultiToken.ResourceUsage.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.GetVirtualAddressForLockingInput), global::AElf.Contracts.MultiToken.GetVirtualAddressForLockingInput.Parser, new[]{ "Address", "LockId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.OwningRental), global::AElf.Contracts.MultiToken.OwningRental.Parser, new[]{ "ResourceAmount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.OwningRentalUnitValue), global::AElf.Contracts.MultiToken.OwningRentalUnitValue.Parser, new[]{ "ResourceUnitValue" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.MultiToken.TransferToContractInput), global::AElf.Contracts.MultiToken.TransferToContractInput.Parser, new[]{ "Symbol", "Amount", "Memo" }, null, null, null, null), + })); + } + #endregion + + } + #region Messages + public sealed partial class AdvanceResourceTokenInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdvanceResourceTokenInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdvanceResourceTokenInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdvanceResourceTokenInput(AdvanceResourceTokenInput other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + resourceTokenSymbol_ = other.resourceTokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdvanceResourceTokenInput Clone() { + return new AdvanceResourceTokenInput(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "resource_token_symbol" field. + public const int ResourceTokenSymbolFieldNumber = 2; + private string resourceTokenSymbol_ = ""; + /// + /// The resource token symbol to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ResourceTokenSymbol { + get { return resourceTokenSymbol_; } + set { + resourceTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of resource token to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AdvanceResourceTokenInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AdvanceResourceTokenInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (ResourceTokenSymbol != other.ResourceTokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (ResourceTokenSymbol.Length != 0) hash ^= ResourceTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (ResourceTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ResourceTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (ResourceTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ResourceTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AdvanceResourceTokenInput other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.ResourceTokenSymbol.Length != 0) { + ResourceTokenSymbol = other.ResourceTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + ResourceTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class TakeResourceTokenBackInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TakeResourceTokenBackInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TakeResourceTokenBackInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TakeResourceTokenBackInput(TakeResourceTokenBackInput other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + resourceTokenSymbol_ = other.resourceTokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TakeResourceTokenBackInput Clone() { + return new TakeResourceTokenBackInput(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address to take back. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "resource_token_symbol" field. + public const int ResourceTokenSymbolFieldNumber = 2; + private string resourceTokenSymbol_ = ""; + /// + /// The resource token symbol to take back. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ResourceTokenSymbol { + get { return resourceTokenSymbol_; } + set { + resourceTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + /// + /// The amount of resource token to take back. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TakeResourceTokenBackInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TakeResourceTokenBackInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (ResourceTokenSymbol != other.ResourceTokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (ResourceTokenSymbol.Length != 0) hash ^= ResourceTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (ResourceTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ResourceTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (ResourceTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ResourceTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TakeResourceTokenBackInput other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.ResourceTokenSymbol.Length != 0) { + ResourceTokenSymbol = other.ResourceTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + ResourceTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class RegisterCrossChainTokenContractAddressInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegisterCrossChainTokenContractAddressInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegisterCrossChainTokenContractAddressInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegisterCrossChainTokenContractAddressInput(RegisterCrossChainTokenContractAddressInput other) : this() { + fromChainId_ = other.fromChainId_; + parentChainHeight_ = other.parentChainHeight_; + transactionBytes_ = other.transactionBytes_; + merklePath_ = other.merklePath_ != null ? other.merklePath_.Clone() : null; + tokenContractAddress_ = other.tokenContractAddress_ != null ? other.tokenContractAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegisterCrossChainTokenContractAddressInput Clone() { + return new RegisterCrossChainTokenContractAddressInput(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private int fromChainId_; + /// + /// The source chain id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 2; + private long parentChainHeight_; + /// + /// The parent chain height of the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "transaction_bytes" field. + public const int TransactionBytesFieldNumber = 3; + private pb::ByteString transactionBytes_ = pb::ByteString.Empty; + /// + /// The raw bytes of the transfer transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString TransactionBytes { + get { return transactionBytes_; } + set { + transactionBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "merkle_path" field. + public const int MerklePathFieldNumber = 4; + private global::AElf.Types.MerklePath merklePath_; + /// + /// The merkle path created from the transaction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.MerklePath MerklePath { + get { return merklePath_; } + set { + merklePath_ = value; + } + } + + /// Field number for the "token_contract_address" field. + public const int TokenContractAddressFieldNumber = 5; + private global::AElf.Types.Address tokenContractAddress_; + /// + /// The token contract address. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address TokenContractAddress { + get { return tokenContractAddress_; } + set { + tokenContractAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegisterCrossChainTokenContractAddressInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegisterCrossChainTokenContractAddressInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (TransactionBytes != other.TransactionBytes) return false; + if (!object.Equals(MerklePath, other.MerklePath)) return false; + if (!object.Equals(TokenContractAddress, other.TokenContractAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FromChainId != 0) hash ^= FromChainId.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (TransactionBytes.Length != 0) hash ^= TransactionBytes.GetHashCode(); + if (merklePath_ != null) hash ^= MerklePath.GetHashCode(); + if (tokenContractAddress_ != null) hash ^= TokenContractAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FromChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FromChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(TransactionBytes); + } + if (merklePath_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MerklePath); + } + if (tokenContractAddress_ != null) { + output.WriteRawTag(42); + output.WriteMessage(TokenContractAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FromChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FromChainId); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(TransactionBytes); + } + if (merklePath_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerklePath); + } + if (tokenContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TokenContractAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegisterCrossChainTokenContractAddressInput other) { + if (other == null) { + return; + } + if (other.FromChainId != 0) { + FromChainId = other.FromChainId; + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.TransactionBytes.Length != 0) { + TransactionBytes = other.TransactionBytes; + } + if (other.merklePath_ != null) { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + MerklePath.MergeFrom(other.MerklePath); + } + if (other.tokenContractAddress_ != null) { + if (tokenContractAddress_ == null) { + TokenContractAddress = new global::AElf.Types.Address(); + } + TokenContractAddress.MergeFrom(other.TokenContractAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FromChainId = input.ReadInt32(); + break; + } + case 16: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 26: { + TransactionBytes = input.ReadBytes(); + break; + } + case 34: { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePath); + break; + } + case 42: { + if (tokenContractAddress_ == null) { + TokenContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(TokenContractAddress); + break; + } + } + } + } + + } + + public sealed partial class ValidateTokenInfoExistsInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateTokenInfoExistsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateTokenInfoExistsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateTokenInfoExistsInput(ValidateTokenInfoExistsInput other) : this() { + symbol_ = other.symbol_; + tokenName_ = other.tokenName_; + totalSupply_ = other.totalSupply_; + decimals_ = other.decimals_; + issuer_ = other.issuer_ != null ? other.issuer_.Clone() : null; + isBurnable_ = other.isBurnable_; + issueChainId_ = other.issueChainId_; + externalInfo_ = other.externalInfo_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValidateTokenInfoExistsInput Clone() { + return new ValidateTokenInfoExistsInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "token_name" field. + public const int TokenNameFieldNumber = 2; + private string tokenName_ = ""; + /// + /// The full name of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TokenName { + get { return tokenName_; } + set { + tokenName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "total_supply" field. + public const int TotalSupplyFieldNumber = 3; + private long totalSupply_; + /// + /// The total supply of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TotalSupply { + get { return totalSupply_; } + set { + totalSupply_ = value; + } + } + + /// Field number for the "decimals" field. + public const int DecimalsFieldNumber = 4; + private int decimals_; + /// + /// The precision of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Decimals { + get { return decimals_; } + set { + decimals_ = value; + } + } + + /// Field number for the "issuer" field. + public const int IssuerFieldNumber = 5; + private global::AElf.Types.Address issuer_; + /// + /// The address that created the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Issuer { + get { return issuer_; } + set { + issuer_ = value; + } + } + + /// Field number for the "is_burnable" field. + public const int IsBurnableFieldNumber = 6; + private bool isBurnable_; + /// + /// A flag indicating if this token is burnable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsBurnable { + get { return isBurnable_; } + set { + isBurnable_ = value; + } + } + + /// Field number for the "issue_chain_id" field. + public const int IssueChainIdFieldNumber = 7; + private int issueChainId_; + /// + /// The chain id of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IssueChainId { + get { return issueChainId_; } + set { + issueChainId_ = value; + } + } + + /// Field number for the "external_info" field. + public const int ExternalInfoFieldNumber = 8; + private static readonly pbc::MapField.Codec _map_externalInfo_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 66); + private readonly pbc::MapField externalInfo_ = new pbc::MapField(); + /// + /// The external information of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ExternalInfo { + get { return externalInfo_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValidateTokenInfoExistsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValidateTokenInfoExistsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (TokenName != other.TokenName) return false; + if (TotalSupply != other.TotalSupply) return false; + if (Decimals != other.Decimals) return false; + if (!object.Equals(Issuer, other.Issuer)) return false; + if (IsBurnable != other.IsBurnable) return false; + if (IssueChainId != other.IssueChainId) return false; + if (!ExternalInfo.Equals(other.ExternalInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (TokenName.Length != 0) hash ^= TokenName.GetHashCode(); + if (TotalSupply != 0L) hash ^= TotalSupply.GetHashCode(); + if (Decimals != 0) hash ^= Decimals.GetHashCode(); + if (issuer_ != null) hash ^= Issuer.GetHashCode(); + if (IsBurnable != false) hash ^= IsBurnable.GetHashCode(); + if (IssueChainId != 0) hash ^= IssueChainId.GetHashCode(); + hash ^= ExternalInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (TokenName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenName); + } + if (TotalSupply != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TotalSupply); + } + if (Decimals != 0) { + output.WriteRawTag(32); + output.WriteInt32(Decimals); + } + if (issuer_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Issuer); + } + if (IsBurnable != false) { + output.WriteRawTag(48); + output.WriteBool(IsBurnable); + } + if (IssueChainId != 0) { + output.WriteRawTag(56); + output.WriteInt32(IssueChainId); + } + externalInfo_.WriteTo(output, _map_externalInfo_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (TokenName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenName); + } + if (TotalSupply != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TotalSupply); + } + if (Decimals != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Decimals); + } + if (issuer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Issuer); + } + if (IsBurnable != false) { + size += 1 + 1; + } + if (IssueChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IssueChainId); + } + size += externalInfo_.CalculateSize(_map_externalInfo_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValidateTokenInfoExistsInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.TokenName.Length != 0) { + TokenName = other.TokenName; + } + if (other.TotalSupply != 0L) { + TotalSupply = other.TotalSupply; + } + if (other.Decimals != 0) { + Decimals = other.Decimals; + } + if (other.issuer_ != null) { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + Issuer.MergeFrom(other.Issuer); + } + if (other.IsBurnable != false) { + IsBurnable = other.IsBurnable; + } + if (other.IssueChainId != 0) { + IssueChainId = other.IssueChainId; + } + externalInfo_.Add(other.externalInfo_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 18: { + TokenName = input.ReadString(); + break; + } + case 24: { + TotalSupply = input.ReadInt64(); + break; + } + case 32: { + Decimals = input.ReadInt32(); + break; + } + case 42: { + if (issuer_ == null) { + Issuer = new global::AElf.Types.Address(); + } + input.ReadMessage(Issuer); + break; + } + case 48: { + IsBurnable = input.ReadBool(); + break; + } + case 56: { + IssueChainId = input.ReadInt32(); + break; + } + case 66: { + externalInfo_.AddEntriesFrom(input, _map_externalInfo_codec); + break; + } + } + } + } + + } + + public sealed partial class UpdateRentalInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UpdateRentalInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentalInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentalInput(UpdateRentalInput other) : this() { + rental_ = other.rental_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentalInput Clone() { + return new UpdateRentalInput(this); + } + + /// Field number for the "rental" field. + public const int RentalFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_rental_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField rental_ = new pbc::MapField(); + /// + /// The unit price of resource tokens, symbol -> unit price. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Rental { + get { return rental_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UpdateRentalInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UpdateRentalInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Rental.Equals(other.Rental)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Rental.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + rental_.WriteTo(output, _map_rental_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += rental_.CalculateSize(_map_rental_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UpdateRentalInput other) { + if (other == null) { + return; + } + rental_.Add(other.rental_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + rental_.AddEntriesFrom(input, _map_rental_codec); + break; + } + } + } + } + + } + + public sealed partial class UpdateRentedResourcesInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UpdateRentedResourcesInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentedResourcesInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentedResourcesInput(UpdateRentedResourcesInput other) : this() { + resourceAmount_ = other.resourceAmount_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public UpdateRentedResourcesInput Clone() { + return new UpdateRentedResourcesInput(this); + } + + /// Field number for the "resource_amount" field. + public const int ResourceAmountFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_resourceAmount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt32(16, 0), 10); + private readonly pbc::MapField resourceAmount_ = new pbc::MapField(); + /// + /// Amount of resource tokens consumed per minute, symbol -> resource consumption. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ResourceAmount { + get { return resourceAmount_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as UpdateRentedResourcesInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(UpdateRentedResourcesInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ResourceAmount.Equals(other.ResourceAmount)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ResourceAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + resourceAmount_.WriteTo(output, _map_resourceAmount_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += resourceAmount_.CalculateSize(_map_resourceAmount_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(UpdateRentedResourcesInput other) { + if (other == null) { + return; + } + resourceAmount_.Add(other.resourceAmount_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + resourceAmount_.AddEntriesFrom(input, _map_resourceAmount_codec); + break; + } + } + } + } + + } + + public sealed partial class ResourceUsage : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceUsage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceUsage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceUsage(ResourceUsage other) : this() { + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ResourceUsage Clone() { + return new ResourceUsage(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_value_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt32(16, 0), 10); + private readonly pbc::MapField value_ = new pbc::MapField(); + /// + /// The amount of resource tokens usage, symbol -> amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ResourceUsage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ResourceUsage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Value.Equals(other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + value_.WriteTo(output, _map_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += value_.CalculateSize(_map_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ResourceUsage other) { + if (other == null) { + return; + } + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + value_.AddEntriesFrom(input, _map_value_codec); + break; + } + } + } + } + + } + + public sealed partial class GetVirtualAddressForLockingInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetVirtualAddressForLockingInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetVirtualAddressForLockingInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetVirtualAddressForLockingInput(GetVirtualAddressForLockingInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + lockId_ = other.lockId_ != null ? other.lockId_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetVirtualAddressForLockingInput Clone() { + return new GetVirtualAddressForLockingInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + /// + /// The address of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "lock_id" field. + public const int LockIdFieldNumber = 2; + private global::AElf.Types.Hash lockId_; + /// + /// The id of the lock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AElf.Types.Hash LockId { + get { return lockId_; } + set { + lockId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetVirtualAddressForLockingInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetVirtualAddressForLockingInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (!object.Equals(LockId, other.LockId)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (lockId_ != null) hash ^= LockId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (lockId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LockId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (lockId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LockId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetVirtualAddressForLockingInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.lockId_ != null) { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + LockId.MergeFrom(other.LockId); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + if (lockId_ == null) { + LockId = new global::AElf.Types.Hash(); + } + input.ReadMessage(LockId); + break; + } + } + } + } + + } + + public sealed partial class OwningRental : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OwningRental()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRental() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRental(OwningRental other) : this() { + resourceAmount_ = other.resourceAmount_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRental Clone() { + return new OwningRental(this); + } + + /// Field number for the "resource_amount" field. + public const int ResourceAmountFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_resourceAmount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField resourceAmount_ = new pbc::MapField(); + /// + /// The amount of resource tokens owed, symbol -> amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ResourceAmount { + get { return resourceAmount_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OwningRental); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OwningRental other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ResourceAmount.Equals(other.ResourceAmount)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ResourceAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + resourceAmount_.WriteTo(output, _map_resourceAmount_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += resourceAmount_.CalculateSize(_map_resourceAmount_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OwningRental other) { + if (other == null) { + return; + } + resourceAmount_.Add(other.resourceAmount_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + resourceAmount_.AddEntriesFrom(input, _map_resourceAmount_codec); + break; + } + } + } + } + + } + + public sealed partial class OwningRentalUnitValue : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OwningRentalUnitValue()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRentalUnitValue() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRentalUnitValue(OwningRentalUnitValue other) : this() { + resourceUnitValue_ = other.resourceUnitValue_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OwningRentalUnitValue Clone() { + return new OwningRentalUnitValue(this); + } + + /// Field number for the "resource_unit_value" field. + public const int ResourceUnitValueFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_resourceUnitValue_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 10); + private readonly pbc::MapField resourceUnitValue_ = new pbc::MapField(); + /// + /// Resource unit price, symbol -> unit price. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ResourceUnitValue { + get { return resourceUnitValue_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OwningRentalUnitValue); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OwningRentalUnitValue other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!ResourceUnitValue.Equals(other.ResourceUnitValue)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ResourceUnitValue.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + resourceUnitValue_.WriteTo(output, _map_resourceUnitValue_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += resourceUnitValue_.CalculateSize(_map_resourceUnitValue_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OwningRentalUnitValue other) { + if (other == null) { + return; + } + resourceUnitValue_.Add(other.resourceUnitValue_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + resourceUnitValue_.AddEntriesFrom(input, _map_resourceUnitValue_codec); + break; + } + } + } + } + + } + + public sealed partial class TransferToContractInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransferToContractInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Contracts.MultiToken.TokenContractImplReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferToContractInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferToContractInput(TransferToContractInput other) : this() { + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TransferToContractInput Clone() { + return new TransferToContractInput(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The symbol of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + /// + /// The amount of token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 3; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TransferToContractInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TransferToContractInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TransferToContractInput other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + Memo = input.ReadString(); + break; + } + } + } + } + + } + + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.c.cs new file mode 100644 index 0000000..06d19c2 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.c.cs @@ -0,0 +1,322 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_pool_contract.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace EBridge.Contracts.TokenPool { + + #region Events + public partial class Locked : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public Locked GetNonIndexed() + { + return new Locked + { + FromChainId = FromChainId, + ToChainId = ToChainId, + TargetTokenSymbol = TargetTokenSymbol, + Amount = Amount, + Sender = Sender, + }; + } + } + + public partial class Released : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public Released GetNonIndexed() + { + return new Released + { + FromChainId = FromChainId, + ToChainId = ToChainId, + TargetTokenSymbol = TargetTokenSymbol, + Amount = Amount, + Receiver = Receiver, + }; + } + } + + public partial class LiquidityAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public LiquidityAdded GetNonIndexed() + { + return new LiquidityAdded + { + TokenSymbol = TokenSymbol, + Amount = Amount, + Provider = Provider, + }; + } + } + + public partial class LiquidityRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public LiquidityRemoved GetNonIndexed() + { + return new LiquidityRemoved + { + TokenSymbol = TokenSymbol, + Amount = Amount, + Provider = Provider, + }; + } + } + + #endregion + + public static partial class TokenPoolContractContainer + { + static readonly string __ServiceName = "TokenPoolContract"; + + #region Marshallers + + static readonly aelf::Marshaller __Marshaller_InitializeInput = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.InitializeInput.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_google_protobuf_Empty = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_LockInput = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.LockInput.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_ReleaseInput = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.ReleaseInput.Parser.ParseFrom); + + static readonly aelf::Marshaller + __Marshaller_AddLiquidityInput = aelf::Marshallers.Create( + (arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.AddLiquidityInput.Parser.ParseFrom); + + static readonly aelf::Marshaller + __Marshaller_RemoveLiquidityInput = aelf::Marshallers.Create( + (arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.RemoveLiquidityInput.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_aelf_Address = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::AElf.Types.Address.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_MigratorInput = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.MigratorInput.Parser.ParseFrom); + + static readonly aelf::Marshaller + __Marshaller_GetTokenPoolInfoInput = aelf::Marshallers.Create( + (arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.GetTokenPoolInfoInput.Parser.ParseFrom); + + static readonly aelf::Marshaller __Marshaller_TokenPoolInfo = + aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.TokenPoolInfo.Parser.ParseFrom); + + static readonly aelf::Marshaller + __Marshaller_GetLiquidityInput = aelf::Marshallers.Create( + (arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::EBridge.Contracts.TokenPool.GetLiquidityInput.Parser.ParseFrom); + + static readonly aelf::Marshaller + __Marshaller_google_protobuf_Int64Value = aelf::Marshallers.Create( + (arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), + global::Google.Protobuf.WellKnownTypes.Int64Value.Parser.ParseFrom); + + #endregion + + #region Methods + + static readonly + aelf::Method + __Method_Initialize = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Initialize", + __Marshaller_InitializeInput, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method + __Method_Lock = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Lock", + __Marshaller_LockInput, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method + __Method_Release = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Release", + __Marshaller_ReleaseInput, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method + __Method_AddLiquidity = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddLiquidity", + __Marshaller_AddLiquidityInput, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method __Method_RemoveLiquidity = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveLiquidity", + __Marshaller_RemoveLiquidityInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method + __Method_SetAdmin = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetAdmin", + __Marshaller_aelf_Address, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method + __Method_SetBridgeContract = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetBridgeContract", + __Marshaller_aelf_Address, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method + __Method_Migrator = + new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Migrator", + __Marshaller_MigratorInput, + __Marshaller_google_protobuf_Empty); + + static readonly + aelf::Method __Method_GetTokenPoolInfo = + new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetTokenPoolInfo", + __Marshaller_GetTokenPoolInfoInput, + __Marshaller_TokenPoolInfo); + + static readonly + aelf::Method __Method_GetLiquidity = + new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetLiquidity", + __Marshaller_GetLiquidityInput, + __Marshaller_google_protobuf_Int64Value); + + static readonly + aelf::Method __Method_GetRemovableLiquidity = + new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetRemovableLiquidity", + __Marshaller_GetLiquidityInput, + __Marshaller_google_protobuf_Int64Value); + + static readonly aelf::Method + __Method_GetAdmin = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetAdmin", + __Marshaller_google_protobuf_Empty, + __Marshaller_aelf_Address); + + static readonly aelf::Method + __Method_GetBridgeContract = + new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetBridgeContract", + __Marshaller_google_protobuf_Empty, + __Marshaller_aelf_Address); + + #endregion + + #region Descriptors + + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList + Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.Services[0], + global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.Services[0], + }; + } + } + + #endregion + + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.g.cs new file mode 100644 index 0000000..0235d24 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenPoolContract.g.cs @@ -0,0 +1,3671 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token_pool_contract.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace EBridge.Contracts.TokenPool { + + /// Holder for reflection information generated from token_pool_contract.proto + public static partial class TokenPoolContractReflection { + + #region Descriptor + /// File descriptor for token_pool_contract.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TokenPoolContractReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chl0b2tlbl9wb29sX2NvbnRyYWN0LnByb3RvGg9hZWxmL2NvcmUucHJvdG8a", + "EmFlbGYvb3B0aW9ucy5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnBy", + "b3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvGh5nb29nbGUv", + "cHJvdG9idWYvd3JhcHBlcnMucHJvdG8aC2FjczEyLnByb3RvIl8KD0luaXRp", + "YWxpemVJbnB1dBIuChdicmlkZ2VfY29udHJhY3RfYWRkcmVzcxgBIAEoCzIN", + "LmFlbGYuQWRkcmVzcxIcCgVhZG1pbhgCIAEoCzINLmFlbGYuQWRkcmVzcyJw", + "CglMb2NrSW5wdXQSFwoPdGFyZ2V0X2NoYWluX2lkGAEgASgJEhsKE3Rhcmdl", + "dF90b2tlbl9zeW1ib2wYAiABKAkSDgoGYW1vdW50GAMgASgDEh0KBnNlbmRl", + "chgEIAEoCzINLmFlbGYuQWRkcmVzcyJzCgxSZWxlYXNlSW5wdXQSFQoNZnJv", + "bV9jaGFpbl9pZBgBIAEoCRIbChN0YXJnZXRfdG9rZW5fc3ltYm9sGAIgASgJ", + "Eg4KBmFtb3VudBgDIAEoAxIfCghyZWNlaXZlchgEIAEoCzINLmFlbGYuQWRk", + "cmVzcyI5ChFBZGRMaXF1aWRpdHlJbnB1dBIUCgx0b2tlbl9zeW1ib2wYASAB", + "KAkSDgoGYW1vdW50GAMgASgDIjwKFFJlbW92ZUxpcXVpZGl0eUlucHV0EhQK", + "DHRva2VuX3N5bWJvbBgBIAEoCRIOCgZhbW91bnQYAyABKAMicwoNTWlncmF0", + "b3JJbnB1dBIfCghwcm92aWRlchgBIAEoCzINLmFlbGYuQWRkcmVzcxIUCgx0", + "b2tlbl9zeW1ib2wYAiABKAkSFgoOZGVwb3NpdF9hbW91bnQYAyABKAMSEwoL", + "bG9ja19hbW91bnQYBCABKAMiLQoVR2V0VG9rZW5Qb29sSW5mb0lucHV0EhQK", + "DHRva2VuX3N5bWJvbBgBIAEoCSJ4Cg1Ub2tlblBvb2xJbmZvEiwKFXRva2Vu", + "X3ZpcnR1YWxfYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRkcmVzcxImChJ0b2tl", + "bl92aXJ0dWFsX2hhc2gYAiABKAsyCi5hZWxmLkhhc2gSEQoJbGlxdWlkaXR5", + "GAMgASgDIkoKEUdldExpcXVpZGl0eUlucHV0Eh8KCHByb3ZpZGVyGAEgASgL", + "Mg0uYWVsZi5BZGRyZXNzEhQKDHRva2VuX3N5bWJvbBgCIAEoCSKGAQoGTG9j", + "a2VkEhUKDWZyb21fY2hhaW5faWQYASABKAkSEwoLdG9fY2hhaW5faWQYAiAB", + "KAkSGwoTdGFyZ2V0X3Rva2VuX3N5bWJvbBgDIAEoCRIOCgZhbW91bnQYBCAB", + "KAMSHQoGc2VuZGVyGAUgASgLMg0uYWVsZi5BZGRyZXNzOgSguxgBIooBCghS", + "ZWxlYXNlZBIVCg1mcm9tX2NoYWluX2lkGAEgASgJEhMKC3RvX2NoYWluX2lk", + "GAIgASgJEhsKE3RhcmdldF90b2tlbl9zeW1ib2wYAyABKAkSDgoGYW1vdW50", + "GAQgASgDEh8KCHJlY2VpdmVyGAUgASgLMg0uYWVsZi5BZGRyZXNzOgSguxgB", + "Il0KDkxpcXVpZGl0eUFkZGVkEhQKDHRva2VuX3N5bWJvbBgBIAEoCRIOCgZh", + "bW91bnQYAiABKAMSHwoIcHJvdmlkZXIYAyABKAsyDS5hZWxmLkFkZHJlc3M6", + "BKC7GAEiXwoQTGlxdWlkaXR5UmVtb3ZlZBIUCgx0b2tlbl9zeW1ib2wYASAB", + "KAkSDgoGYW1vdW50GAIgASgDEh8KCHByb3ZpZGVyGAMgASgLMg0uYWVsZi5B", + "ZGRyZXNzOgSguxgBMvwGChFUb2tlblBvb2xDb250cmFjdBI4CgpJbml0aWFs", + "aXplEhAuSW5pdGlhbGl6ZUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5", + "IgASLAoETG9jaxIKLkxvY2tJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0", + "eSIAEjIKB1JlbGVhc2USDS5SZWxlYXNlSW5wdXQaFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkiABI8CgxBZGRMaXF1aWRpdHkSEi5BZGRMaXF1aWRpdHlJbnB1", + "dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkIKD1JlbW92ZUxpcXVpZGl0", + "eRIVLlJlbW92ZUxpcXVpZGl0eUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5IgASMwoIU2V0QWRtaW4SDS5hZWxmLkFkZHJlc3MaFi5nb29nbGUucHJv", + "dG9idWYuRW1wdHkiABI8ChFTZXRCcmlkZ2VDb250cmFjdBINLmFlbGYuQWRk", + "cmVzcxoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjQKCE1pZ3JhdG9yEg4u", + "TWlncmF0b3JJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkEKEEdl", + "dFRva2VuUG9vbEluZm8SFi5HZXRUb2tlblBvb2xJbmZvSW5wdXQaDi5Ub2tl", + "blBvb2xJbmZvIgWIifcBARJGCgxHZXRMaXF1aWRpdHkSEi5HZXRMaXF1aWRp", + "dHlJbnB1dBobLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlIgWIifcBARJP", + "ChVHZXRSZW1vdmFibGVMaXF1aWRpdHkSEi5HZXRMaXF1aWRpdHlJbnB1dBob", + "Lmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlIgWIifcBARI4CghHZXRBZG1p", + "bhIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoNLmFlbGYuQWRkcmVzcyIFiIn3", + "AQESQQoRR2V0QnJpZGdlQ29udHJhY3QSFi5nb29nbGUucHJvdG9idWYuRW1w", + "dHkaDS5hZWxmLkFkZHJlc3MiBYiJ9wEBGkeyzPYBMkVCcmlkZ2UuQ29udHJh", + "Y3RzLlRva2VuUG9vbC5Ub2tlblBvb2xDb250cmFjdFN0YXRlysr2AQthY3Mx", + "Mi5wcm90b0IeqgIbRUJyaWRnZS5Db250cmFjdHMuVG9rZW5Qb29sYgZwcm90", + "bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::AElf.Standards.ACS12.Acs12Reflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.InitializeInput), global::EBridge.Contracts.TokenPool.InitializeInput.Parser, new[]{ "BridgeContractAddress", "Admin" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.LockInput), global::EBridge.Contracts.TokenPool.LockInput.Parser, new[]{ "TargetChainId", "TargetTokenSymbol", "Amount", "Sender" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.ReleaseInput), global::EBridge.Contracts.TokenPool.ReleaseInput.Parser, new[]{ "FromChainId", "TargetTokenSymbol", "Amount", "Receiver" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.AddLiquidityInput), global::EBridge.Contracts.TokenPool.AddLiquidityInput.Parser, new[]{ "TokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.RemoveLiquidityInput), global::EBridge.Contracts.TokenPool.RemoveLiquidityInput.Parser, new[]{ "TokenSymbol", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.MigratorInput), global::EBridge.Contracts.TokenPool.MigratorInput.Parser, new[]{ "Provider", "TokenSymbol", "DepositAmount", "LockAmount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.GetTokenPoolInfoInput), global::EBridge.Contracts.TokenPool.GetTokenPoolInfoInput.Parser, new[]{ "TokenSymbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.TokenPoolInfo), global::EBridge.Contracts.TokenPool.TokenPoolInfo.Parser, new[]{ "TokenVirtualAddress", "TokenVirtualHash", "Liquidity" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.GetLiquidityInput), global::EBridge.Contracts.TokenPool.GetLiquidityInput.Parser, new[]{ "Provider", "TokenSymbol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.Locked), global::EBridge.Contracts.TokenPool.Locked.Parser, new[]{ "FromChainId", "ToChainId", "TargetTokenSymbol", "Amount", "Sender" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.Released), global::EBridge.Contracts.TokenPool.Released.Parser, new[]{ "FromChainId", "ToChainId", "TargetTokenSymbol", "Amount", "Receiver" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.LiquidityAdded), global::EBridge.Contracts.TokenPool.LiquidityAdded.Parser, new[]{ "TokenSymbol", "Amount", "Provider" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EBridge.Contracts.TokenPool.LiquidityRemoved), global::EBridge.Contracts.TokenPool.LiquidityRemoved.Parser, new[]{ "TokenSymbol", "Amount", "Provider" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class InitializeInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitializeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput(InitializeInput other) : this() { + bridgeContractAddress_ = other.bridgeContractAddress_ != null ? other.bridgeContractAddress_.Clone() : null; + admin_ = other.admin_ != null ? other.admin_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput Clone() { + return new InitializeInput(this); + } + + /// Field number for the "bridge_contract_address" field. + public const int BridgeContractAddressFieldNumber = 1; + private global::AElf.Types.Address bridgeContractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address BridgeContractAddress { + get { return bridgeContractAddress_; } + set { + bridgeContractAddress_ = value; + } + } + + /// Field number for the "admin" field. + public const int AdminFieldNumber = 2; + private global::AElf.Types.Address admin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Admin { + get { return admin_; } + set { + admin_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InitializeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InitializeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(BridgeContractAddress, other.BridgeContractAddress)) return false; + if (!object.Equals(Admin, other.Admin)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (bridgeContractAddress_ != null) hash ^= BridgeContractAddress.GetHashCode(); + if (admin_ != null) hash ^= Admin.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (bridgeContractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(BridgeContractAddress); + } + if (admin_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Admin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (bridgeContractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(BridgeContractAddress); + } + if (admin_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Admin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (bridgeContractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BridgeContractAddress); + } + if (admin_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Admin); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InitializeInput other) { + if (other == null) { + return; + } + if (other.bridgeContractAddress_ != null) { + if (bridgeContractAddress_ == null) { + BridgeContractAddress = new global::AElf.Types.Address(); + } + BridgeContractAddress.MergeFrom(other.BridgeContractAddress); + } + if (other.admin_ != null) { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + Admin.MergeFrom(other.Admin); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (bridgeContractAddress_ == null) { + BridgeContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(BridgeContractAddress); + break; + } + case 18: { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + input.ReadMessage(Admin); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (bridgeContractAddress_ == null) { + BridgeContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(BridgeContractAddress); + break; + } + case 18: { + if (admin_ == null) { + Admin = new global::AElf.Types.Address(); + } + input.ReadMessage(Admin); + break; + } + } + } + } + #endif + + } + + public sealed partial class LockInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LockInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LockInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LockInput(LockInput other) : this() { + targetChainId_ = other.targetChainId_; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + sender_ = other.sender_ != null ? other.sender_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LockInput Clone() { + return new LockInput(this); + } + + /// Field number for the "target_chain_id" field. + public const int TargetChainIdFieldNumber = 1; + private string targetChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetChainId { + get { return targetChainId_; } + set { + targetChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 2; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "sender" field. + public const int SenderFieldNumber = 4; + private global::AElf.Types.Address sender_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Sender { + get { return sender_; } + set { + sender_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LockInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LockInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TargetChainId != other.TargetChainId) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Sender, other.Sender)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TargetChainId.Length != 0) hash ^= TargetChainId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (sender_ != null) hash ^= Sender.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TargetChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TargetChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (sender_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Sender); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TargetChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TargetChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (sender_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Sender); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TargetChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetChainId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (sender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sender); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LockInput other) { + if (other == null) { + return; + } + if (other.TargetChainId.Length != 0) { + TargetChainId = other.TargetChainId; + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.sender_ != null) { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + Sender.MergeFrom(other.Sender); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TargetChainId = input.ReadString(); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + input.ReadMessage(Sender); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TargetChainId = input.ReadString(); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + input.ReadMessage(Sender); + break; + } + } + } + } + #endif + + } + + public sealed partial class ReleaseInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReleaseInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReleaseInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReleaseInput(ReleaseInput other) : this() { + fromChainId_ = other.fromChainId_; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + receiver_ = other.receiver_ != null ? other.receiver_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReleaseInput Clone() { + return new ReleaseInput(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 2; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "receiver" field. + public const int ReceiverFieldNumber = 4; + private global::AElf.Types.Address receiver_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Receiver { + get { return receiver_; } + set { + receiver_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReleaseInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReleaseInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Receiver, other.Receiver)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (receiver_ != null) hash ^= Receiver.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (receiver_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Receiver); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (receiver_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Receiver); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (receiver_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Receiver); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReleaseInput other) { + if (other == null) { + return; + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.receiver_ != null) { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + Receiver.MergeFrom(other.Receiver); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + case 34: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + } + } + } + #endif + + } + + public sealed partial class AddLiquidityInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddLiquidityInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddLiquidityInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddLiquidityInput(AddLiquidityInput other) : this() { + tokenSymbol_ = other.tokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddLiquidityInput Clone() { + return new AddLiquidityInput(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddLiquidityInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddLiquidityInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddLiquidityInput other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RemoveLiquidityInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveLiquidityInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveLiquidityInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveLiquidityInput(RemoveLiquidityInput other) : this() { + tokenSymbol_ = other.tokenSymbol_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveLiquidityInput Clone() { + return new RemoveLiquidityInput(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 3; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveLiquidityInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveLiquidityInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveLiquidityInput other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MigratorInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MigratorInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MigratorInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MigratorInput(MigratorInput other) : this() { + provider_ = other.provider_ != null ? other.provider_.Clone() : null; + tokenSymbol_ = other.tokenSymbol_; + depositAmount_ = other.depositAmount_; + lockAmount_ = other.lockAmount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MigratorInput Clone() { + return new MigratorInput(this); + } + + /// Field number for the "provider" field. + public const int ProviderFieldNumber = 1; + private global::AElf.Types.Address provider_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Provider { + get { return provider_; } + set { + provider_ = value; + } + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 2; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deposit_amount" field. + public const int DepositAmountFieldNumber = 3; + private long depositAmount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long DepositAmount { + get { return depositAmount_; } + set { + depositAmount_ = value; + } + } + + /// Field number for the "lock_amount" field. + public const int LockAmountFieldNumber = 4; + private long lockAmount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long LockAmount { + get { return lockAmount_; } + set { + lockAmount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MigratorInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MigratorInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Provider, other.Provider)) return false; + if (TokenSymbol != other.TokenSymbol) return false; + if (DepositAmount != other.DepositAmount) return false; + if (LockAmount != other.LockAmount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (provider_ != null) hash ^= Provider.GetHashCode(); + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (DepositAmount != 0L) hash ^= DepositAmount.GetHashCode(); + if (LockAmount != 0L) hash ^= LockAmount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (provider_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Provider); + } + if (TokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenSymbol); + } + if (DepositAmount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(DepositAmount); + } + if (LockAmount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(LockAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (provider_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Provider); + } + if (TokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenSymbol); + } + if (DepositAmount != 0L) { + output.WriteRawTag(24); + output.WriteInt64(DepositAmount); + } + if (LockAmount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(LockAmount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (provider_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Provider); + } + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (DepositAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DepositAmount); + } + if (LockAmount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(LockAmount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MigratorInput other) { + if (other == null) { + return; + } + if (other.provider_ != null) { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + Provider.MergeFrom(other.Provider); + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.DepositAmount != 0L) { + DepositAmount = other.DepositAmount; + } + if (other.LockAmount != 0L) { + LockAmount = other.LockAmount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + case 18: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + DepositAmount = input.ReadInt64(); + break; + } + case 32: { + LockAmount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + case 18: { + TokenSymbol = input.ReadString(); + break; + } + case 24: { + DepositAmount = input.ReadInt64(); + break; + } + case 32: { + LockAmount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetTokenPoolInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetTokenPoolInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetTokenPoolInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetTokenPoolInfoInput(GetTokenPoolInfoInput other) : this() { + tokenSymbol_ = other.tokenSymbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetTokenPoolInfoInput Clone() { + return new GetTokenPoolInfoInput(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetTokenPoolInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetTokenPoolInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetTokenPoolInfoInput other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TokenPoolInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenPoolInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenPoolInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenPoolInfo(TokenPoolInfo other) : this() { + tokenVirtualAddress_ = other.tokenVirtualAddress_ != null ? other.tokenVirtualAddress_.Clone() : null; + tokenVirtualHash_ = other.tokenVirtualHash_ != null ? other.tokenVirtualHash_.Clone() : null; + liquidity_ = other.liquidity_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TokenPoolInfo Clone() { + return new TokenPoolInfo(this); + } + + /// Field number for the "token_virtual_address" field. + public const int TokenVirtualAddressFieldNumber = 1; + private global::AElf.Types.Address tokenVirtualAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address TokenVirtualAddress { + get { return tokenVirtualAddress_; } + set { + tokenVirtualAddress_ = value; + } + } + + /// Field number for the "token_virtual_hash" field. + public const int TokenVirtualHashFieldNumber = 2; + private global::AElf.Types.Hash tokenVirtualHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash TokenVirtualHash { + get { return tokenVirtualHash_; } + set { + tokenVirtualHash_ = value; + } + } + + /// Field number for the "liquidity" field. + public const int LiquidityFieldNumber = 3; + private long liquidity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Liquidity { + get { return liquidity_; } + set { + liquidity_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TokenPoolInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TokenPoolInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TokenVirtualAddress, other.TokenVirtualAddress)) return false; + if (!object.Equals(TokenVirtualHash, other.TokenVirtualHash)) return false; + if (Liquidity != other.Liquidity) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (tokenVirtualAddress_ != null) hash ^= TokenVirtualAddress.GetHashCode(); + if (tokenVirtualHash_ != null) hash ^= TokenVirtualHash.GetHashCode(); + if (Liquidity != 0L) hash ^= Liquidity.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (tokenVirtualAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TokenVirtualAddress); + } + if (tokenVirtualHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(TokenVirtualHash); + } + if (Liquidity != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Liquidity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (tokenVirtualAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TokenVirtualAddress); + } + if (tokenVirtualHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(TokenVirtualHash); + } + if (Liquidity != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Liquidity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (tokenVirtualAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TokenVirtualAddress); + } + if (tokenVirtualHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TokenVirtualHash); + } + if (Liquidity != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Liquidity); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TokenPoolInfo other) { + if (other == null) { + return; + } + if (other.tokenVirtualAddress_ != null) { + if (tokenVirtualAddress_ == null) { + TokenVirtualAddress = new global::AElf.Types.Address(); + } + TokenVirtualAddress.MergeFrom(other.TokenVirtualAddress); + } + if (other.tokenVirtualHash_ != null) { + if (tokenVirtualHash_ == null) { + TokenVirtualHash = new global::AElf.Types.Hash(); + } + TokenVirtualHash.MergeFrom(other.TokenVirtualHash); + } + if (other.Liquidity != 0L) { + Liquidity = other.Liquidity; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (tokenVirtualAddress_ == null) { + TokenVirtualAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(TokenVirtualAddress); + break; + } + case 18: { + if (tokenVirtualHash_ == null) { + TokenVirtualHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(TokenVirtualHash); + break; + } + case 24: { + Liquidity = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (tokenVirtualAddress_ == null) { + TokenVirtualAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(TokenVirtualAddress); + break; + } + case 18: { + if (tokenVirtualHash_ == null) { + TokenVirtualHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(TokenVirtualHash); + break; + } + case 24: { + Liquidity = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetLiquidityInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetLiquidityInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLiquidityInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLiquidityInput(GetLiquidityInput other) : this() { + provider_ = other.provider_ != null ? other.provider_.Clone() : null; + tokenSymbol_ = other.tokenSymbol_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetLiquidityInput Clone() { + return new GetLiquidityInput(this); + } + + /// Field number for the "provider" field. + public const int ProviderFieldNumber = 1; + private global::AElf.Types.Address provider_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Provider { + get { return provider_; } + set { + provider_ = value; + } + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 2; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetLiquidityInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetLiquidityInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Provider, other.Provider)) return false; + if (TokenSymbol != other.TokenSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (provider_ != null) hash ^= Provider.GetHashCode(); + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (provider_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Provider); + } + if (TokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (provider_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Provider); + } + if (TokenSymbol.Length != 0) { + output.WriteRawTag(18); + output.WriteString(TokenSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (provider_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Provider); + } + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetLiquidityInput other) { + if (other == null) { + return; + } + if (other.provider_ != null) { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + Provider.MergeFrom(other.Provider); + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + case 18: { + TokenSymbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + case 18: { + TokenSymbol = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Locked : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Locked()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locked() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locked(Locked other) : this() { + fromChainId_ = other.fromChainId_; + toChainId_ = other.toChainId_; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + sender_ = other.sender_ != null ? other.sender_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locked Clone() { + return new Locked(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_chain_id" field. + public const int ToChainIdFieldNumber = 2; + private string toChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ToChainId { + get { return toChainId_; } + set { + toChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 3; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "sender" field. + public const int SenderFieldNumber = 5; + private global::AElf.Types.Address sender_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Sender { + get { return sender_; } + set { + sender_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Locked); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Locked other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ToChainId != other.ToChainId) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Sender, other.Sender)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (ToChainId.Length != 0) hash ^= ToChainId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (sender_ != null) hash ^= Sender.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (ToChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (sender_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Sender); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (ToChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (sender_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Sender); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (ToChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (sender_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sender); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Locked other) { + if (other == null) { + return; + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + if (other.ToChainId.Length != 0) { + ToChainId = other.ToChainId; + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.sender_ != null) { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + Sender.MergeFrom(other.Sender); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + ToChainId = input.ReadString(); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + input.ReadMessage(Sender); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + ToChainId = input.ReadString(); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + if (sender_ == null) { + Sender = new global::AElf.Types.Address(); + } + input.ReadMessage(Sender); + break; + } + } + } + } + #endif + + } + + public sealed partial class Released : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Released()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Released() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Released(Released other) : this() { + fromChainId_ = other.fromChainId_; + toChainId_ = other.toChainId_; + targetTokenSymbol_ = other.targetTokenSymbol_; + amount_ = other.amount_; + receiver_ = other.receiver_ != null ? other.receiver_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Released Clone() { + return new Released(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private string fromChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_chain_id" field. + public const int ToChainIdFieldNumber = 2; + private string toChainId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ToChainId { + get { return toChainId_; } + set { + toChainId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "target_token_symbol" field. + public const int TargetTokenSymbolFieldNumber = 3; + private string targetTokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TargetTokenSymbol { + get { return targetTokenSymbol_; } + set { + targetTokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "receiver" field. + public const int ReceiverFieldNumber = 5; + private global::AElf.Types.Address receiver_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Receiver { + get { return receiver_; } + set { + receiver_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Released); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Released other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ToChainId != other.ToChainId) return false; + if (TargetTokenSymbol != other.TargetTokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Receiver, other.Receiver)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (FromChainId.Length != 0) hash ^= FromChainId.GetHashCode(); + if (ToChainId.Length != 0) hash ^= ToChainId.GetHashCode(); + if (TargetTokenSymbol.Length != 0) hash ^= TargetTokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (receiver_ != null) hash ^= Receiver.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (ToChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (receiver_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Receiver); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FromChainId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromChainId); + } + if (ToChainId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TargetTokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (receiver_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Receiver); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (FromChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromChainId); + } + if (ToChainId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ToChainId); + } + if (TargetTokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TargetTokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (receiver_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Receiver); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Released other) { + if (other == null) { + return; + } + if (other.FromChainId.Length != 0) { + FromChainId = other.FromChainId; + } + if (other.ToChainId.Length != 0) { + ToChainId = other.ToChainId; + } + if (other.TargetTokenSymbol.Length != 0) { + TargetTokenSymbol = other.TargetTokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.receiver_ != null) { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + Receiver.MergeFrom(other.Receiver); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + ToChainId = input.ReadString(); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + FromChainId = input.ReadString(); + break; + } + case 18: { + ToChainId = input.ReadString(); + break; + } + case 26: { + TargetTokenSymbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + if (receiver_ == null) { + Receiver = new global::AElf.Types.Address(); + } + input.ReadMessage(Receiver); + break; + } + } + } + } + #endif + + } + + public sealed partial class LiquidityAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LiquidityAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityAdded(LiquidityAdded other) : this() { + tokenSymbol_ = other.tokenSymbol_; + amount_ = other.amount_; + provider_ = other.provider_ != null ? other.provider_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityAdded Clone() { + return new LiquidityAdded(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "provider" field. + public const int ProviderFieldNumber = 3; + private global::AElf.Types.Address provider_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Provider { + get { return provider_; } + set { + provider_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LiquidityAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LiquidityAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Provider, other.Provider)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (provider_ != null) hash ^= Provider.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (provider_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Provider); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (provider_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Provider); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (provider_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Provider); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LiquidityAdded other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.provider_ != null) { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + Provider.MergeFrom(other.Provider); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + } + } + } + #endif + + } + + public sealed partial class LiquidityRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LiquidityRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EBridge.Contracts.TokenPool.TokenPoolContractReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityRemoved(LiquidityRemoved other) : this() { + tokenSymbol_ = other.tokenSymbol_; + amount_ = other.amount_; + provider_ = other.provider_ != null ? other.provider_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LiquidityRemoved Clone() { + return new LiquidityRemoved(this); + } + + /// Field number for the "token_symbol" field. + public const int TokenSymbolFieldNumber = 1; + private string tokenSymbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TokenSymbol { + get { return tokenSymbol_; } + set { + tokenSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "provider" field. + public const int ProviderFieldNumber = 3; + private global::AElf.Types.Address provider_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Provider { + get { return provider_; } + set { + provider_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LiquidityRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LiquidityRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TokenSymbol != other.TokenSymbol) return false; + if (Amount != other.Amount) return false; + if (!object.Equals(Provider, other.Provider)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TokenSymbol.Length != 0) hash ^= TokenSymbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (provider_ != null) hash ^= Provider.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (provider_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Provider); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TokenSymbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TokenSymbol); + } + if (Amount != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Amount); + } + if (provider_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Provider); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TokenSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TokenSymbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (provider_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Provider); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LiquidityRemoved other) { + if (other == null) { + return; + } + if (other.TokenSymbol.Length != 0) { + TokenSymbol = other.TokenSymbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.provider_ != null) { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + Provider.MergeFrom(other.Provider); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TokenSymbol = input.ReadString(); + break; + } + case 16: { + Amount = input.ReadInt64(); + break; + } + case 26: { + if (provider_ == null) { + Provider = new global::AElf.Types.Address(); + } + input.ReadMessage(Provider); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainIndexingInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainIndexingInfoIndexInput.cs new file mode 100644 index 0000000..cb030f6 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainIndexingInfoIndexInput.cs @@ -0,0 +1,13 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class AddCrossChainIndexingInfoIndexInput +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } + public string IndexChainId { get; set; } + public long IndexBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs new file mode 100644 index 0000000..728c972 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs @@ -0,0 +1,31 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class AddCrossChainTransferIndexInput +{ + public Guid Id { get; set; } + public CrossChainType Type { get; set; } + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public string InlineTransferTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public decimal TransferAmount { get; set; } + public decimal ReceiveAmount { get; set; } + public Guid TransferTokenId { get; set; } + public Guid ReceiveTokenId { get; set; } + public CrossChainStatus Status { get; set; } + public string ReceiptId { get; set; } + public double Progress { get; set; } + public DateTime ProgressUpdateTime { get; set; } + public string TraceId { get; set; } + public ReceiptStatus TransferStatus { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } + public long ReceiveBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusInput.cs new file mode 100644 index 0000000..61e525d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusInput.cs @@ -0,0 +1,10 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class AetherLinkCrossChainStatusInput +{ + // public long SourceChainId { get; set; } + // public long TargetChainId { get; set; } + public string TransactionId { get; set; } + // public string MessageId { get; set; } + public string TraceId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusResultDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusResultDto.cs new file mode 100644 index 0000000..123e883 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AetherLinkCrossChainStatusResultDto.cs @@ -0,0 +1,13 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class AetherLinkCrossChainStatusResultDto +{ + public int Status { get; set; } +} + +public class AetherLinkCommonResult +{ + public bool Success { get; set; } + public string Message { get; set; } + public T Data { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainDailyLimitInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainDailyLimitInput.cs new file mode 100644 index 0000000..a25b200 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainDailyLimitInput.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class ConsumeCrossChainDailyLimitInput +{ + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal Amount { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainRateLimitInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainRateLimitInput.cs new file mode 100644 index 0000000..7cd7ef8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ConsumeCrossChainRateLimitInput.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class ConsumeCrossChainRateLimitInput +{ + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal Amount { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateCrossChainIndexingInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateCrossChainIndexingInfoInput.cs new file mode 100644 index 0000000..43708aa --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateCrossChainIndexingInfoInput.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CreateCrossChainIndexingInfoInput : InputBase +{ + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } + public string IndexChainId { get; set; } + public long IndexBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainDailyLimitsDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainDailyLimitsDto.cs new file mode 100644 index 0000000..567ebeb --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainDailyLimitsDto.cs @@ -0,0 +1,13 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainDailyLimitsDto +{ + public string Token { get; set; } + public decimal Allowance { get; set; } + + public CrossChainDailyLimitsDto(string token, decimal allowance) + { + Token = token; + Allowance = allowance; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitDto.cs new file mode 100644 index 0000000..1d0b371 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitDto.cs @@ -0,0 +1,15 @@ +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimitDto +{ + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal CurrentAmount { get; set; } + public decimal Capacity { get; set; } + public decimal Rate { get; set; } + public bool IsEnable { get; set; } + public TokenDto Token { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitsDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitsDto.cs new file mode 100644 index 0000000..86b1573 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainRateLimitsDto.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimitsDto +{ + public string FromChain { get; set; } + public string ToChain { get; set; } + public List ReceiptRateLimitsInfo { get; set; } + public List SwapRateLimitsInfo { get; set; } +} + +public class RateLimitInfo +{ + public string Token { get; set; } + public decimal Capacity { get; set; } + public decimal RefillRate { get; set; } + + public int MaximumTimeConsumed { get; set; } +} + + diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs new file mode 100644 index 0000000..2074f6c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs @@ -0,0 +1,20 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainReceiveInput +{ + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public DateTime ReceiveTime { get; set; } + public string ReceiptId { get; set; } + public Guid ReceiveTokenId { get; set; } + public decimal ReceiveAmount { get; set; } + public string TraceId { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } + public long ReceiveBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferIndexDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferIndexDto.cs new file mode 100644 index 0000000..8bd9ed3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferIndexDto.cs @@ -0,0 +1,40 @@ +using System; +using AElf.CrossChainServer.Tokens; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferIndexDto: EntityDto +{ + /// + /// 0: Homogeneous, 1: Heterogeneous + /// + public CrossChainType Type { get; set; } + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public string InlineTransferTransactionId { get; set; } + public long TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public long ReceiveTime { get; set; } + public decimal TransferAmount { get; set; } + public decimal ReceiveAmount { get; set; } + public TokenDto TransferToken { get; set; } + public TokenDto ReceiveToken { get; set; } + /// + /// 0: Transferred, 1: Indexed, 2: Received + /// + public CrossChainStatus Status { get; set; } + public string ReceiptId { get; set; } + public int Progress { get; set; } + public long ProgressUpdateTime { get; set; } + + public bool TransferNeedToBeApproved { get; set; } + public string TraceId { get; set; } + public ReceiptStatus TransferStatus { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } + public long ReceiveBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInfoDto.cs new file mode 100644 index 0000000..f08cef0 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInfoDto.cs @@ -0,0 +1,39 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferInfoDto : GraphQLDto +{ + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public long TransferAmount { get; set; } + public long ReceiveAmount { get; set; } + public string ReceiptId { get; set; } + public string TransferTokenSymbol { get; set; } + public string ReceiveTokenSymbol { get; set; } + public TransferType TransferType { get; set; } + public CrossChainType CrossChainType { get; set; } + public long ReceiveBlockHeight { get; set; } +} + +public enum TransferType +{ + Transfer, + Receive +} + +public class GraphQLDto +{ + public string Id { get; set; } + public string ChainId { get; set; } + public string BlockHash { get; set; } + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs new file mode 100644 index 0000000..f129d15 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs @@ -0,0 +1,20 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferInput +{ + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public decimal TransferAmount { get; set; } + public Guid TransferTokenId { get; set; } + public string ReceiptId { get; set; } + // For ton trace + public string TraceId { get; set; } + public ReceiptStatus TransferStatus { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferStatusDto.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferStatusDto.cs new file mode 100644 index 0000000..897807a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferStatusDto.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferStatusDto : EntityDto +{ + public int Progress { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransferStatusInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransferStatusInput.cs new file mode 100644 index 0000000..3a43c10 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransferStatusInput.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.CrossChain; + +public class GetCrossChainTransferStatusInput +{ + [MaxLength(length:10)] + public List Ids { get; set; } = new(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransfersInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransfersInput.cs new file mode 100644 index 0000000..b1d8b3c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/GetCrossChainTransfersInput.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +public class GetCrossChainTransfersInput : PagedAndSortedResultRequestDto +{ + [MaxLength(length:20)] + public string FromChainId { get; set; } + [MaxLength(length:20)] + public string ToChainId { get; set; } + [MaxLength(length:80)] + public string FromAddress { get; set; } + [MaxLength(length:80)] + public string ToAddress { get; set; } + public CrossChainStatus? Status { get; set; } + public CrossChainType? Type { get; set; } + + public string Addresses { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainIndexingInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainIndexingInfoAppService.cs new file mode 100644 index 0000000..dbdc5f7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainIndexingInfoAppService.cs @@ -0,0 +1,14 @@ +using System; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainIndexingInfoAppService +{ + Task CreateAsync(CreateCrossChainIndexingInfoInput input); + Task CleanAsync(DateTime time); + Task CalculateCrossChainProgressAsync(string fromChainId, string toChainId, long height, DateTime txTime); + Task CalculateCrossChainProgressAsync(string fromChainId, string toChainId, long height); + Task AddIndexAsync(AddCrossChainIndexingInfoIndexInput input); + Task DeleteIndexAsync(Guid id); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs new file mode 100644 index 0000000..0e11cc1 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainLimitAppService +{ + Task InitLimitAsync(); + Task SetCrossChainRateLimitAsync(SetCrossChainRateLimitInput input); + Task ConsumeCrossChainRateLimitAsync(ConsumeCrossChainRateLimitInput input); + Task SetCrossChainRateLimitIndexAsync(SetCrossChainRateLimitInput input); + Task> GetCrossChainRateLimitsAsync(); + Task SetCrossChainDailyLimitAsync(SetCrossChainDailyLimitInput input); + Task ConsumeCrossChainDailyLimitAsync(ConsumeCrossChainDailyLimitInput input); + Task SetCrossChainDailyLimitIndexAsync(SetCrossChainDailyLimitInput input); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitInfoAppService.cs new file mode 100644 index 0000000..f18ecbe --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitInfoAppService.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainLimitInfoAppService +{ + /** + * to get Daily Limits config + */ + Task> GetCrossChainDailyLimitsAsync(); + /** + * to get Rate Limits Infos + */ + Task> GetCrossChainRateLimitsAsync(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs new file mode 100644 index 0000000..c804174 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs @@ -0,0 +1,23 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainTransferAppService +{ + Task> GetListAsync(GetCrossChainTransfersInput input); + Task> GetStatusAsync(GetCrossChainTransferStatusInput input); + Task TransferAsync(CrossChainTransferInput input); + Task ReceiveAsync(CrossChainReceiveInput input); + Task UpdateProgressAsync(); + Task AddIndexAsync(AddCrossChainTransferIndexInput input); + Task UpdateIndexAsync(UpdateCrossChainTransferIndexInput input); + Task DeleteIndexAsync(Guid id); + Task UpdateReceiveTransactionAsync(); + Task AutoReceiveAsync(); + Task CheckTransferTransactionConfirmedAsync(string chainId); + Task CheckReceiveTransactionConfirmedAsync(string chainId); + Task CheckEvmTransferTransactionConfirmedAsync(string chainId); + Task CheckEvmReceiveTransactionConfirmedAsync(string chainId); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCommonResult.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCommonResult.cs new file mode 100644 index 0000000..d6d6434 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCommonResult.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class IndexerCommonResult +{ + public T Data { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCrossChainLimitInfo.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCrossChainLimitInfo.cs new file mode 100644 index 0000000..7877eda --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IndexerCrossChainLimitInfo.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.CrossChain; + +public class IndexerCrossChainLimitInfos : IndexerCommonResult +{ + public long TotalRecordCount { get; set; } + public List DataList { get; set; } +} + +public class IndexerCrossChainLimitInfo : IndexerCommonResult +{ + public string Id { get; set; } + + public string FromChainId { get; set; } + + public string ToChainId { get; set; } + + public string Symbol { get; set; } + + public CrossChainLimitType LimitType { get; set; } + + // Default Daily Limit + public long DefaultDailyLimit { get; set; } + + // Refresh Time + public DateTime RefreshTime { get; set; } + + // Current Daily Limit + public long CurrentDailyLimit { get; set; } + + // Token Bucket Capacity + public long Capacity { get; set; } + + // Refill Rate + public long RefillRate { get; set; } + + // IsEnable + public bool IsEnable { get; set; } + + // Current Bucket TokenAmount + public long CurrentBucketTokenAmount { get; set; } + + // Bucket Update Time + public DateTime BucketUpdateTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/LimitSyncOptions.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/LimitSyncOptions.cs new file mode 100644 index 0000000..411ac23 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/LimitSyncOptions.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.CrossChain; + +public class LimitSyncOptions +{ + public bool IsSyncEnabled { get; set; } + public Dictionary> LimitInfos { get; set; } +} + +public class LimitInfo +{ + public string TokenAddress { get; set; } + public string TargetChainId { get; set; } + public string SwapId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainDailyLimitInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainDailyLimitInput.cs new file mode 100644 index 0000000..b85170d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainDailyLimitInput.cs @@ -0,0 +1,15 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class SetCrossChainDailyLimitInput +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal RemainAmount { get; set; } + public long RefreshTime { get; set; } + public decimal DailyLimit { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainRateLimitInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainRateLimitInput.cs new file mode 100644 index 0000000..cd10dae --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/SetCrossChainRateLimitInput.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class SetCrossChainRateLimitInput +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal CurrentAmount { get; set; } + public decimal Capacity { get; set; } + public decimal Rate { get; set; } + public bool IsEnable { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs new file mode 100644 index 0000000..0d29795 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs @@ -0,0 +1,32 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class UpdateCrossChainTransferIndexInput +{ + public Guid Id { get; set; } + public CrossChainType Type { get; set; } + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public string InlineTransferTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public decimal TransferAmount { get; set; } + public decimal ReceiveAmount { get; set; } + public Guid TransferTokenId { get; set; } + public Guid ReceiveTokenId { get; set; } + public CrossChainStatus Status { get; set; } + public string ReceiptId { get; set; } + public double Progress { get; set; } + public DateTime ProgressUpdateTime { get; set; } + public bool TransferNeedToBeApproved { get; set; } + public string TraceId { get; set; } + public ReceiptStatus TransferStatus { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } + public long ReceiveBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerApplicationContractsModule.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerApplicationContractsModule.cs new file mode 100644 index 0000000..4e9d5cf --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerApplicationContractsModule.cs @@ -0,0 +1,30 @@ +using AElf.ExceptionHandler.ABP; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule), + typeof(AOPExceptionModule) +)] +public class CrossChainServerApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + CrossChainServerDtoExtensions.Configure(); + } +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerDtoExtensions.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerDtoExtensions.cs new file mode 100644 index 0000000..7ad6949 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChainServerDtoExtensions.cs @@ -0,0 +1,26 @@ +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer; + +public static class CrossChainServerDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/DateTimeHelper.cs b/src/AElf.CrossChainServer.Application.Contracts/DateTimeHelper.cs new file mode 100644 index 0000000..2ea6b8c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/DateTimeHelper.cs @@ -0,0 +1,22 @@ +using System; + +namespace AElf.CrossChainServer; + +public class DateTimeHelper +{ + public static long ToUnixTimeMilliseconds(DateTime value) + { + var span = value - DateTime.UnixEpoch; + return Math.Max(0, (long)span.TotalMilliseconds); + } + + public static DateTime FromUnixTimeMilliseconds(long value) + { + return DateTime.UnixEpoch.AddMilliseconds(value); + } + + public static DateTime FromUnixTimeSeconds(long value) + { + return DateTime.UnixEpoch.AddSeconds(value); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/ExceptionHandler/ExceptionHandlingService.cs b/src/AElf.CrossChainServer.Application.Contracts/ExceptionHandler/ExceptionHandlingService.cs new file mode 100644 index 0000000..0afee35 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/ExceptionHandler/ExceptionHandlingService.cs @@ -0,0 +1,29 @@ +using System; +using System.Threading.Tasks; +using AElf.ExceptionHandler; +using Serilog; + +namespace AElf.CrossChainServer.ExceptionHandler; + +public static class ExceptionHandlingService +{ + public static async Task HandleException(Exception ex) + { + Log.Error("Handled exception: {message}",ex.Message); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return, + ReturnValue = false + }; + } + + public static async Task HandleExceptionReturnLong(Exception ex) + { + Log.Error("Handled exception: {message}",ex.Message); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return, + ReturnValue = 0 + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/GraphQLClientEnum.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/GraphQLClientEnum.cs new file mode 100644 index 0000000..296ea34 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/GraphQLClientEnum.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.Indexer; + +public enum GraphQLClientEnum +{ + CrossChainClient, + ScanClient +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IGraphQLClientFactory.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IGraphQLClientFactory.cs new file mode 100644 index 0000000..807fd54 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IGraphQLClientFactory.cs @@ -0,0 +1,8 @@ +using GraphQL.Client.Abstractions; + +namespace AElf.CrossChainServer.Indexer; + +public interface IGraphQLClientFactory +{ + IGraphQLClient GetClient(GraphQLClientEnum clientEnum); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerAppService.cs new file mode 100644 index 0000000..a95e670 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerAppService.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.TokenPool; + +namespace AElf.CrossChainServer.Indexer; + +public interface IIndexerAppService +{ + Task GetLatestIndexHeightAsync(string chainId); + Task GetLatestIndexBestHeightAsync(string chainId); + + Task<(bool, CrossChainTransferInfoDto)> GetPendingTransactionAsync(string chainId,string transferTransactionId); + Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiveTransactionAsync(string chainId,string transferTransactionId); + + Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiptAsync(string chainId, string receiptId); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerCrossChainLimitInfoService.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerCrossChainLimitInfoService.cs new file mode 100644 index 0000000..043d5dd --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerCrossChainLimitInfoService.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.Indexer; + +public interface IIndexerCrossChainLimitInfoService +{ + public Task> GetAllCrossChainLimitInfoIndexAsync(); + + public Task> GetCrossChainLimitInfoIndexAsync(string fromChainId, string toChainId, string symbol); + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs new file mode 100644 index 0000000..1b9b5da --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Indexer; + +public class SyncStateResponse +{ + public SyncStateItems CurrentVersion { get; set; } +} + +public class SyncStateItems +{ + public string Version { get; set; } + public List Items { get; set; } +} + +public class BlockChainStatus +{ + public string ChainId { get; set; } + public string LongestChainBlockHash { get; set; } + public long LongestChainHeight { get; set; } + public string BestChainBlockHash { get; set; } + public long BestChainHeight { get; set; } + public string LastIrreversibleBlockHash { get; set; } + public long LastIrreversibleBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/InputBase.cs b/src/AElf.CrossChainServer.Application.Contracts/InputBase.cs new file mode 100644 index 0000000..c4e73f9 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/InputBase.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer +{ + public class InputBase + { + public string ChainId { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissionDefinitionProvider.cs b/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissionDefinitionProvider.cs new file mode 100644 index 0000000..974dcec --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using AElf.CrossChainServer.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace AElf.CrossChainServer.Permissions; + +public class CrossChainServerPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(CrossChainServerPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(CrossChainServerPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissions.cs b/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissions.cs new file mode 100644 index 0000000..c0ef31a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Permissions/CrossChainServerPermissions.cs @@ -0,0 +1,9 @@ +namespace AElf.CrossChainServer.Permissions; + +public static class CrossChainServerPermissions +{ + public const string GroupName = "CrossChainServer"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/ProtoExtensions.cs b/src/AElf.CrossChainServer.Application.Contracts/ProtoExtensions.cs new file mode 100644 index 0000000..646f3fa --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/ProtoExtensions.cs @@ -0,0 +1,34 @@ +using Google.Protobuf; +using Google.Protobuf.Collections; + +namespace AElf.CrossChainServer; + +public static class ProtoExtensions +{ + private static void CopyNonNullProperties(T source, T target) + { + var properties = typeof(T).GetProperties(); + foreach (var property in properties) + { + if (!property.CanRead || !property.CanWrite) continue; + var value = property.GetValue(source); + if (value != null) + { + property.SetValue(target, value); + } + } + } + + public static T MergeFromIndexed(RepeatedField indexed) where T : IMessage, new() + { + var target = new T(); + foreach (var byteString in indexed) + { + var parsedInstance = new T(); + parsedInstance.MergeFrom(byteString); + CopyNonNullProperties(parsedInstance, target); + } + + return target; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainInput.cs new file mode 100644 index 0000000..cc46635 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainInput.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AddChainInput +{ + [Required] public string Symbol { get; set; } + public List ChainIds { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainResultDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainResultDto.cs new file mode 100644 index 0000000..5e8b08a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AddChainResultDto.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AddChainResultDto +{ + public List ChainList { get; set; } +} + +public class AddChainDto +{ + public string Id { get; set; } + public string ChainId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokenDetailDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokenDetailDto.cs new file mode 100644 index 0000000..dc5ca73 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokenDetailDto.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class AvailableTokenDetailDto +{ + public string LiquidityInUsd { get; set; } + public int Holders { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokensDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokensDto.cs new file mode 100644 index 0000000..ee7ef9d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/AvailableTokensDto.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AvailableTokensDto +{ + public List TokenList { get; set; } = new(); +} + +public class AvailableTokenDto +{ + public string TokenName { get; set; } + public string Symbol { get; set; } + public string TokenImage { get; set; } + public string Status { get; set; } + public decimal TotalSupply { get; set; } +} + +public enum TokenStatus +{ + Available, + Listed, + Integrating +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusInput.cs new file mode 100644 index 0000000..010ed10 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusInput.cs @@ -0,0 +1,8 @@ +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class CheckChainAccessStatusInput +{ + [Required] public string Symbol { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusResultDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusResultDto.cs new file mode 100644 index 0000000..d988d44 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CheckChainAccessStatusResultDto.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class CheckChainAccessStatusResultDto +{ + public List ChainList { get; set; } = new(); +} + +public class ChainAccessInfo +{ + public string ChainId { get; set; } + public string ChainName { get; set; } + public string Status { get; set; } + public bool Checked { get; set; } + public string TokenName { get; set; } + public string Symbol { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } +} diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CommonResponseDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CommonResponseDto.cs new file mode 100644 index 0000000..ca17dbe --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/CommonResponseDto.cs @@ -0,0 +1,50 @@ +using System; +using JetBrains.Annotations; +using Volo.Abp; + +namespace AElf.CrossChainServer.TokenAccess; + +public class CommonResponseDto where T : class +{ + private const string SuccessCode = "20000"; + private const string CommonErrorCode = "50000"; + public string Code { get; set; } + public object Data { get; set; } + public string Message { get; set; } = string.Empty; + private readonly bool _success; + bool Success => Code == SuccessCode; + private readonly T _value; + public T Value => Data as T; + + public CommonResponseDto() + { + Code = SuccessCode; + } + + public CommonResponseDto(T data) + { + Code = SuccessCode; + Data = data; + } + + public CommonResponseDto Error(string code, string message) + { + Code = code; + Message = message; + return this; + } + + public CommonResponseDto Error(string message) + { + Code = CommonErrorCode; + Message = message; + return this; + } + + public CommonResponseDto Error(Exception e, [CanBeNull] string message = null) + { + return e is UserFriendlyException ufe + ? Error(ufe.Code, message ?? ufe.Message) + : Error(CommonErrorCode, message ?? e.Message); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetAvailableTokensInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetAvailableTokensInput.cs new file mode 100644 index 0000000..3014060 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetAvailableTokensInput.cs @@ -0,0 +1,8 @@ +using JetBrains.Annotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class GetAvailableTokensInput +{ + [CanBeNull] public string Symbol { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenApplyOrderInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenApplyOrderInput.cs new file mode 100644 index 0000000..4627469 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenApplyOrderInput.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; +using JetBrains.Annotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class GetTokenApplyOrderInput +{ + [Required] public string Symbol { get; set; } + [CanBeNull] public string Id { get; set; } + [CanBeNull] public string ChainId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenConfigInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenConfigInput.cs new file mode 100644 index 0000000..15a8735 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenConfigInput.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class GetTokenConfigInput +{ + public string Symbol { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenPriceInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenPriceInput.cs new file mode 100644 index 0000000..9616d44 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/GetTokenPriceInput.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class GetTokenPriceInput +{ + public string Symbol { get; set; } + public decimal Amount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ITokenAccessAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ITokenAccessAppService.cs new file mode 100644 index 0000000..1f25dd7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ITokenAccessAppService.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ITokenAccessAppService +{ + Task GetAvailableTokensAsync(GetAvailableTokensInput input); + Task GetAvailableTokenDetailAsync(string symbol); + Task CommitTokenAccessInfoAsync(UserTokenAccessInfoInput input); + Task GetUserTokenAccessInfoAsync(UserTokenAccessInfoBaseInput input); + Task CheckChainAccessStatusAsync(CheckChainAccessStatusInput input); + Task AddChainAsync(AddChainInput input); + Task PrepareBindingIssueAsync(PrepareBindIssueInput input); + Task GetBindingIssueAsync(UserTokenBindingDto input); + + Task> GetTokenApplyOrderListAsync(GetTokenApplyOrderListInput input); + Task> GetTokenApplyOrderDetailAsync(GetTokenApplyOrderInput input); + + Task AddUserTokenAccessInfoIndexAsync(AddUserTokenAccessInfoIndexInput input); + Task UpdateUserTokenAccessInfoIndexAsync(UpdateUserTokenAccessInfoIndexInput input); + Task AddThirdUserTokenIssueInfoIndexAsync(AddThirdUserTokenIssueInfoIndexInput input); + Task UpdateThirdUserTokenIssueInfoIndexAsync(UpdateThirdUserTokenIssueInfoIndexInput input); + + Task AddTokenApplyOrderIndexAsync(AddTokenApplyOrderIndexInput input); + Task UpdateTokenApplyOrderIndexAsync(UpdateTokenApplyOrderIndexInput input); + + Task GetTokenConfigAsync(GetTokenConfigInput input); + + Task>> GetTokenWhitelistAsync(); + + Task GetTokenPriceAsync(GetTokenPriceInput input); + + Task TriggerOrderStatusChangeAsync(TriggerOrderStatusChangeInput input); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindIssueInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindIssueInput.cs new file mode 100644 index 0000000..f73305d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindIssueInput.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class PrepareBindIssueInput +{ + [Required] public string Address { get; set; } + [Required] public string Symbol { get; set; } + [Required] public string ChainId { get; set; } + [Required] public string ContractAddress { get; set; } + [Required] public string Supply { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindingDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindingDto.cs new file mode 100644 index 0000000..19fb244 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/PrepareBindingDto.cs @@ -0,0 +1,37 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class PrepareBindingResultDto +{ + public string Code { get; set; } + public string Message { get; set; } + public UserTokenBindingDto Data { get; set; } +} + +public class PrepareBindingInput +{ + public string Address { get; set; } + public string AelfToken { get; set; } + public string AelfChain { get; set; } + public ThirdTokenDto ThirdTokens { get; set; } + public string Signature { get; set; } +} + +public class ThirdTokenDto +{ + public string TokenName { get; set; } + public string Symbol { get; set; } + public string TokenImage { get; set; } + public string TotalSupply { get; set; } + public string ThirdChain { get; set; } + public string Owner { get; set; } + public string ContractAddress { get; set; } +} + +public class BindingInput +{ + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } + public string Signature { get; set; } + public string MintToAddress { get; set; } + public string TokenContractAddress { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/StringHelper.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/StringHelper.cs new file mode 100644 index 0000000..1236263 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/StringHelper.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text.RegularExpressions; +using AElf.Types; +using JetBrains.Annotations; +using Newtonsoft.Json; + +namespace AElf.CrossChainServer.TokenAccess; + +public static class StringHelper +{ + public static decimal SafeToDecimal(this string s, decimal defaultValue = 0) + { + return decimal.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result) + ? result + : defaultValue; + } + + public static T ReplaceObjectWithDict(T input, Dictionary replacement) + { + var json = JsonConvert.SerializeObject(input); + json = json.ReplaceWithDict(replacement); + return JsonConvert.DeserializeObject(json); + } + + /// replace all {param.key} in string + private static string ReplaceWithDict(this string input, Dictionary replacements, + bool throwErrorIfNotFound = true, string defaultValue = "") + { + foreach (var pair in replacements) + { + var key = "{" + pair.Key + "}"; + if (input.Contains(key)) + { + input = input.Replace(key, pair.Value); + } + else if (throwErrorIfNotFound) + { + throw new Exception($"Key '{key}' not found in the input string."); + } + else + { + input = input.Replace(key, defaultValue); + } + } + + return input; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/AddThirdUserTokenIssueInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/AddThirdUserTokenIssueInfoIndexInput.cs new file mode 100644 index 0000000..2d0eca9 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/AddThirdUserTokenIssueInfoIndexInput.cs @@ -0,0 +1,22 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AddThirdUserTokenIssueInfoIndexInput +{ + public Guid Id { get; set; } + public string Address { get; set; } + public string WalletAddress { get; set; } + public string Symbol { get; set; } + public string ChainId { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string TokenName { get; set; } + public string TokenImage { get; set; } + public string OtherChainId { get; set; } + public string TotalSupply { get; set; } + public string ContractAddress { get; set; } + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } + public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdTokenDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdTokenDto.cs new file mode 100644 index 0000000..83e1f28 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdTokenDto.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +public class ThirdTokenResultDto +{ + public string Code { get; set; } + public string Message { get; set; } + public ThirdTokenListDto Data { get; set; } +} + +public class ThirdTokenListDto +{ + public int TotalCount { get; set; } + public List Items { get; set; } +} + +public class ThirdTokenItemDto +{ + public string AelfChain { get; set; } + public string AelfToken { get; set; } + public string ThirdChain { get; set; } + public string ThirdTokenName { get; set; } + public string ThirdSymbol { get; set; } + public string ThirdTokenImage { get; set; } + public string ThirdContractAddress { get; set; } + public string ThirdTotalSupply { get; set; } + public string Address { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfoDto.cs new file mode 100644 index 0000000..cdb8ccf --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfoDto.cs @@ -0,0 +1,19 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class ThirdUserTokenIssueInfoDto +{ + public string Address { get; set; } + public string WalletAddress { get; set; } + public string Symbol { get; set; } + public string ChainId { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string TokenName { get; set; } + public string TokenImage { get; set; } + public string OtherChainId { get; set; } + public string TotalSupply { get; set; } + public string ContractAddress { get; set; } + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } + public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/UpdateThirdUserTokenIssueInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/UpdateThirdUserTokenIssueInfoIndexInput.cs new file mode 100644 index 0000000..6f1530b --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/ThirdUserTokenIssue/UpdateThirdUserTokenIssueInfoIndexInput.cs @@ -0,0 +1,22 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UpdateThirdUserTokenIssueInfoIndexInput +{ + public Guid Id { get; set; } + public string Address { get; set; } + public string WalletAddress { get; set; } + public string Symbol { get; set; } + public string ChainId { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string TokenName { get; set; } + public string TokenImage { get; set; } + public string OtherChainId { get; set; } + public string TotalSupply { get; set; } + public string ContractAddress { get; set; } + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } + public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenAccessNotifyDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenAccessNotifyDto.cs new file mode 100644 index 0000000..1110dff --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenAccessNotifyDto.cs @@ -0,0 +1,10 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenAccessNotifyDto +{ + public string Token { get; set; } + public string TokenContract { get; set; } + public string Chain { get; set; } + public string Website { get; set; } + public string OrderId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/AddTokenApplyOrderIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/AddTokenApplyOrderIndexInput.cs new file mode 100644 index 0000000..bf4223a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/AddTokenApplyOrderIndexInput.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AddTokenApplyOrderIndexInput +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string UserAddress { get; set; } + public string Status { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string ChainId { get; set; } + public string ChainName { get; set; } + public string TokenName { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public List StatusChangedRecords { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/GetTokenApplyOrderListInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/GetTokenApplyOrderListInput.cs new file mode 100644 index 0000000..0092b31 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/GetTokenApplyOrderListInput.cs @@ -0,0 +1,7 @@ +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenAccess; + +public class GetTokenApplyOrderListInput : PagedAndSortedResultRequestDto +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/TokenApplyOrderListDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/TokenApplyOrderListDto.cs new file mode 100644 index 0000000..2c23339 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/TokenApplyOrderListDto.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenApplyOrderDto +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string UserAddress { get; set; } + public string Status { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public ChainTokenInfoResultDto ChainTokenInfo { get; set; } + public Dictionary StatusChangedRecord { get; set; } +} + +public class ChainTokenInfoResultDto +{ + public string ChainId { get; set; } + public string ChainName { get; set; } + public string TokenName { get; set; } + public string Symbol { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public string Status { get; set; } + public decimal DailyLimit { get; set; } + public decimal RateLimit { get; set; } + public string MinAmount { get; set; } +} + +public class TokenApplyDto +{ + public string Symbol { get; set; } + public string Address { get; set; } + public string ChainId { get; set; } + public string Coin { get; set; } + public string Amount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/UpdateTokenApplyOrderIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/UpdateTokenApplyOrderIndexInput.cs new file mode 100644 index 0000000..3576bd3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenApplyOrder/UpdateTokenApplyOrderIndexInput.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UpdateTokenApplyOrderIndexInput +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string UserAddress { get; set; } + public string Status { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string ChainId { get; set; } + public string ChainName { get; set; } + public string TokenName { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public List StatusChangedRecords { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenConfigDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenConfigDto.cs new file mode 100644 index 0000000..38a37e2 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenConfigDto.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenConfigDto +{ + public string LiquidityInUsd { get; set; } + public int Holders { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenDetailDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenDetailDto.cs new file mode 100644 index 0000000..f30fd77 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenDetailDto.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenDetailResultDto +{ + public string Code { get; set; } + public TokenDetailDto Data { get; set; } +} + +public class TokenDetailDto +{ + public decimal Price { get; set; } + public TokenBaseInfo Token { get; set; } + public string TokenContractAddress { get; set; } + public int MergeHolders { get; set; } + public List ChainIds { get; set; } + public decimal TotalSupply { get; set; } + public decimal CirculatingSupply { get; set; } +} + +public class TokenBaseInfo +{ + public string Name { get; set; } + public string Symbol { get; set; } + public string ImageUrl { get; set; } + public int Decimals { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenPriceDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenPriceDto.cs new file mode 100644 index 0000000..4d7346f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenPriceDto.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenPriceDto +{ + public string Symbol { get; set; } + public decimal TokenAmountInUsd { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenWhitelistDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenWhitelistDto.cs new file mode 100644 index 0000000..c48fe75 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TokenWhitelistDto.cs @@ -0,0 +1,16 @@ + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenInfoDto +{ + public string Name { get; set; } + public string Symbol { get; set; } + public long Decimals { get; set; } + public string Address { get; set; } + public string IssueChainId { get; set; } + public bool IsNativeToken { get; set; } + public string Icon { get; set; } + public bool OnlyFrom { get; set; } + public bool OnlyTo { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TriggerOrderStatusChangeInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TriggerOrderStatusChangeInput.cs new file mode 100644 index 0000000..0537696 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/TriggerOrderStatusChangeInput.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TriggerOrderStatusChangeInput +{ + public string OrderId { get; set; } + public ChainTokenDto ChainIdTokenInfo { get; set; } +} + +public class ChainTokenDto +{ + public string ChainId { get; set; } + public string TokenContractAddress { get; set; } + public int TokenDecimals { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserToken/UserTokenInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserToken/UserTokenInfoDto.cs new file mode 100644 index 0000000..f835790 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserToken/UserTokenInfoDto.cs @@ -0,0 +1,13 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public class UserTokenInfoDto +{ + public string TokenName { get; set; } + public string Symbol { get; set; } + public string TokenImage { get; set; } + public string LiquidityInUsd { get; set; } + public int Holders { get; set; } + public string Status { get; set; } + public decimal TotalSupply { get; set; } + public string ChainId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/AddUserTokenAccessInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/AddUserTokenAccessInfoIndexInput.cs new file mode 100644 index 0000000..d46bfc7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/AddUserTokenAccessInfoIndexInput.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class AddUserTokenAccessInfoIndexInput +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string Address { get; set; } + public string OfficialWebsite { get; set; } + public string OfficialTwitter { get; set; } + public string Title { get; set; } + public string PersonName { get; set; } + public string TelegramHandler { get; set; } + public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UpdateUserTokenAccessInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UpdateUserTokenAccessInfoIndexInput.cs new file mode 100644 index 0000000..8abc185 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UpdateUserTokenAccessInfoIndexInput.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UpdateUserTokenAccessInfoIndexInput +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string Address { get; set; } + public string OfficialWebsite { get; set; } + public string OfficialTwitter { get; set; } + public string Title { get; set; } + public string PersonName { get; set; } + public string TelegramHandler { get; set; } + public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoDto.cs new file mode 100644 index 0000000..b363813 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoDto.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UserTokenAccessInfoDto +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string Address { get; set; } + public string OfficialWebsite { get; set; } + public string OfficialTwitter { get; set; } + public string Title { get; set; } + public string PersonName { get; set; } + public string TelegramHandler { get; set; } + public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoInput.cs new file mode 100644 index 0000000..7fa6c87 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenAccess/UserTokenAccessInfoInput.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using JetBrains.Annotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UserTokenAccessInfoBaseInput +{ + [Required] public string Symbol { get; set; } +} + +public class UserTokenAccessInfoInput : UserTokenAccessInfoBaseInput +{ + [CanBeNull] public string OfficialWebsite { get; set; } + [CanBeNull] public string OfficialTwitter { get; set; } + [CanBeNull] public string Title { get; set; } + [CanBeNull] public string PersonName { get; set; } + [CanBeNull] public string TelegramHandler { get; set; } + [Required] public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenBindingDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenBindingDto.cs new file mode 100644 index 0000000..54674a5 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenAccess/UserTokenBindingDto.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UserTokenBindingDto +{ + [Required] public string BindingId { get; set; } + [Required] public string ThirdTokenId { get; set; } + public string TokenContractAddress { get; set; } + [Required] public string MintToAddress { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddPoolLiquidityInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddPoolLiquidityInfoIndexInput.cs new file mode 100644 index 0000000..3e43c7c --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddPoolLiquidityInfoIndexInput.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class AddPoolLiquidityInfoIndexInput +{ + public Guid Id { get; set; } + public Guid TokenId { get; set; } + public string ChainId { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddUserLiquidityInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddUserLiquidityInfoIndexInput.cs new file mode 100644 index 0000000..04e4175 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/AddUserLiquidityInfoIndexInput.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class AddUserLiquidityInfoIndexInput +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public string Provider { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolDetailInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolDetailInput.cs new file mode 100644 index 0000000..9518d77 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolDetailInput.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; +using JetBrains.Annotations; + +namespace AElf.CrossChainServer.TokenPool; + +public class GetPoolDetailInput +{ + [CanBeNull] public string Address { get; set; } + [Required] public string Token { get; set; } + [Required] public string ChainId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolLiquidityInfosInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolLiquidityInfosInput.cs new file mode 100644 index 0000000..8cba55d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolLiquidityInfosInput.cs @@ -0,0 +1,10 @@ +using JetBrains.Annotations; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public class GetPoolLiquidityInfosInput : PagedAndSortedResultRequestDto +{ + [CanBeNull] public string ChainId { get; set; } + [CanBeNull] public string Token { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolListInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolListInput.cs new file mode 100644 index 0000000..dc1b7c8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetPoolListInput.cs @@ -0,0 +1,9 @@ +using JetBrains.Annotations; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public class GetPoolListInput : PagedAndSortedResultRequestDto +{ + [CanBeNull] public string Addresses { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetUserLiquidityInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetUserLiquidityInput.cs new file mode 100644 index 0000000..e190b4a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/GetUserLiquidityInput.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using JetBrains.Annotations; + +namespace AElf.CrossChainServer.TokenPool; + +public class GetUserLiquidityInput +{ + [Required] public List Providers { get; set; } + [CanBeNull] public string ChainId { get; set; } + [CanBeNull] public string Symbol { get; set; } + [CanBeNull] public string TokenAddress { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/ILiquidityAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/ILiquidityAppService.cs new file mode 100644 index 0000000..a4340a8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/ILiquidityAppService.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public interface ILiquidityAppService +{ + Task GetPoolOverviewAsync([CanBeNull] string addresses); + + Task> GetPoolListAsync(GetPoolListInput input); + Task GetPoolDetailAsync(GetPoolDetailInput input); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IPoolLiquidityInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IPoolLiquidityInfoAppService.cs new file mode 100644 index 0000000..3f85959 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IPoolLiquidityInfoAppService.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public interface IPoolLiquidityInfoAppService +{ + Task> GetPoolLiquidityInfosAsync(GetPoolLiquidityInfosInput input); + Task AddLiquidityAsync(PoolLiquidityInfoInput input); + Task RemoveLiquidityAsync(PoolLiquidityInfoInput input); + Task AddIndexAsync(AddPoolLiquidityInfoIndexInput input); + Task UpdateIndexAsync(UpdatePoolLiquidityInfoIndexInput input); + + Task SyncPoolLiquidityInfoFromChainAsync(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IUserLiquidityInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IUserLiquidityInfoAppService.cs new file mode 100644 index 0000000..61f85f3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/IUserLiquidityInfoAppService.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenPool; + +public interface IUserLiquidityInfoAppService +{ + Task> GetUserLiquidityInfosAsync(GetUserLiquidityInput input); + Task AddUserLiquidityAsync(UserLiquidityInfoInput input); + Task RemoveUserLiquidityAsync(UserLiquidityInfoInput input); + Task AddIndexAsync(AddUserLiquidityInfoIndexInput input); + Task UpdateIndexAsync(UpdateUserLiquidityInfoIndexInput input); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolInfoDto.cs new file mode 100644 index 0000000..60a8680 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolInfoDto.cs @@ -0,0 +1,13 @@ +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolInfoDto +{ + public TokenDto Token { get; set; } + public string ChainId { get; set; } + public decimal? MyTvlInUsd { get; set; } + public decimal TotalTvlInUsd { get; set; } + public decimal TokenPrice { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityDto.cs new file mode 100644 index 0000000..2eab204 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityDto.cs @@ -0,0 +1,10 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityDto +{ + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityIndexDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityIndexDto.cs new file mode 100644 index 0000000..6c29618 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityIndexDto.cs @@ -0,0 +1,12 @@ +using System; +using AElf.CrossChainServer.Tokens; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityIndexDto : EntityDto +{ + public string ChainId { get; set; } + public TokenDto TokenInfo { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityInfoInput.cs new file mode 100644 index 0000000..cb20a8e --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquidityInfoInput.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityInfoInput +{ + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public decimal Liquidity { get; set; } + public string Provider { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs new file mode 100644 index 0000000..ade80d7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquiditySyncOptions +{ + public bool IsSyncEnabled { get; set; } = false; + public Dictionary> Token { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolOverviewDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolOverviewDto.cs new file mode 100644 index 0000000..fa566c3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolOverviewDto.cs @@ -0,0 +1,9 @@ +namespace AElf.CrossChainServer.TokenPool; + +public class PoolOverviewDto +{ + public decimal TotalTvlInUsd { get; set; } + public decimal? MyTotalTvlInUsd { get; set; } + public long PoolCount { get; set; } + public long TokenCount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdatePoolLiquidityInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdatePoolLiquidityInfoIndexInput.cs new file mode 100644 index 0000000..a991317 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdatePoolLiquidityInfoIndexInput.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UpdatePoolLiquidityInfoIndexInput +{ + public Guid Id { get; set; } + public Guid TokenId { get; set; } + public string ChainId { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdateUserLiquidityInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdateUserLiquidityInfoIndexInput.cs new file mode 100644 index 0000000..b73540d --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UpdateUserLiquidityInfoIndexInput.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UpdateUserLiquidityInfoIndexInput +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public string Provider { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityDto.cs new file mode 100644 index 0000000..9239369 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityDto.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityDto +{ + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public string Provider { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityIndexDto.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityIndexDto.cs new file mode 100644 index 0000000..992a23f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityIndexDto.cs @@ -0,0 +1,13 @@ +using System; +using AElf.CrossChainServer.Tokens; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityIndexDto : EntityDto +{ + public string Provider { get; set; } + public string ChainId { get; set; } + public TokenDto TokenInfo { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityInfoInput.cs new file mode 100644 index 0000000..a399557 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/UserLiquidityInfoInput.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityInfoInput +{ + public string ChainId { get; set; } + public Guid TokenId { get; set; } + public string Provider { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPrice/ITokenPriceProvider.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPrice/ITokenPriceProvider.cs new file mode 100644 index 0000000..5148a55 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPrice/ITokenPriceProvider.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenPrice; + +public interface ITokenPriceProvider +{ + Task GetPriceAsync(string pair); + Task GetHistoryPriceAsync(string pair, string dateTime); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Tokens/GetTokenInput.cs b/src/AElf.CrossChainServer.Application.Contracts/Tokens/GetTokenInput.cs new file mode 100644 index 0000000..7c39dcb --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Tokens/GetTokenInput.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.Tokens; + +public class GetTokenInput +{ + [MaxLength(length:20)] + public string ChainId { get; set; } + [MaxLength(length:80)] + public string Address { get; set; } + [MaxLength(length:30)] + public string Symbol { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Tokens/ITokenAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Tokens/ITokenAppService.cs new file mode 100644 index 0000000..ad9bf8a --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Tokens/ITokenAppService.cs @@ -0,0 +1,12 @@ +using System; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Tokens +{ + public interface ITokenAppService + { + Task GetAsync(Guid id); + Task GetAsync(GetTokenInput input); + Task CreateAsync(TokenCreateInput input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenCreateInput.cs b/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenCreateInput.cs new file mode 100644 index 0000000..75da00f --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenCreateInput.cs @@ -0,0 +1,9 @@ +namespace AElf.CrossChainServer.Tokens +{ + public class TokenCreateInput:InputBase + { + public string Address { get; set; } + public string Symbol { get; set; } + public int Decimals { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenDto.cs new file mode 100644 index 0000000..e9c6576 --- /dev/null +++ b/src/AElf.CrossChainServer.Application.Contracts/Tokens/TokenDto.cs @@ -0,0 +1,18 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Tokens +{ + public class TokenDto : EntityDto + { + public string ChainId { get; set; } + public string Address { get; set; } + public string Symbol { get; set; } + public int Decimals { get; set; } + public int IssueChainId { get; set; } + public string Owner { get; set; } + public string Icon { get; set; } + public bool IsBurnable { get; set; } + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/AElf.CrossChainServer.Application.csproj b/src/AElf.CrossChainServer.Application/AElf.CrossChainServer.Application.csproj new file mode 100644 index 0000000..7e4e809 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/AElf.CrossChainServer.Application.csproj @@ -0,0 +1,38 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.Application/AccountOptions.cs b/src/AElf.CrossChainServer.Application/AccountOptions.cs new file mode 100644 index 0000000..a52e59e --- /dev/null +++ b/src/AElf.CrossChainServer.Application/AccountOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer; + +public class AccountOptions +{ + public Dictionary PrivateKeys { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/ApiKeyOptions.cs b/src/AElf.CrossChainServer.Application/ApiKeyOptions.cs new file mode 100644 index 0000000..3eafee7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/ApiKeyOptions.cs @@ -0,0 +1,7 @@ + +namespace AElf.CrossChainServer; + +public class ApiKeyOptions +{ + public string TonIndex { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/BlockConfirmationOptions.cs b/src/AElf.CrossChainServer.Application/BlockConfirmationOptions.cs new file mode 100644 index 0000000..10383fc --- /dev/null +++ b/src/AElf.CrossChainServer.Application/BlockConfirmationOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer; + +public class BlockConfirmationOptions +{ + public Dictionary ConfirmationCount { get; set; } = new(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/ChainApiOptions.cs b/src/AElf.CrossChainServer.Application/ChainApiOptions.cs new file mode 100644 index 0000000..c9ed7d1 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/ChainApiOptions.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer +{ + public class ChainApiOptions + { + public Dictionary ChainNodeApis { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/AElfClientFactory.cs b/src/AElf.CrossChainServer.Application/Chains/AElfClientFactory.cs new file mode 100644 index 0000000..1625088 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/AElfClientFactory.cs @@ -0,0 +1,30 @@ +using System.Collections.Concurrent; +using AElf.Client.Service; +using Microsoft.Extensions.Options; + +namespace AElf.CrossChainServer.Chains +{ + public class AElfClientFactory : IBlockchainClientFactory + { + private readonly ChainApiOptions _chainApiOptions; + private readonly ConcurrentDictionary _clientDic; + + public AElfClientFactory(IOptionsSnapshot apiOptions) + { + _chainApiOptions = apiOptions.Value; + _clientDic = new ConcurrentDictionary(); + } + + public AElfClient GetClient(string chainId) + { + if (_clientDic.TryGetValue(chainId, out var client)) + { + return client; + } + + client = new AElfClient(_chainApiOptions.ChainNodeApis[chainId]); + _clientDic[chainId] = client; + return client; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/AElfClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/AElfClientProvider.cs new file mode 100644 index 0000000..1ddf24e --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/AElfClientProvider.cs @@ -0,0 +1,163 @@ +using System; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.Client.Service; +using AElf.CrossChainServer.Tokens; +using AElf.Types; +using Google.Protobuf; +using Microsoft.Extensions.Options; +using Nethereum.ABI.FunctionEncoding.Attributes; +using GetTokenInfoInput = AElf.Client.MultiToken.GetTokenInfoInput; + +namespace AElf.CrossChainServer.Chains +{ + public class AElfClientProvider : IBlockchainClientProvider + { + protected readonly IBlockchainClientFactory BlockchainClientFactory; + private readonly AccountOptions _accountOptions; + + public AElfClientProvider(IBlockchainClientFactory blockchainClientFactory, + IOptionsSnapshot accountOptions) + { + BlockchainClientFactory = blockchainClientFactory; + _accountOptions = accountOptions.Value; + } + + public BlockchainType ChainType { get; } = BlockchainType.AElf; + + public async Task GetTokenAsync(string chainId, string address, string symbol) + { + var client = BlockchainClientFactory.GetClient(chainId); + if (address.IsNullOrWhiteSpace()) + { + address = (await client.GetContractAddressByNameAsync( + HashHelper.ComputeFrom("AElf.ContractNames.Token"))).ToBase58(); + } + + var token = await GetTokenInfoAsync(chainId, address, symbol); + if (token == null) + { + return null; + } + + return new TokenDto + { + ChainId = chainId, + Address = address, + Decimals = token.Decimals, + Symbol = token.Symbol, + IssueChainId = token.IssueChainId, + IsBurnable = token.IsBurnable + }; + } + + public virtual async Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + var client = BlockchainClientFactory.GetClient(chainId); + var block = await client.GetBlockByHeightAsync(height,includeTransactions); + + return new BlockDto + { + BlockHash = block.BlockHash, + Header = new BlockHeaderDto + { + Height = block.Header.Height, + Time = block.Header.Time, + ChainId = block.Header.ChainId, + PreviousBlockHash = block.Header.PreviousBlockHash + }, + Body = new BlockBodyDto + { + Transactions = block.Body.Transactions, + TransactionsCount = block.Body.TransactionsCount + } + }; + } + + public Task GetChainHeightAsync(string chainId) + { + throw new NotImplementedException(); + } + + public virtual async Task GetChainStatusAsync(string chainId) + { + var client = BlockchainClientFactory.GetClient(chainId); + var status = await client.GetChainStatusAsync(); + return new ChainStatusDto + { + ChainId = chainId, + BlockHeight = status.BestChainHeight, + ConfirmedBlockHeight = status.LastIrreversibleBlockHeight + }; + } + + public async Task GetTransactionResultAsync(string chainId, string transactionId) + { + var client = BlockchainClientFactory.GetClient(chainId); + var result = await client.GetTransactionResultAsync(transactionId); + + return new TransactionResultDto + { + ChainId = chainId, + IsMined = result.Status == TransactionResultStatus.Mined.ToString().ToUpper(), + IsFailed = result.Status != TransactionResultStatus.Mined.ToString().ToUpper() && + result.Status != TransactionResultStatus.Pending.ToString().ToUpper(), + BlockHeight = result.BlockNumber, + BlockHash = result.BlockHash, + Transaction = result.Transaction, + Logs = result.Logs + }; + } + + public async Task GetTokenInfoAsync(string chainId, string address, string symbol) + { + var client = BlockchainClientFactory.GetClient(chainId); + + var paramGetBalance = new GetTokenInfoInput + { + Symbol = symbol + }; + var transactionGetToken = + await client.GenerateTransactionAsync(client.GetAddressFromPrivateKey(GetPrivateKey(chainId)), address, + "GetTokenInfo", + paramGetBalance); + var txWithSignGetToken = client.SignTransaction(GetPrivateKey(chainId), transactionGetToken); + var transactionGetTokenResult = await client.ExecuteTransactionAsync(new ExecuteTransactionDto + { + RawTransaction = txWithSignGetToken.ToByteArray().ToHex() + }); + var token = + AElf.Contracts.MultiToken.TokenInfo.Parser.ParseFrom( + ByteArrayHelper.HexStringToByteArray(transactionGetTokenResult)); + + if (token.Symbol != symbol) + { + return null; + } + + return token; + } + + public async Task GetMerklePathAsync(string chainId, string txId) + { + var client = BlockchainClientFactory.GetClient(chainId); + return await client.GetMerklePathByTransactionIdAsync(txId); + } + + public Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight) + { + throw new NotImplementedException(); + } + + public Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, long startHeight, long endHeight, + string logSignature) where TEventDTO : IEventDTO, new() + { + throw new NotImplementedException(); + } + + protected string GetPrivateKey(string chainId) + { + return _accountOptions.PrivateKeys[chainId]; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/BlockchainAppService.cs b/src/AElf.CrossChainServer.Application/Chains/BlockchainAppService.cs new file mode 100644 index 0000000..4b02115 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/BlockchainAppService.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Chains.Ton; +using AElf.CrossChainServer.Contracts.Bridge; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using Microsoft.Extensions.Options; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Volo.Abp; + +namespace AElf.CrossChainServer.Chains +{ + [RemoteService(IsEnabled = false)] + public class BlockchainAppService : CrossChainServerAppService, IBlockchainAppService + { + private readonly IBlockchainClientProviderFactory _blockchainClientProviderFactory; + private readonly ITonIndexProvider _tonIndexProvider; + private BridgeContractOptions _bridgeContractOptions; + + public BlockchainAppService(IBlockchainClientProviderFactory blockchainClientProviderFactory, + ITonIndexProvider tonIndexProvider, IOptionsSnapshot bridgeContractOptions) + { + _blockchainClientProviderFactory = blockchainClientProviderFactory; + _tonIndexProvider = tonIndexProvider; + _bridgeContractOptions = bridgeContractOptions.Value; + } + + public async Task GetTokenInfoAsync(string chainId, string address, string symbol) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetTokenAsync(chainId, address, symbol); + } + + public async Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetBlockByHeightAsync(chainId, height, includeTransactions); + } + + public async Task GetChainHeightAsync(string chainId) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return 0; + } + + return await provider.GetChainHeightAsync(chainId); + } + + [ExceptionHandler(typeof(Exception), Message = "[Bridge chain] Get chain status failed.", + ReturnDefault = ReturnDefault.New, LogTargets = new[] { "chainId" })] + public virtual async Task GetChainStatusAsync(string chainId) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetChainStatusAsync(chainId); + } + + [ExceptionHandler(typeof(Exception), Message = "[Bridge chain] Get transaction result failed.", + ReturnDefault = ReturnDefault.New, LogTargets = new[] { "chainId", "transactionId" })] + public async Task GetTransactionResultAsync(string chainId, string transactionId) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetTransactionResultAsync(chainId, transactionId); + } + + public async Task GetMerklePathAsync(string chainId, string transactionId) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetMerklePathAsync(chainId, transactionId); + } + + public Task> GetTonTransactionAsync(GetTonTransactionInput input) + { + return _tonIndexProvider.GetTonTransactionAsync(input); + } + + public Task GetTonUserFriendlyAddressAsync(string chainId, string address) + { + return _tonIndexProvider.GetTonUserFriendlyAddressAsync(chainId, address); + } + + public async Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, + long endHeight) + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetContractLogsAsync(chainId, contractAddress, startHeight, endHeight); + } + + public async Task> GetContractLogsAndParseAsync(string chainId, + string contractAddress, long startHeight, long endHeight, string logSignature) + where TEventDTO : IEventDTO, new() + { + var provider = await _blockchainClientProviderFactory.GetBlockChainClientProviderAsync(chainId); + if (provider == null) + { + return null; + } + + return await provider.GetContractLogsAndParseAsync(chainId, contractAddress, startHeight, + endHeight,logSignature); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/BlockchainClientProviderFactory.cs b/src/AElf.CrossChainServer.Application/Chains/BlockchainClientProviderFactory.cs new file mode 100644 index 0000000..a708417 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/BlockchainClientProviderFactory.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Chains +{ + public class BlockchainClientProviderFactory : IBlockchainClientProviderFactory, ITransientDependency + { + private readonly IEnumerable _blockchainClientProviders; + private readonly IChainAppService _chainAppService; + + public BlockchainClientProviderFactory(IEnumerable blockchainClientProviders, + IChainAppService chainAppService) + { + _blockchainClientProviders = blockchainClientProviders; + _chainAppService = chainAppService; + } + + public async Task GetBlockChainClientProviderAsync(string chainId) + { + var chain = await _chainAppService.GetAsync(chainId); + return chain == null ? null : _blockchainClientProviders.First(o => o.ChainType == chain.Type); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/ChainAppService.cs b/src/AElf.CrossChainServer.Application/Chains/ChainAppService.cs new file mode 100644 index 0000000..7347fe3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/ChainAppService.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.ExceptionHandler; +using AElf.Indexing.Elasticsearch; +using Nest; +using Serilog; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; + +namespace AElf.CrossChainServer.Chains +{ + [RemoteService(IsEnabled = false)] + public class ChainAppService : CrossChainServerAppService, IChainAppService + { + private readonly IChainRepository _chainRepository; + private readonly INESTRepository _chainIndexRepository; + + public ChainAppService(IChainRepository chainRepository, + INESTRepository chainIndexRepository) + { + _chainRepository = chainRepository; + _chainIndexRepository = chainIndexRepository; + } + + [ExceptionHandler(typeof(Exception), typeof(EntityNotFoundException), + Message = "Chain not found.", ReturnDefault = ReturnDefault.Default, + LogTargets = new[] {"id"})] + public virtual async Task GetAsync(string id) + { + var chain = await _chainRepository.GetAsync(id); + return ObjectMapper.Map(chain); + } + + public async Task GetByNameAsync(string name) + { + var chain = await _chainRepository.FindAsync(o => o.Name == name); + return ObjectMapper.Map(chain); + } + + [ExceptionHandler(typeof(Exception), typeof(EntityNotFoundException), + Message = "Chain not found.", ReturnDefault = ReturnDefault.Default, + LogTargets = new[] {"id"})] + public virtual async Task GetByAElfChainIdAsync(int aelfChainId) + { + var chain = await _chainRepository.FindAsync(o => o.AElfChainId == aelfChainId); + return ObjectMapper.Map(chain); + } + + public async Task> GetListAsync(GetChainsInput input) + { + var mustQuery = new List, QueryContainer>>(); + if (input.Type.HasValue) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Type).Value(input.Type.Value))); + } + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var list = await _chainIndexRepository.GetListAsync(Filter); + + return new ListResultDto + { + Items = ObjectMapper.Map, List>(list.Item2) + }; + } + + public async Task HandleChainException(Exception ex, string id) + { + Log.ForContext("chainId", id).Error(ex, + "Chain not found.{id}", id); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return, + ReturnValue = null + }; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/EvmClientFactory.cs b/src/AElf.CrossChainServer.Application/Chains/EvmClientFactory.cs new file mode 100644 index 0000000..e652783 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/EvmClientFactory.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.Options; +using Serilog; + +namespace AElf.CrossChainServer.Chains +{ + public class EvmClientFactory : IBlockchainClientFactory + { + private readonly ChainApiOptions _chainApiOptions; + + public EvmClientFactory(IOptionsSnapshot apiOptions) + { + _chainApiOptions = apiOptions.Value; + } + + public Nethereum.Web3.Web3 GetClient(string chainId) + { + Log.ForContext("chainId", chainId).Information("Get chain api:{api}", _chainApiOptions.ChainNodeApis[chainId]); + return new Nethereum.Web3.Web3(_chainApiOptions.ChainNodeApis[chainId]); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs new file mode 100644 index 0000000..5556804 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs @@ -0,0 +1,175 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Options; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.BlockchainProcessing.BlockStorage.Entities.Mapping; +using Nethereum.Contracts; +using Nethereum.Contracts.Standards.ERC20.ContractDefinition; +using Nethereum.RPC.Eth.DTOs; +using Serilog; + +namespace AElf.CrossChainServer.Chains +{ + public class EvmClientProvider : IBlockchainClientProvider + { + protected readonly IBlockchainClientFactory BlockchainClientFactory; + public IOptionsSnapshot BlockConfirmationOptions { get; set; } + + public EvmClientProvider(IBlockchainClientFactory blockchainClientFactory) + { + BlockchainClientFactory = blockchainClientFactory; + } + + public BlockchainType ChainType { get; } = BlockchainType.Evm; + + public async Task GetTokenAsync(string chainId, string address, string symbol) + { + var client = BlockchainClientFactory.GetClient(chainId); + var contractHandler = client.Eth.GetContractHandler(address); + + return new TokenDto + { + ChainId = chainId, + Address = address, + Decimals = await contractHandler.QueryAsync(), + Symbol = await contractHandler.QueryAsync() + }; + } + + public Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + throw new NotImplementedException(); + } + + public async Task GetChainHeightAsync(string chainId) + { + var client = BlockchainClientFactory.GetClient(chainId); + var latestBlockNumber = await client.Eth.Blocks.GetBlockNumber.SendRequestAsync(); + return latestBlockNumber.ToLong(); + } + + public async Task GetChainStatusAsync(string chainId) + { + var client = BlockchainClientFactory.GetClient(chainId); + var latestBlockNumber = await client.Eth.Blocks.GetBlockNumber.SendRequestAsync(); + var blockNumber = latestBlockNumber.ToLong(); + + return new ChainStatusDto + { + ChainId = chainId, + BlockHeight = blockNumber, + ConfirmedBlockHeight = blockNumber - BlockConfirmationOptions.Value.ConfirmationCount[chainId] + }; + } + + public async Task GetTransactionResultAsync(string chainId, string transactionId) + { + var client = BlockchainClientFactory.GetClient(chainId); + try + { + var transaction = await client.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionId); + if (transaction == null) + { + return null; + } + return new TransactionResultDto + { + ChainId = chainId, + IsMined = transaction.Status.Value == 1, + IsFailed = transaction.Status.Value == 0, + BlockHash = transaction.BlockHash, + BlockHeight = transaction.BlockNumber.ToLong(), + }; + } + catch (Exception e) + { + Log.Error("Error getting transaction result: {error}", e.Message); + return new TransactionResultDto(); + } + } + + public Task GetMerklePathAsync(string chainId, string txId) + { + throw new NotImplementedException(); + } + + public async Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, + long endHeight) + { + Log.Debug("Get contract logs from {startHeight} to {endHeight}", startHeight, endHeight); + var client = BlockchainClientFactory.GetClient(chainId); + var filterLogs = await client.Eth.Filters.GetLogs.SendRequestAsync(new NewFilterInput + { + Address = new[] { contractAddress }, + FromBlock = new BlockParameter((ulong)startHeight), + ToBlock = new BlockParameter((ulong)endHeight) + }); + var logs = filterLogs.Select(l => new FilterLog + { + Address = l.Address, + BlockHash = l.BlockHash, + BlockNumber = l.BlockNumber.ToLong(), + Data = l.Data, + LogIndex = l.LogIndex.ToLong(), + Topics = l.Topics, + TransactionHash = l.TransactionHash, + TransactionIndex = l.TransactionIndex.ToLong(), + Type = l.Type, + Removed = l.Removed + }).ToList(); + return new FilterLogsDto + { + Logs = logs + }; + } + + public async Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, long startHeight, + long endHeight,string logSignature) where TEventDTO : IEventDTO, new() + { + Log.Debug("Get contract logs from {startHeight} to {endHeight}", startHeight, endHeight); + var client = BlockchainClientFactory.GetClient(chainId); + var filterLogs = await client.Eth.Filters.GetLogs.SendRequestAsync(new NewFilterInput + { + Address = [contractAddress], + FromBlock = new BlockParameter((ulong)startHeight), + ToBlock = new BlockParameter((ulong)endHeight) + }); + var result = new FilterLogsAndEventsDto + { + Events = [] + }; + foreach (var filterLog in filterLogs) + { + if (filterLog.Topics[0]?.ToString()?.Substring(2) != logSignature) + { + continue; + } + + var eventDto = Event.DecodeEvent(filterLog); + // handle eventDto + result.Events.Add(new EventLogs + { + Event = eventDto.Event, + Log = new FilterLog + { + Address = eventDto.Log.Address, + BlockHash = eventDto.Log.BlockHash, + BlockNumber = eventDto.Log.BlockNumber.ToLong(), + Data = eventDto.Log.Data, + LogIndex = eventDto.Log.LogIndex.ToLong(), + Topics = eventDto.Log.Topics, + TransactionHash = eventDto.Log.TransactionHash, + TransactionIndex = eventDto.Log.TransactionIndex.ToLong(), + Type = eventDto.Log.Type, + Removed = eventDto.Log.Removed + } + }); + } + + return result; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientFactory.cs b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientFactory.cs new file mode 100644 index 0000000..25efa97 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientFactory.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Chains +{ + public interface IBlockchainClientFactory + where T : class + { + T GetClient(string chainId); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProvider.cs new file mode 100644 index 0000000..97b4677 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProvider.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Chains +{ + public interface IBlockchainClientProvider + { + BlockchainType ChainType { get; } + Task GetTokenAsync(string chainId, string address, string symbol); + Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false); + Task GetChainHeightAsync(string chainId); + Task GetChainStatusAsync(string chainId); + Task GetTransactionResultAsync(string chainId, string transactionId); + Task GetMerklePathAsync(string chainId, string txId); + Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight); + + Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, + long startHeight, + long endHeight, string logSignature) where TEventDTO : IEventDTO, new(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProviderFactory.cs b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProviderFactory.cs new file mode 100644 index 0000000..86a1176 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/IBlockchainClientProviderFactory.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Chains +{ + public interface IBlockchainClientProviderFactory + { + Task GetBlockChainClientProviderAsync(string chainId); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/ITonIndexClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/ITonIndexClientProvider.cs new file mode 100644 index 0000000..9a44b2a --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/ITonIndexClientProvider.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Concurrent; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.Client.Service; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Chains; + +public interface ITonIndexClientProvider +{ + Task GetAsync(string chainId, string path); +} + +public class TonIndexClientProvider : ITonIndexClientProvider, ISingletonDependency +{ + private readonly ChainApiOptions _chainApiOptions; + private readonly IHttpClientFactory _clientFactory; + private readonly ApiKeyOptions _apiKeyOptions; + + public TonIndexClientProvider(IOptionsSnapshot apiOptions, IHttpClientFactory clientFactory,IOptionsSnapshot apiKeyOptions) + { + _clientFactory = clientFactory; + _chainApiOptions = apiOptions.Value; + _apiKeyOptions = apiKeyOptions.Value; + } + + private System.Net.Http.HttpClient GetClient() + { + var client = _clientFactory.CreateClient(); + if (!string.IsNullOrEmpty(_apiKeyOptions.TonIndex)) + { + client.DefaultRequestHeaders.Add("X-Api-Key", _apiKeyOptions.TonIndex); + } + return client; + } + + public async Task GetAsync(string chainId, string path) + { + var client = GetClient(); + var uri = _chainApiOptions.ChainNodeApis[chainId].TrimEnd('/') + path; + var resp = await client.GetAsync(uri); + return await resp.Content.DeserializeSnakeCaseAsync(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/JettonDto.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/JettonDto.cs new file mode 100644 index 0000000..1f435c7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/JettonDto.cs @@ -0,0 +1,9 @@ +namespace AElf.CrossChainServer.Chains.Ton; + +public class JettonDto +{ + public string Name { get; set; } + public string Description { get; set; } + public string Image { get; set; } + public string Symbol { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/JettonMasterDto.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/JettonMasterDto.cs new file mode 100644 index 0000000..3b43e4c --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/JettonMasterDto.cs @@ -0,0 +1,22 @@ + +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains.Ton; + +public class JettonMasterDto +{ + public List JettonMasters { get; set; } +} + +public class JettonMaster +{ + public string Address { get; set; } + public JettonContent JettonContent { get; set; } +} + +public class JettonContent +{ + public string Decimals { get; set; } + public string Uri { get; set; } + public string Symbol { get; set; } = null; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/TonAddressBooks.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/TonAddressBooks.cs new file mode 100644 index 0000000..5b949dc --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/TonAddressBooks.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace AElf.CrossChainServer.Chains.Ton; + +public class TonAddressBooks +{ + // [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } +} + +public class ResponseItem +{ + [JsonPropertyName("domain")] + public string Domain { get; set; } + + [JsonPropertyName("user_friendly")] + public string UserFriendly { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/TonApiTransaction.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/TonApiTransaction.cs new file mode 100644 index 0000000..15a496c --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/TonApiTransaction.cs @@ -0,0 +1,116 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains.Ton; + + +public class TonApiTransactions +{ + public List Transactions { get; set; } +} + +public class TonApiTransaction +{ + public string Hash { get; set; } + public long Lt { get; set; } + public TonApiAccount Account { get; set; } + public bool Success { get; set; } + public long Utime { get; set; } + public string OrigStatus { get; set; } + public string EndStatus { get; set; } + public long TotalFees { get; set; } + public long EndBalance { get; set; } + public string TransactionType { get; set; } + public string StateUpdateOld { get; set; } + public string StateUpdateNew { get; set; } + public TonapiMessage InMsg { get; set; } + public List OutMsg { get; set; } + public string Block { get; set; } + public string PrevTransHash { get; set; } + public long PrevTransLt { get; set; } + public TonapiComputePhase ComputePhase { get; set; } + public TonapiStoragePhase StoragePhase { get; set; } + public TonapiCreditPhase CreditPhase { get; set; } + public TonapiActionPhase ActionPhase { get; set; } + public string BouncePhase { get; set; } + public bool Aborted { get; set; } + public bool Destroyed { get; set; } + public string Raw { get; set; } +} + +public class TonApiAccount +{ + public string Address { get; set; } + public string Name { get; set; } + public bool IsScam { get; set; } + public string Icon { get; set; } + public bool IsWallet { get; set; } +} + +public class TonapiMessage +{ + public string MsgType { get; set; } + public long CreatedLt { get; set; } + public bool IhrDisabled { get; set; } + public bool Bounce { get; set; } + public bool Bounced { get; set; } + public long Value { get; set; } + public long FwdFee { get; set; } + public long IhrFee { get; set; } + public TonApiAccount Destination { get; set; } + public TonApiAccount Source { get; set; } + public long ImportFee { get; set; } + public long CreatedAt { get; set; } + public string OpCode { get; set; } + public Init Init { get; set; } + public string Hash { get; set; } + public string RawBody { get; set; } + public string DecodedOpName { get; set; } + public DecodedBody DecodedBody { get; set; } +} + +public class Init +{ + public string Boc { get; set; } + public List Interfaces { get; set; } +} + +public class TonapiComputePhase +{ + public bool Skipped { get; set; } + public string SkipReason { get; set; } + public bool Success { get; set; } + public long GasFees { get; set; } + public long GasUsed { get; set; } + public long VmSteps { get; set; } + public int ExitCode { get; set; } + public string ExitCodeDescription { get; set; } +} + +public class TonapiStoragePhase +{ + public long FeesCollected { get; set; } + public long FeesDue { get; set; } + public string StatusChange { get; set; } +} + +public class TonapiCreditPhase +{ + public long FeesCollected { get; set; } + public long Credit { get; set; } +} + +public class TonapiActionPhase +{ + public bool Success { get; set; } + public int ResultCode { get; set; } + public int TotalActions { get; set; } + public int SkippedActions { get; set; } + public long FwdFees { get; set; } + public long TotalFees { get; set; } + public string ResultCodeDescription { get; set; } +} + +public class DecodedBody +{ + public string Payload { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/TonClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/TonClientProvider.cs new file mode 100644 index 0000000..730704e --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/TonClientProvider.cs @@ -0,0 +1,90 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Chains.Ton +{ + public class TonClientProvider : IBlockchainClientProvider + { + protected readonly ITonIndexClientProvider IndexClientProvider; + private readonly IHttpClientFactory _clientFactory; + + public TonClientProvider(ITonIndexClientProvider indexClientProvider, + IHttpClientFactory clientFactory) + { + IndexClientProvider = indexClientProvider; + _clientFactory = clientFactory; + } + + public BlockchainType ChainType { get; } = BlockchainType.Tvm; + + public async Task GetTokenAsync(string chainId, string address, string symbol) + { + var path = $"/jetton/masters?address={address}&limit=1&offset=0"; + var jettonMaster = await IndexClientProvider.GetAsync(chainId, path); + if (jettonMaster.JettonMasters[0].JettonContent.Uri != null) + { + var jetton = await GetJettonAsync(jettonMaster.JettonMasters[0].JettonContent.Uri); + symbol = jetton.Symbol; + } + else + { + symbol = jettonMaster.JettonMasters[0].JettonContent.Symbol; + } + + return new TokenDto + { + ChainId = chainId, + Address = address, + Decimals = int.Parse(jettonMaster.JettonMasters[0].JettonContent.Decimals), + Symbol = symbol + }; + } + + private async Task GetJettonAsync(string uri) + { + var client = _clientFactory.CreateClient(); + var response = await client.GetAsync(uri); + return await response.Content.DeserializeSnakeCaseAsync(); + } + + public Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + throw new NotImplementedException(); + } + + public async Task GetChainHeightAsync(string chainId) + { + throw new NotImplementedException(); + } + + public async Task GetChainStatusAsync(string chainId) + { + throw new NotImplementedException(); + } + + public Task GetTransactionResultAsync(string chainId, string transactionId) + { + throw new NotImplementedException(); + } + + public Task GetMerklePathAsync(string chainId, string txId) + { + throw new NotImplementedException(); + } + + public Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight) + { + throw new NotImplementedException(); + } + + public Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, long startHeight, long endHeight, + string logSignature) where TEventDTO : IEventDTO, new() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexProvider.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexProvider.cs new file mode 100644 index 0000000..ed11320 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexProvider.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.Chains.Ton; + +public interface ITonIndexProvider +{ + Task> GetTonTransactionAsync(GetTonTransactionInput input); + Task GetTonUserFriendlyAddressAsync(string chainId,string address); +} + +public class TonIndexProvider : TonClientProvider, ITonIndexProvider, ITransientDependency +{ + private readonly IObjectMapper _objectMapper; + + public TonIndexProvider(ITonIndexClientProvider indexClientProvider, + IHttpClientFactory clientFactory, IObjectMapper objectMapper) : base(indexClientProvider, + clientFactory) + { + _objectMapper = objectMapper; + } + + public async Task> GetTonTransactionAsync(GetTonTransactionInput input) + { + // var path = + // $"/v2/blockchain/accounts/{input.ContractAddress}/transactions?after_lt={input.LatestTransactionLt}&limit=100&sort=asc"; + var path = + $"/transactions?account={input.ContractAddress}&start_lt={input.LatestTransactionLt}&limit=100&offset=0&sort=asc"; + var tonIndexTransactions = await IndexClientProvider.GetAsync(input.ChainId, path); + + return _objectMapper.Map, List>(tonIndexTransactions.Transactions); + } + + public async Task GetTonUserFriendlyAddressAsync(string chainId,string address) + { + var path = $"/addressBook?address={address}"; + var tonUserFriendlyAddress = await IndexClientProvider.GetAsync>(chainId,path); + return tonUserFriendlyAddress == null ? address : tonUserFriendlyAddress[address].UserFriendly; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexTransactions.cs b/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexTransactions.cs new file mode 100644 index 0000000..44ae729 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Chains/Ton/TonIndexTransactions.cs @@ -0,0 +1,211 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Chains.Ton; + +public class TonIndexTransactions +{ + public List Transactions { get; set; } +} + +public class TonIndexTransaction +{ + public string Account { get; set; } + public TonBlockId BlockRef { get; set; } + public string Hash { get; set; } + public TonMessage InMsg { get; set; } + public long McBlockSeqno { get; set; } + public string Lt { get; set; } + public int Now { get; set; } + public string OrigStatus { get; set; } + public List OutMsgs { get; set; } + public string PrevTransHash { get; set; } + public string PrevTransLt { get; set; } + public string TotalFees { get; set; } + public string TraceId { get; set; } +} + +public class AccountState +{ + public string AccountStatus { get; set; } + public string Balance { get; set; } + public string CodeBoc { get; set; } + public string CodeHash { get; set; } + public string DataBoc { get; set; } + public string DataHash { get; set; } + public string FrozenHash { get; set; } + public string Hash { get; set; } +} + +public class TonBlockId +{ + public long Seqno { get; set; } + public string Shard { get; set; } + public int Workchain { get; set; } +} + +public class TonTransactionDescr +{ + public bool Aborted { get; set; } + public ActionPhase Action { get; set; } + public BouncePhase Bounce { get; set; } + public ComputePhase ComputePh { get; set; } + public bool CreditFirst { get; set; } + public CreditPhase CreditPh { get; set; } + public bool Destroyed { get; set; } + public bool Installed { get; set; } + public bool IsTock { get; set; } + public SplitInfo SplitInfo { get; set; } + public StoragePhase StoragePh { get; set; } + public string Type { get; set; } +} + +public class TonMessage +{ + public bool? Bounce { get; set; } + public bool? Bounced { get; set; } + public string CreatedAt { get; set; } + public string CreatedLt { get; set; } + public string Destination { get; set; } + public string FwdFee { get; set; } + public string Hash { get; set; } + public bool? IhrDisabled { get; set; } + public string IhrFee { get; set; } + public string ImportFee { get; set; } + public TonMessageContent InitState { get; set; } + public TonMessageContent MessageContent { get; set; } + public string Opcode { get; set; } + public string Source { get; set; } + public string Value { get; set; } +} + +public class TonMessageContent +{ + public string Body { get; set; } + public TonDecodedContent Decoded { get; set; } + public string Hash { get; set; } +} + +public class TonDecodedContent +{ + public string Comment { get; set; } + public string Type { get; set; } +} + +public class ActionPhase +{ + public string ActionListHash { get; set; } + public int MsgsCreated { get; set; } + public bool NoFunds { get; set; } + public int ResultArg { get; set; } + public int ResultCode { get; set; } + public int SkippedActions { get; set; } + public int SpecActions { get; set; } + public string StatusChange { get; set; } + public bool Success { get; set; } + public int TotActions { get; set; } + public MessageSize TotMsgSize { get; set; } + public string TotalActionFees { get; set; } + public string TotalFwdFees { get; set; } + public bool Valid { get; set; } +} + +public class BouncePhase +{ + public string FwdFees { get; set; } + public string MsgFees { get; set; } + public MessageSize MsgSize { get; set; } + public string ReqFwdFees { get; set; } + public string Type { get; set; } +} + +public class ComputePhase +{ + public bool AccountActivated { get; set; } + public int ExitArg { get; set; } + public int ExitCode { get; set; } + public string GasCredit { get; set; } + public string GasFee { get; set; } + public string GasLimit { get; set; } + public string GasUsed { get; set; } + public int Mode { get; set; } + public bool MsgStateUsed { get; set; } + public string Reason { get; set; } + public bool Skipped { get; set; } + public bool Success { get; set; } + public string VmFinalStateHash { get; set; } + public string VmInitStateHash { get; set; } + public int VmSteps { get; set; } +} + +public class CreditPhase +{ + public string Credit { get; set; } + public string DueFeesCollected { get; set; } +} + +public class SplitInfo +{ + public int AccSplitDepth { get; set; } + public int CurShardPfxLen { get; set; } + public string SiblingAddr { get; set; } + public string ThisAddr { get; set; } +} + +public class StoragePhase +{ + public string StatusChange { get; set; } + public string StorageFeesCollected { get; set; } + public string StorageFeesDue { get; set; } +} + +public class MessageSize +{ + public string Bits { get; set; } + public string Cell { get; set; } +} + +public class TonBlocks +{ + public List Blocks { get; set; } +} + +public class TonBlockInfo +{ + public bool AfterMerge { get; set; } + public bool AfterSplit { get; set; } + public bool BeforeSplit { get; set; } + public string CreatedBy { get; set; } + public string EndLt { get; set; } + public string FileHash { get; set; } + public int Flags { get; set; } + public Int64 GenCatchainSeqno { get; set; } + public string GenUtime { get; set; } + public Int64 GlobalId { get; set; } + public bool KeyBlock { get; set; } + public Int64 MasterRefSeqno { get; set; } + public TonBlockSummaryInfo BlockSummaryInfoRef { get; set; } + public Int64 MinRefMcSeqno { get; set; } + public List PrevBlocks { get; set; } + public Int64 PrevKeyBlockSeqno { get; set; } + public string RandSeed { get; set; } + public string RootHash { get; set; } + public Int64 Seqno { get; set; } + public string Shard { get; set; } + public string StartLt { get; set; } + public int TxCount { get; set; } + public int ValidatorListHashShort { get; set; } + public int Version { get; set; } + public int VertSeqno { get; set; } + public bool VertSeqnoIncr { get; set; } + public bool WantMerge { get; set; } + public bool WantSplit { get; set; } + public int Workchain { get; set; } +} + +public class TonBlockSummaryInfo +{ + public Int64 Seqno { get; set; } + public string Shard { get; set; } + public int Workchain { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs new file mode 100644 index 0000000..a00cbd7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.Client.Service; +using AElf.Contracts.Bridge; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using AElf.Types; +using EBridge.Contracts.TokenPool; +using Google.Protobuf; +using JetBrains.Annotations; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.Domain.Entities; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +public class AElfBridgeContractProvider : AElfClientProvider, IBridgeContractProvider +{ + private readonly ITokenAppService _tokenAppService; + + public AElfBridgeContractProvider(IBlockchainClientFactory blockchainClientFactory, + IOptionsSnapshot accountOptions, ITokenAppService tokenAppService) : base( + blockchainClientFactory, accountOptions) + { + _tokenAppService = tokenAppService; + } + + public Task GetReceiptDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, + string targetChainId) + { + throw new NotImplementedException(); + } + + public Task GetSwapDailyLimitAsync(string chainId, string contractAddress, string swapId) + { + throw new NotImplementedException(); + } + + public Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, string contractAddress, + List tokenIds, + List targetChainIds) + { + throw new NotImplementedException(); + } + + public Task> GetCurrentSwapTokenBucketStatesAsync(string chainId, string contractAddress, + List tokenIds, List fromChainIds) + { + throw new NotImplementedException(); + } + + public async Task> GetPoolLiquidityAsync(string chainId, string contractAddress, + List tokenIds) + { + var client = BlockchainClientFactory.GetClient(chainId); + var result = new List(); + foreach (var tokenId in tokenIds) + { + var tokenInfo = await _tokenAppService.GetAsync(tokenId); + var param = new GetTokenPoolInfoInput + { + TokenSymbol = tokenInfo.Symbol + }; + var transaction = + await client.GenerateTransactionAsync(client.GetAddressFromPrivateKey(GetPrivateKey(chainId)), + contractAddress, + "GetTokenPoolInfo", param); + var txWithSign = client.SignTransaction(GetPrivateKey(chainId), transaction); + var transactionResult = await client.ExecuteTransactionAsync(new ExecuteTransactionDto + { + RawTransaction = txWithSign.ToByteArray().ToHex() + }); + var tokenPoolInfo = TokenPoolInfo.Parser.ParseFrom(ByteArrayHelper.HexStringToByteArray(transactionResult)); + var liquidity = tokenPoolInfo.Liquidity / (decimal)Math.Pow(10, tokenInfo.Decimals); + Log.Debug( + "Get pool liquidity from aelf contract, chainId: {chainId}, tokenId: {tokenId}, liquidity: {liquidity}", + chainId, tokenId, liquidity); + result.Add(new PoolLiquidityDto + { + ChainId = chainId, + TokenId = tokenId, + Liquidity = liquidity + }); + } + + return result; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs new file mode 100644 index 0000000..dfd87f9 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenPool; +using Microsoft.Extensions.Options; +using Volo.Abp; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +[RemoteService(IsEnabled = false)] +public class BridgeContractAppService : CrossChainServerAppService, IBridgeContractAppService +{ + private readonly IBridgeContractProviderFactory _bridgeContractProviderFactory; + private readonly BridgeContractOptions _bridgeContractOptions; + + public BridgeContractAppService(IBridgeContractProviderFactory bridgeContractProviderFactory, + IOptionsSnapshot options) + { + _bridgeContractProviderFactory = bridgeContractProviderFactory; + _bridgeContractOptions = options.Value; + } + + public async Task GetDailyLimitAsync(string chainId, Guid tokenId, string targetChainId) + { + var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); + if (provider == null) + { + return new DailyLimitDto(); + } + + return await provider.GetReceiptDailyLimitAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenId, targetChainId); + } + + public async Task GetSwapDailyLimitAsync(string chainId, string swapId) + { + var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); + if (provider == null) + { + return new DailyLimitDto(); + } + + return await provider.GetSwapDailyLimitAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, swapId); + } + + public async Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, List tokenIds, + List targetChainIds) + { + var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); + if (provider == null) + { + return new List(); + } + + return await provider.GetCurrentReceiptTokenBucketStatesAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenIds, targetChainIds); + } + + public async Task> GetCurrentSwapTokenBucketStatesAsync(string chainId, List tokenIds, + List fromChainIds) + { + var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); + if (provider == null) + { + return new List(); + } + + return await provider.GetCurrentSwapTokenBucketStatesAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenIds, fromChainIds); + } + + public async Task> GetPoolLiquidityAsync(string chainId, string contractAddress, + List tokenIds) + { + var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); + if (provider == null) + { + return new List(); + } + + return await provider.GetPoolLiquidityAsync(chainId, contractAddress, tokenIds); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractOptions.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractOptions.cs new file mode 100644 index 0000000..5611524 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractOptions.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +public class BridgeContractOptions +{ + public Dictionary ContractAddresses { get; set; } +} + +public class BridgeContractAddress +{ + public string BridgeInContract { get; set; } + public string BridgeOutContract { get; set; } + + public string LimiterContract { get; set; } + public string TokenPoolContract { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractProviderFactory.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractProviderFactory.cs new file mode 100644 index 0000000..6582ec6 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractProviderFactory.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.ExceptionHandler; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +public class BridgeContractProviderFactory : IBridgeContractProviderFactory, ITransientDependency +{ + private readonly IEnumerable _blockchainClientProviders; + private readonly IChainAppService _chainAppService; + + public BridgeContractProviderFactory(IEnumerable blockchainClientProviders, + IChainAppService chainAppService) + { + _blockchainClientProviders = blockchainClientProviders; + _chainAppService = chainAppService; + } + + [ExceptionHandler(typeof(Exception), Message = "Get bridge contract provider failed.", + ReturnDefault = ReturnDefault.Default,LogTargets = new[]{"chainId"})] + public virtual async Task GetBridgeContractProviderAsync(string chainId) + { + var chain = await _chainAppService.GetAsync(chainId); + return chain == null ? null : _blockchainClientProviders.First(o => o.ChainType == chain.Type); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs new file mode 100644 index 0000000..9b133f1 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using Nethereum.Util; +using Nethereum.Web3; +using Serilog; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +public class EvmBridgeContractProvider : EvmClientProvider, IBridgeContractProvider +{ + private readonly ITokenAppService _tokenAppService; + + public EvmBridgeContractProvider(IBlockchainClientFactory blockchainClientFactory, + ITokenAppService tokenAppService) : base( + blockchainClientFactory) + { + _tokenAppService = tokenAppService; + } + + public async Task GetReceiptDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, + string targetChainId) + { + var token = await _tokenAppService.GetAsync(tokenId); + var web3 = BlockchainClientFactory.GetClient(chainId); + var contractHandler = web3.Eth.GetContractHandler(contractAddress); + var receiptDailyLimit = await contractHandler + .QueryDeserializingToObjectAsync( + new GetDailyLimitFunctionMessage + { + Token = token.Address, + TargetChainId = targetChainId + }); + if (receiptDailyLimit != null && receiptDailyLimit.DailyLimit > 0) + { + return new DailyLimitDto + { + RefreshTime = receiptDailyLimit.RefreshTime, + DefaultDailyLimit = + (decimal)((BigDecimal)receiptDailyLimit.DailyLimit / BigInteger.Pow(10, token.Decimals)), + CurrentDailyLimit = (decimal)((BigDecimal)receiptDailyLimit.CurrentTokenAmount / + BigInteger.Pow(10, token.Decimals)) + }; + } + + return new DailyLimitDto(); + } + + public async Task GetSwapDailyLimitAsync(string chainId, string contractAddress, string swapId) + { + var web3 = BlockchainClientFactory.GetClient(chainId); + var contractHandler = web3.Eth.GetContractHandler(contractAddress); + var swapDailyLimit = await contractHandler + .QueryDeserializingToObjectAsync( + new GetSwapDailyLimitFunctionMessage + { + SwapId = ByteStringHelper.FromHexString(swapId).ToByteArray() + }); + if (swapDailyLimit != null && swapDailyLimit.DailyLimit > 0) + { + return new DailyLimitDto + { + RefreshTime = swapDailyLimit.RefreshTime, + DefaultDailyLimit = + (decimal)((BigDecimal)swapDailyLimit.DailyLimit / BigInteger.Pow(10, 18)), + CurrentDailyLimit = (decimal)((BigDecimal)swapDailyLimit.CurrentTokenAmount / + BigInteger.Pow(10, 18)) + }; + } + + return new DailyLimitDto(); + } + + [ExceptionHandler(typeof(Exception), + Message = "[Evm bridge contract] Get current receipt token bucket states failed.", + ReturnDefault = ReturnDefault.New, + LogTargets = new[] { "chainId", "contractAddress", "tokenIds", "targetChainIds" })] + public virtual async Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, + string contractAddress, List tokenIds, + List targetChainIds) + { + var tokenAddress = new List(); + var tokenDecimals = new List(); + foreach (var tokenId in tokenIds) + { + var token = await _tokenAppService.GetAsync(tokenId); + tokenAddress.Add(token.Address); + tokenDecimals.Add(token.Decimals); + } + + var web3 = BlockchainClientFactory.GetClient(chainId); + var contractHandler = web3.Eth.GetContractHandler(contractAddress); + var receiptTokenBucket = await contractHandler + .QueryDeserializingToObjectAsync( + new GetCurrentReceiptTokenBucketStatesFunctionMessage + { + Token = tokenAddress, + TargetChainId = targetChainIds + }); + var tokenBuckets = receiptTokenBucket.TokenBuckets.Select((t, i) => + GetTokenBuckets(t.TokenCapacity, t.Rate,t.IsEnabled,t.LastUpdatedTime,t.CurrentTokenAmount, tokenDecimals[i])).ToList(); + return tokenBuckets; + } + + [ExceptionHandler(typeof(Exception), Message = "[Evm bridge contract] Get current swap token bucket states failed.", + ReturnDefault = ReturnDefault.New, + LogTargets = new[] { "chainId", "contractAddress", "tokenIds", "fromChainIds" })] + public virtual async Task> GetCurrentSwapTokenBucketStatesAsync(string chainId, + string contractAddress, + List tokenIds, List fromChainIds) + { + var tokenAddress = new List(); + var tokenDecimals = new List(); + foreach (var tokenId in tokenIds) + { + var token = await _tokenAppService.GetAsync(tokenId); + tokenAddress.Add(token.Address); + tokenDecimals.Add(token.Decimals); + } + + var web3 = BlockchainClientFactory.GetClient(chainId); + var contractHandler = web3.Eth.GetContractHandler(contractAddress); + var swapTokenBucket = await contractHandler + .QueryDeserializingToObjectAsync( + new GetCurrentSwapTokenBucketStatesFunctionMessage + { + Token = tokenAddress, + FromChainId = fromChainIds + }); + var tokenBuckets = swapTokenBucket.SwapTokenBuckets.Select((t, i) => + GetTokenBuckets(t.TokenCapacity, t.Rate,t.IsEnabled,t.LastUpdatedTime,t.CurrentTokenAmount, tokenDecimals[i])).ToList(); + return tokenBuckets; + } + + public async Task> GetPoolLiquidityAsync(string chainId, string contractAddress, + List tokenIds) + { + var result = new List(); + foreach (var tokenId in tokenIds) + { + var token = await _tokenAppService.GetAsync(tokenId); + var web3 = BlockchainClientFactory.GetClient(chainId); + var balance = await web3.Eth.ERC20.GetContractService(token.Address).BalanceOfQueryAsync(contractAddress); + Log.Debug("Get pool liquidity, chainId: {chainId}, tokenAddress: {token}, balance: {balance}", chainId, + token.Address, balance); + var liquidity = (decimal)((BigDecimal)balance / BigInteger.Pow(10, token.Decimals)); + result.Add(new PoolLiquidityDto + { + ChainId = chainId, + Liquidity = liquidity, + TokenId = tokenId + }); + } + + return result; + } + + private TokenBucketDto GetTokenBuckets(BigInteger capacity, BigInteger rate, bool isEnabled,long lastUpdatedTime, BigInteger currentTokenAmount,int tokenDecimal) + { + if (capacity == 0 || rate == 0) + { + return new TokenBucketDto(); + } + + var tokenCapacity = (decimal)(new BigDecimal(capacity) / BigInteger.Pow(10, tokenDecimal)); + var refillRate = (decimal)(new BigDecimal(rate) / BigInteger.Pow(10, tokenDecimal)); + var currentAmount = (decimal)(new BigDecimal(currentTokenAmount) / BigInteger.Pow(10, tokenDecimal)); + var maximumTimeConsumed = + (int)Math.Ceiling(tokenCapacity / refillRate / CrossChainServerConsts.DefaultRateLimitSeconds); + return new TokenBucketDto + { + Capacity = tokenCapacity, + RefillRate = refillRate, + MaximumTimeConsumed = maximumTimeConsumed, + CurrentTokenAmount = currentAmount, + IsEnabled = isEnabled, + LastUpdatedTime = lastUpdatedTime + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentReceiptTokenBucketStatesFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentReceiptTokenBucketStatesFunctionMessage.cs new file mode 100644 index 0000000..263d4ee --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentReceiptTokenBucketStatesFunctionMessage.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; +using System.Numerics; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +[Function("getCurrentReceiptTokenBucketStates", "tuple[]")] +public class GetCurrentReceiptTokenBucketStatesFunctionMessage : FunctionMessage +{ + [Parameter("address[]", "tokens", 1)] public List Token { get; set; } + + [Parameter("string[]", "targetChainIds", 2)] + public List TargetChainId { get; set; } +} + +[FunctionOutput] +public class ReceiptTokenBucketsDto : IFunctionOutputDTO +{ + [Parameter("tuple[]", "_tokenBuckets", 1)] + public List TokenBuckets { get; set; } +} + +[FunctionOutput] +public class ReceiptTokenBucketDto : IFunctionOutputDTO +{ + [Parameter("uint128", "currentTokenAmount", 1)] + public BigInteger CurrentTokenAmount { get; set; } + + [Parameter("uint32", "lastUpdatedTime", 2)] + public long LastUpdatedTime { get; set; } + + [Parameter("bool", "isEnabled", 3)] + public bool IsEnabled { get; set; } + + [Parameter("uint128", "tokenCapacity", 4)] + public BigInteger TokenCapacity { get; set; } + + [Parameter("uint128", "rate", 5)] + public BigInteger Rate { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentSwapTokenBucketStatesFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentSwapTokenBucketStatesFunctionMessage.cs new file mode 100644 index 0000000..92142fb --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetCurrentSwapTokenBucketStatesFunctionMessage.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; +using System.Numerics; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +[Function("getCurrentSwapTokenBucketStates", "tuple[]")] +public class GetCurrentSwapTokenBucketStatesFunctionMessage : FunctionMessage +{ + [Parameter("address[]", "tokens", 1)] + public List Token { get; set; } + + [Parameter("string[]", "fromChainIds", 2)] + public List FromChainId { get; set; } +} + +[FunctionOutput] +public class SwapTokenBucketsDto : IFunctionOutputDTO +{ + [Parameter("tuple[]", "_tokenBuckets", 1)] + public List SwapTokenBuckets { get; set; } +} + +[FunctionOutput] +public class SwapTokenBucketDto : IFunctionOutputDTO +{ + [Parameter("uint128", "currentTokenAmount", 1)] + public BigInteger CurrentTokenAmount { get; set; } + [Parameter("uint32", "lastUpdatedTime", 2)] + public long LastUpdatedTime { get; set; } + [Parameter("bool", "isEnabled", 3)] + public bool IsEnabled { get; set; } + [Parameter("uint128", "tokenCapacity", 4)] + public BigInteger TokenCapacity { get; set; } + [Parameter("uint128", "rate", 5)] + public BigInteger Rate { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetDailyLimitFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetDailyLimitFunctionMessage.cs new file mode 100644 index 0000000..3e6d584 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetDailyLimitFunctionMessage.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +[Function("getReceiptDailyLimit", "tuple")] +public class GetDailyLimitFunctionMessage : FunctionMessage +{ + [Parameter("address", "token", 1)] + public string Token { get; set; } + + [Parameter("string", "targetChainId", 2)] + public string TargetChainId { get; set; } +} + +[FunctionOutput] +public class ReceiptDailyLimitDto : IFunctionOutputDTO +{ + [Parameter("uint256", "tokenAmount", 1)] + public BigInteger CurrentTokenAmount { get; set; } + [Parameter("uint32", "refreshTime", 2)] + public long RefreshTime { get; set; } + [Parameter("uint256", "defaultTokenAmount", 3)] + public BigInteger DailyLimit { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSwapDailyLimitFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSwapDailyLimitFunctionMessage.cs new file mode 100644 index 0000000..fdb834b --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSwapDailyLimitFunctionMessage.cs @@ -0,0 +1,22 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.Contracts.Bridge; +[Function("getSwapDailyLimit", "tuple")] +public class GetSwapDailyLimitFunctionMessage : FunctionMessage +{ + [Parameter("bytes32", "swapId", 1)] + public byte[] SwapId { get; set; } +} + +[FunctionOutput] +public class SwapDailyLimitDto : IFunctionOutputDTO +{ + [Parameter("uint256", "tokenAmount", 1)] + public BigInteger CurrentTokenAmount { get; set; } + [Parameter("uint32", "refreshTime", 2)] + public long RefreshTime { get; set; } + [Parameter("uint256", "defaultTokenAmount", 3)] + public BigInteger DailyLimit { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProvider.cs new file mode 100644 index 0000000..93ff469 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProvider.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.TokenPool; + +namespace AElf.CrossChainServer.Contracts.Bridge; + +public interface IBridgeContractProvider +{ + BlockchainType ChainType { get; } + + Task GetReceiptDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, string targetChainId); + Task GetSwapDailyLimitAsync(string chainId, string contractAddress, string swapId); + Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, string contractAddress, List tokenIds, List targetChainIds); + Task> GetCurrentSwapTokenBucketStatesAsync(string chainId, string contractAddress, List tokenIds, List fromChainIds); + + Task> GetPoolLiquidityAsync(string chainId, string contractAddress,List tokenIds); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProviderFactory.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProviderFactory.cs new file mode 100644 index 0000000..d5d60fb --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProviderFactory.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Contracts.Bridge +{ + public interface IBridgeContractProviderFactory + { + Task GetBridgeContractProviderAsync(string chainId); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/CrossChain/AElfCrossChainContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/AElfCrossChainContractProvider.cs new file mode 100644 index 0000000..dfc45b7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/AElfCrossChainContractProvider.cs @@ -0,0 +1,40 @@ +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.Client.Service; +using AElf.CrossChainServer.Chains; +using AElf.Standards.ACS7; +using Google.Protobuf; +using Google.Protobuf.WellKnownTypes; +using Microsoft.Extensions.Options; + +namespace AElf.CrossChainServer.Contracts.CrossChain; + +public class AElfCrossChainContractProvider : AElfClientProvider, ICrossChainContractProvider +{ + public AElfCrossChainContractProvider(IBlockchainClientFactory blockchainClientFactory, + IOptionsSnapshot accountOptions) : base(blockchainClientFactory, accountOptions) + { + } + + public async Task GetBoundParentChainHeightAndMerklePathByHeightAsync(string chainId, + string contractAddress, long height) + { + var client = BlockchainClientFactory.GetClient(chainId); + + var param = new Int64Value + { + Value = height + }; + var transaction = + await client.GenerateTransactionAsync(client.GetAddressFromPrivateKey(GetPrivateKey(chainId)), contractAddress, + "GetBoundParentChainHeightAndMerklePathByHeight", param); + var txWithSign = client.SignTransaction(GetPrivateKey(chainId), transaction); + var transactionResult = await client.ExecuteTransactionAsync(new ExecuteTransactionDto + { + RawTransaction = txWithSign.ToByteArray().ToHex() + }); + var result = + CrossChainMerkleProofContext.Parser.ParseFrom(ByteArrayHelper.HexStringToByteArray(transactionResult)); + return result; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractAppService.cs b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractAppService.cs new file mode 100644 index 0000000..500cfc8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractAppService.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; +using AElf.Standards.ACS7; +using Microsoft.Extensions.Options; +using Volo.Abp; + +namespace AElf.CrossChainServer.Contracts.CrossChain; + +[RemoteService(IsEnabled = false)] +public class CrossChainContractAppService : CrossChainServerAppService, ICrossChainContractAppService +{ + private readonly ICrossChainContractProvider _crossChainContractProvider; + private readonly CrossChainContractOptions _crossChainContractOptions; + + public CrossChainContractAppService( + IOptionsSnapshot crossChainContractOptions, + ICrossChainContractProvider aelfCrossChainContractProvider) + { + _crossChainContractProvider = aelfCrossChainContractProvider; + _crossChainContractOptions = crossChainContractOptions.Value; + } + + public async Task GetBoundParentChainHeightAndMerklePathByHeightAsync(string chainId, + long height) + { + var contractAddress = _crossChainContractOptions.ContractAddresses[chainId]; + + return await _crossChainContractProvider.GetBoundParentChainHeightAndMerklePathByHeightAsync(chainId, + contractAddress, height); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractOptions.cs b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractOptions.cs new file mode 100644 index 0000000..6860203 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/CrossChainContractOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Contracts.CrossChain; + +public class CrossChainContractOptions +{ + public Dictionary ContractAddresses { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/CrossChain/ICrossChainContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/ICrossChainContractProvider.cs new file mode 100644 index 0000000..6572bd7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/CrossChain/ICrossChainContractProvider.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.Standards.ACS7; + +namespace AElf.CrossChainServer.Contracts.CrossChain; + +public interface ICrossChainContractProvider +{ + BlockchainType ChainType { get; } + + Task GetBoundParentChainHeightAndMerklePathByHeightAsync(string chainId, string contractAddress, long height); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Token/AElfTokenContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Token/AElfTokenContractProvider.cs new file mode 100644 index 0000000..a71a861 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Token/AElfTokenContractProvider.cs @@ -0,0 +1,43 @@ +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.Client.Service; +using AElf.Contracts.MultiToken; +using AElf.CrossChainServer.Chains; +using AElf.Types; +using Google.Protobuf; +using Microsoft.Extensions.Options; +using Serilog; + +namespace AElf.CrossChainServer.Contracts.Token; + +public class AElfTokenContractProvider : AElfClientProvider, ITokenContractProvider +{ + public AElfTokenContractProvider(IBlockchainClientFactory blockchainClientFactory, + IOptionsSnapshot accountOptions) : base(blockchainClientFactory, accountOptions) + { + } + + public async Task CrossChainReceiveTokenAsync(string chainId, string contractAddress, string privateKey, int fromChainId, long parentChainHeight, + string transferTransaction, MerklePath merklePath) + { + var client = BlockchainClientFactory.GetClient(chainId); + + var param = new CrossChainReceiveTokenInput + { + MerklePath = merklePath, + FromChainId = fromChainId, + ParentChainHeight = parentChainHeight, + TransferTransactionBytes = ByteString.CopyFrom(ByteArrayHelper.HexStringToByteArray(transferTransaction)), + }; + var fromAddress = client.GetAddressFromPrivateKey(privateKey); + var transaction = await client.GenerateTransactionAsync(fromAddress, contractAddress, "CrossChainReceiveToken", param); + var txWithSign = client.SignTransaction(privateKey, transaction); + + var result = await client.SendTransactionAsync(new SendTransactionInput + { + RawTransaction = txWithSign.ToByteArray().ToHex() + }); + Log.Debug("CrossChainReceiveToken txId {txId},RawTransaction: {raw}", result.TransactionId, txWithSign.ToByteArray().ToHex()); + return result.TransactionId; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Token/ITokenContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Token/ITokenContractProvider.cs new file mode 100644 index 0000000..19fdecc --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Token/ITokenContractProvider.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.Types; + +namespace AElf.CrossChainServer.Contracts.Token; + +public interface ITokenContractProvider +{ + BlockchainType ChainType { get; } + + Task CrossChainReceiveTokenAsync(string chainId, string contractAddress, string privateKey, int fromChainId, long parentChainHeight, + string transferTransaction, MerklePath merklePath); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractAppService.cs b/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractAppService.cs new file mode 100644 index 0000000..91a30a8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractAppService.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using AElf.Types; +using Microsoft.Extensions.Options; +using Volo.Abp; + +namespace AElf.CrossChainServer.Contracts.Token; + +[RemoteService(IsEnabled = false)] +public class TokenContractAppService: CrossChainServerAppService,ITokenContractAppService +{ + private readonly ITokenContractProvider _tokenContractProvider; + private readonly AccountOptions _accountOptions; + private readonly TokenContractOptions _tokenContractOptions; + + public TokenContractAppService( + IOptionsSnapshot accountOptions, + IOptionsSnapshot tokenContractOptions, + ITokenContractProvider tokenContractProvider) + { + _tokenContractProvider = tokenContractProvider; + _accountOptions = accountOptions.Value; + _tokenContractOptions = tokenContractOptions.Value; + } + + public async Task CrossChainReceiveTokenAsync(string chainId, int fromChainId, long parentChainHeight, string transferTransaction, + MerklePath merklePath) + { + var contractAddress = _tokenContractOptions.ContractAddresses[chainId]; + var privateKey = _accountOptions.PrivateKeys[chainId]; + return await _tokenContractProvider.CrossChainReceiveTokenAsync(chainId, contractAddress, privateKey, + fromChainId, parentChainHeight, transferTransaction, merklePath); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractOptions.cs b/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractOptions.cs new file mode 100644 index 0000000..d97e633 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Contracts/Token/TokenContractOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Contracts.Token; + +public class TokenContractOptions +{ + public Dictionary ContractAddresses { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/AetherLinkOption.cs b/src/AElf.CrossChainServer.Application/CrossChain/AetherLinkOption.cs new file mode 100644 index 0000000..727c7de --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/AetherLinkOption.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class AetherLinkOption +{ + public string BaseUrl { get; set; } + public string CrossChainStatusUri { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/AutoReceiveConfigOptions.cs b/src/AElf.CrossChainServer.Application/CrossChain/AutoReceiveConfigOptions.cs new file mode 100644 index 0000000..eabf753 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/AutoReceiveConfigOptions.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class AutoReceiveConfigOptions +{ + public int ReceiveRetryTimes { get; set; } = 3; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainIndexingInfoAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainIndexingInfoAppService.cs new file mode 100644 index 0000000..58a61df --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainIndexingInfoAppService.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.Indexing.Elasticsearch; +using Nest; +using Volo.Abp; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.CrossChain; + +[RemoteService(IsEnabled = false)] +public class CrossChainIndexingInfoAppService : CrossChainServerAppService, ICrossChainIndexingInfoAppService +{ + private readonly IChainAppService _chainAppService; + private readonly ICrossChainIndexingInfoRepository _crossChainIndexingInfoRepository; + private readonly INESTRepository _crossChainIndexingInfoIndexRepository; + private readonly IBlockchainAppService _blockchainAppService; + + public CrossChainIndexingInfoAppService(ICrossChainIndexingInfoRepository crossChainIndexingInfoRepository, + IChainAppService chainAppService, + INESTRepository crossChainIndexingInfoIndexRepository, + IBlockchainAppService blockchainAppService) + { + _crossChainIndexingInfoRepository = crossChainIndexingInfoRepository; + _chainAppService = chainAppService; + _crossChainIndexingInfoIndexRepository = crossChainIndexingInfoIndexRepository; + _blockchainAppService = blockchainAppService; + } + + public async Task CreateAsync(CreateCrossChainIndexingInfoInput input) + { + using var uow = UnitOfWorkManager.Begin(); + if (await _crossChainIndexingInfoRepository.FirstOrDefaultAsync(o => + o.ChainId == input.ChainId && o.IndexChainId == input.IndexChainId && + o.IndexBlockHeight == input.IndexBlockHeight) != null) + { + return; + } + + var index = ObjectMapper.Map(input); + await _crossChainIndexingInfoRepository.InsertAsync(index); + await uow.CompleteAsync(); + } + + public async Task CleanAsync(DateTime time) + { + await _crossChainIndexingInfoRepository.DeleteAsync(o => o.BlockTime < time); + } + + public async Task AddIndexAsync(AddCrossChainIndexingInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + await _crossChainIndexingInfoIndexRepository.AddAsync(index); + } + + + public async Task DeleteIndexAsync(Guid id) + { + await _crossChainIndexingInfoIndexRepository.DeleteAsync(id); + } + + public async Task CalculateCrossChainProgressAsync(string fromChainId, string toChainId, long height) + { + var fromChain = await _chainAppService.GetAsync(fromChainId); + var toChain = await _chainAppService.GetAsync(toChainId); + if (fromChain == null || toChain == null) + { + throw new UserFriendlyException("parameter chainId is not registered in database!"); + } + if (fromChain.Type != BlockchainType.AElf || toChain.Type != BlockchainType.AElf) + { + throw new UserFriendlyException("parameter chainId is not valid!"); + } + + var block = await _blockchainAppService.GetBlockByHeightAsync(fromChainId, height); + return await CalculateCrossChainProgressAsync(fromChainId, toChainId, height, block.Header.Time); + } + + public async Task CalculateCrossChainProgressAsync(string fromChainId, string toChainId, long height, + DateTime txTime) + { + var fromChain = await _chainAppService.GetAsync(fromChainId); + var toChain = await _chainAppService.GetAsync(toChainId); + + if (fromChain == null || toChain == null) + { + throw new UserFriendlyException("parameter chainId is not registered in database!"); + } + + if (fromChain.IsMainChain) + { + return await CalculateAElfProgressAsync(fromChain, toChain, height, txTime); + } + + var mainChain = await _chainAppService.GetAsync(CrossChainServerConsts.AElfMainChainId); + + var mustQuery = new List, QueryContainer>> + { + q => q.Term(i => i.Field(f => f.ChainId).Value(mainChain.Id)), + q => q.Term(i => i.Field(f => f.IndexChainId).Value(fromChain.Id)), + q => q.LongRange(i => i.Field(f => f.IndexBlockHeight).GreaterThanOrEquals(height)) + }; + + QueryContainer Query(QueryContainerDescriptor f) => + f.Bool(b => b.Must(mustQuery)); + + var mainChainIndex = + await _crossChainIndexingInfoIndexRepository.GetAsync(Query, sortExp: o => o.BlockTime); + + if (mainChainIndex == null) + { + return await CalculateAElfProgressAsync(fromChain, mainChain, height, txTime) / 2; + } + if (toChain.IsMainChain) + { + return CrossChainServerConsts.HalfOfTheProgress + await CalculateAElfProgressAsync(mainChain, fromChain, mainChainIndex.BlockHeight, + mainChainIndex.BlockTime) / 2; + } + + var sideChainIndexProgress = await CalculateAElfProgressAsync(mainChain, fromChain, + mainChainIndex.BlockHeight, mainChainIndex.BlockTime); + return CrossChainServerConsts.HalfOfTheProgress + (sideChainIndexProgress == CrossChainServerConsts.FullOfTheProgress + ? await CalculateAElfProgressAsync(mainChain, toChain, mainChainIndex.BlockHeight, + mainChainIndex.BlockTime) / 2 + : 0); + } + + private async Task CalculateAElfProgressAsync(ChainDto fromChain, ChainDto toChain, long txHeight, + DateTime txTime) + { + var mustQuery = new List, QueryContainer>> + { + q => q.Term(i => i.Field(f => f.ChainId).Value(toChain.Id)), + q => q.Term(i => i.Field(f => f.IndexChainId).Value(fromChain.Id)) + }; + QueryContainer CurrentIndexedFilter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var currentIndexed = + await _crossChainIndexingInfoIndexRepository.GetAsync(CurrentIndexedFilter, sortExp: o => o.BlockTime, sortType: SortOrder.Descending); + + if (currentIndexed == null) + { + return 0; + } + + var currentIndexedHeight = currentIndexed.IndexBlockHeight; + + mustQuery = new List, QueryContainer>> + { + q => q.Term(i => i.Field(f => f.ChainId).Value(toChain.Id)), + q => q.Term(i => i.Field(f => f.IndexChainId).Value(fromChain.Id)), + q => q.DateRange(i => i.Field(f => f.BlockTime).LessThan(txTime)) + }; + QueryContainer TransferIndexedQuery(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var transferIndexed = + await _crossChainIndexingInfoIndexRepository.GetAsync(TransferIndexedQuery, sortExp: o => o.BlockTime, sortType: SortOrder.Descending); + + if (transferIndexed == null || currentIndexedHeight >= txHeight) + { + return CrossChainServerConsts.FullOfTheProgress; + } + + var transferIndexedHeight = transferIndexed.IndexBlockHeight; + + return (int) ((currentIndexedHeight - transferIndexedHeight) * CrossChainServerConsts.FullOfTheProgress / + (txHeight - transferIndexedHeight)); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs new file mode 100644 index 0000000..d249424 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp; + +namespace AElf.CrossChainServer.CrossChain; + +[RemoteService(IsEnabled = false)] +public class CrossChainLimitAppService : CrossChainServerAppService, ICrossChainLimitAppService +{ + private readonly ICrossChainDailyLimitRepository _crossChainDailyLimitRepository; + private readonly ICrossChainRateLimitRepository _crossChainRateLimitRepository; + private readonly INESTRepository _crossChainRateLimitIndexRepository; + private readonly INESTRepository _crossChainDailyLimitIndexRepository; + private readonly ITokenRepository _tokenRepository; + private readonly IBridgeContractAppService _bridgeContractAppService; + private readonly IChainAppService _chainAppService; + private readonly IBlockchainAppService _blockchainAppService; + private readonly ISettingManager _settingManager; + private readonly LimitSyncOptions _limitSyncOptions; + private readonly ITokenAppService _tokenAppService; + + public CrossChainLimitAppService(ICrossChainDailyLimitRepository crossChainDailyLimitRepository, + ICrossChainRateLimitRepository crossChainRateLimitRepository, + INESTRepository crossChainRateLimitIndexRepository, + INESTRepository crossChainDailyLimitIndexRepository, + ITokenRepository tokenRepository, IBridgeContractAppService bridgeContractAppService, + IChainAppService chainAppService, IBlockchainAppService blockchainAppService, ISettingManager settingManager, + IOptionsSnapshot limitSyncOptions, ITokenAppService tokenAppService) + { + _crossChainDailyLimitRepository = crossChainDailyLimitRepository; + _crossChainRateLimitRepository = crossChainRateLimitRepository; + _crossChainRateLimitIndexRepository = crossChainRateLimitIndexRepository; + _crossChainDailyLimitIndexRepository = crossChainDailyLimitIndexRepository; + _tokenRepository = tokenRepository; + _bridgeContractAppService = bridgeContractAppService; + _chainAppService = chainAppService; + _blockchainAppService = blockchainAppService; + _settingManager = settingManager; + _tokenAppService = tokenAppService; + _limitSyncOptions = limitSyncOptions.Value; + } + + public async Task InitLimitAsync() + { + var evmChainList = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.Evm + }); + foreach (var chain in evmChainList.Items) + { + Log.Debug("Sync limit info from chain {chainId}.", chain.Id); + // Step 1: Retrieve the current height of the EVM chain and insert a new EVM limit sync height. + var currentChainHeight = await _blockchainAppService.GetChainHeightAsync(chain.Id); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmDailyLimitSetIndexerSync, null), + currentChainHeight.ToString()); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmDailyLimitConsumedIndexerSync, null), + currentChainHeight.ToString()); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmRateLimitSetIndexerSync, null), + currentChainHeight.ToString()); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmRateLimitConsumedIndexerSync, null), + currentChainHeight.ToString()); + // Step 2: Query the EVM contract to sync the liquidity of configured tokens. + // receipt limit + var limitsInfos = _limitSyncOptions.LimitInfos[chain.Id]; + var tokenIdList = new List(); + var targetChainIdList = new List(); + var aelfTargetChainIdList = new List(); + foreach (var limit in limitsInfos) + { + var aelfChain = await _chainAppService.GetByAElfChainIdAsync(ChainHelper.ConvertBase58ToChainId(limit.TargetChainId)); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Address = limit.TokenAddress + }); + tokenIdList.Add(token.Id); + targetChainIdList.Add(aelfChain.Id); + aelfTargetChainIdList.Add(limit.TargetChainId); + var receiptDailyLimit = + await _bridgeContractAppService.GetDailyLimitAsync(chain.Id, token.Id, aelfChain.Id); + await SetCrossChainDailyLimitAsync(new SetCrossChainDailyLimitInput + { + ChainId = chain.Id, + DailyLimit = receiptDailyLimit.DefaultDailyLimit, + RefreshTime = receiptDailyLimit.RefreshTime, + RemainAmount = receiptDailyLimit.CurrentDailyLimit, + TokenId = token.Id, + TargetChainId = limit.TargetChainId, + Type = CrossChainLimitType.Receipt + }); + var swapDailyLimit = + await _bridgeContractAppService.GetSwapDailyLimitAsync(chain.Id, limit.SwapId); + await SetCrossChainDailyLimitAsync(new SetCrossChainDailyLimitInput + { + ChainId = chain.Id, + DailyLimit = swapDailyLimit.DefaultDailyLimit, + RefreshTime = swapDailyLimit.RefreshTime, + RemainAmount = swapDailyLimit.CurrentDailyLimit, + TokenId = token.Id, + TargetChainId = limit.TargetChainId, + Type = CrossChainLimitType.Swap + }); + } + + var rateLimit = + await _bridgeContractAppService.GetCurrentReceiptTokenBucketStatesAsync(chain.Id, tokenIdList, + targetChainIdList); + for (var i = 0; i < rateLimit.Count; i++) + { + await SetCrossChainRateLimitAsync(new SetCrossChainRateLimitInput + { + ChainId = chain.Id, + CurrentAmount = rateLimit[i].CurrentTokenAmount, + Capacity = rateLimit[i].Capacity, + Rate = rateLimit[i].RefillRate, + TokenId = tokenIdList[i], + TargetChainId = aelfTargetChainIdList[i], + Type = CrossChainLimitType.Receipt + }); + } + var swapRateLimit = + await _bridgeContractAppService.GetCurrentSwapTokenBucketStatesAsync(chain.Id, tokenIdList, + targetChainIdList); + for (var i = 0; i < swapRateLimit.Count; i++) + { + await SetCrossChainRateLimitAsync(new SetCrossChainRateLimitInput + { + ChainId = chain.Id, + CurrentAmount = swapRateLimit[i].CurrentTokenAmount, + Capacity = swapRateLimit[i].Capacity, + Rate = swapRateLimit[i].RefillRate, + TokenId = tokenIdList[i], + TargetChainId = aelfTargetChainIdList[i], + Type = CrossChainLimitType.Swap + }); + } + } + + Log.Information("Finish to sync limit info from chain."); + } + + private string GetSettingKey(string syncType, string typePrefix) + { + return string.IsNullOrWhiteSpace(typePrefix) ? syncType : $"{typePrefix}-{syncType}"; + } + + public async Task SetCrossChainRateLimitAsync(SetCrossChainRateLimitInput input) + { + var limit = await _crossChainRateLimitRepository.FindAsync(o => + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + + if (limit == null) + { + limit = ObjectMapper.Map(input); + await _crossChainRateLimitRepository.InsertAsync(limit); + } + else + { + limit.CurrentAmount = input.CurrentAmount; + limit.Capacity = input.Capacity; + limit.Rate = input.Rate; + limit.IsEnable = input.IsEnable; + await _crossChainRateLimitRepository.UpdateAsync(limit); + } + } + + public async Task SetCrossChainRateLimitIndexAsync(SetCrossChainRateLimitInput input) + { + var limit = ObjectMapper.Map(input); + limit.Token = await _tokenRepository.GetAsync(input.TokenId); + await _crossChainRateLimitIndexRepository.AddOrUpdateAsync(limit); + } + + public async Task ConsumeCrossChainRateLimitAsync(ConsumeCrossChainRateLimitInput input) + { + var limit = await _crossChainRateLimitRepository.GetAsync(o => + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + if (limit.IsEnable) + { + limit.CurrentAmount -= input.Amount; + await _crossChainRateLimitRepository.UpdateAsync(limit); + } + } + + public async Task> GetCrossChainRateLimitsAsync() + { + var list = await _crossChainRateLimitIndexRepository.GetListAsync(); + return ObjectMapper.Map, List>(list.Item2); + } + + public async Task SetCrossChainDailyLimitAsync(SetCrossChainDailyLimitInput input) + { + var limit = await _crossChainDailyLimitRepository.FindAsync(o => + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + + if (limit == null) + { + limit = ObjectMapper.Map(input); + await _crossChainDailyLimitRepository.InsertAsync(limit); + } + else + { + limit.RemainAmount = input.RemainAmount; + limit.RefreshTime = input.RefreshTime; + limit.DailyLimit = input.DailyLimit; + await _crossChainDailyLimitRepository.UpdateAsync(limit); + } + } + + public async Task SetCrossChainDailyLimitIndexAsync(SetCrossChainDailyLimitInput input) + { + var limit = ObjectMapper.Map(input); + limit.Token = await _tokenRepository.GetAsync(input.TokenId); + await _crossChainDailyLimitIndexRepository.AddOrUpdateAsync(limit); + } + + public async Task ConsumeCrossChainDailyLimitAsync(ConsumeCrossChainDailyLimitInput input) + { + Log.Debug("ConsumeCrossChainDailyLimitAsync, chainId: {chainId}, targetChainId: {targetChainId}, tokenId: {tokenId}, type: {type}, amount: {amount}", + input.ChainId, input.TargetChainId, input.TokenId, input.Type, input.Amount); + var limit = await _crossChainDailyLimitRepository.GetAsync(o => + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + limit.RemainAmount -= input.Amount; + await _crossChainDailyLimitRepository.UpdateAsync(limit); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs new file mode 100644 index 0000000..c600e39 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs @@ -0,0 +1,403 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.CrossChain; + +[RemoteService(IsEnabled = false)] +public class CrossChainLimitInfoAppService : CrossChainServerAppService, ICrossChainLimitInfoAppService +{ + private readonly IIndexerCrossChainLimitInfoService _indexerCrossChainLimitInfoService; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + private readonly IOptionsMonitor _crossChainLimitsOptions; + private readonly ITokenSymbolMappingProvider _tokenSymbolMappingProvider; + private readonly ICrossChainLimitAppService _crossChainLimitAppService; + + public CrossChainLimitInfoAppService( + IIndexerCrossChainLimitInfoService indexerCrossChainLimitInfoService, + ITokenAppService tokenAppService, + IChainAppService chainAppService, + IOptionsMonitor crossChainLimitsOptions, + ITokenSymbolMappingProvider tokenSymbolMappingProvider, ICrossChainLimitAppService crossChainLimitAppService) + { + _indexerCrossChainLimitInfoService = indexerCrossChainLimitInfoService; + _tokenAppService = tokenAppService; + _chainAppService = chainAppService; + _crossChainLimitsOptions = crossChainLimitsOptions; + _tokenSymbolMappingProvider = tokenSymbolMappingProvider; + _crossChainLimitAppService = crossChainLimitAppService; + } + + public async Task> GetCrossChainDailyLimitsAsync() + { + var crossChainLimits = _crossChainLimitsOptions.CurrentValue; + Log.ForContext("chainId", crossChainLimits.ChainIdInfo.TokenFirstChainId).Information( + "Get cross chain limit from settings.{chainId}", crossChainLimits.ChainIdInfo.TokenFirstChainId); + var toChainIds = new HashSet(crossChainLimits.ChainIdInfo.ToChainIds); + var indexerCrossChainLimitInfos = + await _indexerCrossChainLimitInfoService.GetAllCrossChainLimitInfoIndexAsync(); + //sort by config fromChainId first. + var crossChainLimitInfos = indexerCrossChainLimitInfos + .Where(item => toChainIds.Contains(item.ToChainId)) + .OrderByDescending(item => item.FromChainId == crossChainLimits.ChainIdInfo.TokenFirstChainId) + .ToList(); + var fromChainDailyLimits = new Dictionary(); + var tokenDict = new Dictionary(); + foreach (var info in crossChainLimitInfos) + { + var key = info.Symbol; + // skip if the current item does not match the fromChainId + if (fromChainDailyLimits.TryGetValue(key, out var chainDailyLimitsDto) + && chainDailyLimitsDto.FromChainId != info.FromChainId) + { + continue; + } + + //avoid repeated get + var tokenKey = info.ToChainId + "_" + info.Symbol; + if (!tokenDict.TryGetValue(tokenKey, out var token)) + { + token = await GetTokenInfoAsync(info.ToChainId, info.Symbol); + if (token == null) + { + continue; + } + + tokenDict[tokenKey] = token; + } + + var allowance = info.DefaultDailyLimit / (decimal)Math.Pow(10, token.Decimals); + chainDailyLimitsDto ??= new FromChainDailyLimitsDto(info.FromChainId, info.Symbol, 0); + chainDailyLimitsDto.Allowance += allowance; + fromChainDailyLimits[key] = chainDailyLimitsDto; + } + + //add token sort logic + var resultList = fromChainDailyLimits.Values + .Select(item => new CrossChainDailyLimitsDto(item.Token, item.Allowance)) + .OrderBy(item => crossChainLimits.GetTokenSortWeight(item.Token)) + .ToList(); + return new ListResultDto + { + Items = resultList + }; + } + + public async Task> GetCrossChainRateLimitsAsync() + { + var result = new List(); + var crossChainLimitInfos = await GetCrossChainLimitInfosAsync(); + var otherChainLimitInfos = await GetRateLimitsAsync(); + foreach (var crossChainLimitInfo in crossChainLimitInfos) + { + var chain = await _chainAppService.GetAsync(crossChainLimitInfo.Key.FromChainId); + if (chain == null) + { + continue; + } + + if (chain.Type == BlockchainType.AElf) + { + Log.ForContext("fromChainId", crossChainLimitInfo.Key.FromChainId) + .ForContext("toChainId", crossChainLimitInfo.Key.ToChainId).Information( + "Limit data processing,From chain:{fromChainId}, to chain:{toChainId}", + crossChainLimitInfo.Key.FromChainId, crossChainLimitInfo.Key.ToChainId); + var receiptRateLimits = + await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.FromChainId); + var swapRateLimits = new List(); + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + { + swapRateLimits = OfEvmRateLimitInfos(value); + } + + var chainDto = await _chainAppService.GetAsync(crossChainLimitInfo.Key.FromChainId); + if (chainDto == null) + { + continue; + } + + var aelfChainId = chainDto.AElfChainId; + crossChainLimitInfo.Key.FromChainId = ChainHelper.ConvertChainIdToBase58(aelfChainId); + result.Add(new CrossChainRateLimitsDto + { + FromChain = crossChainLimitInfo.Key.FromChainId, + ToChain = crossChainLimitInfo.Key.ToChainId, + ReceiptRateLimitsInfo = receiptRateLimits, + SwapRateLimitsInfo = swapRateLimits + }); + } + else if (chain.Type == BlockchainType.Evm) + { + Log.ForContext("fromChainId", crossChainLimitInfo.Key.FromChainId) + .ForContext("toChainId", crossChainLimitInfo.Key.ToChainId) + .Debug( + "Limit data processing,From chain:{fromChainId}, to chain:{toChainId}", + crossChainLimitInfo.Key.FromChainId, crossChainLimitInfo.Key.ToChainId); + var swapRateLimits = + await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.ToChainId); + + var receiptRateLimits = new List(); + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + { + receiptRateLimits = OfEvmRateLimitInfos(value); + } + + var chainDto = await _chainAppService.GetAsync(crossChainLimitInfo.Key.ToChainId); + if (chainDto == null) + { + continue; + } + + var aelfChainId = chainDto.AElfChainId; + crossChainLimitInfo.Key.ToChainId = ChainHelper.ConvertChainIdToBase58(aelfChainId); + result.Add(new CrossChainRateLimitsDto + { + FromChain = crossChainLimitInfo.Key.FromChainId, + ToChain = crossChainLimitInfo.Key.ToChainId, + ReceiptRateLimitsInfo = receiptRateLimits, + SwapRateLimitsInfo = swapRateLimits + }); + } + else if (chain.Type == BlockchainType.Tvm) + { + Log.ForContext("fromChainId", crossChainLimitInfo.Key.FromChainId) + .ForContext("toChainId", crossChainLimitInfo.Key.ToChainId) + .Debug( + "Limit data processing,From chain:{fromChainId}, to chain:{toChainId}", + crossChainLimitInfo.Key.FromChainId, crossChainLimitInfo.Key.ToChainId); + var swapRateLimits = + await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.ToChainId); + + var receiptRateLimits = new List(); + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + { + receiptRateLimits = OfEvmRateLimitInfos(value); + } + + var chainDto = await _chainAppService.GetAsync(crossChainLimitInfo.Key.ToChainId); + if (chainDto == null) + { + continue; + } + + var aelfChainId = chainDto.AElfChainId; + crossChainLimitInfo.Key.ToChainId = ChainHelper.ConvertChainIdToBase58(aelfChainId); + result.Add(new CrossChainRateLimitsDto + { + FromChain = crossChainLimitInfo.Key.FromChainId, + ToChain = crossChainLimitInfo.Key.ToChainId, + ReceiptRateLimitsInfo = receiptRateLimits, + SwapRateLimitsInfo = swapRateLimits + }); + } + } + + return new ListResultDto + { + Items = result + }; + } + + private async Task>> + GetCrossChainLimitInfosAsync() + { + var crossChainLimits = _crossChainLimitsOptions.CurrentValue; + var crossChainLimitInfoDictionary = + new Dictionary>(); + var indexerCrossChainLimitInfos = + await _indexerCrossChainLimitInfoService.GetAllCrossChainLimitInfoIndexAsync(); + var crossChainLimitInfos = indexerCrossChainLimitInfos + .OrderBy(item => crossChainLimits.GetChainSortWeight(item.FromChainId, item.ToChainId)) + .ThenBy(item => crossChainLimits.GetTokenSortWeight(item.Symbol)) + .ToList(); + foreach (var item in crossChainLimitInfos) + { + Log.ForContext("fromChainId", item.FromChainId) + .ForContext("toChainId", item.ToChainId) + .Debug( + "Start to get limit info. From chain:{fromChainId}, to chain:{toChainId}, symbol:{symbol}", + item.FromChainId, item.ToChainId, item.Symbol); + if (item.LimitType == CrossChainLimitType.Receipt) + { + var chain = await _chainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(item.FromChainId)); + item.FromChainId = chain.Id; + } + else + { + var chain = await _chainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(item.ToChainId)); + item.ToChainId = chain.Id; + } + + var key = new CrossChainLimitKey + { + FromChainId = item.FromChainId, + ToChainId = item.ToChainId + }; + if (!crossChainLimitInfoDictionary.TryGetValue(key, out var tokenDictionary)) + { + tokenDictionary = new Dictionary(); + crossChainLimitInfoDictionary[key] = tokenDictionary; + } + + tokenDictionary[item.Symbol] = item; + } + + return crossChainLimitInfoDictionary; + } + + private async Task> OfRateLimitInfos( + Dictionary tokenDictionary, string chainId) + { + var result = new List(); + foreach (var pair in tokenDictionary) + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Symbol = pair.Key + }); + var capacity = (decimal)pair.Value.Capacity; + var refillRate = (decimal)pair.Value.RefillRate; + var time = 0; + if (capacity != 0 && refillRate != 0) + { + capacity = capacity / (decimal)Math.Pow(10, token.Decimals); + refillRate = refillRate / (decimal)Math.Pow(10, token.Decimals); + time = (int)Math.Ceiling(capacity / refillRate / CrossChainServerConsts.DefaultRateLimitSeconds); + } + + result.Add(new RateLimitInfo + { + Token = pair.Key, + Capacity = capacity, + RefillRate = refillRate, + MaximumTimeConsumed = time + }); + } + + return result; + } + + private static List OfEvmRateLimitInfos( + Dictionary tokenDictionary) + { + return tokenDictionary.Select(pair => new RateLimitInfo + { + Token = pair.Key, + Capacity = pair.Value.Capacity, + RefillRate = pair.Value.RefillRate, + MaximumTimeConsumed = pair.Value.MaximumTimeConsumed + }).ToList(); + } + + private async Task>> GetRateLimitsAsync() + { + var result = new Dictionary>(); + var limits = await _crossChainLimitAppService.GetCrossChainRateLimitsAsync(); + foreach (var limit in limits) + { + var limitKey = new CrossChainLimitKey(); + var chain = await _chainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(limit.TargetChainId)); + if (limit.Type == CrossChainLimitType.Receipt) + { + limitKey.FromChainId = limit.ChainId; + limitKey.ToChainId = chain.Id; + } + else + { + + limitKey.FromChainId = chain.Id; + limitKey.ToChainId = limit.ChainId; + } + + if (!result.TryGetValue(limitKey, out var value)) + { + value = new Dictionary(); + } + + var symbol = + _tokenSymbolMappingProvider.GetMappingSymbol(limit.ChainId, limit.TargetChainId, limit.Token.Symbol); + + var tokenBucket = new TokenBucketDto(); + if (limit.Capacity != 0 || limit.Rate != 0) + { + tokenBucket.Capacity = limit.Capacity; + tokenBucket.RefillRate = limit.Rate; + tokenBucket.MaximumTimeConsumed = + (int)Math.Ceiling(tokenBucket.Capacity / tokenBucket.RefillRate / + CrossChainServerConsts.DefaultRateLimitSeconds); + } + + value[symbol] = tokenBucket; + + result[limitKey] = value; + } + + return result; + } + + [ExceptionHandler(typeof(Exception), Message = "Get token info failed.", + ReturnDefault = ReturnDefault.Default, LogTargets = new[] { "chainId", "symbol" })] + public virtual async Task GetTokenInfoAsync(string chainId, string symbol) + { + var chain = await _chainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(chainId)); + var convertedChainId = chain.Id; + + return await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = convertedChainId, + Symbol = symbol + }); + } +} + +public class FromChainDailyLimitsDto +{ + public string FromChainId { get; set; } + public string Token { get; set; } + public decimal Allowance { get; set; } + + public FromChainDailyLimitsDto(string fromChainId, string token, decimal allowance) + { + FromChainId = fromChainId; + Token = token; + Allowance = allowance; + } +} + +public class CrossChainLimitKey +{ + public string FromChainId { get; set; } + + public string ToChainId { get; set; } + + public override bool Equals(object obj) + { + if (obj is not CrossChainLimitKey p) + { + return false; + } + + return FromChainId == p.FromChainId && ToChainId == p.ToChainId; + } + + public override int GetHashCode() + { + return HashCode.Combine(FromChainId, ToChainId); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitsOptions.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitsOptions.cs new file mode 100644 index 0000000..1d49e8e --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitsOptions.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainLimitsOptions +{ + private const int DefaultWeightValue = 999; + public ChainIdInfo ChainIdInfo { get; set; } + //key is fromChainId-toChainId, value is Weight + public Dictionary ChainSortRules { get; set; } = new Dictionary(); + //key is token, value is Weight + public Dictionary TokenSortRules { get; set; } = new Dictionary(); + + public int GetChainSortWeight(string fromChainId, string toChainId) + { + string key = fromChainId + "-" + toChainId; + if (!ChainSortRules.TryGetValue(key, out var value)) + { + value = DefaultWeightValue; + } + return value; + } + + public int GetTokenSortWeight(string token) + { + if (!TokenSortRules.TryGetValue(token, out var value)) + { + value = DefaultWeightValue; + } + return value; + } +} + +public class ChainIdInfo +{ + //ChainId with high priority(if it has repeated ChainId) + public string TokenFirstChainId { get; set; } + + public List ToChainIds { get; set; } +} diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.ExceptionHandler.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.ExceptionHandler.cs new file mode 100644 index 0000000..dd988f4 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.ExceptionHandler.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.ExceptionHandler; +using Serilog; + +namespace AElf.CrossChainServer.CrossChain; + +public partial class CrossChainTransferAppService +{ + public async Task HandleTransferDbException(Exception ex, CrossChainTransfer transfer) + { + Log.Error($"DbUpdateConcurrencyException: {ex.Message}"); + await HandleUniqueTransfer(ex, transfer); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return, + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs new file mode 100644 index 0000000..d266638 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs @@ -0,0 +1,1094 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Tokens; +using AElf.CSharp.Core; +using AElf.ExceptionHandler; +using AElf.Indexing.Elasticsearch; +using Microsoft.EntityFrameworkCore; +using Nest; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using MySqlConnector; +using Serilog; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.CrossChain; + +[RemoteService(IsEnabled = false)] +public partial class CrossChainTransferAppService : CrossChainServerAppService, ICrossChainTransferAppService +{ + private readonly ICrossChainTransferRepository _crossChainTransferRepository; + private readonly IChainAppService _chainAppService; + private readonly INESTRepository _crossChainTransferIndexRepository; + private readonly ITokenRepository _tokenRepository; + private readonly IBlockchainAppService _blockchainAppService; + private readonly ICheckTransferProvider _checkTransferProvider; + private readonly IEnumerable _crossChainTransferProviders; + private readonly IIndexerAppService _indexerAppService; + private readonly ITokenAppService _tokenAppService; + private readonly AutoReceiveConfigOptions _autoReceiveConfigOptions; + private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly TonConfigOption _tonConfigOption; + private readonly SyncStateServiceOption _syncStateServiceOption; + + private const int PageCount = 1000; + + public CrossChainTransferAppService(ICrossChainTransferRepository crossChainTransferRepository, + IChainAppService chainAppService, + INESTRepository crossChainTransferIndexRepository, + ITokenRepository tokenRepository, + IBlockchainAppService blockchainAppService, + ICheckTransferProvider checkTransferProvider, + IEnumerable crossChainTransferProviders, + IIndexerAppService indexerAppService, ITokenAppService tokenAppService, + IOptionsSnapshot autoReceiveConfigOptions, IUnitOfWorkManager unitOfWorkManager, + IOptionsSnapshot tonConfigOption, + IOptionsSnapshot syncStateServiceOption) + { + _crossChainTransferRepository = crossChainTransferRepository; + _chainAppService = chainAppService; + _crossChainTransferIndexRepository = crossChainTransferIndexRepository; + _tokenRepository = tokenRepository; + _blockchainAppService = blockchainAppService; + _checkTransferProvider = checkTransferProvider; + _indexerAppService = indexerAppService; + _tokenAppService = tokenAppService; + _unitOfWorkManager = unitOfWorkManager; + _autoReceiveConfigOptions = autoReceiveConfigOptions.Value; + _crossChainTransferProviders = crossChainTransferProviders.ToList(); + _tonConfigOption = tonConfigOption.Value; + _syncStateServiceOption = syncStateServiceOption.Value; + } + + public async Task> GetListAsync(GetCrossChainTransfersInput input) + { + var mustQuery = new List, QueryContainer>>(); + + if (!input.FromChainId.IsNullOrWhiteSpace()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.FromChainId).Value(input.FromChainId))); + } + + if (!input.ToChainId.IsNullOrWhiteSpace()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.ToChainId).Value(input.ToChainId))); + } + + if (!input.FromAddress.IsNullOrWhiteSpace()) + { + var shouldFromQuery = new List, QueryContainer>>(); + + if (!Base58CheckEncoding.Verify(input.FromAddress) && + Nethereum.Util.AddressExtensions.IsValidEthereumAddressHexFormat(input.FromAddress)) + { + shouldFromQuery.Add(q => q.Term(i => i.Field(f => f.FromAddress).Value(input.FromAddress.ToLower()))); + } + + if (TonAddressHelper.IsTonFriendlyAddress(input.FromAddress)) + { + shouldFromQuery.Add(q => q.Term(i => + i.Field(f => f.FromAddress).Value(TonAddressHelper.GetTonRawAddress(input.FromAddress)))); + } + + shouldFromQuery.Add(q => q.Term(i => i.Field(f => f.FromAddress).Value(input.FromAddress))); + + mustQuery.Add(q => q.Bool(bb => bb + .MinimumShouldMatch(1) + .Should(shouldFromQuery) + )); + } + + if (!input.ToAddress.IsNullOrWhiteSpace()) + { + var shouldToQuery = new List, QueryContainer>>(); + + if (!Base58CheckEncoding.Verify(input.ToAddress) && + Nethereum.Util.AddressExtensions.IsValidEthereumAddressHexFormat(input.ToAddress)) + { + shouldToQuery.Add(q => q.Term(i => i.Field(f => f.ToAddress).Value(input.ToAddress.ToLower()))); + } + + if (TonAddressHelper.IsTonFriendlyAddress(input.ToAddress)) + { + shouldToQuery.Add(q => q.Term(i => + i.Field(f => f.ToAddress).Value(TonAddressHelper.GetTonRawAddress(input.ToAddress)))); + } + + shouldToQuery.Add(q => q.Term(i => i.Field(f => f.ToAddress).Value(input.ToAddress))); + + mustQuery.Add(q => q.Bool(bb => bb + .MinimumShouldMatch(1) + .Should(shouldToQuery) + )); + } + + if (!input.Addresses.IsNullOrWhiteSpace()) + { + var addressList = input.Addresses.Split(','); + var shouldAddressesQuery = + new List, QueryContainer>>(); + foreach (var address in addressList) + { + if (!Base58CheckEncoding.Verify(address) && + Nethereum.Util.AddressExtensions.IsValidEthereumAddressHexFormat(address)) + { + shouldAddressesQuery.Add(q => q.Bool(b => b.Should( + s => s.Term(i => i.Field(f => f.FromAddress).Value(address.ToLower())), + s => s.Term(i => i.Field(f => f.ToAddress).Value(address.ToLower())) + ))); + } + + if (TonAddressHelper.IsTonFriendlyAddress(address)) + { + var rawAddress = TonAddressHelper.GetTonRawAddress(address); + shouldAddressesQuery.Add(q => q.Bool(b => b.Should( + s => s.Term(i => i.Field(f => f.FromAddress).Value(rawAddress)), + s => s.Term(i => i.Field(f => f.ToAddress).Value(rawAddress)) + ))); + } + + + shouldAddressesQuery.Add(q => q.Bool(b => b.Should( + s => s.Term(i => i.Field(f => f.FromAddress).Value(address)), + s => s.Term(i => i.Field(f => f.ToAddress).Value(address)) + ))); + } + + mustQuery.Add(q => q.Bool(bb => bb + .MinimumShouldMatch(1) + .Should(shouldAddressesQuery) + )); + } + + if (input.Status.HasValue) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Status).Value(input.Status.Value))); + } + + if (input.Type.HasValue) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Type).Value(input.Type.Value))); + } + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var list = await _crossChainTransferIndexRepository.GetListAsync(Filter, limit: input.MaxResultCount, + skip: input.SkipCount, sortExp: o => o.TransferTime, sortType: SortOrder.Descending); + var totalCount = await _crossChainTransferIndexRepository.CountAsync(Filter); + + var items = ObjectMapper.Map, List>(list.Item2) + .Select(dto => + { + dto.FromAddress = TonAddressHelper.ConvertRawAddressToFriendly(dto.FromAddress, + _tonConfigOption.IsTestOnly, _tonConfigOption.IsBounceable); + dto.ToAddress = TonAddressHelper.ConvertRawAddressToFriendly(dto.ToAddress, _tonConfigOption.IsTestOnly, + _tonConfigOption.IsBounceable); + return dto; + }) + .ToList(); + + return new PagedResultDto + { + TotalCount = totalCount.Count, + Items = items + }; + } + + public async Task> GetStatusAsync(GetCrossChainTransferStatusInput input) + { + var mustQuery = new List, QueryContainer>>(); + mustQuery.Add(q => q.Ids(i => i.Values(input.Ids))); + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var list = await _crossChainTransferIndexRepository.GetListAsync(Filter); + return new ListResultDto + { + Items = ObjectMapper.Map, List>(list.Item2) + }; + } + + public async Task TransferAsync(CrossChainTransferInput input) + { + var transfer = await FindCrossChainTransferAsync(input.FromChainId, input.ToChainId, + input.TransferTransactionId, input.ReceiptId); + + var isTransferExist = true; + if (transfer == null) + { + Log.Information( + "New transfer {transferTxId},{receiptId},{status}", input.TransferTransactionId, input.ReceiptId,input.TransferStatus); + isTransferExist = false; + transfer = ObjectMapper.Map(input); + transfer.ReceiveStatus = ReceiptStatus.Initializing; + transfer.Type = await GetCrossChainTypeAsync(input.FromChainId, input.ToChainId); + transfer.Progress = 0; + transfer.ProgressUpdateTime = input.TransferTime; + transfer.Status = CrossChainStatus.Transferred; + } + else + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "Update transfer {transferTxId},{receiptId},{status}", input.TransferTransactionId, input.ReceiptId, + input.TransferStatus); + transfer.FromAddress = input.FromAddress; + transfer.TransferTokenId = input.TransferTokenId; + transfer.TransferTransactionId = input.TransferTransactionId; + transfer.TransferAmount = input.TransferAmount; + transfer.TransferTime = input.TransferTime; + transfer.TransferBlockHeight = input.TransferBlockHeight; + transfer.TransferStatus = input.TransferStatus; + } + + if (isTransferExist) + { + await UpdateCrossChainTransferAsync(transfer); + } + else + { + await InsertCrossChainTransferAsync(transfer); + } + } + + [ExceptionHandler(typeof(DbUpdateConcurrencyException), typeof(DbUpdateException), + TargetType = typeof(CrossChainTransferAppService), + MethodName = nameof(HandleTransferDbException))] + public virtual Task UpdateCrossChainTransferAsync(CrossChainTransfer transfer) + { + return _crossChainTransferRepository.UpdateAsync(transfer, true); + } + + [ExceptionHandler(typeof(DbUpdateConcurrencyException), typeof(DbUpdateException), + TargetType = typeof(CrossChainTransferAppService), + MethodName = nameof(HandleTransferDbException))] + public virtual Task InsertCrossChainTransferAsync(CrossChainTransfer transfer) + { + return _crossChainTransferRepository.InsertAsync(transfer, autoSave: true); + } + + private async Task HandleUniqueTransfer(Exception ex, T input) + { + if (ex.InnerException is MySqlException mySqlEx && mySqlEx.Number == 1062) + { + if (typeof(T) == typeof(CrossChainTransferInput)) + { + var transferInput = input as CrossChainTransferInput; + var transfer = await _crossChainTransferRepository.FindAsync(o => + o.FromChainId == transferInput.FromChainId && o.ToChainId == transferInput.ToChainId && + o.TransferTransactionId == transferInput.TransferTransactionId); + ; + + if (transfer != null) + { + transfer.TransferTokenId = transferInput.TransferTokenId; + transfer.TransferTransactionId = transferInput.TransferTransactionId; + transfer.TransferAmount = transferInput.TransferAmount; + transfer.TransferTime = transferInput.TransferTime; + transfer.TransferBlockHeight = transferInput.TransferBlockHeight; + + await _crossChainTransferRepository.UpdateAsync(transfer); + } + else + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Error(ex, + "Unable to handle unique constraint for transfer {TransferTransactionId} and receipt {ReceiptId}.", + transferInput.TransferTransactionId, transferInput.ReceiptId); + } + } + else if (typeof(T) == typeof(CrossChainReceiveInput)) + { + var receiveInput = input as CrossChainReceiveInput; + var transfer = await _crossChainTransferRepository.FindAsync(o => + o.FromChainId == receiveInput.FromChainId && o.ToChainId == receiveInput.ToChainId && + o.TransferTransactionId == receiveInput.TransferTransactionId); + if (transfer != null) + { + transfer.ReceiveTokenId = receiveInput.ReceiveTokenId; + transfer.ReceiveTransactionId = receiveInput.ReceiveTransactionId; + transfer.ReceiveTime = receiveInput.ReceiveTime; + transfer.ReceiveAmount = receiveInput.ReceiveAmount; + + transfer.ReceiveBlockHeight = receiveInput.ReceiveBlockHeight; + transfer.ReceiveStatus = receiveInput.ReceiveStatus; + if (receiveInput.ReceiveStatus == ReceiptStatus.Confirmed) + { + transfer.Status = CrossChainStatus.Received; + } + + transfer.Progress = CrossChainServerConsts.FullOfTheProgress; + transfer.ProgressUpdateTime = receiveInput.ReceiveTime; + + await _crossChainTransferRepository.UpdateAsync(transfer); + } + else + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Error( + ex, + "Unable to handle unique constraint for transfer {TransferTransactionId} and receipt {ReceiptId}.", + receiveInput.TransferTransactionId, receiveInput.ReceiptId); + } + } + } + else + { + Log.Error(ex, + "Failed to insert or update transfer info."); + } + } + + public async Task ReceiveAsync(CrossChainReceiveInput input) + { + Log.ForContext("fromChainId", input.FromChainId).ForContext("toChainId", input.ToChainId).Information( + "Receive transfer {transferTxId},{receiptId},{receiveTxId}", input.TransferTransactionId, input.ReceiptId, + input.ReceiveTransactionId); + var transfer = await FindCrossChainTransferAsync(input.FromChainId, input.ToChainId, + input.TransferTransactionId, input.ReceiptId); + + var isTransferExist = true; + if (transfer == null) + { + Log.ForContext("fromChainId", input.FromChainId).ForContext("toChainId", input.ToChainId).Information( + "New receive {transferTxId},{receiptId},{receiveTxId},{status}", input.TransferTransactionId, input.ReceiptId, + input.ReceiveTransactionId,input.ReceiveStatus); + isTransferExist = false; + transfer = ObjectMapper.Map(input); + transfer.Type = await GetCrossChainTypeAsync(input.FromChainId, input.ToChainId); + transfer.TransferStatus = ReceiptStatus.Confirmed; + } + else + { + Log.ForContext("fromChainId", input.FromChainId).ForContext("toChainId", input.ToChainId).Information( + "Update receive {transferTxId},{receiptId},{receiveTxId},{status}", transfer.TransferTransactionId, + input.ReceiptId, + input.ReceiveTransactionId,input.ReceiveStatus); + transfer.ReceiveTokenId = input.ReceiveTokenId; + transfer.ReceiveTransactionId = input.ReceiveTransactionId; + transfer.ReceiveTime = input.ReceiveTime; + } + + transfer.ReceiveAmount = input.ReceiveAmount; + transfer.ReceiveBlockHeight = input.ReceiveBlockHeight; + transfer.ReceiveStatus = input.ReceiveStatus; + transfer.Status = CrossChainStatus.Indexed; + if (input.ReceiveStatus == ReceiptStatus.Confirmed) + { + transfer.Status = CrossChainStatus.Received; + } + + transfer.Progress = CrossChainServerConsts.FullOfTheProgress; + transfer.ProgressUpdateTime = input.ReceiveTime; + if (isTransferExist) + { + await UpdateCrossChainTransferAsync(transfer); + } + else + { + await InsertCrossChainTransferAsync(transfer); + } + } + + public async Task DeleteCrossChainTransferAsync(string fromChainId, string toChainId, string transferTransactionId, + string receiptId) + { + var transfer = await FindCrossChainTransferAsync(fromChainId, toChainId, + transferTransactionId, receiptId); + if (transfer != null) + { + Log.Debug("Delete transfer {transferTxId},{receiptId}", transfer.TransferTransactionId, + transfer.ReceiptId); + await _crossChainTransferRepository.DeleteAsync(transfer); + } + } + + [ExceptionHandler(typeof(Exception), typeof(InvalidOperationException), + Message = "Find cross chain transfer failed.", ReturnDefault = ReturnDefault.Default, + LogTargets = new[] { "fromChainId", "toChainId", "transferTransactionId", "receiptId" })] + public virtual async Task FindCrossChainTransferAsync(string fromChainId, string toChainId, + string transferTransactionId, string receiptId) + { + var crossChainType = await GetCrossChainTypeAsync(fromChainId, toChainId); + return await GetCrossChainTransferProvider(crossChainType) + .FindTransferAsync(fromChainId, toChainId, transferTransactionId, receiptId); + } + + public async Task AddIndexAsync(AddCrossChainTransferIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TransferTokenId != Guid.Empty) + { + index.TransferToken = await _tokenRepository.GetAsync(input.TransferTokenId); + } + + if (input.ReceiveTokenId != Guid.Empty) + { + index.ReceiveToken = await _tokenRepository.GetAsync(input.ReceiveTokenId); + } + + await _crossChainTransferIndexRepository.AddAsync(index); + } + + public async Task UpdateIndexAsync(UpdateCrossChainTransferIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TransferTokenId != Guid.Empty) + { + index.TransferToken = await _tokenRepository.GetAsync(input.TransferTokenId); + } + + if (input.ReceiveTokenId != Guid.Empty) + { + index.ReceiveToken = await _tokenRepository.GetAsync(input.ReceiveTokenId); + } + + await _crossChainTransferIndexRepository.UpdateAsync(index); + } + + public async Task DeleteIndexAsync(Guid id) + { + await _crossChainTransferIndexRepository.DeleteAsync(id); + } + + public async Task UpdateProgressAsync() + { + var page = 0; + var crossChainTransfers = await GetToUpdateProgressAsync(page); + + while (crossChainTransfers.Count != 0) + { + var now = DateTime.UtcNow; + var toUpdate = new List(); + foreach (var transfer in crossChainTransfers) + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "UpdateProgress.TransferTransactionId:{txId},progress:{progress}", + transfer.TransferTransactionId, transfer.Progress); + var provider = GetCrossChainTransferProvider(transfer.Type); + var progress = await provider.CalculateCrossChainProgressAsync(transfer); + + if (progress == transfer.Progress) + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "Progress not changed. TransferTransactionId:{txId}", + transfer.TransferTransactionId); + continue; + } + + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "Progress changed. Progress:{progress},transferTransactionId:{txId}", + progress, transfer.TransferTransactionId); + transfer.Progress = progress; + transfer.ProgressUpdateTime = now; + if (progress == CrossChainServerConsts.FullOfTheProgress) + { + transfer.Status = CrossChainStatus.Indexed; + } + + toUpdate.Add(transfer); + } + + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); + + page++; + crossChainTransfers = await GetToUpdateProgressAsync(page); + } + } + + private async Task GetCrossChainTypeAsync(string fromChainId, string toChainId) + { + var fromChain = await _chainAppService.GetAsync(fromChainId); + var toChain = await _chainAppService.GetAsync(toChainId); + + if (fromChain == null || toChain == null) + { + return CrossChainType.Homogeneous; + } + + return fromChain.Type == toChain.Type ? CrossChainType.Homogeneous : CrossChainType.Heterogeneous; + } + + private async Task> GetToUpdateProgressAsync(int page) + { + using var uow = _unitOfWorkManager.Begin(); + var q = await _crossChainTransferRepository.GetQueryableAsync(); + var crossChainTransfers = await AsyncExecuter.ToListAsync(q + .Where(o => o.Status == CrossChainStatus.Transferred && o.TransferStatus == ReceiptStatus.Confirmed && + o.Progress != CrossChainServerConsts.FullOfTheProgress && o.ProgressUpdateTime > DateTime.UtcNow.AddDays(-1)) + .OrderBy(o => o.ProgressUpdateTime) + .Skip(PageCount * page) + .Take(PageCount)); + await uow.CompleteAsync(); + return crossChainTransfers; + } + + [ExceptionHandler(typeof(Exception), Message = "Update receive transaction failed.")] + public virtual async Task UpdateReceiveTransactionAsync() + { + var page = 0; + var toUpdate = new List(); + var crossChainTransfers = await GetToUpdateReceiveTransactionAsync(page); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "UpdateReceiveTransaction.TransferTransactionId:{id}", transfer.TransferTransactionId); + var txResult = + await _blockchainAppService.GetTransactionResultAsync(transfer.ToChainId, + transfer.ReceiveTransactionId); + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Information( + "txResult.TransferTransactionId:{id},is failed:{isFailed}", transfer.TransferTransactionId, + txResult.IsFailed); + + if (txResult.IsFailed) + { + Log.Information("[UpdateReceiveTransactionAsync] Transaction failed. TransferTransactionId:{id}, ReceiveTransactionId:{txId}", + transfer.TransferTransactionId,transfer.ReceiveTransactionId); + transfer.ReceiveTransactionId = null; + transfer.ReceiveStatus = ReceiptStatus.Initializing; + transfer.ReceiveBlockHeight = 0; + transfer.ReceiveTime = new DateTime(); + transfer.ReceiveAmount = 0; + toUpdate.Add(transfer); + } + else if (txResult.IsMined) + { + Log.Information("[UpdateReceiveTransactionAsync] Transaction mined. TransferTransactionId:{id}, ReceiveTransactionId:{txId}", + transfer.TransferTransactionId,transfer.ReceiveTransactionId); + var chainStatus = await _blockchainAppService.GetChainStatusAsync(transfer.ToChainId); + if (chainStatus.ConfirmedBlockHeight >= txResult.BlockHeight) + { + var block = await _blockchainAppService.GetBlockByHeightAsync(transfer.ToChainId, + txResult.BlockHeight); + if (block.BlockHash != txResult.BlockHash) + { + transfer.ReceiveTransactionId = null; + toUpdate.Add(transfer); + } + } + } + } + + page++; + crossChainTransfers = await GetToUpdateReceiveTransactionAsync(page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate); + } + } + + private async Task> GetToUpdateReceiveTransactionAsync(int page) + { + using var uow = _unitOfWorkManager.Begin(); + var q = await _crossChainTransferRepository.GetQueryableAsync(); + var crossChainTransfers = await AsyncExecuter.ToListAsync(q + .Where(o => o.Status == CrossChainStatus.Indexed && + o.Progress == CrossChainServerConsts.FullOfTheProgress && o.ReceiveTransactionId != null && + o.Type == CrossChainType.Homogeneous) + .OrderBy(o => o.ProgressUpdateTime) + .Skip(PageCount * page) + .Take(PageCount)); + await uow.CompleteAsync(); + return crossChainTransfers; + } + + // This method is used to auto receive the cross chain transfer. + // Only for homogeneous transfer. + public async Task AutoReceiveAsync() + { + var page = 0; + var toUpdate = new List(); + var crossChainTransfers = await GetHomogeneousTransferToReceivedAsync(page); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "AutoReceive. TransferTransactionId:{id}", transfer.TransferTransactionId); + var toChain = await _chainAppService.GetAsync(transfer.ToChainId); + if (toChain == null || toChain.Type != BlockchainType.AElf) + { + continue; + } + + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Information( + "Start to auto receive, transferTransactionId:{id}", transfer.TransferTransactionId); + + if (!await _checkTransferProvider.CheckTokenExistAsync(transfer.FromChainId, transfer.ToChainId, + transfer.TransferTokenId)) + { + Logger.LogInformation( + "Token not exist. From chain:{fromChain}, to chain:{toChain}, Id: {transferId}", + transfer.FromChainId, transfer.ToChainId, transfer.TransferTransactionId); + transfer.ReceiveTransactionAttemptTimes += 1; + toUpdate.Add(transfer); + continue; + } + + var provider = GetCrossChainTransferProvider(transfer.Type); + var txId = await provider.SendReceiveTransactionAsync(transfer); + if (string.IsNullOrWhiteSpace(txId)) + { + transfer.ReceiveTransactionId = txId; + transfer.ReceiveTransactionAttemptTimes += 1; + toUpdate.Add(transfer); + continue; + } + + transfer.ReceiveTransactionId = txId; + transfer.ReceiveTransactionAttemptTimes += 1; + toUpdate.Add(transfer); + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Information( + "Send auto receive tx: {txId}, Id:{id},TransferTransactionId:{transferId}", + txId, transfer.Id, transfer.TransferTransactionId); + } + + page++; + crossChainTransfers = await GetHomogeneousTransferToReceivedAsync(page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate); + } + } + + public async Task CheckTransferTransactionConfirmedAsync(string chainId) + { + Log.Information( + "[CheckTransferTransactionConfirmedAsync] Start to check transfer transaction confirmed. ChainId:{ChainId}", + chainId); + var page = 0; + var toUpdate = new List(); + var currentLib = await _indexerAppService.GetLatestIndexHeightAsync(chainId); + var crossChainTransfers = await GetPendingTransferTransactionAsync(chainId, currentLib, page); + Log.Debug("[CheckTransferTransactionConfirmedAsync] Check transfer transaction confirmed. Count:{count}", + crossChainTransfers.Count); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.Debug( + "[CheckTransferTransactionConfirmedAsync] Check if the transaction has been confirmed. TransferTransactionId:{id}, receiptId:{receiptId}", + transfer.TransferTransactionId, transfer.ReceiptId); + var chain = await _chainAppService.GetAsync(transfer.FromChainId); + bool success; + CrossChainTransferInfoDto crossChainTransferInfo; + if (transfer.Type == CrossChainType.Heterogeneous) + { + (success, crossChainTransferInfo) = + await _indexerAppService.GetPendingReceiptAsync( + ChainHelper.ConvertChainIdToBase58(chain.AElfChainId), + transfer.ReceiptId); + } + else + { + (success, crossChainTransferInfo) = await _indexerAppService.GetPendingTransactionAsync( + ChainHelper.ConvertChainIdToBase58(chain.AElfChainId), + transfer.TransferTransactionId); + } + + switch (success) + { + case false: + Log.Warning( + "[CheckTransferTransactionConfirmedAsync] Query aefinder failed, retry. TransferTransactionId:{id}, receiptId:{receiptId}", + transfer.TransferTransactionId, transfer.ReceiptId); + continue; + case true when crossChainTransferInfo == null: + Log.Warning( + "[CheckTransferTransactionConfirmedAsync] Transaction not exist from aefinder, delete. TransferTransactionId:{id}, receiptId:{receiptId}", + transfer.TransferTransactionId, transfer.ReceiptId); + await DeleteCrossChainTransferAsync(transfer.FromChainId, transfer.ToChainId, + transfer.TransferTransactionId, transfer.ReceiptId); + continue; + } + + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "[CheckTransferTransactionConfirmedAsync] Update transfer {transferTxId},{receiptId}", + transfer.TransferTransactionId, + transfer.ReceiptId); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = transfer.FromChainId, + Symbol = crossChainTransferInfo.TransferTokenSymbol + }); + transfer.FromAddress = crossChainTransferInfo.FromAddress; + transfer.TransferTokenId = token.Id; + transfer.TransferTransactionId = crossChainTransferInfo.TransferTransactionId; + transfer.TransferAmount = crossChainTransferInfo.TransferAmount / (decimal)Math.Pow(10, token.Decimals); + transfer.TransferTime = crossChainTransferInfo.TransferTime; + transfer.TransferBlockHeight = crossChainTransferInfo.TransferBlockHeight; + transfer.TransferStatus = ReceiptStatus.Confirmed; + toUpdate.Add(transfer); + } + + page++; + crossChainTransfers = await GetPendingTransferTransactionAsync(chainId, currentLib, page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); + } + } + + public async Task CheckReceiveTransactionConfirmedAsync(string chainId) + { + Log.Information( + "[CheckReceiveTransactionConfirmedAsync] Start to check receive transaction confirmed. ChainId:{ChainId}", + chainId); + var page = 0; + var toUpdate = new List(); + var currentLib = await _indexerAppService.GetLatestIndexHeightAsync(chainId); + var crossChainTransfers = await GetPendingReceiveTransactionAsync(chainId, currentLib, page); + Log.Debug("[CheckReceiveTransactionConfirmedAsync] Check receive transaction confirmed. Count:{count}", + crossChainTransfers.Count); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.Debug( + "[CheckReceiveTransactionConfirmedAsync] Check if the transaction has been confirmed. ReceiveTransactionId:{id}, receiptId:{receiptId}", + transfer.TransferTransactionId, transfer.ReceiptId); + var chain = await _chainAppService.GetAsync(transfer.ToChainId); + bool success; + CrossChainTransferInfoDto crossChainTransferInfo; + if (transfer.Type == CrossChainType.Heterogeneous) + { + (success, crossChainTransferInfo) = + await _indexerAppService.GetPendingReceiptAsync( + ChainHelper.ConvertChainIdToBase58(chain.AElfChainId), + transfer.ReceiptId); + } + else + { + (success, crossChainTransferInfo) = await _indexerAppService.GetPendingReceiveTransactionAsync( + ChainHelper.ConvertChainIdToBase58(chain.AElfChainId), + transfer.ReceiveTransactionId); + } + if (!success) + { + Log.Warning( + "[CheckReceiveTransactionConfirmedAsync] Query aefinder failed, retry. ReceiveTransactionId:{id}, receiptId:{receiptId}", + transfer.ReceiveTransactionId, transfer.ReceiptId); + continue; + } + + if (success && crossChainTransferInfo == null) + { + Log.Warning( + "[CheckReceiveTransactionConfirmedAsync] Transaction not exist from aefinder, delete. ReceiveTransactionId:{id}, receiptId:{receiptId}", + transfer.ReceiveTransactionId, transfer.ReceiptId); + transfer.ReceiveTransactionId = null; + transfer.ReceiveStatus = ReceiptStatus.Initializing; + transfer.ReceiveBlockHeight = 0; + transfer.ReceiveTime = new DateTime(); + transfer.ReceiveAmount = 0; + toUpdate.Add(transfer); + continue; + } + + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "[CheckReceiveTransactionConfirmedAsync] Update receive {receiveTransactionId},{receiptId}", + transfer.ReceiveTransactionId, + transfer.ReceiptId); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = transfer.ToChainId, + Symbol = crossChainTransferInfo.ReceiveTokenSymbol + }); + transfer.ReceiveTokenId = token.Id; + transfer.ReceiveTransactionId = crossChainTransferInfo.ReceiveTransactionId; + transfer.ReceiveTime = crossChainTransferInfo.ReceiveTime; + + transfer.ReceiveAmount = crossChainTransferInfo.ReceiveAmount / (decimal)Math.Pow(10, token.Decimals); + transfer.ReceiveBlockHeight = crossChainTransferInfo.ReceiveBlockHeight; + transfer.ReceiveStatus = ReceiptStatus.Confirmed; + transfer.Status = CrossChainStatus.Received; + transfer.Progress = CrossChainServerConsts.FullOfTheProgress; + transfer.ProgressUpdateTime = crossChainTransferInfo.ReceiveTime; + transfer.TransferStatus = ReceiptStatus.Confirmed; + + toUpdate.Add(transfer); + } + + page++; + crossChainTransfers = await GetPendingReceiveTransactionAsync(chainId, currentLib, page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); + } + } + + public async Task CheckEvmTransferTransactionConfirmedAsync(string chainId) + { + Log.Information( + "[CheckEvmTransferTransactionConfirmedAsync] Start to check evm transfer transaction confirmed. ChainId:{ChainId}", + chainId); + var page = 0; + var toUpdate = new List(); + var currentChainStatus = await _blockchainAppService.GetChainStatusAsync(chainId); + var crossChainTransfers = + await GetPendingTransferTransactionAsync(chainId, currentChainStatus.ConfirmedBlockHeight, page); + Log.Debug("[CheckEvmTransferTransactionConfirmedAsync] Check evm transfer transaction confirmed. Count:{count}", + crossChainTransfers.Count); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.Debug( + "[CheckEvmTransferTransactionConfirmedAsync] Check if the evm transaction has been confirmed. TransferTransactionId:{id}, receiptId:{receiptId}", + transfer.TransferTransactionId, transfer.ReceiptId); + var txResult = + await GetTransactionResultWithRetryAsync(chainId, + transfer.TransferTransactionId); + if (txResult == null) + { + Log.Error( + "[CheckEvmTransferTransactionConfirmedAsync] Transaction {TransactionId} not found on chain {ChainId}", + transfer.TransferTransactionId, + chainId); + await DeleteCrossChainTransferAsync(transfer.FromChainId, transfer.ToChainId, + transfer.TransferTransactionId, transfer.ReceiptId); + } + + if (txResult.IsMined && txResult.BlockHeight == transfer.TransferBlockHeight) + { + Log.Debug( + "[CheckEvmTransferTransactionConfirmedAsync] Transaction {TransactionId} is mined on chain {ChainId}", + transfer.TransferTransactionId, + chainId); + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "[CheckEvmTransferTransactionConfirmedAsync] Update transfer {transferTxId},{receiptId}", + transfer.TransferTransactionId, + transfer.ReceiptId); + transfer.TransferStatus = ReceiptStatus.Confirmed; + toUpdate.Add(transfer); + } + + else if (txResult.IsFailed) + { + Log.Debug( + "[CheckEvmTransferTransactionConfirmedAsync] Transaction {TransactionId} failed on chain {ChainId}", + transfer.TransferTransactionId, + chainId); + await DeleteCrossChainTransferAsync(transfer.FromChainId, transfer.ToChainId, + transfer.TransferTransactionId, transfer.ReceiptId); + } + else + { + Log.Debug( + "[CheckEvmTransferTransactionConfirmedAsync] Query from {ChainId} failed. {TransactionId}", + chainId, transfer.TransferTransactionId); + // retry + } + } + + page++; + crossChainTransfers = + await GetPendingTransferTransactionAsync(chainId, currentChainStatus.ConfirmedBlockHeight, page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); + } + } + + public async Task CheckEvmReceiveTransactionConfirmedAsync(string chainId) + { + Log.Information( + "[CheckEvmReceiveTransactionConfirmedAsync] Start to check evm receive transaction confirmed. ChainId:{ChainId}", + chainId); + var page = 0; + var toUpdate = new List(); + var currentChainStatus = await _blockchainAppService.GetChainStatusAsync(chainId); + var crossChainTransfers = + await GetPendingReceiveTransactionAsync(chainId, currentChainStatus.ConfirmedBlockHeight, page); + Log.Debug("[CheckEvmReceiveTransactionConfirmedAsync] Check evm receive transaction confirmed. Count:{count}", + crossChainTransfers.Count); + while (crossChainTransfers.Count != 0) + { + foreach (var transfer in crossChainTransfers) + { + Log.Debug( + "[CheckEvmReceiveTransactionConfirmedAsync] Check if the evm transaction has been confirmed. receiveTransactionId:{id}, receiptId:{receiptId}", + transfer.ReceiveTransactionId, transfer.ReceiptId); + var txResult = + await GetTransactionResultWithRetryAsync(chainId, + transfer.ReceiveTransactionId); + if (txResult == null) + { + Log.Error( + "[CheckEvmReceiveTransactionConfirmedAsync] Transaction {TransactionId} not found on chain {ChainId}", + transfer.ReceiveTransactionId, + chainId); + transfer.ReceiveTransactionId = null; + transfer.ReceiveStatus = ReceiptStatus.Initializing; + transfer.ReceiveBlockHeight = 0; + transfer.ReceiveTime = new DateTime(); + transfer.ReceiveAmount = 0; + toUpdate.Add(transfer); + } + + else if (txResult.IsMined && txResult.BlockHeight == transfer.ReceiveBlockHeight) + { + Log.Debug( + "[CheckEvmReceiveTransactionConfirmedAsync] Transaction {TransactionId} is mined on chain {ChainId}", + transfer.ReceiveTransactionId, + chainId); + + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) + .Debug( + "[CheckEvmReceiveTransactionConfirmedAsync] Update receive {transferTxId},{receiptId}", + transfer.ReceiveTransactionId, + transfer.ReceiptId); + transfer.TransferStatus = ReceiptStatus.Confirmed; + transfer.ReceiveStatus = ReceiptStatus.Confirmed; + transfer.Status = CrossChainStatus.Received; + transfer.Progress = CrossChainServerConsts.FullOfTheProgress; + toUpdate.Add(transfer); + } + else if (txResult.IsFailed) + { + Log.Debug( + "[CheckEvmReceiveTransactionConfirmedAsync] Transaction {TransactionId} failed on chain {ChainId}", + transfer.ReceiveTransactionId, + chainId); + transfer.ReceiveTransactionId = null; + transfer.ReceiveStatus = ReceiptStatus.Initializing; + transfer.ReceiveBlockHeight = 0; + transfer.ReceiveTime = new DateTime(); + transfer.ReceiveAmount = 0; + toUpdate.Add(transfer); + } + else + { + Log.Debug("[CheckEvmReceiveTransactionConfirmedAsync] Query from {ChainId} failed. {TransactionId}", + chainId, transfer.ReceiveTransactionId); + // retry + } + } + + page++; + crossChainTransfers = + await GetPendingReceiveTransactionAsync(chainId, currentChainStatus.ConfirmedBlockHeight, page); + } + + if (toUpdate.Count > 0) + { + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); + } + } + + private async Task GetTransactionResultWithRetryAsync(string chainId, string txId) + { + const int maxRetries = 3; + const int delayMilliseconds = 500; + + for (var i = 1; i <= maxRetries; i++) + { + var res = await _blockchainAppService.GetTransactionResultAsync(chainId, txId); + if (res != null && res.ChainId == null) + { + Log.Warning("Retry {Retry}/{MaxRetry} failed to query transaction {TxId} on chain {ChainId}", + i, maxRetries, txId, chainId); + if (i == maxRetries) + { + Log.Error("Max retry reached. Failed to query transaction {TxId} on chain {ChainId}", txId, + chainId); + return new TransactionResultDto(); + } + + await Task.Delay(delayMilliseconds * (int)Math.Pow(2, i - 1)); + } + else + { + return res; + } + } + + return new TransactionResultDto(); + } + + private async Task> GetPendingTransferTransactionAsync(string chainId, long lib, + int page) + { + using var uow = _unitOfWorkManager.Begin(); + var q = await _crossChainTransferRepository.GetQueryableAsync(); + var crossChainTransfers = await AsyncExecuter.ToListAsync(q + .Where(o => o.TransferStatus == ReceiptStatus.Pending && o.FromChainId == chainId && + o.TransferBlockHeight <= lib) + .OrderBy(o => o.TransferBlockHeight) + .Skip(PageCount * page) + .Take(PageCount)); + await uow.CompleteAsync(); + return crossChainTransfers; + } + + private async Task> GetPendingReceiveTransactionAsync(string chainId, long lib, + int page) + { + using var uow = _unitOfWorkManager.Begin(); + var q = await _crossChainTransferRepository.GetQueryableAsync(); + var crossChainTransfers = await AsyncExecuter.ToListAsync(q + .Where(o => o.ReceiveStatus == ReceiptStatus.Pending && o.ToChainId == chainId && + o.ReceiveTransactionId != null && + o.ReceiveBlockHeight > 0 && + o.ReceiveBlockHeight <= lib) + .OrderBy(o => o.ReceiveTime) + .Skip(PageCount * page) + .Take(PageCount)); + await uow.CompleteAsync(); + return crossChainTransfers; + } + + // This method is used to get the transfers that need to be received. + // It will check if the transfer is in progress and if it has not been received yet. + // Only for homogeneous transfers. + private async Task> GetHomogeneousTransferToReceivedAsync(int page) + { + using var uow = _unitOfWorkManager.Begin(); + var q = await _crossChainTransferRepository.GetQueryableAsync(); + var crossChainTransfers = await AsyncExecuter.ToListAsync(q + .Where(o => o.Progress == CrossChainServerConsts.FullOfTheProgress && o.ReceiveTransactionId == null && + o.ReceiveTransactionAttemptTimes < _autoReceiveConfigOptions.ReceiveRetryTimes && + o.Type == CrossChainType.Homogeneous) + .OrderBy(o => o.ProgressUpdateTime) + .Skip(PageCount * page) + .Take(PageCount)); + await uow.CompleteAsync(); + return crossChainTransfers; + } + + private ICrossChainTransferProvider GetCrossChainTransferProvider(CrossChainType crossChainType) + { + return _crossChainTransferProviders.First(o => o.CrossChainType == crossChainType); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs new file mode 100644 index 0000000..2c31224 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs @@ -0,0 +1,65 @@ +using System; +using System.Net; +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using Nethereum.Util; +using Serilog; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.CrossChain; + +public class HeterogeneousCrossChainTransferProvider : ICrossChainTransferProvider, ITransientDependency +{ + private readonly IChainAppService _chainAppService; + private readonly ICrossChainTransferRepository _crossChainTransferRepository; + private readonly IAetherLinkProvider _aetherLinkProvider; + + public HeterogeneousCrossChainTransferProvider(IChainAppService chainAppService, + ICrossChainTransferRepository crossChainTransferRepository, + IAetherLinkProvider aetherLinkProvider) + { + _chainAppService = chainAppService; + _crossChainTransferRepository = crossChainTransferRepository; + _aetherLinkProvider = aetherLinkProvider; + } + + public CrossChainType CrossChainType { get; } = CrossChainType.Heterogeneous; + + [UnitOfWork] + public async Task FindTransferAsync(string fromChainId, string toChainId, + string transferTransactionId, string receiptId) + { + Log.Debug("Find transfer from chain {fromChainId} to chain {toChainId} with receipt id {receiptId}.", + fromChainId, toChainId, receiptId); + return await _crossChainTransferRepository.FindAsync(o => + o.FromChainId == fromChainId && o.ToChainId == toChainId && o.ReceiptId == receiptId); + } + + public async Task CalculateCrossChainProgressAsync(CrossChainTransfer transfer) + { + var chain = await _chainAppService.GetAsync(transfer.ToChainId); + var fromChain = await _chainAppService.GetAsync(transfer.FromChainId); + if (chain == null || fromChain == null) + { + return 0; + } + + Log.Debug("Calculate cross chain progress {txId}", transfer.TransferTransactionId); + return await _aetherLinkProvider.CalculateCrossChainProgressAsync(new AetherLinkCrossChainStatusInput + { + TransactionId = transfer.TransferTransactionId + }); + } + + public Task SendReceiveTransactionAsync(CrossChainTransfer transfer) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/HomogeneousCrossChainTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/HomogeneousCrossChainTransferProvider.cs new file mode 100644 index 0000000..b095e3e --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/HomogeneousCrossChainTransferProvider.cs @@ -0,0 +1,186 @@ +using System; +using System.Linq; +using System.Net; +using System.Text.Json.Nodes; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.ExceptionHandler; +using AElf.Types; +using Google.Protobuf; +using Google.Protobuf.Collections; +using Newtonsoft.Json; +using Serilog; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.CrossChain; + +public class HomogeneousCrossChainTransferProvider : ICrossChainTransferProvider, ITransientDependency +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly ITokenContractAppService _tokenContractAppService; + private readonly IBlockchainAppService _blockchainAppService; + private readonly IChainAppService _chainAppService; + private readonly ICrossChainContractAppService _crossChainContractAppService; + private readonly ICrossChainTransferRepository _crossChainTransferRepository; + + public HomogeneousCrossChainTransferProvider(ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService, + ITokenContractAppService tokenContractAppService, IBlockchainAppService blockchainAppService, + IChainAppService chainAppService, ICrossChainContractAppService crossChainContractAppService, + ICrossChainTransferRepository crossChainTransferRepository) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + _tokenContractAppService = tokenContractAppService; + _blockchainAppService = blockchainAppService; + _chainAppService = chainAppService; + _crossChainContractAppService = crossChainContractAppService; + _crossChainTransferRepository = crossChainTransferRepository; + } + + public CrossChainType CrossChainType { get; } = CrossChainType.Homogeneous; + + [UnitOfWork] + public async Task FindTransferAsync(string fromChainId, string toChainId, + string transferTransactionId, string receiptId) + { + var result = await _crossChainTransferRepository.FindAsync(o => + o.FromChainId == fromChainId && o.ToChainId == toChainId && + o.TransferTransactionId == transferTransactionId); + return result ?? await _crossChainTransferRepository.FindAsync(o => + o.FromChainId == fromChainId && o.ToChainId == toChainId && + o.InlineTransferTransactionId == transferTransactionId); + } + + public async Task CalculateCrossChainProgressAsync(CrossChainTransfer transfer) + { + return await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync( + transfer.FromChainId, transfer.ToChainId, transfer.TransferBlockHeight, + transfer.TransferTime); + } + + [ExceptionHandler(typeof(Exception), typeof(InvalidOperationException), typeof(WebException), + Message = "SendReceiveTransaction failed.",ReturnDefault = ReturnDefault.Default, + LogTargets = new[]{"transfer"})] + public virtual async Task SendReceiveTransactionAsync(CrossChainTransfer transfer) + { + var txResult = + await _blockchainAppService.GetTransactionResultAsync(transfer.FromChainId, + transfer.TransferTransactionId); + Log.ForContext("transactionId", transfer.TransferTransactionId).Debug("sendTransactionResult:{transactionResult}", + JsonConvert.SerializeObject(txResult)); + var parentHeight = txResult.BlockHeight; + var fromChain = await _chainAppService.GetAsync(transfer.FromChainId); + if (fromChain == null) + { + return ""; + } + + var inlineTxLogs = txResult.Logs.Where(p => p.Name.Equals(InlineTransactionCreated.Descriptor.Name)).ToList(); + Log.ForContext("transactionId", transfer.TransferTokenId).Debug("sendTransactionResult inlineTxLogs:{inlineTxLogs}", + JsonConvert.SerializeObject(inlineTxLogs)); + if (inlineTxLogs.Count > 0) + { + foreach (var inlineCreatedLog in inlineTxLogs) + { + var inlineCreated = ProtoExtensions.MergeFromIndexed( + new RepeatedField + { + ByteString.FromBase64(inlineCreatedLog.Indexed[0]) + }); + Log.ForContext("transactionId", transfer.TransferTokenId).Debug("sendTransactionResult inlineCreated:{inlineCreated}", + JsonConvert.SerializeObject(inlineCreated)); + try + { + var inlineTransaction = inlineCreated.Transaction; + if (!inlineTransaction.MethodName.Contains(".CrossChainTransfer.")) + { + continue; + } + transfer.InlineTransferTransactionId = inlineTransaction.GetHash().ToHex(); + var inlineMerklePath = await GetMerklePathAsync(transfer.FromChainId, inlineTransaction.GetHash().ToHex()); + if (transfer.FromChainId != CrossChainServerConsts.AElfMainChainId) + { + var merkleProofContext = + await _crossChainContractAppService.GetBoundParentChainHeightAndMerklePathByHeightAsync( + transfer.FromChainId, txResult.BlockHeight); + parentHeight = merkleProofContext.BoundParentChainHeight; + inlineMerklePath.MerklePathNodes.AddRange(merkleProofContext.MerklePathFromParentChain.MerklePathNodes); + } + return await _tokenContractAppService.CrossChainReceiveTokenAsync(transfer.ToChainId, + fromChain.AElfChainId, parentHeight, inlineTransaction.ToByteArray().ToHex(), inlineMerklePath); + } + catch (Exception e) + { + Console.WriteLine(e); + Log.Error(e, "Fail: {message}", e.Message); + throw; + } + } + } + + var paramsJson = JsonNode.Parse(txResult.Transaction.Params); + var param = new AElf.Contracts.MultiToken.CrossChainTransferInput + { + To = Address.FromBase58(paramsJson["to"].ToString()), + Amount = long.Parse(paramsJson["amount"].ToString()), + Symbol = paramsJson["symbol"].ToString(), + IssueChainId = int.Parse(paramsJson["issueChainId"].ToString()), + ToChainId = int.Parse(paramsJson["toChainId"].ToString()) + }; + if (paramsJson["memo"] != null) + { + param.Memo = paramsJson["memo"].ToString(); + } + + var transaction = new Transaction + { + From = Address.FromBase58(txResult.Transaction.From), + To = Address.FromBase58(txResult.Transaction.To), + Params = param.ToByteString(), + Signature = ByteString.FromBase64(txResult.Transaction.Signature), + MethodName = txResult.Transaction.MethodName, + RefBlockNumber = txResult.Transaction.RefBlockNumber, + RefBlockPrefix = ByteString.FromBase64(txResult.Transaction.RefBlockPrefix) + }; + var merklePath = await GetMerklePathAsync(transfer.FromChainId, transfer.TransferTransactionId); + if (transfer.FromChainId != CrossChainServerConsts.AElfMainChainId) + { + var merkleProofContext = + await _crossChainContractAppService.GetBoundParentChainHeightAndMerklePathByHeightAsync( + transfer.FromChainId, txResult.BlockHeight); + parentHeight = merkleProofContext.BoundParentChainHeight; + merklePath.MerklePathNodes.AddRange(merkleProofContext.MerklePathFromParentChain.MerklePathNodes); + } + return await _tokenContractAppService.CrossChainReceiveTokenAsync(transfer.ToChainId, + fromChain.AElfChainId, parentHeight, transaction.ToByteArray().ToHex(), merklePath); + } + + private async Task GetMerklePathAsync(string chainId, string txId) + { + var merklePathDto = await _blockchainAppService.GetMerklePathAsync(chainId, txId); + var merklePath = new MerklePath(); + foreach (var node in merklePathDto.MerklePathNodes) + { + merklePath.MerklePathNodes.Add(new MerklePathNode() + { + Hash = new Hash() { Value = AElf.Types.Hash.LoadFromHex(node.Hash).Value }, + IsLeftChildNode = node.IsLeftChildNode + }); + } + + return merklePath; + } + + private FlowBehavior HandleSendReceiveTransactionException(Exception ex, CrossChainTransfer transfer) + { + Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId).Error(ex, + "SendReceiveTransaction failed.{fromChainId},{toChainId},{transferTokenId},{transferAmount},{toAddress}", + transfer.FromChainId, transfer.ToChainId, transfer.TransferTokenId, transfer.TransferAmount, + transfer.ToAddress); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/IAetherLinkProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/IAetherLinkProvider.cs new file mode 100644 index 0000000..cc7dcfc --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/IAetherLinkProvider.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Serilog; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.CrossChain; + +public interface IAetherLinkProvider +{ + Task CalculateCrossChainProgressAsync(AetherLinkCrossChainStatusInput input); +} + +public class AetherLinkProvider : IAetherLinkProvider +{ + private readonly IHttpProvider _httpProvider; + private readonly AetherLinkOption _aetherLinkOption; + private ApiInfo _getCrossChainStatusUri => new(HttpMethod.Get, _aetherLinkOption.CrossChainStatusUri); + + public AetherLinkProvider(IHttpProvider httpProvider, IOptionsSnapshot aetherLinkOption) + { + _httpProvider = httpProvider; + _aetherLinkOption = aetherLinkOption.Value; + } + + public async Task CalculateCrossChainProgressAsync(AetherLinkCrossChainStatusInput input) + { + var result = await _httpProvider.InvokeAsync>(_aetherLinkOption.BaseUrl, + _getCrossChainStatusUri, null,ConvertInputToDictionary(input)); + if (!result.Success || result.Data == null) + { + Log.Error("Get status from aetherlink failed."); + return 0; + } + + var crossChainStatus = result.Data.Status; + Log.Debug("Get cross chain status {crossChainStatus} from aetherlink {traceId},{txId}.", crossChainStatus,input.TraceId,input.TransactionId); + return 25 * (1 + crossChainStatus); + } + + private Dictionary ConvertInputToDictionary(AetherLinkCrossChainStatusInput input) + { + var jsonString = JsonConvert.SerializeObject(input); + return JsonConvert.DeserializeObject>(jsonString); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs new file mode 100644 index 0000000..ac509fc --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs @@ -0,0 +1,62 @@ +using System; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Nethereum.Util; +using Serilog; +using Volo.Abp.Domain.Entities; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICheckTransferProvider +{ + Task CheckTokenExistAsync(string fromChainId, string toChainId, Guid tokenId); +} + +public class CheckTransferProvider : ICheckTransferProvider +{ + private readonly IIndexerCrossChainLimitInfoService _indexerCrossChainLimitInfoService; + private readonly IChainAppService _chainAppService; + private readonly ITokenAppService _tokenAppService; + private readonly ITokenSymbolMappingProvider _tokenSymbolMappingProvider; + + + public CheckTransferProvider( + IIndexerCrossChainLimitInfoService indexerCrossChainLimitInfoService, IChainAppService chainAppService, + ITokenAppService tokenAppService, ITokenSymbolMappingProvider tokenSymbolMappingProvider) + { + _indexerCrossChainLimitInfoService = indexerCrossChainLimitInfoService; + _chainAppService = chainAppService; + _tokenAppService = tokenAppService; + _tokenSymbolMappingProvider = tokenSymbolMappingProvider; + } + + [ExceptionHandler(typeof(Exception), Message = "Check transfer: get token info error.", + ReturnDefault = ReturnDefault.Default,LogTargets = new[]{"fromChainId","toChainId","tokenId"})] + public virtual async Task GetTokenInfoAsync(string fromChainId, string toChainId, Guid tokenId) + { + var transferToken = await _tokenAppService.GetAsync(tokenId); + var symbol = + _tokenSymbolMappingProvider.GetMappingSymbol(fromChainId, toChainId, transferToken.Symbol); + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = toChainId, + Symbol = symbol + }); + return token; + } + + public async Task CheckTokenExistAsync(string fromChainId, string toChainId, Guid tokenId) + { + var token = await GetTokenInfoAsync(fromChainId, toChainId, tokenId); + return token != null; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/ICrossChainTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/ICrossChainTransferProvider.cs new file mode 100644 index 0000000..af0b549 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/ICrossChainTransferProvider.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainTransferProvider +{ + CrossChainType CrossChainType { get; } + + Task FindTransferAsync(string fromChainId, string toChainId, + string transferTransactionId, string receiptId); + Task CalculateCrossChainProgressAsync(CrossChainTransfer transfer); + Task SendReceiveTransactionAsync(CrossChainTransfer transfer); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/TonConfigOption.cs b/src/AElf.CrossChainServer.Application/CrossChain/TonConfigOption.cs new file mode 100644 index 0000000..8bb300a --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChain/TonConfigOption.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.CrossChain; + +public class TonConfigOption +{ + public bool IsTestOnly { get; set; } = false; + public bool IsBounceable { get; set; } = false; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChainServerAppService.cs b/src/AElf.CrossChainServer.Application/CrossChainServerAppService.cs new file mode 100644 index 0000000..a57d243 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChainServerAppService.cs @@ -0,0 +1,14 @@ +using AElf.CrossChainServer.Localization; +using Volo.Abp.Application.Services; + +namespace AElf.CrossChainServer; + +/* Inherit your application services from this class. + */ +public abstract class CrossChainServerAppService : ApplicationService +{ + protected CrossChainServerAppService() + { + LocalizationResource = typeof(CrossChainServerResource); + } +} diff --git a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..fe83e21 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs @@ -0,0 +1,120 @@ +using AElf.CrossChainServer.BridgeContract; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Chains.Ton; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AutoMapper; +using Volo.Abp.AutoMapper; +using TonAddressHelper = AElf.CrossChainServer.Chains.TonAddressHelper; +using Token = AElf.CrossChainServer.Tokens.Token; + +namespace AElf.CrossChainServer; + +public class CrossChainServerApplicationAutoMapperProfile : Profile +{ + public CrossChainServerApplicationAutoMapperProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap() + .ForMember(destination => destination.TransferTime, + opt => opt.MapFrom(source => DateTimeHelper.ToUnixTimeMilliseconds(source.TransferTime))) + .ForMember(destination => destination.ReceiveTime, + opt => opt.MapFrom(source => DateTimeHelper.ToUnixTimeMilliseconds(source.ReceiveTime))) + .ForMember(destination => destination.ProgressUpdateTime, + opt => opt.MapFrom(source => DateTimeHelper.ToUnixTimeMilliseconds(source.ProgressUpdateTime))); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap().ReverseMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap().Ignore(t => t.ChainTokenInfo).Ignore(t => t.StatusChangedRecord); + CreateMap().Ignore(t => t.ChainTokenInfo).Ignore(t => t.StatusChangedRecord); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap() + .ForMember(i => i.TokenName, opt => opt.MapFrom(i => i.ThirdTokenName)) + .ForMember(i => i.TokenImage, opt => opt.MapFrom(i => i.ThirdTokenImage)) + .ForMember(i => i.ContractAddress, opt => opt.MapFrom(i => i.ThirdContractAddress)) + .ForMember(i => i.TotalSupply, opt => opt.MapFrom(i => i.ThirdTotalSupply)); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap().Ignore(d=>d.ContractAddress); + + CreateMap() + .ForMember(i => i.Symbol, opt => opt.MapFrom(i => i.Token.Symbol)); + CreateMap(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs new file mode 100644 index 0000000..29343dd --- /dev/null +++ b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs @@ -0,0 +1,93 @@ +using AElf.AetherlinkApi; +using AElf.Client.Service; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Chains.Ton; +using AElf.CrossChainServer.Contracts.Bridge; +using AElf.CrossChainServer.Contracts.CrossChain; +using AElf.CrossChainServer.Contracts.Token; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.HttpClient; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.TokenPrice; +using AElf.CrossChainServer.Tokens; +using AElf.ExceptionHandler.ABP; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerDomainModule), + typeof(AbpAccountApplicationModule), + typeof(CrossChainServerApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule), + typeof(CrossChainServerAetherlinkApiModule), + typeof(AOPExceptionModule) +)] +public class CrossChainServerApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { options.AddMaps(); }); + + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("ChainApi")); + Configure(configuration.GetSection("BridgeContract")); + Configure(configuration.GetSection("BlockConfirmation")); + Configure(configuration.GetSection("Account")); + Configure(configuration.GetSection("TokenContract")); + Configure(configuration.GetSection("CrossChainContract")); + Configure(configuration.GetSection("TokenSymbolMapping")); + Configure(configuration.GetSection("GraphQLClients")); + Configure(configuration.GetSection("CrossChainLimits")); + Configure(configuration.GetSection("AutoReceiveConfig")); + Configure(configuration.GetSection("SyncStateService")); + Configure(configuration.GetSection("TokenPriceIdMapping")); + Configure(configuration.GetSection("TokenAccess")); + Configure(configuration.GetSection("PoolLiquiditySync")); + Configure(configuration.GetSection("AetherLink")); + Configure(configuration.GetSection("ApiKey")); + Configure(configuration.GetSection("TokenWhitelist")); + Configure(configuration.GetSection("LarkNotifyTemplate")); + Configure(configuration.GetSection("ChainIdMap")); + Configure(configuration.GetSection("TonConfig")); + Configure(configuration.GetSection("LimitSync")); + + context.Services.AddSingleton, AElfClientFactory>(); + context.Services.AddSingleton, EvmClientFactory>(); + context.Services.AddSingleton(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + } +} diff --git a/src/AElf.CrossChainServer.Application/GraphQLClientOptions.cs b/src/AElf.CrossChainServer.Application/GraphQLClientOptions.cs new file mode 100644 index 0000000..6837d8c --- /dev/null +++ b/src/AElf.CrossChainServer.Application/GraphQLClientOptions.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer +{ + public class GraphQLClientOptions + { + public Dictionary Mapping { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/HttpClient/ApiInfo.cs b/src/AElf.CrossChainServer.Application/HttpClient/ApiInfo.cs new file mode 100644 index 0000000..2a20edf --- /dev/null +++ b/src/AElf.CrossChainServer.Application/HttpClient/ApiInfo.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace AElf.CrossChainServer.HttpClient; + +public class ApiInfo +{ + public string Path { get; set; } + public HttpMethod Method { get; set; } + + public ApiInfo(HttpMethod method, string path, string name = null) + { + Path = path; + Method = method; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/HttpClient/HttpProvider.cs b/src/AElf.CrossChainServer.Application/HttpClient/HttpProvider.cs new file mode 100644 index 0000000..1aa25e0 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/HttpClient/HttpProvider.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.HttpClient; + +public interface IHttpProvider : ISingletonDependency +{ + Task InvokeAsync(string domain, ApiInfo apiInfo, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true); + + Task InvokeAsync(HttpMethod method, string url, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true); +} + +public class HttpProvider : IHttpProvider +{ + public static readonly JsonSerializerSettings DefaultJsonSettings = JsonSettingsBuilder.New() + .WithCamelCasePropertyNamesResolver() + .IgnoreNullValue() + .Build(); + + private const int DefaultTimeout = 5000; + private readonly IHttpClientFactory _httpClientFactory; + private readonly ILogger _logger; + + public HttpProvider(IHttpClientFactory httpClientFactory, + ILogger logger) + { + _httpClientFactory = httpClientFactory; + _logger = logger; + } + + public async Task InvokeAsync(string domain, ApiInfo apiInfo, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true) + { + var resp = await InvokeAsync(apiInfo.Method, domain + apiInfo.Path, pathParams, param, body, header, timeout, + withInfoLog, withDebugLog); + try + { + return JsonConvert.DeserializeObject(resp, settings ?? DefaultJsonSettings); + } + catch (Exception ex) + { + throw new HttpRequestException($"Error deserializing service [{apiInfo.Path}] response body: {resp}", ex); + } + } + + public async Task InvokeAsync(HttpMethod method, string url, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true) + { + var resp = await InvokeAsync(method, url, pathParams, param, body, header, timeout, withInfoLog, withDebugLog); + try + { + return JsonConvert.DeserializeObject(resp, settings ?? DefaultJsonSettings); + } + catch (Exception ex) + { + throw new HttpRequestException($"Error deserializing service [{url}] response body: {resp}", ex); + } + } + + public async Task InvokeResponseAsync(string domain, ApiInfo apiInfo, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withLog = false, bool debugLog = true) + { + return await InvokeResponseAsync(apiInfo.Method, domain + apiInfo.Path, pathParams, param, body, header, + timeout, withLog, debugLog); + } + + public async Task InvokeAsync(string domain, ApiInfo apiInfo, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, JsonSerializerSettings settings = null, int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true) + { + return await InvokeAsync(apiInfo.Method, domain + apiInfo.Path, pathParams, param, body, header, timeout, + withInfoLog, withDebugLog); + } + + public async Task InvokeAsync(HttpMethod method, string url, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, + int? timeout = null, + bool withInfoLog = false, bool withDebugLog = true) + { + var response = await InvokeResponseAsync(method, url, pathParams, param, body, header, timeout, withInfoLog, + withDebugLog); + var content = await response.Content.ReadAsStringAsync(); + if (!response.IsSuccessStatusCode) + { + throw new HttpRequestException( + $"Server [{url}] returned status code {response.StatusCode} : {content}", null, response.StatusCode); + } + + return content; + } + + public async Task InvokeResponseAsync(HttpMethod method, string url, + Dictionary pathParams = null, + Dictionary param = null, + string body = null, + Dictionary header = null, + int? timeout = null, + bool withLog = false, bool debugLog = true) + { + // url params + var fullUrl = PathParamUrl(url, pathParams); + + var builder = new UriBuilder(fullUrl); + var query = HttpUtility.ParseQueryString(builder.Query); + foreach (var item in param ?? new Dictionary()) + query[item.Key] = item.Value; + builder.Query = query.ToString() ?? string.Empty; + + var request = new HttpRequestMessage(method, builder.ToString()); + + // headers + foreach (var h in header ?? new Dictionary()) + request.Headers.Add(h.Key, h.Value); + + // body + if (body != null) + request.Content = new StringContent(body, Encoding.UTF8, "application/json"); + + // send + var stopwatch = Stopwatch.StartNew(); + var client = _httpClientFactory.CreateClient(); + client.Timeout = TimeSpan.FromMilliseconds(timeout ?? DefaultTimeout); + var response = await client.SendAsync(request); + var content = await response.Content.ReadAsStringAsync(); + var time = stopwatch.ElapsedMilliseconds; + // log + if (withLog) + _logger.LogInformation( + "Request To {FullUrl}, statusCode={StatusCode}, time={Time}, query={Query}, body={Body}, resp={Content}", + fullUrl, response.StatusCode, time, builder.Query, body, content); + else if (debugLog) + _logger.LogDebug( + "Request To {FullUrl}, statusCode={StatusCode}, time={Time}, query={Query}, body={Body}, resp={Content}", + fullUrl, response.StatusCode, time, builder.Query, body, content); + return response; + } + + private static string PathParamUrl(string url, Dictionary pathParams) + { + return pathParams.IsNullOrEmpty() + ? url + : pathParams.Aggregate(url, (current, param) => current.Replace($"{{{param.Key}}}", param.Value)); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs b/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs new file mode 100644 index 0000000..2a096a2 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs @@ -0,0 +1,42 @@ +using System; +using AElf.Types; +using Google.Protobuf; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using Org.BouncyCastle.Utilities.Encoders; + +namespace AElf.CrossChainServer.HttpClient; + +public class JsonSettingsBuilder +{ + + private readonly JsonSerializerSettings _instance = new(); + + private JsonSettingsBuilder() + { + } + + public static JsonSettingsBuilder New() + { + return new JsonSettingsBuilder(); + } + + public JsonSerializerSettings Build() + { + return _instance; + } + + + public JsonSettingsBuilder WithCamelCasePropertyNamesResolver() + { + _instance.ContractResolver = new CamelCasePropertyNamesContractResolver(); + return this; + } + + public JsonSettingsBuilder IgnoreNullValue() + { + _instance.NullValueHandling = NullValueHandling.Ignore; + return this; + } + +} diff --git a/src/AElf.CrossChainServer.Application/HttpResponseExtension.cs b/src/AElf.CrossChainServer.Application/HttpResponseExtension.cs new file mode 100644 index 0000000..302ba43 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/HttpResponseExtension.cs @@ -0,0 +1,23 @@ +using System.Net.Http; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace AElf.CrossChainServer; + +public static class HttpResponseExtension +{ + public static async Task DeserializeSnakeCaseAsync(this HttpContent content) + { + var respData = await content.ReadAsStringAsync(); + var serializeSetting = new JsonSerializerSettings + { + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new SnakeCaseNamingStrategy() + } + }; + + return JsonConvert.DeserializeObject(respData, serializeSetting); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Indexer/GraphQLClientFactory.cs b/src/AElf.CrossChainServer.Application/Indexer/GraphQLClientFactory.cs new file mode 100644 index 0000000..f5b3ab3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Indexer/GraphQLClientFactory.cs @@ -0,0 +1,34 @@ +using System.Collections.Concurrent; +using GraphQL.Client.Abstractions; +using GraphQL.Client.Http; +using GraphQL.Client.Serializer.Newtonsoft; +using Microsoft.Extensions.Options; + +namespace AElf.CrossChainServer.Indexer +{ + public class GraphQLClientFactory : IGraphQLClientFactory + { + private readonly GraphQLClientOptions _graphQlClientOptions; + private readonly ConcurrentDictionary _clientDic; + + public GraphQLClientFactory(IOptionsSnapshot graphQlClientOptions) + { + _graphQlClientOptions = graphQlClientOptions.Value; + _clientDic = new ConcurrentDictionary(); + } + + public IGraphQLClient GetClient(GraphQLClientEnum clientEnum) + { + var clientName = clientEnum.ToString(); + if (_clientDic.TryGetValue(clientName, out var client)) + { + return client; + } + + client = new GraphQLHttpClient(_graphQlClientOptions.Mapping[clientName], + new NewtonsoftJsonSerializer()); + _clientDic[clientName] = client; + return client; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Indexer/GraphQLHelper.cs b/src/AElf.CrossChainServer.Application/Indexer/GraphQLHelper.cs new file mode 100644 index 0000000..5d18d31 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Indexer/GraphQLHelper.cs @@ -0,0 +1,38 @@ +using System.Linq; +using System.Threading.Tasks; +using GraphQL; +using GraphQL.Client.Abstractions; +using Serilog; + +namespace AElf.CrossChainServer.Indexer; + +public interface IGraphQLHelper +{ + Task QueryAsync(GraphQLRequest request); +} + +public class GraphQLHelper : IGraphQLHelper +{ + public const int PageCount = 1000; + + private readonly IGraphQLClient _graphQLClient; + + public GraphQLHelper(IGraphQLClient graphQLClient) + { + _graphQLClient = graphQLClient; + } + + public async Task QueryAsync(GraphQLRequest request) + { + var graphQlResponse = await _graphQLClient.SendQueryAsync(request); + if (graphQlResponse.Errors is not { Length: > 0 }) + { + return graphQlResponse.Data; + } + + Log.Error("query graphQL err, errors = {Errors}", + string.Join(",", graphQlResponse.Errors.Select(e => e.Message).ToList())); + + return default; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs b/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs new file mode 100644 index 0000000..db46ab0 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs @@ -0,0 +1,287 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.CrossChainServer.HttpClient; +using AElf.ExceptionHandler; +using GraphQL; +using GraphQL.Client.Abstractions; +using Microsoft.Extensions.Logging; +using Serilog; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Volo.Abp; + +namespace AElf.CrossChainServer.Indexer; + +[RemoteService(IsEnabled = false)] +public class IndexerAppService : CrossChainServerAppService, IIndexerAppService +{ + private readonly IGraphQLClient _graphQlClient; + private readonly IChainAppService _chainAppService; + private readonly IHttpProvider _httpProvider; + private readonly SyncStateServiceOption _syncStateServiceOption; + private ApiInfo _syncStateUri => new(HttpMethod.Get, _syncStateServiceOption.SyncStateUri); + + public IndexerAppService(IGraphQLClientFactory graphQlClientFactory, IChainAppService chainAppService, + IHttpProvider httpProvider, + IOptionsSnapshot syncStateServiceOption) + { + _graphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); + _chainAppService = chainAppService; + _httpProvider = httpProvider; + _syncStateServiceOption = syncStateServiceOption.Value; + } + + [ExceptionHandler(typeof(Exception), Message = "Query swap syncState error", + TargetType = typeof(ExceptionHandlingService), + MethodName = nameof(ExceptionHandlingService.HandleExceptionReturnLong))] + public virtual async Task GetLatestIndexHeightAsync(string chainId) + { + var chain = await _chainAppService.GetAsync(chainId); + if (chain == null) + { + return 0; + } + + var aelfChainId = ChainHelper.ConvertChainIdToBase58(chain.AElfChainId); + var res = await _httpProvider.InvokeAsync(_syncStateServiceOption.BaseUrl, _syncStateUri); + var blockHeight = res.CurrentVersion.Items.FirstOrDefault(i => i.ChainId == aelfChainId) + ?.LastIrreversibleBlockHeight; + Logger.LogDebug("Get latest index height. chainId: {chainId}, height: {height}", aelfChainId, + blockHeight); + return blockHeight ?? 0; + } + + [ExceptionHandler(typeof(Exception), Message = "Query swap syncState error", + TargetType = typeof(ExceptionHandlingService), + MethodName = nameof(ExceptionHandlingService.HandleExceptionReturnLong))] + public virtual async Task GetLatestIndexBestHeightAsync(string chainId) + { + var chain = await _chainAppService.GetAsync(chainId); + if (chain == null) + { + return 0; + } + + var aelfChainId = ChainHelper.ConvertChainIdToBase58(chain.AElfChainId); + var res = await _httpProvider.InvokeAsync(_syncStateServiceOption.BaseUrl, _syncStateUri); + var blockHeight = res.CurrentVersion.Items.FirstOrDefault(i => i.ChainId == aelfChainId) + ?.BestChainHeight; + Logger.LogInformation("Get latest best index height. chainId: {chainId}, height: {height}", aelfChainId, + blockHeight); + return blockHeight ?? 0; + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingTransactionAsync(string chainId, + string transferTransactionId) + { + var data = await QueryDataAsync>(GetRequest(chainId, + transferTransactionId)); + if (data == null) + { + Logger.LogInformation( + "Get pending transaction failed. chainId: {chainId}, transferTransactionId: {transferTransactionId}", + chainId, transferTransactionId); + return (false, null); + } + + Log.ForContext("chainId", chainId).Information( + "Get pending transaction success. chainId: {chainId}, transferTransactionId: {transferTransactionId}, data: {data}", + chainId, transferTransactionId, JsonConvert.SerializeObject(data.Data)); + return (true, data.Data); + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiveTransactionAsync(string chainId, + string receiveTransactionId) + { + var data = await QueryDataAsync>(GetPendingReceiveTransactionRequest( + chainId, + receiveTransactionId)); + if (data == null) + { + Log.Debug( + "Get pending receive transaction failed. chainId: {chainId}, receiveTransactionId: {receiveTransactionId}", + chainId, receiveTransactionId); + return (false, null); + + } + + Log.ForContext("chainId", chainId).Information( + "Get pending receive transaction success. chainId: {chainId}, receiveTransactionId: {receiveTransactionId}, data: {data}", + chainId, receiveTransactionId, JsonConvert.SerializeObject(data.Data)); + return (true, data.Data); + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiptAsync(string chainId, string receiptId) + { + var data = await QueryDataAsync>(GetPendingReceiptRequest(chainId, + receiptId)); + if (data == null) + { + Log.Debug("Get pending receipt failed. chainId: {chainId}, receiptId: {receiptId}", + chainId, receiptId); + return (false, null); + } + + Log.ForContext("chainId", chainId).Information( + "Get pending receipt success. chainId: {chainId}, receiptId: {receiptId}, data: {data}", + chainId, receiptId, JsonConvert.SerializeObject(data.Data)); + return (true, data.Data); + } + + private GraphQLRequest GetRequest(string chainId, string transactionId) + { + return new GraphQLRequest + { + Query = + @"query( + $chainId:String, + $transactionId:String + ) { + data:homogeneousCrossChainTransferInfo( + input: { + chainId:$chainId, + transactionId:$transactionId + } + ){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + crossChainType, + transferType, + fromChainId, + toChainId, + transferTokenSymbol, + transferAmount, + transferTime, + transferTransactionId, + fromAddress, + toAddress, + receiveTokenSymbol, + receiveAmount, + receiveTime, + receiveTransactionId, + receiptId, + receiveBlockHeight + } + }", + Variables = new + { + chainId = chainId, + transactionId = transactionId + } + }; + } + + private GraphQLRequest GetPendingReceiveTransactionRequest(string chainId, string transactionId) + { + return new GraphQLRequest + { + Query = + @"query( + $chainId:String, + $transactionId:String + ) { + data:homogeneousCrossChainReceiveInfo( + input: { + chainId:$chainId, + transactionId:$transactionId + } + ){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + crossChainType, + transferType, + fromChainId, + toChainId, + transferTokenSymbol, + transferAmount, + transferTime, + transferTransactionId, + fromAddress, + toAddress, + receiveTokenSymbol, + receiveAmount, + receiveTime, + receiveTransactionId, + receiptId, + receiveBlockHeight + } + }", + Variables = new + { + chainId = chainId, + transactionId = transactionId + } + }; + } + + + private GraphQLRequest GetPendingReceiptRequest(string chainId, string receiptId) + { + return new GraphQLRequest + { + Query = + @"query( + $chainId:String, + $receiptId:String + ) { + data:queryCrossChainTransferInfoByReceiptId( + input: { + chainId:$chainId, + receiptId:$receiptId + } + ){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + crossChainType, + transferType, + fromChainId, + toChainId, + transferTokenSymbol, + transferAmount, + transferTime, + transferTransactionId, + fromAddress, + toAddress, + receiveTokenSymbol, + receiveAmount, + receiveTime, + receiveTransactionId, + receiptId, + receiveBlockHeight + } + }", + Variables = new + { + chainId = chainId, + receiptId = receiptId + } + }; + } + + private async Task QueryDataAsync(GraphQLRequest request) + { + var data = await _graphQlClient.SendQueryAsync(request); + if (data.Errors == null || data.Errors.Length == 0) + { + return data.Data; + } + + Log.Error("Query indexer failed. errors: {Errors}", + string.Join(",", data.Errors.Select(e => e.Message).ToList())); + return default; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Indexer/IndexerCrossChainLimitInfoService.cs b/src/AElf.CrossChainServer.Application/Indexer/IndexerCrossChainLimitInfoService.cs new file mode 100644 index 0000000..dcca433 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Indexer/IndexerCrossChainLimitInfoService.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.ExceptionHandler; +using GraphQL; +using Microsoft.Extensions.Logging; +using Serilog; +using Volo.Abp; + +namespace AElf.CrossChainServer.Indexer; + +[RemoteService(IsEnabled = false)] +public class IndexerCrossChainLimitInfoService : CrossChainServerAppService, IIndexerCrossChainLimitInfoService +{ + + private readonly IGraphQLHelper _graphQlHelper; + + public IndexerCrossChainLimitInfoService(IGraphQLClientFactory graphQlClientFactory) + { + _graphQlHelper = + new GraphQLHelper(graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient)); + } + + public async Task> GetAllCrossChainLimitInfoIndexAsync() + { + return await GetCrossChainLimitInfoIndexAsync(null, null, null); + } + + public async Task> GetCrossChainLimitInfoIndexAsync(string fromChainId, + string toChainId, string symbol) + { + var skipCount = 0; + var crossChainLimitInfos = new List(); + List crossChainLimitInfosTemp; + do + { + Log.ForContext("toChainId", toChainId) + .Debug( + "To get cross chain limit infos skipCount:{skipCount} toChainId:{toChainId} symbol:{symbol}", + skipCount, toChainId, symbol); + + var indexerCrossChainLimitInfos = + await QueryCrossChainLimitInfoIndexAsync(skipCount, fromChainId, toChainId, symbol); + if (indexerCrossChainLimitInfos?.DataList.IsNullOrEmpty() != false) + { + break; + } + + skipCount += indexerCrossChainLimitInfos.DataList.Count; + crossChainLimitInfosTemp = indexerCrossChainLimitInfos.DataList; + crossChainLimitInfos.AddRange(crossChainLimitInfosTemp); + } while (crossChainLimitInfosTemp.Count == GraphQLHelper.PageCount); + + return crossChainLimitInfos; + } + + [ExceptionHandler(typeof(Exception),Message = "[Indexer cross chain limit] Query cross chain limit failed.", + ReturnDefault = ReturnDefault.Default, LogTargets = new[] {"fromChainId","toChainId","symbol"})] + public virtual async Task QueryCrossChainLimitInfoIndexAsync(int skipCount, + string fromChainId, string toChainId, string symbol) + { + var indexerCommonResult = await _graphQlHelper.QueryAsync(new GraphQLRequest + { + Query = @" + query($skipCount:Int!,$fromChainId:String,$toChainId:String,$symbol:String) { + data:queryCrossChainLimitInfos(input:{skipCount: $skipCount,fromChainId: $fromChainId,toChainId: $toChainId,symbol: $symbol}){ + totalRecordCount, + dataList:data { + id, + fromChainId, + toChainId, + symbol, + limitType + defaultDailyLimit, + refreshTime, + currentDailyLimit, + capacity, + refillRate, + isEnable, + currentBucketTokenAmount, + bucketUpdateTime + + } + } + }", + Variables = new + { + skipCount, + fromChainId, + toChainId, + symbol + } + }); + return indexerCommonResult?.Data; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Properties/AssemblyInfo.cs b/src/AElf.CrossChainServer.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..83ef7a7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("AElf.CrossChainServer.Application.Tests")] diff --git a/src/AElf.CrossChainServer.Application/SyncStateServiceOption.cs b/src/AElf.CrossChainServer.Application/SyncStateServiceOption.cs new file mode 100644 index 0000000..8235530 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/SyncStateServiceOption.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer; + +public class SyncStateServiceOption +{ + public string BaseUrl { get; set; } + public string SyncStateUri { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/AssertHelper.cs b/src/AElf.CrossChainServer.Application/TokenAccess/AssertHelper.cs new file mode 100644 index 0000000..15ed986 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/AssertHelper.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Text; +using JetBrains.Annotations; +using Microsoft.IdentityModel.Tokens; +using Volo.Abp; + +namespace AElf.CrossChainServer.TokenAccess; + +public static class AssertHelper +{ + private const int DefaultErrorCode = 50000; + private const string DefaultErrorReason = "Assert failed"; + + public static void IsTrue(bool expression, [CanBeNull] string reason) + { + IsTrue(expression, DefaultErrorCode, reason); + } + + public static void IsTrue(bool expression, int code = DefaultErrorCode, + [CanBeNull] string reason = DefaultErrorReason) + { + if (!expression) + { + throw new UserFriendlyException( + Format(reason), code.ToString()); + } + } + + private static string Format(string template, params object[] values) + { + if (values == null || values.Length == 0) + return template; + + var valueIndex = 0; + var start = 0; + int placeholderStart; + var result = new StringBuilder(); + + while ((placeholderStart = template.IndexOf('{', start)) != -1) + { + var placeholderEnd = template.IndexOf('}', placeholderStart); + if (placeholderEnd == -1) break; + + result.Append(template, start, placeholderStart - start); + + if (valueIndex < values.Length) + result.Append(values[valueIndex++] ?? "null"); + else + result.Append(template, placeholderStart, placeholderEnd - placeholderStart + 1); + + start = placeholderEnd + 1; + } + + if (start < template.Length) + result.Append(template, start, template.Length - start); + + return result.ToString(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/ChainIdMapOptions.cs b/src/AElf.CrossChainServer.Application/TokenAccess/ChainIdMapOptions.cs new file mode 100644 index 0000000..8271158 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/ChainIdMapOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class ChainIdMapOptions +{ + public Dictionary Chain { get; set; } = new(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/IAggregatePriceProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/IAggregatePriceProvider.cs new file mode 100644 index 0000000..ab7ffb2 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/IAggregatePriceProvider.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using AElf.CrossChainServer.TokenPrice; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface IAggregatePriceProvider +{ + Task GetPriceAsync(string symbol); +} + +public class AggregatePriceProvider : IAggregatePriceProvider, ITransientDependency +{ + private readonly ITokenPriceProvider _tokenPriceProvider; + private readonly TokenPriceIdMappingOptions _tokenPriceIdMappingOptions; + private readonly IAwakenProvider _awakenProvider; + + public AggregatePriceProvider(ITokenPriceProvider tokenPriceProvider, + IOptionsSnapshot tokenPriceIdMappingOptions, + IAwakenProvider awakenProvider) + { + _tokenPriceProvider = tokenPriceProvider; + _awakenProvider = awakenProvider; + _tokenPriceIdMappingOptions = tokenPriceIdMappingOptions.Value; + } + + + public async Task GetPriceAsync(string symbol) + { + var priceInUsd = 0m; + Log.Debug("To get token price from aetherlink: {symbol}", symbol); + if (_tokenPriceIdMappingOptions.CoinIdMapping.TryGetValue(symbol, out var coinId)) + { + priceInUsd = await _tokenPriceProvider.GetPriceAsync(coinId); + Log.Debug("Token price from aetherlink: {symbol} {priceInUsd}", symbol, priceInUsd); + } + + if (priceInUsd != 0) + { + return priceInUsd; + } + + Log.Debug("To get token price from awaken: {symbol}", symbol); + priceInUsd = await _awakenProvider.GetTokenPriceInUsdAsync(symbol); + Log.Debug("Token price from awaken: {symbol} {priceInUsd}", symbol, priceInUsd); + + return priceInUsd; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/IAwakenProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/IAwakenProvider.cs new file mode 100644 index 0000000..1022af2 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/IAwakenProvider.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface IAwakenProvider +{ + Task GetTokenLiquidityInUsdAsync(string symbol); + Task GetTokenPriceInUsdAsync(string symbol); + +} + +public class AwakenProvider : IAwakenProvider , ITransientDependency +{ + private readonly IHttpProvider _httpProvider; + private readonly TokenAccessOptions _tokenAccessOptions; + + public AwakenProvider(IHttpProvider httpProvider,IOptionsSnapshot tokenAccessOptions) + { + _httpProvider = httpProvider; + _tokenAccessOptions = tokenAccessOptions.Value; + } + + private ApiInfo TokenLiquidityUri => new(HttpMethod.Get, _tokenAccessOptions.AwakenGetTokenLiquidityUri); + private ApiInfo TokenPriceUri => new(HttpMethod.Get, _tokenAccessOptions.AwakenGetPriceUri); + + + public async Task GetTokenLiquidityInUsdAsync(string symbol) + { + var tokenParams = new Dictionary(); + tokenParams["symbol"] = symbol; + var resultDto = await _httpProvider.InvokeAsync>(_tokenAccessOptions.AwakenBaseUrl, + TokenLiquidityUri, param: tokenParams); + return resultDto.Code == CrossChainServerConsts.SuccessHttpCode ? resultDto.Value : "0"; + } + + public async Task GetTokenPriceInUsdAsync(string symbol) + { + if (_tokenAccessOptions.SymbolMap.TryGetValue(symbol, out var symbolMap)) + { + symbol = symbolMap; + } + var tokenParams = new Dictionary(); + tokenParams["symbol"] = symbol; + var resultDto = await _httpProvider.InvokeAsync>(_tokenAccessOptions.AwakenBaseUrl, + TokenPriceUri, param: tokenParams); + return resultDto.Code == CrossChainServerConsts.SuccessHttpCode ? decimal.Parse(resultDto.Value) : 0; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/ILarkRobotNotifyProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/ILarkRobotNotifyProvider.cs new file mode 100644 index 0000000..ec61f11 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/ILarkRobotNotifyProvider.cs @@ -0,0 +1,61 @@ +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using AElf.CrossChainServer.Notify; +using Google.Protobuf.WellKnownTypes; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Serilog; +using Volo.Abp.DependencyInjection; + + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ILarkRobotNotifyProvider +{ + Task SendMessageAsync(NotifyRequest notifyRequest); +} + +public class LarkRobotNotifyProvider : ILarkRobotNotifyProvider,ITransientDependency +{ + private readonly LarkNotifyTemplateOptions _larkNotifyTemplateOptions; + private readonly IHttpProvider _httpProvider; + + public LarkRobotNotifyProvider(IOptionsSnapshot larkNotifyTemplateOptions, + IHttpProvider httpProvider) + { + _larkNotifyTemplateOptions = larkNotifyTemplateOptions.Value; + _httpProvider = httpProvider; + } + + public async Task SendMessageAsync(NotifyRequest notifyRequest) + { + var templateExists = + _larkNotifyTemplateOptions.Templates.TryGetValue(notifyRequest.Template, out var templates); + if (!templateExists) + { + Log.Error("Template {Template} not found", notifyRequest.Template); + return false; + } + + var notifyContent = StringHelper.ReplaceObjectWithDict(templates.LarkGroup, notifyRequest.Params); + var cardMessage = LarkMessageBuilder.CardMessageBuilder() + .WithSignature(notifyContent.Secret) + .WithTitle(notifyContent.Title, notifyContent.TitleTemplate) + .AddMarkdownContents(notifyContent.Contents) + .Build(); + + var resp = await _httpProvider.InvokeAsync>(HttpMethod.Post, + notifyContent.WebhookUrl, + body: JsonConvert.SerializeObject(cardMessage, HttpProvider.DefaultJsonSettings)); + return resp.Success; + } +} + +public class LarkRobotResponse +{ + public int Code { get; set; } + public T Data { get; set; } + public string Msg { get; set; } + public bool Success => Code == 0; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/IScanProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/IScanProvider.cs new file mode 100644 index 0000000..ec1c623 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/IScanProvider.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using AElf.CrossChainServer.Indexer; +using GraphQL; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface IScanProvider +{ + Task GetTokenHolderListAsync(string address, int skipCount, int maxResultCount, + string symbol = ""); + + Task GetTokenDetailAsync(string symbol); +} + +public class ScanProvider : IScanProvider, ITransientDependency +{ + private readonly IGraphQLHelper _graphQlHelper; + private readonly IHttpProvider _httpProvider; + private readonly TokenAccessOptions _tokenAccessOptions; + private ApiInfo ScanTokenDetailUri => new(HttpMethod.Get, _tokenAccessOptions.ScanTokenDetailUri); + + public ScanProvider(IGraphQLClientFactory graphQlClientFactory, + IOptionsSnapshot tokenAccessOptions, IHttpProvider httpProvider) + { + _httpProvider = httpProvider; + _graphQlHelper = new GraphQLHelper(graphQlClientFactory.GetClient(GraphQLClientEnum.ScanClient)); + _tokenAccessOptions = tokenAccessOptions.Value; + } + + public async Task GetTokenHolderListAsync(string address, int skipCount, + int maxResultCount, string symbol = "") + { + var indexerResult = await _graphQlHelper.QueryAsync(new GraphQLRequest + { + Query = + @"query($symbol:String!,$skipCount:Int!,$maxResultCount:Int!,$address:String, + $types:[SymbolType!],$amountGreaterThanZero:Boolean){ + accountToken(input: {symbol:$symbol,skipCount:$skipCount,types:$types, + maxResultCount:$maxResultCount,address:$address,amountGreaterThanZero:$amountGreaterThanZero}){ + totalCount, + items{ + id, + address, + token { + symbol, + type, + decimals + }, + metadata{chainId,block{blockHash,blockTime,blockHeight}}, + amount, + formatAmount + } + } + }", + Variables = new + { + symbol = symbol, + skipCount = skipCount, + maxResultCount = maxResultCount, + address = address, + types = SymbolType.Token, + amountGreaterThanZero = true + } + }); + return indexerResult == null ? new IndexerTokenHolderInfoListDto() : indexerResult.AccountToken; + } + + public async Task GetTokenDetailAsync(string symbol) + { + var detailDto = await _httpProvider.InvokeAsync( + _tokenAccessOptions.ScanBaseUrl, ScanTokenDetailUri, + param: new Dictionary { ["symbol"] = symbol }); + return detailDto.Code == CrossChainServerConsts.SuccessHttpCode ? detailDto.Data : null; + } +} + +public class IndexerTokenHolderInfosDto +{ + public IndexerTokenHolderInfoListDto AccountToken { get; set; } +} + +public class IndexerTokenBaseDto +{ + public string Symbol { get; set; } + public SymbolType Type { get; set; } + public int Decimals { get; set; } +} + +public enum SymbolType +{ + Token, + Nft, + Nft_Collection +} + +public class IndexerTokenHolderInfoDto +{ + public string Id { get; set; } + public string Address { get; set; } + public IndexerTokenBaseDto Token { get; set; } + public long Amount { get; set; } + public decimal FormatAmount { get; set; } + public MetadataDto Metadata { get; set; } +} + +public class IndexerTokenHolderInfoListDto +{ + public long TotalCount { get; set; } + public List Items { get; set; } = new(); +} + +public class MetadataDto +{ + public string ChainId { get; set; } + + public BlockMetadataDto Block { get; set; } +} + +public class BlockMetadataDto +{ + public string BlockHash { get; set; } + + public long BlockHeight { get; set; } + + public DateTime BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/ITokenImageProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/ITokenImageProvider.cs new file mode 100644 index 0000000..f86fa1f --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/ITokenImageProvider.cs @@ -0,0 +1,35 @@ +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ITokenImageProvider +{ + Task GetTokenImageAsync(string symbol); +} + +public class TokenImageProvider : ITokenImageProvider, ITransientDependency +{ + private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; + private readonly ITokenInfoCacheProvider _tokenCacheProvider; + + public TokenImageProvider(IThirdUserTokenIssueRepository thirdUserTokenIssueRepository, ITokenInfoCacheProvider tokenCacheProvider) + { + _thirdUserTokenIssueRepository = thirdUserTokenIssueRepository; + _tokenCacheProvider = tokenCacheProvider; + } + + public async Task GetTokenImageAsync(string symbol) + { + var token = await _tokenCacheProvider.GetTokenAsync(symbol); + if (token != null && !string.IsNullOrWhiteSpace(token.TokenImage)) + { + return token.TokenImage; + } + var tokenInfo = await _thirdUserTokenIssueRepository.GetListAsync(o => o.Symbol == symbol); + var tokenImageExistList = tokenInfo.Where(t => t.TokenImage != null).ToList(); + return tokenImageExistList.FirstOrDefault()?.TokenImage; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/ITokenInfoCacheProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/ITokenInfoCacheProvider.cs new file mode 100644 index 0000000..bbb21b8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/ITokenInfoCacheProvider.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Distributed; +using Serilog; +using Volo.Abp.Caching; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ITokenInfoCacheProvider +{ + Task AddTokenListAsync(List userTokenInfoList); + Task GetTokenAsync(string symbol); +} + +public class TokenInfoCacheProvider : ITokenInfoCacheProvider +{ + private readonly IDistributedCache _tokenCache; + private const string CachePrefix = "EbridgeServer:TokenList:"; + public TokenInfoCacheProvider(IDistributedCache tokenCache) + { + _tokenCache = tokenCache; + } + public async Task AddTokenListAsync(List userTokenInfoList) + { + foreach (var info in userTokenInfoList) + { + Log.Debug("Add token info to cache. {symbol},{info}", info.Symbol,JsonSerializer.Serialize(info)); + await _tokenCache.SetAsync(GetCacheKey(info.Symbol), info, new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddMonths(1) + }); + } + } + public async Task GetTokenAsync(string symbol) + { + var key = GetCacheKey(symbol); + var info = await _tokenCache.GetAsync(key); + return info; + } + private string GetCacheKey(string key) + { + return $"{CachePrefix}:{key}"; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/LarkNotifyTemplateOptions.cs b/src/AElf.CrossChainServer.Application/TokenAccess/LarkNotifyTemplateOptions.cs new file mode 100644 index 0000000..c9d3fde --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/LarkNotifyTemplateOptions.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class LarkNotifyTemplateOptions +{ + public Dictionary Templates { get; set; } + +} + +public class NotifyTemplate +{ + public LarkGroupMessageTemplate LarkGroup { get; set; } +} + +public class LarkGroupMessageTemplate +{ + public string WebhookUrl { get; set; } + public string Secret { get; set; } + public string TitleTemplate { get; set; } + public string Title { get; set; } + public List Contents { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessAppService.cs b/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessAppService.cs new file mode 100644 index 0000000..de8a6c7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessAppService.cs @@ -0,0 +1,1027 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Notify; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; +using JetBrains.Annotations; +using Microsoft.Extensions.Options; +using Nest; +using Serilog; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Users; + +namespace AElf.CrossChainServer.TokenAccess; + +[RemoteService(IsEnabled = false)] +public class TokenAccessAppService : CrossChainServerAppService, ITokenAccessAppService +{ + private readonly ITokenApplyOrderRepository _tokenApplyOrderRepository; + private readonly IUserAccessTokenInfoRepository _userAccessTokenInfoRepository; + private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; + private readonly ICrossChainUserRepository _crossChainUserRepository; + private readonly INESTRepository _tokenApplyOrderIndexRepository; + private readonly INESTRepository _userAccessTokenInfoIndexRepository; + private readonly INESTRepository _thirdUserTokenIssueIndexRepository; + + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly IChainAppService _chainAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IBridgeContractAppService _bridgeContractAppService; + + private readonly ILarkRobotNotifyProvider _larkRobotNotifyProvider; + private readonly IAggregatePriceProvider _aggregatePriceProvider; + private readonly ITokenInvokeProvider _tokenInvokeProvider; + private readonly IScanProvider _scanProvider; + private readonly IAwakenProvider _awakenProvider; + private readonly ITokenInfoCacheProvider _tokenInfoCacheProvider; + + private readonly TokenAccessOptions _tokenAccessOptions; + private readonly TokenWhitelistOptions _tokenWhitelistOptions; + private readonly ChainIdMapOptions _chainIdMapOptions; + + private const int MaxMaxResultCount = 1000; + private const int DefaultSkipCount = 0; + private const int PageSize = 50; + private const int MaxResultCount = 200; + private const string TokenListingAlarm = "TokenListingAlarm"; + + public TokenAccessAppService( + ITokenApplyOrderRepository tokenApplyOrderRepository, + INESTRepository tokenApplyOrderIndexRepository, + IUserAccessTokenInfoRepository userAccessTokenInfoRepository, + IThirdUserTokenIssueRepository thirdUserTokenIssueRepository, + INESTRepository userAccessTokenInfoIndexRepository, + ILarkRobotNotifyProvider larkRobotNotifyProvider, IPoolLiquidityInfoAppService poolLiquidityInfoAppService, + IChainAppService chainAppService, ITokenAppService tokenAppService, + ICrossChainUserRepository crossChainUserRepository, IBridgeContractAppService bridgeContractAppService, + ITokenInvokeProvider tokenInvokeProvider, + IOptionsSnapshot tokenAccessOptions, + IOptionsSnapshot tokenWhitelistOptions, + INESTRepository thirdUserTokenIssueIndexRepository, + IAggregatePriceProvider aggregatePriceProvider, + IOptionsSnapshot chainIdMapOptions, + IScanProvider scanProvider, IAwakenProvider awakenProvider, ITokenInfoCacheProvider tokenInfoCacheProvider) + { + _tokenApplyOrderRepository = tokenApplyOrderRepository; + _tokenApplyOrderIndexRepository = tokenApplyOrderIndexRepository; + _userAccessTokenInfoRepository = userAccessTokenInfoRepository; + _thirdUserTokenIssueRepository = thirdUserTokenIssueRepository; + _userAccessTokenInfoIndexRepository = userAccessTokenInfoIndexRepository; + _larkRobotNotifyProvider = larkRobotNotifyProvider; + _poolLiquidityInfoAppService = poolLiquidityInfoAppService; + _chainAppService = chainAppService; + _tokenAppService = tokenAppService; + _crossChainUserRepository = crossChainUserRepository; + _bridgeContractAppService = bridgeContractAppService; + _tokenInvokeProvider = tokenInvokeProvider; + _thirdUserTokenIssueIndexRepository = thirdUserTokenIssueIndexRepository; + _aggregatePriceProvider = aggregatePriceProvider; + _scanProvider = scanProvider; + _awakenProvider = awakenProvider; + _tokenInfoCacheProvider = tokenInfoCacheProvider; + _tokenAccessOptions = tokenAccessOptions.Value; + _tokenWhitelistOptions = tokenWhitelistOptions.Value; + _chainIdMapOptions = chainIdMapOptions.Value; + } + + public async Task GetAvailableTokensAsync(GetAvailableTokensInput input) + { + var result = new AvailableTokensDto(); + var address = await GetUserAddressAsync(); + if (address.IsNullOrEmpty()) + { + return result; + } + + //step 1 : get user token holder list from scan indexer; + var tokenHoldingList = new List(); + var skipCount = 0; + while (true) + { + var tokenList = + await _scanProvider.GetTokenHolderListAsync(address, skipCount, PageSize, input.Symbol ?? ""); + if (tokenList == null || tokenList.TotalCount <= 0) + { + break; + } + + skipCount += tokenList.Items.Count; + //step 2 : filter already support token in bridge from config; + var toAddTokenList = + ObjectMapper.Map, List>(tokenList.Items); + var filteredTokens = + toAddTokenList.Where(t => !_tokenAccessOptions.TokensToFilter.Contains(t.Symbol)).ToList(); + tokenHoldingList.AddRange(filteredTokens); + if (tokenList.Items.Count < PageSize) + { + break; + } + } + + tokenHoldingList = tokenHoldingList.DistinctBy(o => o.Symbol).ToList(); + var supportChainList = _tokenAccessOptions.ChainWhitelistForTestnet.Count == 0 + ? _tokenAccessOptions.OtherChainIdList + : _tokenAccessOptions.ChainWhitelistForTestnet; + //step 3 : get token info (ex. icon) from scan interface; + //step 4 : deal status, get apply order to select status; Available,Listed,Integrating. + var tasks = tokenHoldingList.Select(async token => { await GetTokenInfoAsync(token, supportChainList); }); + await Task.WhenAll(tasks); + + var tokenResultList = + tokenHoldingList.Take(MaxResultCount).OrderBy(t => t.Status).ThenBy(t => t.Symbol).ToList(); + await _tokenInfoCacheProvider.AddTokenListAsync(tokenResultList); + result.TokenList = ObjectMapper.Map, List>(tokenResultList); + return result; + } + + private async Task GetTokenInfoAsync(UserTokenInfoDto token, List supportChainList) + { + var tokenInCache = await _tokenInfoCacheProvider.GetTokenAsync(token.Symbol); + if (tokenInCache != null) + { + token.TokenImage = tokenInCache.TokenImage; + token.TokenName = tokenInCache.TokenName; + token.TotalSupply = tokenInCache.TotalSupply; + token.ChainId = tokenInCache.ChainId; + token.Holders = tokenInCache.Holders; + token.LiquidityInUsd = tokenInCache.LiquidityInUsd; + } + else + { + var tokenInfo = await _scanProvider.GetTokenDetailAsync(token.Symbol); + token.TokenImage = tokenInfo?.Token.ImageUrl; + token.TokenName = tokenInfo?.Token.Name; + token.TotalSupply = tokenInfo?.TotalSupply ?? 0; + token.ChainId = tokenInfo?.ChainIds.FirstOrDefault(); + } + + var orderList = await GetTokenApplyOrderIndexListAsync(null, token.Symbol); + if (orderList == null || orderList.Count == 0) + { + token.Status = TokenStatus.Available.ToString(); + } + else + { + var orderChainStatus = orderList + .ToDictionary(order => order.ChainTokenInfo.ChainId, order => order.ChainTokenInfo.Status); + + var isAllChainHasOrder = supportChainList.All(c => orderChainStatus.ContainsKey(c)); + if (!isAllChainHasOrder) + { + token.Status = TokenStatus.Available.ToString(); + } + else + { + var isAllChainOrderComplete = supportChainList.All(c => + orderChainStatus.TryGetValue(c, out var status) && + status == TokenApplyOrderStatus.Complete.ToString()); + token.Status = isAllChainOrderComplete + ? TokenStatus.Listed.ToString() + : TokenStatus.Integrating.ToString(); + } + } + } + + private async Task<(string, long)> GetTokenLiquidityInUsdAndHoldersAsync(string symbol) + { + var tokenInfo = await _tokenInfoCacheProvider.GetTokenAsync(symbol); + var holders = tokenInfo?.Holders ?? 0; + var liquidityInUsd = tokenInfo?.LiquidityInUsd ?? "0"; + return (liquidityInUsd, holders); + } + + public async Task GetAvailableTokenDetailAsync(string symbol) + { + var address = await GetUserAddressAsync(); + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + var tokenInfo = await _scanProvider.GetTokenDetailAsync(symbol); + var liquidityInUsd = await _awakenProvider.GetTokenLiquidityInUsdAsync(symbol); + var token = await _tokenInfoCacheProvider.GetTokenAsync(symbol); + token.Holders = tokenInfo.MergeHolders; + token.LiquidityInUsd = liquidityInUsd; + Log.Debug("Get available token detail {symbol} with liquidity {liquidityInUsd},holders {holders}.", symbol, + liquidityInUsd, tokenInfo.MergeHolders); + await _tokenInfoCacheProvider.AddTokenListAsync(new List { token }); + return new AvailableTokenDetailDto + { + LiquidityInUsd = liquidityInUsd, + Holders = tokenInfo.MergeHolders + }; + } + + public async Task CommitTokenAccessInfoAsync(UserTokenAccessInfoInput input) + { + var address = await GetUserAddressAsync(); + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + AssertHelper.IsTrue(input.Email.Contains(CrossChainServerConsts.At), "Please enter a valid email address"); + AssertHelper.IsTrue(await CheckLiquidityAndHolderAvailableAsync(input.Symbol), + "Not enough liquidity or holders"); + + var dto = ObjectMapper.Map(input); + dto.Address = address; + var existAccessInfo = + await _userAccessTokenInfoRepository.FindAsync(o => o.Address == address && o.Symbol == input.Symbol); + if (existAccessInfo == null) + { + Log.Debug("{user} create new token access info. {symbol}", address, input.Symbol); + await _userAccessTokenInfoRepository.InsertAsync(dto); + } + else + { + Log.Debug("{user} has already applied for {symbol} token access, update record.", address, input.Symbol); + existAccessInfo.Email = dto.Email; + existAccessInfo.OfficialWebsite = dto.OfficialWebsite; + existAccessInfo.PersonName = dto.PersonName; + existAccessInfo.Title = dto.Title; + existAccessInfo.TelegramHandler = dto.TelegramHandler; + existAccessInfo.OfficialTwitter = dto.OfficialTwitter; + await _userAccessTokenInfoRepository.UpdateAsync(existAccessInfo); + } + + return true; + } + + public async Task GetUserTokenAccessInfoAsync(UserTokenAccessInfoBaseInput input) + { + var address = await GetUserAddressAsync(); + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + var info = await GetUserTokenAccessInfoAsync(address, input.Symbol); + return info.FirstOrDefault(); + } + + #region CheckChainAccessStatus + + public async Task CheckChainAccessStatusAsync(CheckChainAccessStatusInput input) + { + var result = new CheckChainAccessStatusResultDto(); + var address = await GetUserAddressAsync(); + // Validate user address + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + AssertHelper.IsTrue(await CheckLiquidityAndHolderAvailableAsync(input.Symbol), + "Not enough liquidity or holders."); + // Populate chain and other chain lists + PopulateChainLists(result, input.Symbol); + + // Update third-party token data + await _tokenInvokeProvider.GetThirdTokenListAndUpdateAsync(input.Symbol); + + // Retrieve token apply order data + var applyOrderList = await GetTokenApplyOrderIndexListAsync(null, input.Symbol); + + // Process other chain list + await ProcessOtherChainListAsync(result.ChainList, applyOrderList, input.Symbol); + + return result; + } + + // Populates chain and other chain lists + private void PopulateChainLists(CheckChainAccessStatusResultDto result, string symbol) + { + result.ChainList.AddRange(_tokenAccessOptions.OtherChainIdList.Select(c => new ChainAccessInfo + { + ChainId = c, + ChainName = c, + Symbol = symbol + })); + } + + // Processes the chain list to determine the status of each chain + private async Task ProcessOtherChainListAsync( + List otherChainList, + List applyOrderList, + string symbol) + { + foreach (var item in otherChainList) + { + // Check if the token is completed on the chain + var isCompleted = _tokenWhitelistOptions.TokenWhitelist.ContainsKey(symbol) && + _tokenWhitelistOptions.TokenWhitelist[symbol].ContainsKey(item.ChainId); + + // Get the status from the apply order list + var applyOrder = applyOrderList.FirstOrDefault(t => t.ChainTokenInfo != null && + t.ChainTokenInfo.ChainId == item.ChainId); + var applyStatus = applyOrder?.ChainTokenInfo?.Status; + // Retrieve user token issue details + var res = await _thirdUserTokenIssueRepository.FindAsync(o => + o.OtherChainId == item.ChainId && o.Symbol == item.Symbol); + + item.TotalSupply = res?.TotalSupply.SafeToDecimal() ?? 0M; + item.Decimals = CrossChainServerConsts.DefaultEvmTokenDecimal; + item.TokenName = res?.TokenName; + item.ContractAddress = res?.ContractAddress; + item.Icon = res?.TokenImage; + + // Determine the status + item.Status = DetermineStatus(isCompleted, applyStatus, res); + + // Determine if the token is selected + item.Checked = DetermineCheckedStatus(isCompleted, applyOrderList, item.ChainId); + + // Add binding and third token IDs if available + if (res != null && !res.BindingId.IsNullOrEmpty() && !res.ThirdTokenId.IsNullOrEmpty()) + { + item.BindingId = res.BindingId; + item.ThirdTokenId = res.ThirdTokenId; + } + } + } + + // Determines the status of the token + private static string DetermineStatus(bool isCompleted, string applyStatus, ThirdUserTokenIssueInfo res) + { + if (isCompleted) + { + return TokenApplyOrderStatus.Complete.ToString(); + } + + if (!applyStatus.IsNullOrEmpty()) + { + return applyStatus; + } + + if (res != null && !res.Status.IsNullOrEmpty()) + { + return res.Status; + } + + return TokenApplyOrderStatus.Unissued.ToString(); + } + + // Determines if the token is selected + private static bool DetermineCheckedStatus(bool isCompleted, List applyOrderList, + string chainId) + { + return isCompleted || + applyOrderList.Exists(t => + t.ChainTokenInfo?.ChainId == chainId); + } + + #endregion + + #region AddChain + + public async Task AddChainAsync(AddChainInput input) + { + var address = await GetUserAddressAsync(); + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + AssertHelper.IsTrue(await CheckLiquidityAndHolderAvailableAsync(input.Symbol), + "Not enough liquidity or holders."); + + var userAccessInfo = + await _userAccessTokenInfoRepository.FindAsync(t => t.Symbol == input.Symbol && t.Address == address); + + // 1. Check chain access status - Get the status of my token on all chains + var chainAccessStatus = await CheckChainAccessStatusAsync(new CheckChainAccessStatusInput + { + Symbol = input.Symbol + }); + + // Validate provided chain IDs against available chain access status + ValidateChainIds(input.ChainIds, chainAccessStatus.ChainList, "Failed to add chain."); + + var result = new AddChainResultDto(); + // 2. Process other chain + if (IsNonEmpty(input.ChainIds)) + { + foreach (var otherChainId in input.ChainIds) + { + await ProcessOtherChainAsync(otherChainId, input.Symbol, address, userAccessInfo?.OfficialWebsite, + chainAccessStatus.ChainList, result); + } + } + + return result; + } + + private void ValidateChainIds(List chainIds, List chainAccessList, string errorMessage) + { + if (IsNonEmpty(chainIds) && !chainIds.Any(t => chainAccessList.Exists(c => c.ChainId == t))) + { + throw new UserFriendlyException(errorMessage); + } + } + + private bool IsNullOrEmpty(List list) + { + return list == null || list.Count == 0; + } + + private bool IsNonEmpty(List list) + { + return !IsNullOrEmpty(list); + } + + private async Task ProcessOtherChainAsync(string otherChainId, string symbol, string address, + string officialWebsite, List otherChainList, + AddChainResultDto result) + { + // Step 1: Check if the OtherChainId is in the "Issued" state + var chain = otherChainList.FirstOrDefault(t => t.ChainId == otherChainId); + if (chain?.Status != TokenApplyOrderStatus.Issued.ToString()) + { + Log.Debug("Chain {chainId} is not in the 'Issued' state.", otherChainId); + return; + } + + // Step 2: Prevent duplicate orders for the same OtherChainId + var order = await _tokenApplyOrderRepository.FindAsync(o => + o.Symbol == symbol && o.ChainId == otherChainId); + if (order != null) + { + Log.Debug("Order {token},{chainId} already exists.", symbol, otherChainId); + return; + } + + if (await CheckIfLiquidityHasBeenAddedAsync(chain.ContractAddress, otherChainId, symbol, chain.TotalSupply)) + { + Log.Debug("Liquidity has been added for {token} on {chainId}.", symbol, otherChainId); + chain.Status = TokenApplyOrderStatus.PoolInitialized.ToString(); + } + else + { + // Step 3: Create a new token apply order with "PoolInitializing" status + chain.Status = TokenApplyOrderStatus.PoolInitializing.ToString(); + } + + var tokenApplyOrder = + CreateTokenApplyOrder(symbol, address, chain.Status, chain); + + // Step 5: Insert to mysql and send lark notify + var orderInsert = await _tokenApplyOrderRepository.InsertAsync(tokenApplyOrder); + result.ChainList ??= new List(); + result.ChainList.Add(new AddChainDto + { + Id = orderInsert.Id.ToString(), + ChainId = otherChainId + }); + await SendLarkNotifyAsync(new TokenAccessNotifyDto + { + Token = tokenApplyOrder.Symbol, + Chain = otherChainId, + TokenContract = chain.ContractAddress, + Website = officialWebsite, + OrderId = orderInsert.Id.ToString() + }); + } + + private async Task CheckIfLiquidityHasBeenAddedAsync(string tokenAddress, string chainId, string symbol, + decimal totalSupply) + { + Log.Debug("Check if liquidity has been added for {tokenAddress},{token} on {chainId}.", tokenAddress, symbol, + chainId); + totalSupply = totalSupply == 0 + ? (await _tokenInfoCacheProvider.GetTokenAsync(symbol)).TotalSupply + : totalSupply; + Log.Debug("Total supply of {token} is {totalSupply}.", tokenAddress, totalSupply); + var liquidity = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync(new GetPoolLiquidityInfosInput + { + Token = tokenAddress, + ChainId = chainId + }); + if (liquidity.TotalCount > 0) + { + var liq = liquidity.Items.FirstOrDefault()?.Liquidity; + Log.Debug("Liquidity has been added for {token} on {chainId}, totalSupply:{total}.", tokenAddress, chainId, + liq); + return liq == totalSupply; + } + + return false; + } + + // Utility: Creates a new TokenApplyOrder + private TokenApplyOrder CreateTokenApplyOrder(string symbol, string userAddress, string status, + ChainAccessInfo chain) + { + Log.Debug("Create token apply order for {symbol} on {chainId}.chain info:{chainInfo}", symbol, chain.ChainId, + JsonSerializer.Serialize(chain)); + return new TokenApplyOrder + { + Symbol = symbol, + UserAddress = userAddress, + Status = status, + CreateTime = ToUtcMilliSeconds(DateTime.UtcNow), + UpdateTime = ToUtcMilliSeconds(DateTime.UtcNow), + StatusChangedRecords = new List + { + new() { Id = Guid.NewGuid(), Status = status, Time = DateTime.UtcNow } + }, + ChainId = chain.ChainId, + ChainName = chain.ChainName, + TokenName = chain.TokenName, + TotalSupply = chain.TotalSupply, + Decimals = chain.Decimals, + Icon = chain.Icon, + PoolAddress = chain.PoolAddress, + ContractAddress = chain.ContractAddress + }; + } + + private async Task SendLarkNotifyAsync(TokenAccessNotifyDto dto) + { + await _larkRobotNotifyProvider.SendMessageAsync(new NotifyRequest + { + Template = TokenListingAlarm, + Params = new Dictionary + { + [TokenListingKeys.Token] = dto.Token, + [TokenListingKeys.TokenContract] = dto.TokenContract, + [TokenListingKeys.Chain] = dto.Chain, + [TokenListingKeys.Website] = dto.Website, + [TokenListingKeys.OrderId] = dto.OrderId + } + }); + } + + #endregion + + public async Task PrepareBindingIssueAsync(PrepareBindIssueInput input) + { + AssertHelper.IsTrue(CheckAddress(input.Address), $"Invalid other chain address.{input.ChainId}"); + var chainStatus = await CheckChainAccessStatusAsync(new CheckChainAccessStatusInput { Symbol = input.Symbol }); + AssertHelper.IsTrue(input.ChainId.IsNullOrEmpty() || chainStatus.ChainList.Exists( + c => c.ChainId == input.ChainId), $"Invalid chainId {input.ChainId}."); + var address = await GetUserAddressAsync(); + var token = await _tokenInfoCacheProvider.GetTokenAsync(input.Symbol); + var dto = new ThirdUserTokenIssueInfoDto + { + Address = address, + WalletAddress = input.Address, + Symbol = input.Symbol, + ChainId = token.ChainId ?? CrossChainServerConsts.AElfMainChain, + TokenName = + chainStatus.ChainList.FirstOrDefault(t => t.ChainId == input.ChainId)?.TokenName ?? token.TokenName, + TokenImage = + chainStatus.ChainList.FirstOrDefault(t => t.ChainId == input.ChainId)?.Icon ?? token.TokenImage, + OtherChainId = input.ChainId, + ContractAddress = input.ContractAddress, + TotalSupply = input.Supply + }; + return await _tokenInvokeProvider.PrepareBindingAsync(dto); + } + + private static bool CheckAddress(string address) + { + return Nethereum.Util.AddressExtensions.IsValidEthereumAddressHexFormat(address) || + TonAddressHelper.IsTonFriendlyAddress(address); + } + + public async Task GetBindingIssueAsync(UserTokenBindingDto input) + { + var address = await GetUserAddressAsync(); + AssertHelper.IsTrue(!address.IsNullOrEmpty(), "No permission."); + return await _tokenInvokeProvider.BindingAsync(input); + } + + public async Task> GetTokenApplyOrderListAsync( + GetTokenApplyOrderListInput input) + { + var address = await GetUserAddressAsync(); + if (address.IsNullOrEmpty()) return new PagedResultDto(); + var mustQuery = new List, QueryContainer>>(); + mustQuery.Add(q => q.Term(i => i.Field(f => f.UserAddress).Value(address))); + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + var (count, result) = await _tokenApplyOrderIndexRepository.GetListAsync(Filter, sortExp: o => o.UpdateTime, + sortType: SortOrder.Descending, skip: input.SkipCount, limit: input.MaxResultCount); + return new PagedResultDto + { + Items = await LoopCollectionItemsAsync( + ObjectMapper.Map, List>(result)), + TotalCount = count + }; + } + + public async Task> GetTokenApplyOrderDetailAsync(GetTokenApplyOrderInput input) + { + var address = await GetUserAddressAsync(); + if (address.IsNullOrEmpty()) return new List(); + var list = await GetTokenApplyOrderIndexListAsync(address, input.Symbol, input.Id, input.ChainId); + return await LoopCollectionItemsAsync( + ObjectMapper.Map, List>(list)); + } + + private async Task> LoopCollectionItemsAsync(List itemList) + { + foreach (var item in itemList) + { + if (item.ChainTokenInfo != null && IsStatusValid(item.ChainTokenInfo.Status)) + { + await ProcessOtherChainTokenInfoAsync(item.ChainTokenInfo); + } + } + + return itemList; + } + + private static bool IsStatusValid(string status) + { + return status == TokenApplyOrderStatus.Complete.ToString(); + } + + private async Task ProcessOtherChainTokenInfoAsync(ChainTokenInfoResultDto otherChainTokenInfo) + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = otherChainTokenInfo.ChainId, + Address = otherChainTokenInfo.ContractAddress + }); + + var dailyLimit = await _bridgeContractAppService.GetDailyLimitAsync( + otherChainTokenInfo.ChainId, token.Id, CrossChainServerConsts.AElfMainChainId); + + otherChainTokenInfo.DailyLimit = dailyLimit.DefaultDailyLimit; + + var rateLimit = (await _bridgeContractAppService.GetCurrentReceiptTokenBucketStatesAsync( + otherChainTokenInfo.ChainId, new List { token.Id }, + new List { CrossChainServerConsts.AElfMainChainId })) + .FirstOrDefault(); + + otherChainTokenInfo.RateLimit = rateLimit?.RefillRate ?? 0; + otherChainTokenInfo.MinAmount = _tokenAccessOptions.DefaultConfig.MinLiquidityInUsd.ToString(); + } + + public async Task AddUserTokenAccessInfoIndexAsync(AddUserTokenAccessInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + await _userAccessTokenInfoIndexRepository.AddAsync(index); + } + + public async Task UpdateUserTokenAccessInfoIndexAsync(UpdateUserTokenAccessInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + await _userAccessTokenInfoIndexRepository.UpdateAsync(index); + } + + public async Task AddThirdUserTokenIssueInfoIndexAsync(AddThirdUserTokenIssueInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + await _thirdUserTokenIssueIndexRepository.AddAsync(index); + } + + public async Task UpdateThirdUserTokenIssueInfoIndexAsync(UpdateThirdUserTokenIssueInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + await _thirdUserTokenIssueIndexRepository.UpdateAsync(index); + } + + public async Task AddTokenApplyOrderIndexAsync(AddTokenApplyOrderIndexInput input) + { + var index = ObjectMapper.Map(input); + index.ChainTokenInfo = new ChainTokenInfoIndex() + { + Symbol = input.Symbol, + ChainId = input.ChainId, + ChainName = input.ChainName, + TokenName = input.TokenName, + TotalSupply = input.TotalSupply, + Decimals = input.Decimals, + Icon = input.Icon, + PoolAddress = input.PoolAddress, + ContractAddress = input.ContractAddress, + Status = input.Status + }; + foreach (var statusChangedRecord in input.StatusChangedRecords) + { + index.StatusChangedRecord ??= new Dictionary(); + index.StatusChangedRecord.Add(statusChangedRecord.Status, + ToUtcMilliSeconds(statusChangedRecord.Time).ToString()); + } + + Log.Debug("AddTokenApplyOrderIndexAsync start.{orderId}", input.Id); + await _tokenApplyOrderIndexRepository.AddAsync(index); + } + + public async Task UpdateTokenApplyOrderIndexAsync(UpdateTokenApplyOrderIndexInput input) + { + var index = ObjectMapper.Map(input); + index.ChainTokenInfo = new ChainTokenInfoIndex() + { + Symbol = input.Symbol, + ChainId = input.ChainId, + ChainName = input.ChainName, + TokenName = input.TokenName, + TotalSupply = input.TotalSupply, + Decimals = input.Decimals, + Icon = input.Icon, + PoolAddress = input.PoolAddress, + ContractAddress = input.ContractAddress, + Status = input.Status + }; + foreach (var statusChangedRecord in input.StatusChangedRecords) + { + index.StatusChangedRecord ??= new Dictionary(); + index.StatusChangedRecord.Add(statusChangedRecord.Status, + ToUtcMilliSeconds(statusChangedRecord.Time).ToString()); + } + + Log.Debug("UpdateTokenApplyOrderIndexAsync start.{orderId}", input.Id); + await _tokenApplyOrderIndexRepository.UpdateAsync(index); + } + + public async Task GetTokenConfigAsync(GetTokenConfigInput input) + { + return new TokenConfigDto + { + LiquidityInUsd = !_tokenAccessOptions.TokenConfig.ContainsKey(input.Symbol) + ? _tokenAccessOptions.DefaultConfig.Liquidity + : _tokenAccessOptions.TokenConfig[input.Symbol].Liquidity, + Holders = !_tokenAccessOptions.TokenConfig.ContainsKey(input.Symbol) + ? _tokenAccessOptions.DefaultConfig.Holders + : _tokenAccessOptions.TokenConfig[input.Symbol].Holders + }; + } + + #region TokenWhitelist + + public async Task>> GetTokenWhitelistAsync() + { + var tokenWhitelist = _tokenWhitelistOptions.TokenWhitelist; + var result = tokenWhitelist.ToDictionary( + tokenEntry => tokenEntry.Key, + tokenEntry => tokenEntry.Value.ToDictionary( + chainEntry => chainEntry.Key, + chainEntry => ObjectMapper.Map(chainEntry.Value) + )); + // step 1: get complete order chain token info; + // step 2: get main and dapp chain liquidity; + // step 3: set token info flags; + // step 4: if main or dapp chain token isburnable is false, only main or dapp; + var orderList = + await GetTokenApplyOrderIndexListAsync(null, null, null, null, TokenApplyOrderStatus.Complete.ToString()); + var liquidityList = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync( + new GetPoolLiquidityInfosInput + { + MaxResultCount = MaxMaxResultCount, + SkipCount = DefaultSkipCount + }); + var symbolChainOrderLiquidityMap = liquidityList.Items + .GroupBy(liq => liq.TokenInfo.Symbol) + .ToDictionary( + g => g.Key, + g => g.ToDictionary(liq => liq.ChainId, liq => liq.Liquidity) + ); + + foreach (var order in orderList) + { + Log.Debug("GetTokenWhitelistAsync start.{symbol}", order.Symbol); + var chainTokenInfoMap = result.TryGetValue(order.Symbol, out var chainTokenMap) + ? chainTokenMap + : new Dictionary(); + + var tokenInfo = InitializeEvmTokenInfo(order.Symbol, order.ChainTokenInfo); + if (!_chainIdMapOptions.Chain.TryGetValue(order.ChainTokenInfo.ChainId, out var chainId)) + { + continue; + } + + if (symbolChainOrderLiquidityMap.TryGetValue(order.Symbol, out var liquidityMap)) + { + SetEvmTokenFlags(order.ChainTokenInfo.ChainId, tokenInfo, liquidityMap); + } + + chainTokenInfoMap.TryAdd(chainId, tokenInfo); + foreach (var aelfChainId in _tokenAccessOptions.ChainIdList) + { + var chainIdAelfConvert = ConvertToTargetChainId(aelfChainId); + if (chainTokenInfoMap.ContainsKey(chainIdAelfConvert)) + { + continue; + } + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = aelfChainId, + Symbol = order.Symbol + }); + if (!token.IsBurnable) + { + var tokenInfoAelfIssue = InitializeAelfTokenInfo(order.Symbol, token, order.ChainTokenInfo.Icon); + if (symbolChainOrderLiquidityMap.TryGetValue(order.Symbol, out var liquiditySideMap)) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(token.IssueChainId); + var chainIdConvert = ChainHelper.ConvertChainIdToBase58(token.IssueChainId); + SetAelfTokenFlags(chain.Id, tokenInfoAelfIssue, liquiditySideMap); + chainTokenInfoMap.TryAdd(chainIdConvert, tokenInfoAelfIssue); + } + + break; + } + + var tokenInfoAelf = InitializeAelfTokenInfo(order.Symbol, token, order.ChainTokenInfo.Icon); + if (symbolChainOrderLiquidityMap.TryGetValue(order.Symbol, out var liquidityMainMap)) + { + SetAelfTokenFlags(aelfChainId, tokenInfoAelf, liquidityMainMap); + chainTokenInfoMap.TryAdd(chainIdAelfConvert, tokenInfoAelf); + } + } + + result[order.Symbol] = chainTokenInfoMap; + } + + return result; + } + + private string ConvertToTargetChainId(string sourceChainId) + => _tokenAccessOptions.ChainIdMap.FirstOrDefault(kvp => kvp.Value == sourceChainId).Key ?? string.Empty; + + private void SetAelfTokenFlags(string chainId, TokenInfoDto tokenInfoDto, Dictionary liquidityMap) + { + var aelfChainLiquidity = liquidityMap.TryGetValue(chainId, out var liquidity) ? liquidity : 0; + var hasOtherChainLiquidity = _tokenAccessOptions.OtherChainIdList + .Any(otherChainId => liquidityMap.TryGetValue(otherChainId, out var evmLiquidity) && evmLiquidity > 0); + tokenInfoDto.OnlyFrom = hasOtherChainLiquidity && aelfChainLiquidity <= 0; + tokenInfoDto.OnlyTo = aelfChainLiquidity > 0 && !hasOtherChainLiquidity; + } + + private void SetEvmTokenFlags(string chainId, TokenInfoDto tokenInfoDto, Dictionary liquidityMap) + { + var evmLiquidity = liquidityMap.TryGetValue(chainId, out var liquidity) ? liquidity : 0; + var hasAelfChainLiquidity = _tokenAccessOptions.ChainIdList + .Any(aelfChainId => liquidityMap.TryGetValue(aelfChainId, out var aelfLiquidity) && aelfLiquidity > 0); + tokenInfoDto.OnlyFrom = hasAelfChainLiquidity && evmLiquidity <= 0; + tokenInfoDto.OnlyTo = evmLiquidity > 0 && !hasAelfChainLiquidity; + } + + private static TokenInfoDto InitializeEvmTokenInfo(string symbol, ChainTokenInfoIndex chainToken) + { + return new TokenInfoDto + { + Symbol = symbol, + Name = chainToken.TokenName, + Address = chainToken.ContractAddress, + Icon = chainToken.Icon, + Decimals = chainToken.Decimals, + IsNativeToken = false, + OnlyTo = false, + OnlyFrom = false + }; + } + + private static TokenInfoDto InitializeAelfTokenInfo(string symbol, TokenDto token, string icon) + { + return new TokenInfoDto + { + Symbol = symbol, + Name = token.Symbol, + Address = token.Address, + Icon = icon, + Decimals = token.Decimals, + IsNativeToken = false, + IssueChainId = token.IssueChainId.ToString(), + OnlyTo = false, + OnlyFrom = false + }; + } + + #endregion + + + public async Task GetTokenPriceAsync(GetTokenPriceInput input) + { + var result = new TokenPriceDto + { + Symbol = input.Symbol + }; + var priceInUsd = await _aggregatePriceProvider.GetPriceAsync(input.Symbol); + var amountInUsd = input.Amount * priceInUsd; + result.TokenAmountInUsd = amountInUsd; + return result; + } + + public async Task TriggerOrderStatusChangeAsync(TriggerOrderStatusChangeInput input) + { + var queryable = + await _tokenApplyOrderRepository.WithDetailsAsync(y => y.StatusChangedRecords); + var query = queryable.Where(x => x.Id == Guid.Parse(input.OrderId)); + var order = await AsyncExecuter.FirstOrDefaultAsync(query); + if (order == null || order.Status != TokenApplyOrderStatus.PoolInitialized.ToString()) + { + throw new UserFriendlyException($"Invalid order {order.Id.ToString()}."); + } + + order.ContractAddress ??= input.ChainIdTokenInfo.TokenContractAddress; + order.Decimals = order.Decimals == 0 + ? order.Decimals + : input.ChainIdTokenInfo.TokenDecimals; + order.Status = TokenApplyOrderStatus.Complete.ToString(); + order.StatusChangedRecords.Add(new StatusChangedRecord + { + Id = Guid.NewGuid(), + OrderId = order.Id, + Status = TokenApplyOrderStatus.Complete.ToString(), + Time = DateTime.UtcNow + }); + Log.Debug("TriggerOrderStatusChangeAsync start.{orderId}", input.OrderId); + await _tokenApplyOrderRepository.UpdateAsync(order); + return true; + } + + + private async Task GetUserAddressAsync() + { + var userId = CurrentUser.IsAuthenticated ? CurrentUser?.GetId() : null; + if (!userId.HasValue) return null; + var queryable = + await _crossChainUserRepository.WithDetailsAsync(y => y.AddressInfos); + var query = queryable.Where(x => x.Id == userId); + var userDto = await AsyncExecuter.FirstOrDefaultAsync(query); + return userDto?.AddressInfos?.FirstOrDefault()?.Address; + } + + private async Task CheckLiquidityAndHolderAvailableAsync(string symbol) + { + var (liquidityInUsdFromCache, holdersFromCache) = await GetTokenLiquidityInUsdAndHoldersAsync(symbol); + var liquidityInUsd = !_tokenAccessOptions.TokenConfig.ContainsKey(symbol) + ? _tokenAccessOptions.DefaultConfig.Liquidity + : _tokenAccessOptions.TokenConfig[symbol].Liquidity; + var holders = !_tokenAccessOptions.TokenConfig.ContainsKey(symbol) + ? _tokenAccessOptions.DefaultConfig.Holders + : _tokenAccessOptions.TokenConfig[symbol].Holders; + + var decimalEnough = liquidityInUsdFromCache.SafeToDecimal() > liquidityInUsd.SafeToDecimal(); + Log.Debug("Check Liquidity available, owner: {owner} and option: {option}", + liquidityInUsdFromCache.SafeToDecimal(), liquidityInUsd.SafeToDecimal()); + var holdersEnough = holdersFromCache > holders; + Log.Debug("Check Holders available, owner: {owner} and option: {option}", holdersFromCache, holders); + return decimalEnough && holdersEnough; + } + + private async Task> GetUserTokenAccessInfoAsync(string address, + [CanBeNull] string symbol) + { + var mustQuery = new List, QueryContainer>>(); + mustQuery.Add(q => q.Term(i => i.Field(f => f.Address).Value(address))); + if (symbol != null) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Symbol).Value(symbol))); + } + + QueryContainer Filter(QueryContainerDescriptor f) => + f.Bool(b => b.Must(mustQuery)); + + var list = await _userAccessTokenInfoIndexRepository.GetListAsync(Filter); + return ObjectMapper.Map, List>(list.Item2); + } + + private async Task> GetTokenApplyOrderIndexListAsync(string address, string symbol, + string id = null, string chainId = null, string status = null) + { + var mustQuery = new List, QueryContainer>>(); + if (!address.IsNullOrEmpty()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.UserAddress).Value(address))); + } + + if (!symbol.IsNullOrEmpty()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Symbol).Value(symbol))); + } + + if (!id.IsNullOrEmpty()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Id).Value(id))); + } + + if (!status.IsNullOrEmpty()) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.Status).Value(status))); + } + + if (!chainId.IsNullOrEmpty()) + { + mustQuery.Add(q => q.Bool(i => i.Should( + s => s.Match(k => + k.Field("chainTokenInfo.chainId").Query(chainId)), + s => s.Term(k => + k.Field(f => f.ChainTokenInfo.ChainId).Value(chainId))))); + } + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + var result = await _tokenApplyOrderIndexRepository.GetListAsync(Filter); + return result.Item2; + } + + public static long ToUtcMilliSeconds(DateTime dateTime) + { + return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds(); + } + + private static class TokenListingKeys + { + public const string Token = "token"; + public const string TokenContract = "tokenContract"; + public const string Chain = "chain"; + public const string Website = "website"; + public const string OrderId = "orderId"; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessOptions.cs b/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessOptions.cs new file mode 100644 index 0000000..b27e7e8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/TokenAccessOptions.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenAccessOptions +{ + public List ChainIdList { get; set; } = new(); + public List OtherChainIdList { get; set; } = new(); + public string ScanBaseUrl { get; set; } + public string ScanTokenDetailUri { get; set; } + public string SymbolMarketBaseUrl { get; set; } + public string SymbolMarketUserTokenListUri { get; set; } + public string SymbolMarketUserThirdTokenListUri { get; set; } + public string SymbolMarketPrepareBindingUri { get; set; } + public string SymbolMarketBindingUri { get; set; } + public string AwakenBaseUrl { get; set; } + public string AwakenGetTokenLiquidityUri { get; set; } + public string AwakenGetPriceUri { get; set; } + public string HashVerifyKey { get; set; } + public AvailableTokenConfigDto DefaultConfig { get; set; } = new(); + public Dictionary TokenConfig { get; set; } = new(); + public Dictionary ChainIdMap { get; set; } + public Dictionary SymbolMap { get; set; } + public string DAppChainTokenContractAddress { get; set; } + public List TokensToFilter { get; set; } = new(); + public List ChainWhitelistForTestnet { get; set; } = new(); + public List BlackSymbolList { get; set; } = new(); + +} +public class AvailableTokenConfigDto +{ + public string Liquidity { get; set; } = "1000"; + public int Holders { get; set; } = 1000; + public long MinLiquidityInUsd { get; set; } = 5000; + public long MinLiquidityInUsdForAlarm { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenAccess/TokenInvokeProvider.cs b/src/AElf.CrossChainServer.Application/TokenAccess/TokenInvokeProvider.cs new file mode 100644 index 0000000..b33b083 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenAccess/TokenInvokeProvider.cs @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using AElf.CrossChainServer.HttpClient; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.ExceptionHandler; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Serilog; +using Volo.Abp.DependencyInjection; +using Volo.Abp.ObjectMapping; +using JsonSerializer = System.Text.Json.JsonSerializer; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ITokenInvokeProvider +{ + Task GetThirdTokenListAndUpdateAsync(string symbol); + Task PrepareBindingAsync(ThirdUserTokenIssueInfoDto dto); + Task BindingAsync(UserTokenBindingDto dto); +} + +public class TokenInvokeProvider : ITokenInvokeProvider, ITransientDependency +{ + private readonly IHttpProvider _httpProvider; + private readonly TokenAccessOptions _tokenAccessOptions; + private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; + private readonly IObjectMapper _objectMapper; + + private ApiInfo UserThirdTokenListUri => + new(HttpMethod.Get, _tokenAccessOptions.SymbolMarketUserThirdTokenListUri); + + public TokenInvokeProvider(IHttpProvider httpProvider, IOptionsSnapshot tokenAccessOptions, + IThirdUserTokenIssueRepository thirdUserTokenIssueRepository, IObjectMapper objectMapper) + { + _httpProvider = httpProvider; + _tokenAccessOptions = tokenAccessOptions.Value; + _thirdUserTokenIssueRepository = thirdUserTokenIssueRepository; + _objectMapper = objectMapper; + } + + [ExceptionHandler(typeof(Exception), + Message = "[GetThirdTokenListAndUpdateAsync] Get third token from symbolMarket failed.", + ReturnDefault = ReturnDefault.Default, LogTargets = new[] { "symbol" })] + public async Task GetThirdTokenListAndUpdateAsync(string symbol) + { + var resultDto = await FetchThirdTokenListAsync(symbol); + if (resultDto.Code != "20000" || resultDto.Data == null) + { + Log.Warning("Get {symbol} failed, message: {message}", symbol, resultDto.Message); + return false; + } + + Log.Debug("Get third token list from tsm:{result}", JsonSerializer.Serialize(resultDto)); + + foreach (var item in resultDto.Data.Items) + { + var aelfChainId = FindMatchChainId(item.AelfChain); + var thirdChainId = FindMatchChainId(item.ThirdChain); + + if (string.IsNullOrWhiteSpace(aelfChainId) || string.IsNullOrWhiteSpace(thirdChainId)) + { + Log.Warning("skip not supported chainId, aelf chain: {aelfChainId} third chain: {thirdChainId}", + item.AelfChain, item.ThirdChain); + continue; + } + + await UpsertThirdTokenAsync(item, aelfChainId, thirdChainId); + } + + return false; + } + + private async Task FetchThirdTokenListAsync(string symbol) + { + var tokenParams = new Dictionary + { + ["aelfToken"] = symbol + }; + + return await _httpProvider.InvokeAsync( + _tokenAccessOptions.SymbolMarketBaseUrl, UserThirdTokenListUri, param: tokenParams); + } + + private async Task UpsertThirdTokenAsync(ThirdTokenItemDto item, string aelfChainId, + string thirdChainId) + { + var existingToken = await _thirdUserTokenIssueRepository.FindAsync(o => + o.Symbol == item.AelfToken && o.OtherChainId == thirdChainId); + + if (existingToken != null) + { + Log.Debug( + "Update third token, Symbol: {symbol}, OtherChainId: {thirdChainId} TokenIssue,result:{result}", + item.AelfToken, thirdChainId, JsonSerializer.Serialize(item)); + existingToken.ContractAddress = item.ThirdContractAddress; + existingToken.Status = TokenApplyOrderStatus.Issued.ToString(); + await _thirdUserTokenIssueRepository.UpdateAsync(existingToken, autoSave: true); + } + else + { + Log.Debug( + "Add third token, Symbol: {symbol}, OtherChainId: {thirdChainId},TokenAddress:{token} TokenIssue,result:{result}", + item.ThirdSymbol, thirdChainId, item.ThirdContractAddress, JsonSerializer.Serialize(item)); + var info = _objectMapper.Map(item); + info.Address = item.Address; + info.Symbol = item.AelfToken; + info.ChainId = aelfChainId; + info.OtherChainId = thirdChainId; + info.Status = TokenApplyOrderStatus.Issued.ToString(); + await _thirdUserTokenIssueRepository.InsertAsync(info, autoSave: true); + } + } + + public async Task PrepareBindingAsync(ThirdUserTokenIssueInfoDto dto) + { + var res = await _thirdUserTokenIssueRepository.FindAsync(o => + o.Address == dto.Address && o.Symbol == dto.Symbol && o.OtherChainId == dto.OtherChainId); + if (res != null && !res.BindingId.IsNullOrEmpty() && !res.ThirdTokenId.IsNullOrEmpty()) + { + Log.Debug("Get existing TokenIssue, no need request symbol market again."); + return new UserTokenBindingDto { BindingId = res.BindingId, ThirdTokenId = res.ThirdTokenId }; + } + + // var aelfChainId = ConvertToTargetChainId(dto.ChainId); + var thirdChainId = ConvertToTargetChainId(dto.OtherChainId); + if (string.IsNullOrEmpty(thirdChainId)) + { + Log.Warning("Failed to convert to target OtherChainId:{0}", dto.OtherChainId); + return new UserTokenBindingDto(); + } + + var prepareBindingInput = new PrepareBindingInput + { + Address = dto.Address, + AelfToken = dto.Symbol, + AelfChain = dto.ChainId, + ThirdTokens = new ThirdTokenDto + { + TokenName = dto.TokenName, + Symbol = dto.Symbol, + TokenImage = dto.TokenImage, + TotalSupply = dto.TotalSupply, + ThirdChain = thirdChainId, + Owner = dto.WalletAddress, + ContractAddress = dto.ContractAddress + }, + Signature = BuildRequestHash(string.Concat(dto.Address, dto.Symbol, dto.ChainId, dto.TokenName, dto.Symbol, + dto.TokenImage, dto.TotalSupply, dto.WalletAddress, thirdChainId, dto.ContractAddress)) + }; + Log.Debug("Tsm params:{param}", JsonSerializer.Serialize(prepareBindingInput)); + var url = $"{_tokenAccessOptions.SymbolMarketBaseUrl}{_tokenAccessOptions.SymbolMarketPrepareBindingUri}"; + var resultDto = await _httpProvider.InvokeAsync(HttpMethod.Post, url, + body: JsonConvert.SerializeObject(prepareBindingInput, HttpProvider.DefaultJsonSettings)); + if (resultDto.Code != "20000") + { + Log.Warning("Request forest prepare binding failed, {ERR}", resultDto.Message); + return new UserTokenBindingDto(); + } + + var bindingId = resultDto.Data?.BindingId; + var thirdTokenId = resultDto.Data?.ThirdTokenId; + var status = TokenApplyOrderStatus.Issuing.ToString(); + if (res != null) + { + Log.Debug( + "get exist TokenIssue, will update BindingId, ThirdTokenId and status {status} to issuing", res.Status); + res.BindingId = bindingId; + res.ThirdTokenId = thirdTokenId; + res.Status = status; + await _thirdUserTokenIssueRepository.UpdateAsync(res); + } + else + { + Log.Debug("create TokenIssue, will update {symbol},{chainId},{otherChainId} status to issuing", + dto.Symbol, dto.ChainId, dto.OtherChainId); + var info = _objectMapper.Map(dto); + info.BindingId = bindingId; + info.ThirdTokenId = thirdTokenId; + info.Status = status; + Log.Debug("insert info:{info}",JsonSerializer.Serialize(info)); + await _thirdUserTokenIssueRepository.InsertAsync(info); + } + + return new UserTokenBindingDto { BindingId = bindingId, ThirdTokenId = thirdTokenId }; + } + + public async Task BindingAsync(UserTokenBindingDto dto) + { + var userTokenIssue = await _thirdUserTokenIssueRepository.FindAsync(o => + o.BindingId == dto.BindingId && o.ThirdTokenId == dto.ThirdTokenId); + if (userTokenIssue == null) + { + Log.Debug($"Token {dto.BindingId} {dto.ThirdTokenId} not exist."); + return false; + } + + if (userTokenIssue.Status == TokenApplyOrderStatus.Issued.ToString()) + { + Log.Debug($"Skip, Token {dto.BindingId} {dto.ThirdTokenId} had issued"); + return true; + } + + var url = $"{_tokenAccessOptions.SymbolMarketBaseUrl}{_tokenAccessOptions.SymbolMarketBindingUri}"; + var resultDto = await _httpProvider.InvokeAsync>(HttpMethod.Post, url, + body: JsonConvert.SerializeObject(new BindingInput + { + BindingId = dto.BindingId, + ThirdTokenId = dto.ThirdTokenId, + Signature = BuildRequestHash(string.Concat(dto.BindingId, dto.ThirdTokenId, + dto.MintToAddress)), + MintToAddress = dto.MintToAddress + }, HttpProvider.DefaultJsonSettings)); + Log.Debug("result from tsm:{res}",JsonSerializer.Serialize(resultDto)); + if (resultDto.Code != "20000" || string.IsNullOrEmpty(resultDto.Value)) + { + Log.Warning($"request symbol market fail, {resultDto.Message}"); + return false; + } + + userTokenIssue.ContractAddress = resultDto.Value; + userTokenIssue.BindingId = dto.BindingId; + userTokenIssue.ThirdTokenId = dto.ThirdTokenId; + userTokenIssue.Status = TokenApplyOrderStatus.Issued.ToString(); + await _thirdUserTokenIssueRepository.UpdateAsync(userTokenIssue); + return true; + } + + private string BuildRequestHash(string request) + { + var hashVerifyKey = _tokenAccessOptions.HashVerifyKey; + var requestHash = HashHelper.ComputeFrom(string.Concat(request, hashVerifyKey)); + return requestHash.ToHex(); + } + + private string FindMatchChainId(string sourceChainId) + => _tokenAccessOptions.ChainIdMap.TryGetValue(sourceChainId, out var value) ? value : string.Empty; + + private string ConvertToTargetChainId(string sourceChainId) + => _tokenAccessOptions.ChainIdMap.FirstOrDefault(kvp => kvp.Value == sourceChainId).Key ?? string.Empty; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenPool/ITokenLiquidityMonitorProvider.cs b/src/AElf.CrossChainServer.Application/TokenPool/ITokenLiquidityMonitorProvider.cs new file mode 100644 index 0000000..df5ab29 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenPool/ITokenLiquidityMonitorProvider.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Notify; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Options; + +namespace AElf.CrossChainServer.TokenPool; + +public interface ITokenLiquidityMonitorProvider +{ + Task MonitorTokenLiquidityAsync(string chainId, Guid tokenId, decimal poolLiquidity); +} + +public class TokenLiquidityMonitorProvider : ITokenLiquidityMonitorProvider +{ + private readonly ILarkRobotNotifyProvider _larkRobotNotifyProvider; + private const string LiquidityInsufficientAlarm = "LiquidityInsufficientAlarm"; + private readonly TokenAccessOptions _tokenAccessOptions; + private readonly ITokenApplyOrderRepository _tokenApplyOrderRepository; + private readonly IUserAccessTokenInfoRepository _userAccessTokenInfoRepository; + private readonly IAggregatePriceProvider _aggregatePriceProvider; + private readonly ITokenAppService _tokenAppService; + + public TokenLiquidityMonitorProvider(ILarkRobotNotifyProvider larkRobotNotifyProvider, + IOptionsSnapshot tokenAccessOptions, IAggregatePriceProvider aggregatePriceProvider, + ITokenApplyOrderRepository tokenApplyOrderRepository, + IUserAccessTokenInfoRepository userAccessTokenInfoRepository, ITokenAppService tokenAppService) + { + _larkRobotNotifyProvider = larkRobotNotifyProvider; + _aggregatePriceProvider = aggregatePriceProvider; + _tokenApplyOrderRepository = tokenApplyOrderRepository; + _userAccessTokenInfoRepository = userAccessTokenInfoRepository; + _tokenAppService = tokenAppService; + _tokenAccessOptions = tokenAccessOptions.Value; + } + + private async Task SendLarkNotifyAsync(LiquidityDto dto) + { + await _larkRobotNotifyProvider.SendMessageAsync(new NotifyRequest + { + Template = LiquidityInsufficientAlarm, + Params = new Dictionary + { + [LiquidityKeys.Token] = dto.Token, + [LiquidityKeys.LiquidityInUsd] = dto.LiquidityInUsd, + [LiquidityKeys.Chain] = dto.Chain, + [LiquidityKeys.PersonName] = dto.PersonName, + [LiquidityKeys.TelegramHandler] = dto.TelegramHandler, + [LiquidityKeys.Email] = dto.Email + } + }); + } + + public async Task MonitorTokenLiquidityAsync(string chainId, Guid tokenId, decimal poolLiquidity) + { + var token = await _tokenAppService.GetAsync(tokenId); + var symbol = token.Symbol; + decimal alarmThreshold = _tokenAccessOptions.TokenConfig.TryGetValue(symbol, out var value) + ? value.MinLiquidityInUsdForAlarm + : _tokenAccessOptions.DefaultConfig.MinLiquidityInUsdForAlarm; + + var poolLiquidityInUsd = await _aggregatePriceProvider.GetPriceAsync(symbol); + string personName = null; + string telegramHandler = null; + string email = null; + + var apply = await _tokenApplyOrderRepository.GetListAsync(p => p.Symbol == symbol); + if (apply.Count > 0) + { + var address = apply.First().UserAddress; + var userAccess = + await _userAccessTokenInfoRepository.GetAsync(o => o.Address == address && o.Symbol == symbol); + personName = userAccess?.PersonName; + telegramHandler = userAccess?.TelegramHandler; + email = userAccess?.Email; + } + + if (poolLiquidityInUsd <= alarmThreshold) + { + await SendLarkNotifyAsync(new LiquidityDto + { + Token = symbol, + LiquidityInUsd = poolLiquidityInUsd.ToString(), + Chain = chainId, + PersonName = personName, + TelegramHandler = telegramHandler, + Email = email + }); + } + } + + private static class LiquidityKeys + { + public const string Token = "token"; + public const string LiquidityInUsd = "liquidityInUsd"; + public const string Chain = "chain"; + public const string PersonName = "personName"; + public const string TelegramHandler = "telegramHandler"; + public const string Email = "email"; + } +} + +public class LiquidityDto +{ + public string Token { get; set; } + public string LiquidityInUsd { get; set; } + public string Chain { get; set; } + public string PersonName { get; set; } + public string TelegramHandler { get; set; } + public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenPool/LiquidityAppService.cs b/src/AElf.CrossChainServer.Application/TokenPool/LiquidityAppService.cs new file mode 100644 index 0000000..151e3c3 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenPool/LiquidityAppService.cs @@ -0,0 +1,262 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.TokenPool; + +[RemoteService(IsEnabled = false)] +public class LiquidityAppService : CrossChainServerAppService, ILiquidityAppService +{ + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly IUserLiquidityInfoAppService _userLiquidityInfoAppService; + private readonly IChainAppService _chainAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IAggregatePriceProvider _aggregatePriceProvider; + private readonly ITokenImageProvider _tokenImageProvider; + private const int MaxMaxResultCount = 1000; + private const int DefaultSkipCount = 0; + + private readonly TokenAccessOptions _tokenAccessOptions; + + public LiquidityAppService(IPoolLiquidityInfoAppService poolLiquidityInfoAppService, + IUserLiquidityInfoAppService userLiquidityInfoAppService, + IOptionsSnapshot tokenAccessOptions, IAggregatePriceProvider aggregatePriceProvider, + ITokenImageProvider tokenImageProvider, IChainAppService chainAppService, ITokenAppService tokenAppService) + { + _poolLiquidityInfoAppService = poolLiquidityInfoAppService; + _userLiquidityInfoAppService = userLiquidityInfoAppService; + _aggregatePriceProvider = aggregatePriceProvider; + _tokenImageProvider = tokenImageProvider; + _chainAppService = chainAppService; + _tokenAppService = tokenAppService; + _tokenAccessOptions = tokenAccessOptions.Value; + } + + public async Task GetPoolOverviewAsync(string addresses) + { + var poolLiquidityInfoList = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync( + new GetPoolLiquidityInfosInput + { + MaxResultCount = MaxMaxResultCount, + SkipCount = DefaultSkipCount + }); + var blackSymbolList = _tokenAccessOptions.BlackSymbolList; + var poolList = new List(); + if (blackSymbolList.Count > 0) + { + poolList.AddRange(poolLiquidityInfoList.Items.ToList() + .Where(r => !blackSymbolList.Contains(r.TokenInfo.Symbol))); + } + else + { + poolList.AddRange(poolLiquidityInfoList.Items.ToList()); + } + var poolCount = poolList.Count; + var symbolList = poolList + .Select(p => p.TokenInfo.Symbol) + .Select(symbol => + _tokenAccessOptions.SymbolMap.TryGetValue(symbol, out var aelfSymbol) ? aelfSymbol : symbol) + .Distinct() + .ToList(); + var tokenCount = symbolList.Count; + var userLiquidityInfoList = string.IsNullOrWhiteSpace(addresses) + ? new List() + : await _userLiquidityInfoAppService.GetUserLiquidityInfosAsync(new GetUserLiquidityInput + { Providers = addresses.Split(',').ToList() }); + var tokenPrice = await GetTokenPricesAsync(poolList); + var totalLiquidityInUsd = CalculateTotalLiquidityInUsd(poolList, tokenPrice); + var totalMyLiquidityInUsd = CalculateUserTotalLiquidityInUsd(userLiquidityInfoList, tokenPrice); + return new PoolOverviewDto + { + MyTotalTvlInUsd = totalMyLiquidityInUsd, + TotalTvlInUsd = totalLiquidityInUsd, + PoolCount = poolCount, + TokenCount = tokenCount + }; + } + + public async Task> GetPoolListAsync(GetPoolListInput input) + { + var poolLiquidityInfos = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync( + new GetPoolLiquidityInfosInput + { + MaxResultCount = input.MaxResultCount, + SkipCount = input.SkipCount + }); + var poolLiquidityInfoList = poolLiquidityInfos.Items.ToList(); + var result = new List(); + var tokenPrice = await GetTokenPricesAsync(poolLiquidityInfoList); + var groupedPoolLiquidityInfoList = poolLiquidityInfoList.GroupBy(p => p.ChainId); + + foreach (var group in groupedPoolLiquidityInfoList) + { + var chainId = group.Key; + foreach (var poolLiquidity in group) + { + var tokenPriceInUsd = tokenPrice[poolLiquidity.TokenInfo.Symbol]; + poolLiquidity.TokenInfo.Icon = + await _tokenImageProvider.GetTokenImageAsync(poolLiquidity.TokenInfo.Symbol); + var poolInfo = new PoolInfoDto + { + ChainId = poolLiquidity.ChainId, + Token = poolLiquidity.TokenInfo, + TotalTvlInUsd = poolLiquidity.Liquidity * tokenPriceInUsd, + TokenPrice = tokenPriceInUsd, + MyTvlInUsd = 0 + }; + if (!string.IsNullOrWhiteSpace(input.Addresses)) + { + var userLiquidityInfo = await _userLiquidityInfoAppService.GetUserLiquidityInfosAsync( + new GetUserLiquidityInput + { + Providers = input.Addresses.Split(',').ToList(), + ChainId = chainId, + Symbol = poolLiquidity.TokenInfo.Symbol + }); + if (userLiquidityInfo?.Count > 0) + { + var userLiquidityTotal = userLiquidityInfo.Sum(l => l.Liquidity); + poolInfo.MyTvlInUsd = userLiquidityTotal * tokenPriceInUsd; + } + } + + result.Add(poolInfo); + } + } + + DealWithBlackList(result); + return new PagedResultDto + { + TotalCount = poolLiquidityInfos.TotalCount, + Items = result.OrderByDescending(r => r.TotalTvlInUsd).ThenBy(r => r.Token.Symbol).ToList() + }; + } + + private void DealWithBlackList(List result) + { + var blackSymbolList = _tokenAccessOptions.BlackSymbolList; + if (blackSymbolList.Count == 0) + { + return; + } + + result.RemoveAll(r => blackSymbolList.Contains(r.Token.Symbol)); + } + + public async Task GetPoolDetailAsync(GetPoolDetailInput input) + { + var poolLiquidityInfos = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync( + new GetPoolLiquidityInfosInput + { + ChainId = input.ChainId, + Token = input.Token + }); + var poolLiquidity = poolLiquidityInfos.Items.FirstOrDefault(); + if (poolLiquidity == null) + { + Log.Warning("Pool liquidity info not found.{chainId} {token}", input.ChainId, input.Token); + return new PoolInfoDto(); + } + + var chainType = await _chainAppService.GetAsync(input.ChainId); + string tokenSymbol; + if (chainType.Type == BlockchainType.AElf) + { + tokenSymbol = input.Token; + } + else + { + tokenSymbol = (await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = input.ChainId, + Address = input.Token + })).Symbol; + } + + var priceInUsd = await _aggregatePriceProvider.GetPriceAsync(tokenSymbol); + var myLiquidity = 0m; + if (!string.IsNullOrWhiteSpace(input.Address)) + { + var userLiq = await _userLiquidityInfoAppService.GetUserLiquidityInfosAsync(new GetUserLiquidityInput + { + Providers = new List() { input.Address }, + ChainId = input.ChainId, + Symbol = tokenSymbol + }); + myLiquidity = userLiq.FirstOrDefault()?.Liquidity ?? 0; + } + + poolLiquidity.TokenInfo.Icon = await _tokenImageProvider.GetTokenImageAsync(poolLiquidity.TokenInfo.Symbol); + return new PoolInfoDto + { + ChainId = poolLiquidity.ChainId, + Token = poolLiquidity.TokenInfo, + TotalTvlInUsd = poolLiquidity.Liquidity * priceInUsd, + MyTvlInUsd = myLiquidity * priceInUsd, + TokenPrice = priceInUsd + }; + } + + private async Task> GetTokenPricesAsync( + List poolLiquidityInfoList) + { + var allSymbols = poolLiquidityInfoList + .Select(pool => pool.TokenInfo.Symbol) + .Distinct() + .ToList(); + var tokenPrices = new Dictionary(); + foreach (var symbol in allSymbols) + { + Log.Debug("To get token price: {symbol}", symbol); + var priceInUsd = await _aggregatePriceProvider.GetPriceAsync(symbol); + tokenPrices[symbol] = priceInUsd; + } + + return tokenPrices; + } + + private decimal CalculateTotalLiquidityInUsd( + List poolLiquidityInfoList, + Dictionary tokenPrices) + { + if (poolLiquidityInfoList.Count == 0) + { + return 0m; + } + + return poolLiquidityInfoList + .GroupBy(pool => pool.TokenInfo.Symbol) + .Sum(group => + { + var priceInUsd = tokenPrices[group.Key]; + var totalLiquidity = group.Sum(pool => pool.Liquidity); + return totalLiquidity * priceInUsd; + }); + } + + private decimal CalculateUserTotalLiquidityInUsd( + List userLiquidityInfoList, + Dictionary tokenPrices) + { + if (userLiquidityInfoList.Count == 0) + { + return 0m; + } + + return userLiquidityInfoList + .GroupBy(userLiq => userLiq.TokenInfo.Symbol) + .Sum(group => + { + var priceInUsd = tokenPrices[group.Key]; + var totalLiquidity = group.Sum(userLiq => userLiq.Liquidity); + return totalLiquidity * priceInUsd; + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenPool/PoolLiquidityInfoAppService.cs b/src/AElf.CrossChainServer.Application/TokenPool/PoolLiquidityInfoAppService.cs new file mode 100644 index 0000000..c2740ca --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenPool/PoolLiquidityInfoAppService.cs @@ -0,0 +1,419 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.Contracts.Bridge; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; +using Microsoft.Extensions.Options; +using Nest; +using Serilog; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Token = AElf.CrossChainServer.Tokens.Token; + +namespace AElf.CrossChainServer.TokenPool; + +[RemoteService(IsEnabled = false)] +public class PoolLiquidityInfoAppService : CrossChainServerAppService, IPoolLiquidityInfoAppService +{ + private readonly IPoolLiquidityRepository _poolLiquidityRepository; + private readonly INESTRepository _poolLiquidityInfoIndexRepository; + private readonly ITokenRepository _tokenRepository; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + private readonly IBlockchainAppService _blockchainAppService; + private readonly ISettingManager _settingManager; + private readonly IBridgeContractAppService _bridgeContractAppService; + private readonly BridgeContractOptions _bridgeContractOptions; + private readonly PoolLiquiditySyncOptions _poolLiquiditySyncOptions; + private readonly ITokenApplyOrderRepository _tokenApplyOrderRepository; + private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; + private readonly ITokenLiquidityMonitorProvider _tokenLiquidityMonitorProvider; + private readonly TokenAccessOptions _tokenAccessOptions; + + public PoolLiquidityInfoAppService(IPoolLiquidityRepository poolLiquidityRepository, + INESTRepository poolLiquidityInfoIndexRepository, + ITokenRepository tokenRepository, IChainAppService chainAppService, IBlockchainAppService blockchainAppService, + ISettingManager settingManager, + IOptionsSnapshot bridgeContractOptions, + IOptionsSnapshot poolLiquiditySyncOptions, ITokenAppService tokenAppService, + IBridgeContractAppService bridgeContractAppService, ITokenApplyOrderRepository tokenApplyOrderRepository, + ITokenLiquidityMonitorProvider tokenLiquidityMonitorProvider, + IOptionsSnapshot tokenAccessOptions, + IThirdUserTokenIssueRepository thirdUserTokenIssueRepository) + { + _poolLiquidityRepository = poolLiquidityRepository; + _poolLiquidityInfoIndexRepository = poolLiquidityInfoIndexRepository; + _tokenRepository = tokenRepository; + _chainAppService = chainAppService; + _blockchainAppService = blockchainAppService; + _settingManager = settingManager; + _tokenAppService = tokenAppService; + _bridgeContractAppService = bridgeContractAppService; + _tokenApplyOrderRepository = tokenApplyOrderRepository; + _tokenLiquidityMonitorProvider = tokenLiquidityMonitorProvider; + _thirdUserTokenIssueRepository = thirdUserTokenIssueRepository; + _tokenAccessOptions = tokenAccessOptions.Value; + _bridgeContractOptions = bridgeContractOptions.Value; + _poolLiquiditySyncOptions = poolLiquiditySyncOptions.Value; + } + + public async Task> GetPoolLiquidityInfosAsync( + GetPoolLiquidityInfosInput input) + { + var mustQuery = new List, QueryContainer>>(); + if (input.ChainId == null) + { + var chainList = await _chainAppService.GetListAsync(new GetChainsInput()); + var chainIds = chainList.Items.Select(c => c.Id).ToList(); + if (chainIds.Any()) + { + mustQuery.Add(q => q.Terms(t => t.Field(f => f.ChainId).Terms(chainIds))); + } + } + else if (!string.IsNullOrWhiteSpace(input.ChainId)) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.ChainId).Value(input.ChainId))); + if (!string.IsNullOrWhiteSpace(input.Token)) + { + var chain = await _chainAppService.GetAsync(input.ChainId); + switch (chain.Type) + { + case BlockchainType.AElf: + mustQuery.Add(q => q.Term(i => i.Field(f => f.TokenInfo.Symbol).Value(input.Token))); + break; + case BlockchainType.Evm: + mustQuery.Add(q => q.Term(i => i.Field(f => f.TokenInfo.Address).Value(input.Token))); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + + var list = await _poolLiquidityInfoIndexRepository.GetListAsync(Filter, limit: input.MaxResultCount, + skip: input.SkipCount, sortExp: o => o.Liquidity, + sortType: SortOrder.Descending); + var totalCount = await _poolLiquidityInfoIndexRepository.CountAsync(Filter); + + return new PagedResultDto + { + TotalCount = totalCount.Count, + Items = ObjectMapper.Map, List>(list.Item2) + }; + } + + public async Task AddLiquidityAsync(PoolLiquidityInfoInput input) + { + var liquidityInfo = await FindPoolLiquidityInfoAsync(input.ChainId, input.TokenId); + var isLiquidityExist = true; + if (liquidityInfo == null) + { + Log.Debug("New pool liquidity info. {chainId}-{tokenId}-{amount}", input.ChainId, input.TokenId, + input.Liquidity); + isLiquidityExist = false; + liquidityInfo = ObjectMapper.Map(input); + await DealUpdateOrderInfoAsync(input.ChainId, input.TokenId, input.Provider); + } + else + { + Log.Debug("Update pool liquidity info.{chainId}-{tokenId}-{amount}", input.ChainId, input.TokenId, + input.Liquidity); + liquidityInfo.Liquidity += input.Liquidity; + } + + if (isLiquidityExist) + { + await _poolLiquidityRepository.UpdateAsync(liquidityInfo); + } + else + { + await _poolLiquidityRepository.InsertAsync(liquidityInfo); + } + + await _tokenLiquidityMonitorProvider.MonitorTokenLiquidityAsync(liquidityInfo.ChainId, liquidityInfo.TokenId, + liquidityInfo.Liquidity); + } + + public async Task RemoveLiquidityAsync(PoolLiquidityInfoInput input) + { + var liquidityInfo = await FindPoolLiquidityInfoAsync(input.ChainId, input.TokenId); + if (liquidityInfo == null) + { + Log.Error("Pool liquidity info not found. {chainId}-{tokenId}", input.ChainId, input.TokenId); + } + else + { + Log.Debug("Remove pool liquidity info.{chainId}-{tokenId}-{amount}", input.ChainId, input.TokenId, + input.Liquidity); + liquidityInfo.Liquidity -= input.Liquidity; + await _poolLiquidityRepository.UpdateAsync(liquidityInfo, autoSave: true); + } + + await _tokenLiquidityMonitorProvider.MonitorTokenLiquidityAsync(liquidityInfo.ChainId, liquidityInfo.TokenId, + liquidityInfo.Liquidity); + } + + public async Task AddIndexAsync(AddPoolLiquidityInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TokenId != Guid.Empty) + { + index.TokenInfo = await _tokenRepository.GetAsync(input.TokenId); + } + + await _poolLiquidityInfoIndexRepository.AddAsync(index); + } + + public async Task UpdateIndexAsync(UpdatePoolLiquidityInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TokenId != Guid.Empty) + { + index.TokenInfo = await _tokenRepository.GetAsync(input.TokenId); + } + + await _poolLiquidityInfoIndexRepository.UpdateAsync(index); + } + + public async Task SyncPoolLiquidityInfoFromChainAsync() + { + Log.Information("Start to sync pool liquidity info from chain."); + var chainList = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.AElf + }); + foreach (var chain in chainList.Items) + { + Log.Debug("Sync pool liquidity info from chain {chainId}.", chain.Id); + // // Step 1: Retrieve the current height of the best chain on AElf and insert a new AElf liquidity sync height + var chainStatus = await _blockchainAppService.GetChainStatusAsync(chain.Id); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.PoolLiquidityIndexerSync, null), + chainStatus.BlockHeight.ToString()); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.UserLiquidityIndexerSync, null), + chainStatus.BlockHeight.ToString()); + // Step 2: Query the AElf contract to sync the liquidity of configured tokens - getLiquidityInfo. + var tokenSymbols = _poolLiquiditySyncOptions.Token[chain.Id]; + var tokenIdList = new List(); + foreach (var symbol in tokenSymbols) + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = symbol + }); + tokenIdList.Add(token.Id); + } + + var poolLiquidityList = await _bridgeContractAppService.GetPoolLiquidityAsync(chain.Id, + _bridgeContractOptions.ContractAddresses[chain.Id].TokenPoolContract, tokenIdList); + // Step 3: Write the data into poolLiquidity. + foreach (var poolLiquidity in poolLiquidityList) + { + await AddLiquidityAsync(ObjectMapper.Map(poolLiquidity)); + } + } + + var evmChainList = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.Evm + }); + foreach (var chain in evmChainList.Items) + { + Log.Debug("Sync pool liquidity info from chain {chainId}.", chain.Id); + // Step 1: Retrieve the current height of the EVM chain and insert a new EVM liquidity sync height. + var currentChainHeight = await _blockchainAppService.GetChainHeightAsync(chain.Id); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmPoolLiquidityIndexerSync, null), + currentChainHeight.ToString()); + await _settingManager.SetAsync(chain.Id, + GetSettingKey(CrossChainServerSettings.EvmUserLiquidityIndexerSync, null), + currentChainHeight.ToString()); + // Step 2: Query the EVM contract to sync the liquidity of configured tokens - getBalance. + var tokenAddresses = _poolLiquiditySyncOptions.Token[chain.Id]; + var tokenIdList = new List(); + foreach (var tokenAddress in tokenAddresses) + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Address = tokenAddress + }); + tokenIdList.Add(token.Id); + } + + var poolLiquidityList = await _bridgeContractAppService.GetPoolLiquidityAsync(chain.Id, + _bridgeContractOptions.ContractAddresses[chain.Id].TokenPoolContract, tokenIdList); + // Step 3: Write the data into poolLiquidity. + foreach (var poolLiquidity in poolLiquidityList) + { + await AddLiquidityAsync(ObjectMapper.Map(poolLiquidity)); + } + } + + Log.Information("Finish to sync pool liquidity info from chain."); + } + + private async Task FindPoolLiquidityInfoAsync(string chainId, Guid tokenId) + { + return await _poolLiquidityRepository.FindAsync(o => o.ChainId == chainId && o.TokenId == tokenId); + } + + private string GetSettingKey(string syncType, string typePrefix) + { + return string.IsNullOrWhiteSpace(typePrefix) ? syncType : $"{typePrefix}-{syncType}"; + } + + private async Task DealUpdateOrderInfoAsync(string chainId, Guid tokenId, string provider) + { + var chain = await _chainAppService.GetAsync(chainId); + if (chain.Type == BlockchainType.AElf || !string.Equals(provider, CrossChainServerConsts.AddressZero)) + { + Log.Information("Not deal with aelf chain liquidity or provider is not zero address.{chainId},{provider}", + chainId, provider); + return; + } + + var token = await _tokenRepository.GetAsync(tokenId); + var queryable = await _tokenApplyOrderRepository.WithDetailsAsync(y => y.StatusChangedRecords); + var query = queryable.Where(x => x.Symbol == token.Symbol && x.ChainId == chainId); + var order = await AsyncExecuter.FirstOrDefaultAsync(query); + if (order == null) + { + Log.Information( + "Token apply order not found,chainId: {chainId},symbol: {symbol}", chainId, token.Symbol); + var thirdTokenInfo = + await _thirdUserTokenIssueRepository.FindAsync(t => t.Symbol == token.Symbol && t.OtherChainId == chainId); + if (thirdTokenInfo == null) + { + Log.Warning("Third token info not found,chainId: {chainId},symbol: {symbol}", chainId, token.Symbol); + return; + } + + await CreateTokenApplyOrderAsync(token.Symbol, thirdTokenInfo.Address, + TokenApplyOrderStatus.PoolInitialized.ToString(), + thirdTokenInfo); + } + else + { + if (order.Status != TokenApplyOrderStatus.PoolInitializing.ToString()) + { + Log.Warning("Invalid token apply order status, orderId: {orderId}", order.Id); + return; + } + + order.Status = TokenApplyOrderStatus.PoolInitialized.ToString(); + order.StatusChangedRecords.Add(new StatusChangedRecord + { + Status = TokenApplyOrderStatus.PoolInitialized.ToString(), + Time = DateTime.UtcNow + }); + await _tokenApplyOrderRepository.UpdateAsync(order); + } + + await DealWithAElfChainLiquidityAsync(token.Symbol); + } + + private async Task DealWithAElfChainLiquidityAsync(string symbol) + { + var chainsToInsert = new List(); + var chainIdSet = _tokenAccessOptions.ChainIdList; + var tokens = new List(); + foreach (var chainId in chainIdSet) + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Symbol = symbol + }); + tokens.Add(token); + } + if (tokens.Count > 0) + { + if (tokens.First().IsBurnable) + { + var toAdd = new List(); + foreach (var token in tokens) + { + var existingPool = await _poolLiquidityRepository.FindAsync(p => p.TokenId == token.Id); + if (existingPool == null) + { + toAdd.Add(new PoolLiquidityInfo + { + ChainId = token.ChainId, + TokenId = token.Id, + Liquidity = 0 + }); + } + } + chainsToInsert.AddRange(toAdd); + } + else + { + var issueChainId = tokens.First().IssueChainId; + var chain = await _chainAppService.GetByAElfChainIdAsync(issueChainId); + var token = tokens.FirstOrDefault(t => t.ChainId == chain.Id); + if (token != null) + { + if (await _poolLiquidityRepository.FindAsync(token.Id) == null) + { + chainsToInsert.Add(new PoolLiquidityInfo + { + ChainId = token.ChainId, + TokenId = token.Id, + Liquidity = 0 + }); + } + } + } + } + if (chainsToInsert.Count != 0) + { + await _poolLiquidityRepository.InsertManyAsync(chainsToInsert); + } + } + + private async Task CreateTokenApplyOrderAsync(string symbol, string userAddress, string status, + ThirdUserTokenIssueInfo tokenIssueInfo) + { + var order = new TokenApplyOrder + { + Symbol = symbol, + UserAddress = userAddress, + Status = status, + CreateTime = ToUtcMilliSeconds(DateTime.UtcNow), + UpdateTime = ToUtcMilliSeconds(DateTime.UtcNow), + StatusChangedRecords = new List + { + new() { Id = Guid.NewGuid(), Status = status, Time = DateTime.UtcNow } + }, + ChainId = tokenIssueInfo.OtherChainId, + ChainName = tokenIssueInfo.OtherChainId, + TokenName = tokenIssueInfo.TokenName, + TotalSupply = tokenIssueInfo.TotalSupply.SafeToDecimal(), + Decimals = CrossChainServerConsts.DefaultEvmTokenDecimal, + Icon = tokenIssueInfo.TokenImage, + PoolAddress = _bridgeContractOptions.ContractAddresses[tokenIssueInfo.OtherChainId] + .TokenPoolContract, + ContractAddress = tokenIssueInfo.ContractAddress + }; + await _tokenApplyOrderRepository.InsertAsync(order); + } + + public static long ToUtcMilliSeconds(DateTime dateTime) + { + return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenPool/UserLiquidityInfoAppService.cs b/src/AElf.CrossChainServer.Application/TokenPool/UserLiquidityInfoAppService.cs new file mode 100644 index 0000000..0d42468 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenPool/UserLiquidityInfoAppService.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenPrice; +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; +using Microsoft.Extensions.Options; +using Nest; +using Serilog; +using Volo.Abp; + +namespace AElf.CrossChainServer.TokenPool; + +[RemoteService(IsEnabled = false)] +public class UserLiquidityInfoAppService : CrossChainServerAppService, IUserLiquidityInfoAppService +{ + private readonly IUserLiquidityRepository _userLiquidityRepository; + private readonly INESTRepository _userLiquidityInfoIndexRepository; + private readonly ITokenRepository _tokenRepository; + + public UserLiquidityInfoAppService(IUserLiquidityRepository userLiquidityRepository, + INESTRepository userLiquidityInfoIndexRepository, + ITokenRepository tokenRepository) + { + _userLiquidityRepository = userLiquidityRepository; + _userLiquidityInfoIndexRepository = userLiquidityInfoIndexRepository; + _tokenRepository = tokenRepository; + } + + public async Task> GetUserLiquidityInfosAsync(GetUserLiquidityInput input) + { + var mustQuery = + new List, QueryContainer>>(); + var providers = new List(); + foreach (var provider in input.Providers.Distinct()) + { + if (!Base58CheckEncoding.Verify(provider)) + { + if (Nethereum.Util.AddressExtensions.IsValidEthereumAddressHexFormat(provider)) + { + providers.Add(provider.ToLower()); + continue; + } + } + + if (TonAddressHelper.IsTonFriendlyAddress(provider)) + { + providers.Add(TonAddressHelper.GetTonRawAddress(provider)); + continue; + } + + providers.Add(provider); + } + + mustQuery.Add(q => q.Terms(t => t.Field(f => f.Provider).Terms(providers))); + + if (!string.IsNullOrWhiteSpace(input.ChainId)) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.ChainId).Value(input.ChainId))); + } + + if (!string.IsNullOrWhiteSpace(input.Symbol)) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.TokenInfo.Symbol).Value(input.Symbol))); + } + + if (!string.IsNullOrWhiteSpace(input.TokenAddress)) + { + mustQuery.Add(q => q.Term(i => i.Field(f => f.TokenInfo.Address).Value(input.TokenAddress))); + } + + + QueryContainer Filter(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); + var list = await _userLiquidityInfoIndexRepository.GetListAsync(Filter, sortExp: o => o.Liquidity, + sortType: SortOrder.Descending); + return ObjectMapper.Map, List>(list.Item2); + } + + public async Task AddUserLiquidityAsync(UserLiquidityInfoInput input) + { + var liquidityInfo = await FindUserLiquidityInfoAsync(input.ChainId, input.TokenId, input.Provider); + var isLiquidityExist = true; + if (liquidityInfo == null) + { + Log.ForContext("ChainId", input.ChainId) + .ForContext("TokenId", input.TokenId) + .Debug("New user liquidity info, provider: {provider}", input.Provider); + isLiquidityExist = false; + liquidityInfo = ObjectMapper.Map(input); + } + else + { + Log.ForContext("ChainId", input.ChainId) + .ForContext("TokenId", input.TokenId) + .Debug("Update pool liquidity info, provider: {provider}", input.Provider); + liquidityInfo.Liquidity += input.Liquidity; + } + + if (isLiquidityExist) + { + await _userLiquidityRepository.UpdateAsync(liquidityInfo, autoSave: true); + } + else + { + await _userLiquidityRepository.InsertAsync(liquidityInfo, autoSave: true); + } + } + + public async Task RemoveUserLiquidityAsync(UserLiquidityInfoInput input) + { + var liquidityInfo = await FindUserLiquidityInfoAsync(input.ChainId, input.TokenId, input.Provider); + if (liquidityInfo == null) + { + Log.ForContext("ChainId", input.ChainId) + .ForContext("TokenId", input.TokenId) + .Error("User liquidity info not found, provider: {provider}", input.Provider); + } + else + { + liquidityInfo.Liquidity -= input.Liquidity; + await _userLiquidityRepository.UpdateAsync(liquidityInfo, autoSave: true); + } + } + + public async Task AddIndexAsync(AddUserLiquidityInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TokenId != Guid.Empty) + { + index.TokenInfo = await _tokenRepository.GetAsync(input.TokenId); + } + + await _userLiquidityInfoIndexRepository.AddAsync(index); + } + + public async Task UpdateIndexAsync(UpdateUserLiquidityInfoIndexInput input) + { + var index = ObjectMapper.Map(input); + + if (input.TokenId != Guid.Empty) + { + index.TokenInfo = await _tokenRepository.GetAsync(input.TokenId); + } + + await _userLiquidityInfoIndexRepository.UpdateAsync(index); + } + + private async Task FindUserLiquidityInfoAsync(string chainId, Guid tokenId, string provider) + { + return await _userLiquidityRepository.FindAsync(o => + o.ChainId == chainId && o.TokenId == tokenId && o.Provider == provider); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenPriceIdMappingOptions.cs b/src/AElf.CrossChainServer.Application/TokenPriceIdMappingOptions.cs new file mode 100644 index 0000000..b5b2296 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenPriceIdMappingOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer; + +public class TokenPriceIdMappingOptions +{ + public Dictionary CoinIdMapping { get; set; } = new(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/TokenWhitelistOptions.cs b/src/AElf.CrossChainServer.Application/TokenWhitelistOptions.cs new file mode 100644 index 0000000..8dc09b8 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/TokenWhitelistOptions.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer; + +public class TokenWhitelistOptions +{ + /// + /// token -> chainId -> tokenInfo + /// + public Dictionary> TokenWhitelist { get; set; } = new(); +} + +public class TokenInfo +{ + public string Name { get; set; } + public string Symbol { get; set; } + public long Decimals { get; set; } + public string Address { get; set; } + public string IssueChainId { get; set; } + public bool IsNativeToken { get; set; } + public string Icon { get; set; } + public bool OnlyFrom { get; set; } + public bool OnlyTo { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Tokens/ITokenSymbolMappingProvider.cs b/src/AElf.CrossChainServer.Application/Tokens/ITokenSymbolMappingProvider.cs new file mode 100644 index 0000000..e2b3a24 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Tokens/ITokenSymbolMappingProvider.cs @@ -0,0 +1,35 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Tokens; + +public interface ITokenSymbolMappingProvider +{ + string GetMappingSymbol(string fromChainId, string toChainId, string symbol); +} + +public class TokenSymbolMappingProvider : ITokenSymbolMappingProvider, ITransientDependency +{ + private readonly TokenSymbolMappingOptions _tokenSymbolMappingOptions; + + public TokenSymbolMappingProvider(IOptionsSnapshot tokenSymbolMappingOptions) + { + _tokenSymbolMappingOptions = tokenSymbolMappingOptions.Value; + } + + public string GetMappingSymbol(string fromChainId, string toChainId, string symbol) + { + if (_tokenSymbolMappingOptions.Mapping.TryGetValue(fromChainId, out var items)) + { + if (items.TryGetValue(toChainId, out var mappingSymbols)) + { + if (mappingSymbols.TryGetValue(symbol, out var mappingSymbol)) + { + return mappingSymbol; + } + } + } + + return symbol; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Tokens/TokenAppService.cs b/src/AElf.CrossChainServer.Application/Tokens/TokenAppService.cs new file mode 100644 index 0000000..ced2e24 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Tokens/TokenAppService.cs @@ -0,0 +1,88 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.ExceptionHandler; +using AElf.ExceptionHandler; +using Microsoft.Extensions.Logging; +using Serilog; +using Volo.Abp; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.Tokens +{ + [RemoteService(IsEnabled = false)] + public class TokenAppService : CrossChainServerAppService, ITokenAppService + { + private readonly ITokenRepository _tokenRepository; + private readonly IBlockchainAppService _blockchainAppService; + + public TokenAppService( ITokenRepository tokenRepository, IBlockchainAppService blockchainAppService) + { + _tokenRepository = tokenRepository; + _blockchainAppService = blockchainAppService; + } + + public async Task GetAsync(Guid id) + { + var token = await _tokenRepository.GetAsync(id); + return ObjectMapper.Map(token); + } + + public async Task GetAsync(GetTokenInput input) + { + var token = await _tokenRepository.FirstOrDefaultAsync(o => + o.ChainId == input.ChainId && + (input.Address.IsNullOrWhiteSpace() || o.Address == input.Address ) && + (input.Symbol.IsNullOrWhiteSpace() || o.Symbol == input.Symbol)); + if (token == null) + { + if (input.Address != null && input.Address == CrossChainServerConsts.TonCoinAddress) + { + token = await _tokenRepository.InsertAsync(new Token + { + Address = input.Address, + Decimals = CrossChainServerConsts.TonCoinTokenDecimal, + Symbol = CrossChainServerConsts.TonCoinTokenSymbol, + ChainId = input.ChainId, + IssueChainId = 0, + IsBurnable = false + }, autoSave: true); + } + else + { + var tokenDto = await _blockchainAppService.GetTokenInfoAsync(input.ChainId, input.Address, input.Symbol); + if (tokenDto == null) + { + Log.ForContext("chainId", input.ChainId).Error( + "Cannot get token! chain: {chainId}, address: {address}, symbol: {symbol}.", input.ChainId, + input.Address ?? string.Empty, input.Symbol ?? string.Empty); + + throw new EntityNotFoundException("Token not exist."); + } + + token = await _tokenRepository.InsertAsync(new Token + { + Address = tokenDto.Address, + Decimals = tokenDto.Decimals, + Symbol = tokenDto.Symbol, + ChainId = input.ChainId, + IssueChainId = tokenDto.IssueChainId, + IsBurnable = tokenDto.IsBurnable + }, autoSave: true); + } + + } + + return ObjectMapper.Map(token); + } + + public async Task CreateAsync(TokenCreateInput input) + { + var token = ObjectMapper.Map(input); + + token = await _tokenRepository.InsertAsync(token, autoSave: true); + return ObjectMapper.Map(token); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Tokens/TokenSymbolMappingOptions.cs b/src/AElf.CrossChainServer.Application/Tokens/TokenSymbolMappingOptions.cs new file mode 100644 index 0000000..72193c7 --- /dev/null +++ b/src/AElf.CrossChainServer.Application/Tokens/TokenSymbolMappingOptions.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Tokens; + +public class TokenSymbolMappingOptions +{ + public Dictionary>> Mapping { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/AElf.CrossChainServer.AuthServer.csproj b/src/AElf.CrossChainServer.AuthServer/AElf.CrossChainServer.AuthServer.csproj new file mode 100644 index 0000000..fec7d7b --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/AElf.CrossChainServer.AuthServer.csproj @@ -0,0 +1,69 @@ + + + + net8.0 + enable + enable + AElf.CrossChainServer.Auth + true + true + true + false + true + + + + + Always + + + Always + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerAuthServerModule.cs b/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerAuthServerModule.cs new file mode 100644 index 0000000..dcf8454 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerAuthServerModule.cs @@ -0,0 +1,227 @@ +using AElf.CrossChainServer.Auth.Options; +using AElf.CrossChainServer.EntityFrameworkCore; +using AElf.CrossChainServer.Localization; +using Localization.Resources.AbpUi; +using Medallion.Threading; +using Medallion.Threading.Redis; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Serilog; +using StackExchange.Redis; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Auditing; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.ExtensionGrantTypes; +using Volo.Abp.OpenIddict.Tokens; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.Auth; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpDistributedLockingModule), + typeof(AbpAccountApplicationModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(CrossChainServerDomainModule), + typeof(CrossChainServerEntityFrameworkCoreModule) +)] +public class AElfCrossChainServerAuthServerModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + + PreConfigure(builder => + { + builder.AddServer(options => + { + options.UseAspNetCore().DisableTransportSecurityRequirement(); + options.SetIssuer(new Uri(configuration["AuthServer:IssuerUri"])); + int.TryParse(configuration["ExpirationHour"], out int expirationHour); + if (expirationHour > 0) + { + options.SetAccessTokenLifetime(DateTime.Now.AddHours(expirationHour) - DateTime.Now); + } + }); + + builder.AddValidation(options => + { + options.AddAudiences("CrossChainServer"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + + PreConfigure(builder => + { + builder.Configure(openIddictServerOptions => + { + openIddictServerOptions.GrantTypes.Add("signature"); + openIddictServerOptions.GrantTypes.Add(AuthConstant.GrantType); + }); + }); + } + + // public override void ConfigureServices(ServiceConfigurationContext context) + // { + // Configure(options => + // { + // options.Grants.Add("signature", new SignatureGrantHandler()); + // options.Grants.Add(AuthConstant.GrantType, new LoginTokenExtensionGrant()); + // }); + // Configure(x => x.IsCleanupEnabled = false); + // } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; + }); + + context.Services.Configure(configuration.GetSection("GraphQL")); + context.Services.Configure(configuration.GetSection("Chains")); + context.Services.Configure(configuration.GetSection("Recaptcha")); + Configure(configuration.GetSection("Contract")); + context.Services.Configure(option => + { + option.TimeRange = Convert.ToInt32(configuration["TimeRange"]); + }); + + Configure(options => + { + options.Grants.Add("signature", new SignatureGrantHandler()); + options.Grants.Add(AuthConstant.GrantType, new LoginTokenExtensionGrant()); + }); + + Configure(options => + { + options.Resources.Get().AddBaseTypes(typeof(AbpUiResource)); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + }); + + Configure(options => + { + options.StyleBundles.Configure(LeptonXLiteThemeBundles.Styles.Global, + bundle => { bundle.AddFiles("/global-styles.css"); } + ); + }); + + Configure(options => { options.IsEnabled = false; }); + + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(',')); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + Configure(x => x.IsCleanupEnabled = false); + Configure(options => { options.IsJobExecutionEnabled = false; }); + Configure(options => { options.KeyPrefix = "CrossChainServer:Auth:"; }); + + var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("CrossChainServer"); + if (!hostingEnvironment.IsDevelopment()) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "CrossChainServer-Protection-Keys"); + } + + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); + + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + context.Services.AddHttpClient(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + app.UseUnitOfWork(); + app.UseAuthorization(); + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + + DisplayConfigurationProviders(context); + } + + public static void DisplayConfigurationProviders(ApplicationInitializationContext context) + { + try + { + var configuration = context.GetConfiguration(); + var configurationRoot = (IConfigurationRoot)configuration; + foreach (var provider in configurationRoot.Providers.ToList()) + { + Log.Warning("ConfigurationProvider: {0}", provider.ToString()); + } + } + catch (Exception e) + { + Log.Error(e, "display configuration providers error."); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerBrandingProvider.cs b/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerBrandingProvider.cs new file mode 100644 index 0000000..702265b --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/AElfCrossChainServerBrandingProvider.cs @@ -0,0 +1,19 @@ +using AElf.CrossChainServer.Localization; +using Microsoft.Extensions.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace AElf.CrossChainServer.Auth; + +[Dependency(ReplaceServices = true)] +public class AElfCrossChainServerBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public AElfCrossChainServerBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AElfCrossChainServer"]; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/ApolloConfigurationExtension.cs b/src/AElf.CrossChainServer.AuthServer/ApolloConfigurationExtension.cs new file mode 100644 index 0000000..1013929 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/ApolloConfigurationExtension.cs @@ -0,0 +1,16 @@ +namespace AElf.CrossChainServer.Auth; + +public static class ApolloConfigurationExtension +{ + public static IHostBuilder UseApollo(this IHostBuilder builder) + { + return builder + .ConfigureAppConfiguration(config => + { + var apolloOption = config.Build().GetSection("apollo"); + if (!apolloOption.GetSection("UseApollo").Get()) return; + + config.AddApollo(apolloOption); + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Common/CommonConstant.cs b/src/AElf.CrossChainServer.AuthServer/Common/CommonConstant.cs new file mode 100644 index 0000000..611ab95 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Common/CommonConstant.cs @@ -0,0 +1,83 @@ +namespace AElf.CrossChainServer.Auth.Common; + +public static class CommonConstant +{ + public const string Space = " "; + public const string EmptyString = ""; + public const string Dot = "."; + public const string Hyphen = "-"; + public const string Colon = ":"; + public const string Underline = "_"; + public const string Comma = ","; + public const string At = "@"; + public const string Slash = "/"; + public const string V = "v"; + public const string WithdrawRequestErrorKey = "WithdrawRequestErrorKey"; + public const string WithdrawThirdPartErrorKey = "WithdrawThirdPartError"; + public const string SignatureClientName = "Signature"; + public const string ThirdPartSignUrl = "/api/app/signature/thirdPart"; + public const string PendingStatus = "pending"; + public const string SuccessStatus = "success"; + public const string Withdraw = "withdraw"; + public const string Deposit = "deposit"; + + public const string DepositOrderLostAlarm = "DepositOrderLostAlarm"; + public const string DepositOrderCoinNotSupportAlarm = "DepositOrderCoinNotSupportAlarm"; + + public const string PortKeyAppId = "PortKey"; + public const string NightElfAppId = "NightElf"; + + public static class DefaultConst + { + public const int ThirdPartDigitals = 4; + public const int ElfDecimals = 8; + public const decimal DefaultMinThirdPartFee = 0.1M; + public const string CaContractName = "Portkey.Contracts.CA"; + public const string CaContractName2 = "Portkey.Contracts.CA2"; + public const string ManagerForwardCall = "ManagerForwardCall"; + public const string TransferToken = "TransferToken"; + public const string PortKeyVersion = "v1"; + public const string PortKeyVersion2 = "v2"; + public const string LimitLogs = "candlesticks,from"; + } + + public static class ChainId + { + public const string AElfMainChain = "AELF"; + public const string AElfSideChainTdvv = "tDVV"; + } + + public static class Network + { + public const string AElf = "AELF"; + public const string ETH = "ETH"; + } + + public static class NetworkStatus + { + public const string Health = "Health"; + public const string Offline = "Offline"; + } + + public static class Symbol + { + public const string Elf = "ELF"; + public const string USD = "USD"; + public const string USDT = "USDT"; + public const string SGR = "SGR-1"; + } + + public static class TransactionState + { + public const string Mined = "MINED"; + public const string Pending = "PENDING"; + public const string NotExisted = "NOTEXISTED"; + public const string Failed = "FAILED"; + public const string NodeValidationFailed = "NODEVALIDATIONFAILED"; + } + + public static class ThirdPartResponseCode + { + public const string DuplicateRequest = "12009"; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Common/GuidHelper.cs b/src/AElf.CrossChainServer.AuthServer/Common/GuidHelper.cs new file mode 100644 index 0000000..26e6686 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Common/GuidHelper.cs @@ -0,0 +1,14 @@ +using System.Security.Cryptography; +using System.Text; + +namespace AElf.CrossChainServer.Auth.Common; + +public static class GuidHelper +{ + public static Guid UniqGuid(params string[] paramArr) + => new(MD5.HashData(Encoding.Default.GetBytes(GenerateId(paramArr)))); + + public static string GenerateId(params string[] paramArr) => string.Join("_", paramArr); + public static string GenerateGrainId(params object[] ids) => ids.JoinAsString("-"); + public static string GenerateCombinedId(params string[] parts) => string.Join(CommonConstant.Colon, parts); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Common/WalletEnum.cs b/src/AElf.CrossChainServer.AuthServer/Common/WalletEnum.cs new file mode 100644 index 0000000..e5aca6f --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Common/WalletEnum.cs @@ -0,0 +1,11 @@ +namespace AElf.CrossChainServer.Auth.Common; + +public enum WalletEnum +{ + Portkey = 0, + NightElf, + EVM, + Solana, + TRX, + TON +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/DTOs/HolderInfoDto.cs b/src/AElf.CrossChainServer.AuthServer/DTOs/HolderInfoDto.cs new file mode 100644 index 0000000..fcb2508 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/DTOs/HolderInfoDto.cs @@ -0,0 +1,21 @@ +namespace AElf.CrossChainServer.Auth.DTOs; + +public class HolderInfoIndexerDto +{ + public List CaHolderInfo { get; set; } +} + +public class HolderInfoDto +{ + public string CreateChainId { get; set; } + public string CaHash { get; set; } + public string CaAddress { get; set; } + public string ChainId { get; set; } + public List ManagerInfos { get; set; } +} + +public class ManagerInfo +{ + public string Address { get; set; } + public string ExtraData { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.c.cs b/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.c.cs new file mode 100644 index 0000000..27ac252 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.c.cs @@ -0,0 +1,54 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs12.proto +// +// Original file comments: +// * +// AElf Standards ACS12(User Contract Standard) +// +// Used to manage user contract. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace AElf.Standards.ACS12 { + + #region Events + #endregion + internal static partial class UserContractContainer + { + static readonly string __ServiceName = "acs12.UserContract"; + + #region Marshallers + #endregion + + #region Methods + #endregion + + #region Descriptors + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.Services[0], + }; + } + } + #endregion + + // public class UserContractReferenceState : global::AElf.Sdk.CSharp.State.ContractReferenceState + // { + // } + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.g.cs b/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.g.cs new file mode 100644 index 0000000..8d57133 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Generated/Acs12.g.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acs12.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace AElf.Standards.ACS12 { + + /// Holder for reflection information generated from acs12.proto + internal static partial class Acs12Reflection { + + #region Descriptor + /// File descriptor for acs12.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Acs12Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgthY3MxMi5wcm90bxIFYWNzMTIaEmFlbGYvb3B0aW9ucy5wcm90bxobZ29v", + "Z2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3Jh", + "cHBlcnMucHJvdG8aD2FlbGYvY29yZS5wcm90byJeChZVc2VyQ29udHJhY3RN", + "ZXRob2RGZWVzEioKBGZlZXMYAiADKAsyHC5hY3MxMi5Vc2VyQ29udHJhY3RN", + "ZXRob2RGZWUSGAoQaXNfc2l6ZV9mZWVfZnJlZRgDIAEoCCI6ChVVc2VyQ29u", + "dHJhY3RNZXRob2RGZWUSDgoGc3ltYm9sGAEgASgJEhEKCWJhc2ljX2ZlZRgC", + "IAEoAzIOCgxVc2VyQ29udHJhY3RCIaoCFEFFbGYuU3RhbmRhcmRzLkFDUzEy", + "ipL0AQVhY3MxMlAAUAFQAmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::AElf.Types.CoreReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS12.UserContractMethodFees), global::AElf.Standards.ACS12.UserContractMethodFees.Parser, new[]{ "Fees", "IsSizeFeeFree" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Standards.ACS12.UserContractMethodFee), global::AElf.Standards.ACS12.UserContractMethodFee.Parser, new[]{ "Symbol", "BasicFee" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///Specified method fee for user contract. + /// + internal sealed partial class UserContractMethodFees : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UserContractMethodFees()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees(UserContractMethodFees other) : this() { + fees_ = other.fees_.Clone(); + isSizeFeeFree_ = other.isSizeFeeFree_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFees Clone() { + return new UserContractMethodFees(this); + } + + /// Field number for the "fees" field. + public const int FeesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_fees_codec + = pb::FieldCodec.ForMessage(18, global::AElf.Standards.ACS12.UserContractMethodFee.Parser); + private readonly pbc::RepeatedField fees_ = new pbc::RepeatedField(); + /// + /// List of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Fees { + get { return fees_; } + } + + /// Field number for the "is_size_fee_free" field. + public const int IsSizeFeeFreeFieldNumber = 3; + private bool isSizeFeeFree_; + /// + /// Optional based on the implementation of SetConfiguration method. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsSizeFeeFree { + get { return isSizeFeeFree_; } + set { + isSizeFeeFree_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UserContractMethodFees); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UserContractMethodFees other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!fees_.Equals(other.fees_)) return false; + if (IsSizeFeeFree != other.IsSizeFeeFree) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= fees_.GetHashCode(); + if (IsSizeFeeFree != false) hash ^= IsSizeFeeFree.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + fees_.WriteTo(output, _repeated_fees_codec); + if (IsSizeFeeFree != false) { + output.WriteRawTag(24); + output.WriteBool(IsSizeFeeFree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + fees_.WriteTo(ref output, _repeated_fees_codec); + if (IsSizeFeeFree != false) { + output.WriteRawTag(24); + output.WriteBool(IsSizeFeeFree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += fees_.CalculateSize(_repeated_fees_codec); + if (IsSizeFeeFree != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UserContractMethodFees other) { + if (other == null) { + return; + } + fees_.Add(other.fees_); + if (other.IsSizeFeeFree != false) { + IsSizeFeeFree = other.IsSizeFeeFree; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 18: { + fees_.AddEntriesFrom(input, _repeated_fees_codec); + break; + } + case 24: { + IsSizeFeeFree = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 18: { + fees_.AddEntriesFrom(ref input, _repeated_fees_codec); + break; + } + case 24: { + IsSizeFeeFree = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class UserContractMethodFee : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UserContractMethodFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee(UserContractMethodFee other) : this() { + symbol_ = other.symbol_; + basicFee_ = other.basicFee_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UserContractMethodFee Clone() { + return new UserContractMethodFee(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + /// + /// The token symbol of the method fee. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "basic_fee" field. + public const int BasicFeeFieldNumber = 2; + private long basicFee_; + /// + /// The amount of fees to be charged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long BasicFee { + get { return basicFee_; } + set { + basicFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UserContractMethodFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UserContractMethodFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (BasicFee != other.BasicFee) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (BasicFee != 0L) hash ^= BasicFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (BasicFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(BasicFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (BasicFee != 0L) { + output.WriteRawTag(16); + output.WriteInt64(BasicFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (BasicFee != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BasicFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UserContractMethodFee other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.BasicFee != 0L) { + BasicFee = other.BasicFee; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + BasicFee = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + BasicFee = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.AuthServer/Generated/AuthorityInfo.g.cs b/src/AElf.CrossChainServer.AuthServer/Generated/AuthorityInfo.g.cs new file mode 100644 index 0000000..fb76f83 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Generated/AuthorityInfo.g.cs @@ -0,0 +1,292 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: authority_info.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from authority_info.proto +internal static partial class AuthorityInfoReflection { + + #region Descriptor + /// File descriptor for authority_info.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AuthorityInfoReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRhdXRob3JpdHlfaW5mby5wcm90bxoPYWVsZi9jb3JlLnByb3RvIl4KDUF1", + "dGhvcml0eUluZm8SJwoQY29udHJhY3RfYWRkcmVzcxgBIAEoCzINLmFlbGYu", + "QWRkcmVzcxIkCg1vd25lcl9hZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNz", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::AuthorityInfo), global::AuthorityInfo.Parser, new[]{ "ContractAddress", "OwnerAddress" }, null, null, null, null) + })); + } + #endregion + +} +#region Messages +internal sealed partial class AuthorityInfo : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AuthorityInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::AuthorityInfoReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AuthorityInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AuthorityInfo(AuthorityInfo other) : this() { + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + ownerAddress_ = other.ownerAddress_ != null ? other.ownerAddress_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AuthorityInfo Clone() { + return new AuthorityInfo(this); + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 1; + private global::AElf.Types.Address contractAddress_; + /// + /// The contract address of the controller. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "owner_address" field. + public const int OwnerAddressFieldNumber = 2; + private global::AElf.Types.Address ownerAddress_; + /// + /// The address of the owner of the contract. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address OwnerAddress { + get { return ownerAddress_; } + set { + ownerAddress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AuthorityInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AuthorityInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (!object.Equals(OwnerAddress, other.OwnerAddress)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (ownerAddress_ != null) hash ^= OwnerAddress.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (ownerAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OwnerAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (contractAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAddress); + } + if (ownerAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OwnerAddress); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (ownerAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OwnerAddress); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AuthorityInfo other) { + if (other == null) { + return; + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.ownerAddress_ != null) { + if (ownerAddress_ == null) { + OwnerAddress = new global::AElf.Types.Address(); + } + OwnerAddress.MergeFrom(other.OwnerAddress); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + if (ownerAddress_ == null) { + OwnerAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OwnerAddress); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 18: { + if (ownerAddress_ == null) { + OwnerAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(OwnerAddress); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.c.cs b/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.c.cs new file mode 100644 index 0000000..af2ccdc --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.c.cs @@ -0,0 +1,957 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ca_contract.proto +// +// Original file comments: +// * +// CA contract. +#pragma warning disable 0414, 1591 +#region Designer generated code + +using System.Collections.Generic; +using aelf = global::AElf.CSharp.Core; + +namespace Portkey.Contracts.CA { + + #region Events + internal partial class CAHolderCreated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new CAHolderCreated + { + Creator = Creator + }, + new CAHolderCreated + { + CaHash = CaHash + }, + new CAHolderCreated + { + CaAddress = CaAddress + }, + new CAHolderCreated + { + Manager = Manager + }, + }; + } + + public CAHolderCreated GetNonIndexed() + { + return new CAHolderCreated + { + ExtraData = ExtraData, + }; + } + } + + internal partial class GuardianAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new GuardianAdded + { + CaHash = CaHash + }, + }; + } + + public GuardianAdded GetNonIndexed() + { + return new GuardianAdded + { + CaAddress = CaAddress, + GuardianAdded_ = GuardianAdded_, + }; + } + } + + internal partial class GuardianRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new GuardianRemoved + { + CaHash = CaHash + }, + }; + } + + public GuardianRemoved GetNonIndexed() + { + return new GuardianRemoved + { + CaAddress = CaAddress, + GuardianRemoved_ = GuardianRemoved_, + }; + } + } + + internal partial class GuardianUpdated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new GuardianUpdated + { + CaHash = CaHash + }, + }; + } + + public GuardianUpdated GetNonIndexed() + { + return new GuardianUpdated + { + CaAddress = CaAddress, + GuardianUpdatedPre = GuardianUpdatedPre, + GuardianUpdatedNew = GuardianUpdatedNew, + }; + } + } + + internal partial class LoginGuardianAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new LoginGuardianAdded + { + CaHash = CaHash + }, + new LoginGuardianAdded + { + Manager = Manager + }, + new LoginGuardianAdded + { + LoginGuardian = LoginGuardian + }, + }; + } + + public LoginGuardianAdded GetNonIndexed() + { + return new LoginGuardianAdded + { + CaAddress = CaAddress, + }; + } + } + + public partial class ManagerInfoSocialRecovered : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ManagerInfoSocialRecovered + { + CaHash = CaHash + }, + new ManagerInfoSocialRecovered + { + CaAddress = CaAddress + }, + new ManagerInfoSocialRecovered + { + Manager = Manager + }, + }; + } + + public ManagerInfoSocialRecovered GetNonIndexed() + { + return new ManagerInfoSocialRecovered + { + ExtraData = ExtraData, + }; + } + } + + internal partial class ManagerInfoAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ManagerInfoAdded + { + CaHash = CaHash + }, + new ManagerInfoAdded + { + CaAddress = CaAddress + }, + new ManagerInfoAdded + { + Manager = Manager + }, + }; + } + + public ManagerInfoAdded GetNonIndexed() + { + return new ManagerInfoAdded + { + ExtraData = ExtraData, + }; + } + } + + internal partial class ManagerInfoRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ManagerInfoRemoved + { + CaHash = CaHash + }, + new ManagerInfoRemoved + { + CaAddress = CaAddress + }, + new ManagerInfoRemoved + { + Manager = Manager + }, + }; + } + + public ManagerInfoRemoved GetNonIndexed() + { + return new ManagerInfoRemoved + { + ExtraData = ExtraData, + }; + } + } + + internal partial class ManagerInfoUpdated : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ManagerInfoUpdated + { + CaHash = CaHash + }, + new ManagerInfoUpdated + { + CaAddress = CaAddress + }, + new ManagerInfoUpdated + { + Manager = Manager + }, + }; + } + + public ManagerInfoUpdated GetNonIndexed() + { + return new ManagerInfoUpdated + { + ExtraData = ExtraData, + }; + } + } + + internal partial class LoginGuardianUnbound : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new LoginGuardianUnbound + { + CaHash = CaHash + }, + new LoginGuardianUnbound + { + Manager = Manager + }, + new LoginGuardianUnbound + { + LoginGuardianIdentifierHash = LoginGuardianIdentifierHash + }, + }; + } + + public LoginGuardianUnbound GetNonIndexed() + { + return new LoginGuardianUnbound + { + CaAddress = CaAddress, + }; + } + } + + internal partial class LoginGuardianRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new LoginGuardianRemoved + { + CaHash = CaHash + }, + new LoginGuardianRemoved + { + Manager = Manager + }, + new LoginGuardianRemoved + { + LoginGuardian = LoginGuardian + }, + }; + } + + public LoginGuardianRemoved GetNonIndexed() + { + return new LoginGuardianRemoved + { + CaAddress = CaAddress, + }; + } + } + + internal partial class VerifierServerEndPointsAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new VerifierServerEndPointsAdded + { + VerifierServer = VerifierServer + }, + }; + } + + public VerifierServerEndPointsAdded GetNonIndexed() + { + return new VerifierServerEndPointsAdded + { + }; + } + } + + internal partial class VerifierServerEndPointsRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new VerifierServerEndPointsRemoved + { + VerifierServer = VerifierServer + }, + }; + } + + public VerifierServerEndPointsRemoved GetNonIndexed() + { + return new VerifierServerEndPointsRemoved + { + }; + } + } + + internal partial class VerifierServerRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new VerifierServerRemoved + { + VerifierServer = VerifierServer + }, + }; + } + + public VerifierServerRemoved GetNonIndexed() + { + return new VerifierServerRemoved + { + }; + } + } + + internal partial class CAServerAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CAServerAdded GetNonIndexed() + { + return new CAServerAdded + { + CaSeverAdded = CaSeverAdded, + }; + } + } + + internal partial class CAServerRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + }; + } + + public CAServerRemoved GetNonIndexed() + { + return new CAServerRemoved + { + CaServerRemoved = CaServerRemoved, + }; + } + } + + internal partial class CAHolderSynced : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new CAHolderSynced + { + Creator = Creator + }, + new CAHolderSynced + { + CaHash = CaHash + }, + new CAHolderSynced + { + CaAddress = CaAddress + }, + new CAHolderSynced + { + ManagerInfosAdded = ManagerInfosAdded + }, + new CAHolderSynced + { + ManagerInfosRemoved = ManagerInfosRemoved + }, + new CAHolderSynced + { + LoginGuardiansAdded = LoginGuardiansAdded + }, + new CAHolderSynced + { + LoginGuardiansUnbound = LoginGuardiansUnbound + }, + }; + } + + public CAHolderSynced GetNonIndexed() + { + return new CAHolderSynced + { + }; + } + } + + internal partial class CreatorControllerAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new CreatorControllerAdded + { + Address = Address + }, + }; + } + + public CreatorControllerAdded GetNonIndexed() + { + return new CreatorControllerAdded + { + }; + } + } + + internal partial class CreatorControllerRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new CreatorControllerRemoved + { + Address = Address + }, + }; + } + + public CreatorControllerRemoved GetNonIndexed() + { + return new CreatorControllerRemoved + { + }; + } + } + + internal partial class ServerControllerAdded : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ServerControllerAdded + { + Address = Address + }, + }; + } + + public ServerControllerAdded GetNonIndexed() + { + return new ServerControllerAdded + { + }; + } + } + + internal partial class ServerControllerRemoved : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new ServerControllerRemoved + { + Address = Address + }, + }; + } + + public ServerControllerRemoved GetNonIndexed() + { + return new ServerControllerRemoved + { + }; + } + } + + internal partial class AdminChanged : aelf::IEvent + { + public global::System.Collections.Generic.IEnumerable GetIndexed() + { + return new List + { + new AdminChanged + { + Address = Address + }, + }; + } + + public AdminChanged GetNonIndexed() + { + return new AdminChanged + { + }; + } + } + + #endregion + internal static partial class CAContractContainer + { + static readonly string __ServiceName = "ca.CAContract"; + + #region Marshallers + static readonly aelf::Marshaller __Marshaller_ca_InitializeInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.InitializeInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_google_protobuf_Empty = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_CreateCAHolderInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.CreateCAHolderInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AddGuardianInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AddGuardianInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveGuardianInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveGuardianInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_UpdateGuardianInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.UpdateGuardianInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_SetGuardianForLoginInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.SetGuardianForLoginInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_UnsetGuardianForLoginInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.UnsetGuardianForLoginInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ManagerForwardCallInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ManagerForwardCallInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ManagerTransferInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ManagerTransferInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ManagerTransferFromInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ManagerTransferFromInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_SocialRecoveryInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.SocialRecoveryInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AddManagerInfoInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AddManagerInfoInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveManagerInfoInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveManagerInfoInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveOtherManagerInfoInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveOtherManagerInfoInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_UpdateManagerInfosInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.UpdateManagerInfosInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AddVerifierServerEndPointsInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AddVerifierServerEndPointsInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveVerifierServerEndPointsInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveVerifierServerEndPointsInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveVerifierServerInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveVerifierServerInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AddCAServerInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AddCAServerInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_RemoveCAServerInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.RemoveCAServerInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_GetHolderInfoInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.GetHolderInfoInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_GetHolderInfoOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.GetHolderInfoOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_GetVerifierServersOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.GetVerifierServersOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_GetCAServersOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.GetCAServersOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ValidateCAHolderInfoWithManagerInfosExistsInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ValidateCAHolderInfoWithManagerInfosExistsInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_SyncHolderInfoInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.SyncHolderInfoInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ValidateStrategyInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ValidateStrategyInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ValidateStrategyOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ValidateStrategyOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_SetContractDelegationFeeInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.SetContractDelegationFeeInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_GetContractDelegationFeeOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.GetContractDelegationFeeOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ControllerInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ControllerInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_ControllerOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.ControllerOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AdminInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AdminInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_AdminOutput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.AdminOutput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_OperationTypeInSignatureEnabledInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.OperationTypeInSignatureEnabledInput.Parser.ParseFrom); + static readonly aelf::Marshaller __Marshaller_ca_SetCAContractAddressesInput = aelf::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Portkey.Contracts.CA.SetCAContractAddressesInput.Parser.ParseFrom); + #endregion + + #region Methods + static readonly aelf::Method __Method_Initialize = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "Initialize", + __Marshaller_ca_InitializeInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_CreateCAHolder = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "CreateCAHolder", + __Marshaller_ca_CreateCAHolderInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_AddGuardian = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddGuardian", + __Marshaller_ca_AddGuardianInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveGuardian = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveGuardian", + __Marshaller_ca_RemoveGuardianInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_UpdateGuardian = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "UpdateGuardian", + __Marshaller_ca_UpdateGuardianInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_SetGuardianForLogin = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetGuardianForLogin", + __Marshaller_ca_SetGuardianForLoginInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_UnsetGuardianForLogin = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "UnsetGuardianForLogin", + __Marshaller_ca_UnsetGuardianForLoginInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ManagerForwardCall = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ManagerForwardCall", + __Marshaller_ca_ManagerForwardCallInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ManagerTransfer = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ManagerTransfer", + __Marshaller_ca_ManagerTransferInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ManagerTransferFrom = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ManagerTransferFrom", + __Marshaller_ca_ManagerTransferFromInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_SocialRecovery = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SocialRecovery", + __Marshaller_ca_SocialRecoveryInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_AddManagerInfo = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddManagerInfo", + __Marshaller_ca_AddManagerInfoInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveManagerInfo = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveManagerInfo", + __Marshaller_ca_RemoveManagerInfoInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveOtherManagerInfo = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveOtherManagerInfo", + __Marshaller_ca_RemoveOtherManagerInfoInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_UpdateManagerInfos = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "UpdateManagerInfos", + __Marshaller_ca_UpdateManagerInfosInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_AddVerifierServerEndPoints = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddVerifierServerEndPoints", + __Marshaller_ca_AddVerifierServerEndPointsInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveVerifierServerEndPoints = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveVerifierServerEndPoints", + __Marshaller_ca_RemoveVerifierServerEndPointsInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveVerifierServer = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveVerifierServer", + __Marshaller_ca_RemoveVerifierServerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_AddCAServer = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddCAServer", + __Marshaller_ca_AddCAServerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveCAServer = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveCAServer", + __Marshaller_ca_RemoveCAServerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetHolderInfo = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetHolderInfo", + __Marshaller_ca_GetHolderInfoInput, + __Marshaller_ca_GetHolderInfoOutput); + + static readonly aelf::Method __Method_GetVerifierServers = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetVerifierServers", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_GetVerifierServersOutput); + + static readonly aelf::Method __Method_GetCAServers = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetCAServers", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_GetCAServersOutput); + + static readonly aelf::Method __Method_ValidateCAHolderInfoWithManagerInfosExists = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ValidateCAHolderInfoWithManagerInfosExists", + __Marshaller_ca_ValidateCAHolderInfoWithManagerInfosExistsInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_SyncHolderInfo = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SyncHolderInfo", + __Marshaller_ca_SyncHolderInfoInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_ValidateStrategy = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "ValidateStrategy", + __Marshaller_ca_ValidateStrategyInput, + __Marshaller_ca_ValidateStrategyOutput); + + static readonly aelf::Method __Method_SetContractDelegationFee = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetContractDelegationFee", + __Marshaller_ca_SetContractDelegationFeeInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetContractDelegationFee = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "GetContractDelegationFee", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_GetContractDelegationFeeOutput); + + static readonly aelf::Method __Method_AddCreatorController = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddCreatorController", + __Marshaller_ca_ControllerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveCreatorController = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveCreatorController", + __Marshaller_ca_ControllerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetCreatorControllers = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetCreatorControllers", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_ControllerOutput); + + static readonly aelf::Method __Method_AddServerController = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "AddServerController", + __Marshaller_ca_ControllerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_RemoveServerController = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "RemoveServerController", + __Marshaller_ca_ControllerInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetServerControllers = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetServerControllers", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_ControllerOutput); + + static readonly aelf::Method __Method_ChangeAdmin = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ChangeAdmin", + __Marshaller_ca_AdminInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_GetAdmin = new aelf::Method( + aelf::MethodType.View, + __ServiceName, + "GetAdmin", + __Marshaller_google_protobuf_Empty, + __Marshaller_ca_AdminOutput); + + static readonly aelf::Method __Method_ChangeOperationTypeInSignatureEnabled = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "ChangeOperationTypeInSignatureEnabled", + __Marshaller_ca_OperationTypeInSignatureEnabledInput, + __Marshaller_google_protobuf_Empty); + + static readonly aelf::Method __Method_SetCAContractAddresses = new aelf::Method( + aelf::MethodType.Action, + __ServiceName, + "SetCAContractAddresses", + __Marshaller_ca_SetCAContractAddressesInput, + __Marshaller_google_protobuf_Empty); + + #endregion + + #region Descriptors + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.Services[0]; } + } + + public static global::System.Collections.Generic.IReadOnlyList Descriptors + { + get + { + return new global::System.Collections.Generic.List() + { + global::AElf.Standards.ACS12.Acs12Reflection.Descriptor.Services[0], + global::Portkey.Contracts.CA.CaContractReflection.Descriptor.Services[0], + }; + } + } + #endregion + + // public class CAContractReferenceState : global::AElf.Sdk.CSharp.State.ContractReferenceState + // { + // internal global::AElf.Sdk.CSharp.State.MethodReference Initialize { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference CreateCAHolder { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddGuardian { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveGuardian { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference UpdateGuardian { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference SetGuardianForLogin { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference UnsetGuardianForLogin { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ManagerForwardCall { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ManagerTransfer { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ManagerTransferFrom { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference SocialRecovery { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddManagerInfo { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveManagerInfo { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveOtherManagerInfo { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference UpdateManagerInfos { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddVerifierServerEndPoints { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveVerifierServerEndPoints { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveVerifierServer { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddCAServer { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveCAServer { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetHolderInfo { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetVerifierServers { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetCAServers { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ValidateCAHolderInfoWithManagerInfosExists { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference SyncHolderInfo { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ValidateStrategy { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference SetContractDelegationFee { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetContractDelegationFee { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddCreatorController { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveCreatorController { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetCreatorControllers { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference AddServerController { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference RemoveServerController { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetServerControllers { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ChangeAdmin { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference GetAdmin { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference ChangeOperationTypeInSignatureEnabled { get; set; } + // internal global::AElf.Sdk.CSharp.State.MethodReference SetCAContractAddresses { get; set; } + // } + } +} +#endregion + diff --git a/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.g.cs b/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.g.cs new file mode 100644 index 0000000..64b6d72 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Generated/CaContract.g.cs @@ -0,0 +1,19654 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ca_contract.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Portkey.Contracts.CA { + + /// Holder for reflection information generated from ca_contract.proto + internal static partial class CaContractReflection { + + #region Descriptor + /// File descriptor for ca_contract.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CaContractReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFjYV9jb250cmFjdC5wcm90bxICY2EaD2FlbGYvY29yZS5wcm90bxoSYWVs", + "Zi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8a", + "H2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8aFGF1dGhvcml0eV9p", + "bmZvLnByb3RvGgthY3MxMi5wcm90byKzAQoKSG9sZGVySW5mbxImCg9jcmVh", + "dG9yX2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSJgoNbWFuYWdlcl9p", + "bmZvcxgCIAMoCzIPLmNhLk1hbmFnZXJJbmZvEicKDWd1YXJkaWFuX2xpc3QY", + "AyABKAsyEC5jYS5HdWFyZGlhbkxpc3QSLAoSanVkZ2VtZW50X3N0cmF0ZWd5", + "GAQgASgLMhAuY2EuU3RyYXRlZ3lOb2RlIkEKC01hbmFnZXJJbmZvEh4KB2Fk", + "ZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSEgoKZXh0cmFfZGF0YRgCIAEo", + "CSIvCgxHdWFyZGlhbkxpc3QSHwoJZ3VhcmRpYW5zGAEgAygLMgwuY2EuR3Vh", + "cmRpYW4imQEKCEd1YXJkaWFuEh4KBHR5cGUYASABKA4yEC5jYS5HdWFyZGlh", + "blR5cGUSHwoLdmVyaWZpZXJfaWQYAiABKAsyCi5hZWxmLkhhc2gSIwoPaWRl", + "bnRpZmllcl9oYXNoGAMgASgLMgouYWVsZi5IYXNoEgwKBHNhbHQYBCABKAkS", + "GQoRaXNfbG9naW5fZ3VhcmRpYW4YBSABKAgiiAEKDlZlcmlmaWVyU2VydmVy", + "EhYKAmlkGAEgASgLMgouYWVsZi5IYXNoEgwKBG5hbWUYAiABKAkSEQoJaW1h", + "Z2VfdXJsGAMgASgJEhIKCmVuZF9wb2ludHMYBCADKAkSKQoSdmVyaWZpZXJf", + "YWRkcmVzc2VzGAUgAygLMg0uYWVsZi5BZGRyZXNzIisKCENBU2VydmVyEgwK", + "BG5hbWUYASABKAkSEQoJZW5kX3BvaW50GAIgASgJIkIKElZlcmlmaWVyU2Vy", + "dmVyTGlzdBIsChB2ZXJpZmllcl9zZXJ2ZXJzGAEgAygLMhIuY2EuVmVyaWZp", + "ZXJTZXJ2ZXIiMAoMQ0FTZXJ2ZXJMaXN0EiAKCmNhX3NlcnZlcnMYASADKAsy", + "DC5jYS5DQVNlcnZlciI0Cg5Db250cm9sbGVyTGlzdBIiCgtjb250cm9sbGVy", + "cxgBIAMoCzINLmFlbGYuQWRkcmVzcyI5Cg9NYW5hZ2VySW5mb0xpc3QSJgoN", + "bWFuYWdlcl9pbmZvcxgBIAMoCzIPLmNhLk1hbmFnZXJJbmZvIjgKEUxvZ2lu", + "R3VhcmRpYW5MaXN0EiMKD2xvZ2luX2d1YXJkaWFucxgBIAMoCzIKLmFlbGYu", + "SGFzaCI4Cg9Jbml0aWFsaXplSW5wdXQSJQoOY29udHJhY3RfYWRtaW4YASAB", + "KAsyDS5hZWxmLkFkZHJlc3MiMQoPQ29udHJvbGxlcklucHV0Eh4KB2FkZHJl", + "c3MYASABKAsyDS5hZWxmLkFkZHJlc3MiNAoQQ29udHJvbGxlck91dHB1dBIg", + "CglhZGRyZXNzZXMYASADKAsyDS5hZWxmLkFkZHJlc3MiLAoKQWRtaW5JbnB1", + "dBIeCgdhZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzIi0KC0FkbWluT3V0", + "cHV0Eh4KB2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MilwEKE0NyZWF0", + "ZUNBSG9sZGVySW5wdXQSKwoRZ3VhcmRpYW5fYXBwcm92ZWQYASABKAsyEC5j", + "YS5HdWFyZGlhbkluZm8SJQoMbWFuYWdlcl9pbmZvGAIgASgLMg8uY2EuTWFu", + "YWdlckluZm8SLAoSanVkZ2VtZW50X3N0cmF0ZWd5GAMgASgLMhAuY2EuU3Ry", + "YXRlZ3lOb2RlIoQBCgxHdWFyZGlhbkluZm8SHgoEdHlwZRgBIAEoDjIQLmNh", + "Lkd1YXJkaWFuVHlwZRIjCg9pZGVudGlmaWVyX2hhc2gYAiABKAsyCi5hZWxm", + "Lkhhc2gSLwoRdmVyaWZpY2F0aW9uX2luZm8YAyABKAsyFC5jYS5WZXJpZmlj", + "YXRpb25JbmZvIlcKEFZlcmlmaWNhdGlvbkluZm8SFgoCaWQYASABKAsyCi5h", + "ZWxmLkhhc2gSEQoJc2lnbmF0dXJlGAIgASgMEhgKEHZlcmlmaWNhdGlvbl9k", + "b2MYAyABKAkiYgoMU3RyYXRlZ3lOb2RlEh4KBG5hbWUYASABKA4yEC5jYS5T", + "dHJhdGVneU5hbWUSIwoEdHlwZRgCIAMoDjIVLmNhLlN0cmF0ZWd5VmFsdWVU", + "eXBlEg0KBXZhbHVlGAMgAygMIiQKE1N0cmF0ZWd5TG9uZ1dyYXBwZXISDQoF", + "dmFsdWUYASABKAMiJgoVU3RyYXRlZ3lTdHJpbmdXcmFwcGVyEg0KBXZhbHVl", + "GAEgASgJIicKFUNvbnRyYWN0RGVsZWdhdGlvbkZlZRIOCgZhbW91bnQYASAB", + "KAMiUgodU2V0Q29udHJhY3REZWxlZ2F0aW9uRmVlSW5wdXQSMQoOZGVsZWdh", + "dGlvbl9mZWUYASABKAsyGS5jYS5Db250cmFjdERlbGVnYXRpb25GZWUiUwoe", + "R2V0Q29udHJhY3REZWxlZ2F0aW9uRmVlT3V0cHV0EjEKDmRlbGVnYXRpb25f", + "ZmVlGAEgASgLMhkuY2EuQ29udHJhY3REZWxlZ2F0aW9uRmVlIogBChBBZGRH", + "dWFyZGlhbklucHV0EhsKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2gSKQoP", + "Z3VhcmRpYW5fdG9fYWRkGAIgASgLMhAuY2EuR3VhcmRpYW5JbmZvEiwKEmd1", + "YXJkaWFuc19hcHByb3ZlZBgDIAMoCzIQLmNhLkd1YXJkaWFuSW5mbyKOAQoT", + "UmVtb3ZlR3VhcmRpYW5JbnB1dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5I", + "YXNoEiwKEmd1YXJkaWFuX3RvX3JlbW92ZRgCIAEoCzIQLmNhLkd1YXJkaWFu", + "SW5mbxIsChJndWFyZGlhbnNfYXBwcm92ZWQYAyADKAsyEC5jYS5HdWFyZGlh", + "bkluZm8ixAEKE1VwZGF0ZUd1YXJkaWFuSW5wdXQSGwoHY2FfaGFzaBgBIAEo", + "CzIKLmFlbGYuSGFzaBIwChZndWFyZGlhbl90b191cGRhdGVfcHJlGAIgASgL", + "MhAuY2EuR3VhcmRpYW5JbmZvEjAKFmd1YXJkaWFuX3RvX3VwZGF0ZV9uZXcY", + "AyABKAsyEC5jYS5HdWFyZGlhbkluZm8SLAoSZ3VhcmRpYW5zX2FwcHJvdmVk", + "GAQgAygLMhAuY2EuR3VhcmRpYW5JbmZvIlcKGFNldEd1YXJkaWFuRm9yTG9n", + "aW5JbnB1dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5IYXNoEh4KCGd1YXJk", + "aWFuGAIgASgLMgwuY2EuR3VhcmRpYW4iWQoaVW5zZXRHdWFyZGlhbkZvckxv", + "Z2luSW5wdXQSGwoHY2FfaGFzaBgBIAEoCzIKLmFlbGYuSGFzaBIeCghndWFy", + "ZGlhbhgCIAEoCzIMLmNhLkd1YXJkaWFuIoIBChdNYW5hZ2VyRm9yd2FyZENh", + "bGxJbnB1dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5IYXNoEicKEGNvbnRy", + "YWN0X2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSEwoLbWV0aG9kX25h", + "bWUYAyABKAkSDAoEYXJncxgEIAEoDCJ8ChRNYW5hZ2VyVHJhbnNmZXJJbnB1", + "dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5IYXNoEhkKAnRvGAIgASgLMg0u", + "YWVsZi5BZGRyZXNzEg4KBnN5bWJvbBgDIAEoCRIOCgZhbW91bnQYBCABKAMS", + "DAoEbWVtbxgFIAEoCSKdAQoYTWFuYWdlclRyYW5zZmVyRnJvbUlucHV0EhsK", + "B2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2gSGwoEZnJvbRgCIAEoCzINLmFl", + "bGYuQWRkcmVzcxIZCgJ0bxgDIAEoCzINLmFlbGYuQWRkcmVzcxIOCgZzeW1i", + "b2wYBCABKAkSDgoGYW1vdW50GAUgASgDEgwKBG1lbW8YBiABKAkiZQoSR2V0", + "SG9sZGVySW5mb0lucHV0EhsKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2gS", + "MgoebG9naW5fZ3VhcmRpYW5faWRlbnRpZmllcl9oYXNoGAIgASgLMgouYWVs", + "Zi5IYXNoIqYBChNHZXRIb2xkZXJJbmZvT3V0cHV0EhsKB2NhX2hhc2gYASAB", + "KAsyCi5hZWxmLkhhc2gSIQoKY2FfYWRkcmVzcxgCIAEoCzINLmFlbGYuQWRk", + "cmVzcxInCg1ndWFyZGlhbl9saXN0GAMgASgLMhAuY2EuR3VhcmRpYW5MaXN0", + "EiYKDW1hbmFnZXJfaW5mb3MYBCADKAsyDy5jYS5NYW5hZ2VySW5mbyKeAQoT", + "U29jaWFsUmVjb3ZlcnlJbnB1dBIyCh5sb2dpbl9ndWFyZGlhbl9pZGVudGlm", + "aWVyX2hhc2gYASABKAsyCi5hZWxmLkhhc2gSLAoSZ3VhcmRpYW5zX2FwcHJv", + "dmVkGAIgAygLMhAuY2EuR3VhcmRpYW5JbmZvEiUKDG1hbmFnZXJfaW5mbxgD", + "IAEoCzIPLmNhLk1hbmFnZXJJbmZvIlkKE0FkZE1hbmFnZXJJbmZvSW5wdXQS", + "GwoHY2FfaGFzaBgBIAEoCzIKLmFlbGYuSGFzaBIlCgxtYW5hZ2VyX2luZm8Y", + "AiABKAsyDy5jYS5NYW5hZ2VySW5mbyI1ChZSZW1vdmVNYW5hZ2VySW5mb0lu", + "cHV0EhsKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2gijwEKG1JlbW92ZU90", + "aGVyTWFuYWdlckluZm9JbnB1dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5I", + "YXNoEiUKDG1hbmFnZXJfaW5mbxgCIAEoCzIPLmNhLk1hbmFnZXJJbmZvEiwK", + "Emd1YXJkaWFuc19hcHByb3ZlZBgDIAMoCzIQLmNhLkd1YXJkaWFuSW5mbyJe", + "ChdVcGRhdGVNYW5hZ2VySW5mb3NJbnB1dBIbCgdjYV9oYXNoGAEgASgLMgou", + "YWVsZi5IYXNoEiYKDW1hbmFnZXJfaW5mb3MYAiADKAsyDy5jYS5NYW5hZ2Vy", + "SW5mbyKEAQofQWRkVmVyaWZpZXJTZXJ2ZXJFbmRQb2ludHNJbnB1dBIMCgRu", + "YW1lGAEgASgJEhEKCWltYWdlX3VybBgCIAEoCRISCgplbmRfcG9pbnRzGAMg", + "AygJEiwKFXZlcmlmaWVyX2FkZHJlc3NfbGlzdBgEIAMoCzINLmFlbGYuQWRk", + "cmVzcyIzChlSZW1vdmVWZXJpZmllclNlcnZlcklucHV0EhYKAmlkGAEgASgL", + "MgouYWVsZi5IYXNoIlAKIlJlbW92ZVZlcmlmaWVyU2VydmVyRW5kUG9pbnRz", + "SW5wdXQSFgoCaWQYASABKAsyCi5hZWxmLkhhc2gSEgoKZW5kX3BvaW50cxgC", + "IAMoCSI0ChBBZGRDQVNlcnZlcklucHV0EgwKBG5hbWUYASABKAkSEgoKZW5k", + "X3BvaW50cxgCIAEoCSIjChNSZW1vdmVDQVNlcnZlcklucHV0EgwKBG5hbWUY", + "ASABKAkiSAoYR2V0VmVyaWZpZXJTZXJ2ZXJzT3V0cHV0EiwKEHZlcmlmaWVy", + "X3NlcnZlcnMYASADKAsyEi5jYS5WZXJpZmllclNlcnZlciI2ChJHZXRDQVNl", + "cnZlcnNPdXRwdXQSIAoKY2Ffc2VydmVycxgBIAMoCzIMLmNhLkNBU2VydmVy", + "IsQBCi9WYWxpZGF0ZUNBSG9sZGVySW5mb1dpdGhNYW5hZ2VySW5mb3NFeGlz", + "dHNJbnB1dBIbCgdjYV9oYXNoGAEgASgLMgouYWVsZi5IYXNoEiYKDW1hbmFn", + "ZXJfaW5mb3MYAiADKAsyDy5jYS5NYW5hZ2VySW5mbxIjCg9sb2dpbl9ndWFy", + "ZGlhbnMYAyADKAsyCi5hZWxmLkhhc2gSJwoTbm90X2xvZ2luX2d1YXJkaWFu", + "cxgEIAMoCzIKLmFlbGYuSGFzaCKTAQobVmVyaWZpY2F0aW9uVHJhbnNhY3Rp", + "b25JbmZvEhUKDWZyb21fY2hhaW5faWQYASABKAUSGwoTcGFyZW50X2NoYWlu", + "X2hlaWdodBgCIAEoAxIZChF0cmFuc2FjdGlvbl9ieXRlcxgDIAEoDBIlCgtt", + "ZXJrbGVfcGF0aBgEIAEoCzIQLmFlbGYuTWVya2xlUGF0aCJdChNTeW5jSG9s", + "ZGVySW5mb0lucHV0EkYKHXZlcmlmaWNhdGlvbl90cmFuc2FjdGlvbl9pbmZv", + "GAEgASgLMh8uY2EuVmVyaWZpY2F0aW9uVHJhbnNhY3Rpb25JbmZvIq8BChVW", + "YWxpZGF0ZVN0cmF0ZWd5SW5wdXQSJwoNc3RyYXRlZ3lfbm9kZRgBIAEoCzIQ", + "LmNhLlN0cmF0ZWd5Tm9kZRI7Cgl2YXJpYWJsZXMYAiADKAsyKC5jYS5WYWxp", + "ZGF0ZVN0cmF0ZWd5SW5wdXQuVmFyaWFibGVzRW50cnkaMAoOVmFyaWFibGVz", + "RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgDOgI4ASJuChZWYWxp", + "ZGF0ZVN0cmF0ZWd5T3V0cHV0EhMKC2Jvb2xfcmVzdWx0GAEgASgIEhQKDGlu", + "dDY0X3Jlc3VsdBgCIAEoAxIpCg9zdHJhdGVneV9vdXRwdXQYAyABKAsyEC5j", + "YS5TdHJhdGVneU5vZGUixwEKD0NBSG9sZGVyQ3JlYXRlZBIlCgdjcmVhdG9y", + "GAEgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIiCgdjYV9oYXNoGAIgASgL", + "MgouYWVsZi5IYXNoQgWIj/UBARIoCgpjYV9hZGRyZXNzGAMgASgLMg0uYWVs", + "Zi5BZGRyZXNzQgWIj/UBARIlCgdtYW5hZ2VyGAQgASgLMg0uYWVsZi5BZGRy", + "ZXNzQgWIj/UBARISCgpleHRyYV9kYXRhGAUgASgJOgSguxgBIoIBCg1HdWFy", + "ZGlhbkFkZGVkEiIKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2hCBYiP9QEB", + "EiEKCmNhX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSJAoOZ3VhcmRp", + "YW5fYWRkZWQYAyABKAsyDC5jYS5HdWFyZGlhbjoEoLsYASKGAQoPR3VhcmRp", + "YW5SZW1vdmVkEiIKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2hCBYiP9QEB", + "EiEKCmNhX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSJgoQZ3VhcmRp", + "YW5fcmVtb3ZlZBgDIAEoCzIMLmNhLkd1YXJkaWFuOgSguxgBIrYBCg9HdWFy", + "ZGlhblVwZGF0ZWQSIgoHY2FfaGFzaBgBIAEoCzIKLmFlbGYuSGFzaEIFiI/1", + "AQESIQoKY2FfYWRkcmVzcxgCIAEoCzINLmFlbGYuQWRkcmVzcxIqChRndWFy", + "ZGlhbl91cGRhdGVkX3ByZRgDIAEoCzIMLmNhLkd1YXJkaWFuEioKFGd1YXJk", + "aWFuX3VwZGF0ZWRfbmV3GAQgASgLMgwuY2EuR3VhcmRpYW46BKC7GAEitQEK", + "EkxvZ2luR3VhcmRpYW5BZGRlZBIiCgdjYV9oYXNoGAEgASgLMgouYWVsZi5I", + "YXNoQgWIj/UBARIhCgpjYV9hZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNz", + "EiUKB21hbmFnZXIYAyABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBEisKDmxv", + "Z2luX2d1YXJkaWFuGAQgASgLMgwuY2EuR3VhcmRpYW5CBYiP9QEBOgSguxgB", + "IqsBChpNYW5hZ2VySW5mb1NvY2lhbFJlY292ZXJlZBIiCgdjYV9oYXNoGAEg", + "ASgLMgouYWVsZi5IYXNoQgWIj/UBARIoCgpjYV9hZGRyZXNzGAIgASgLMg0u", + "YWVsZi5BZGRyZXNzQgWIj/UBARIlCgdtYW5hZ2VyGAMgASgLMg0uYWVsZi5B", + "ZGRyZXNzQgWIj/UBARISCgpleHRyYV9kYXRhGAQgASgJOgSguxgBIqEBChBN", + "YW5hZ2VySW5mb0FkZGVkEiIKB2NhX2hhc2gYASABKAsyCi5hZWxmLkhhc2hC", + "BYiP9QEBEigKCmNhX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3NCBYiP", + "9QEBEiUKB21hbmFnZXIYAyABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBEhIK", + "CmV4dHJhX2RhdGEYBCABKAk6BKC7GAEiowEKEk1hbmFnZXJJbmZvUmVtb3Zl", + "ZBIiCgdjYV9oYXNoGAEgASgLMgouYWVsZi5IYXNoQgWIj/UBARIoCgpjYV9h", + "ZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARIlCgdtYW5hZ2Vy", + "GAMgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARISCgpleHRyYV9kYXRhGAQg", + "ASgJOgSguxgBIqMBChJNYW5hZ2VySW5mb1VwZGF0ZWQSIgoHY2FfaGFzaBgB", + "IAEoCzIKLmFlbGYuSGFzaEIFiI/1AQESKAoKY2FfYWRkcmVzcxgCIAEoCzIN", + "LmFlbGYuQWRkcmVzc0IFiI/1AQESJQoHbWFuYWdlchgDIAEoCzINLmFlbGYu", + "QWRkcmVzc0IFiI/1AQESEgoKZXh0cmFfZGF0YRgEIAEoCToEoLsYASLFAQoU", + "TG9naW5HdWFyZGlhblVuYm91bmQSIgoHY2FfaGFzaBgBIAEoCzIKLmFlbGYu", + "SGFzaEIFiI/1AQESIQoKY2FfYWRkcmVzcxgCIAEoCzINLmFlbGYuQWRkcmVz", + "cxIlCgdtYW5hZ2VyGAMgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBARI5Ch5s", + "b2dpbl9ndWFyZGlhbl9pZGVudGlmaWVyX2hhc2gYBCABKAsyCi5hZWxmLkhh", + "c2hCBYiP9QEBOgSguxgBIrcBChRMb2dpbkd1YXJkaWFuUmVtb3ZlZBIiCgdj", + "YV9oYXNoGAEgASgLMgouYWVsZi5IYXNoQgWIj/UBARIhCgpjYV9hZGRyZXNz", + "GAIgASgLMg0uYWVsZi5BZGRyZXNzEiUKB21hbmFnZXIYAyABKAsyDS5hZWxm", + "LkFkZHJlc3NCBYiP9QEBEisKDmxvZ2luX2d1YXJkaWFuGAQgASgLMgwuY2Eu", + "R3VhcmRpYW5CBYiP9QEBOgSguxgBIlgKHFZlcmlmaWVyU2VydmVyRW5kUG9p", + "bnRzQWRkZWQSMgoPdmVyaWZpZXJfc2VydmVyGAEgASgLMhIuY2EuVmVyaWZp", + "ZXJTZXJ2ZXJCBYiP9QEBOgSguxgBIloKHlZlcmlmaWVyU2VydmVyRW5kUG9p", + "bnRzUmVtb3ZlZBIyCg92ZXJpZmllcl9zZXJ2ZXIYASABKAsyEi5jYS5WZXJp", + "ZmllclNlcnZlckIFiI/1AQE6BKC7GAEiUQoVVmVyaWZpZXJTZXJ2ZXJSZW1v", + "dmVkEjIKD3ZlcmlmaWVyX3NlcnZlchgBIAEoCzISLmNhLlZlcmlmaWVyU2Vy", + "dmVyQgWIj/UBAToEoLsYASI7Cg1DQVNlcnZlckFkZGVkEiQKDmNhX3NldmVy", + "X2FkZGVkGAEgASgLMgwuY2EuQ0FTZXJ2ZXI6BKC7GAEiQAoPQ0FTZXJ2ZXJS", + "ZW1vdmVkEicKEWNhX3NlcnZlcl9yZW1vdmVkGAEgASgLMgwuY2EuQ0FTZXJ2", + "ZXI6BKC7GAEi+wIKDkNBSG9sZGVyU3luY2VkEiUKB2NyZWF0b3IYASABKAsy", + "DS5hZWxmLkFkZHJlc3NCBYiP9QEBEiIKB2NhX2hhc2gYAiABKAsyCi5hZWxm", + "Lkhhc2hCBYiP9QEBEigKCmNhX2FkZHJlc3MYAyABKAsyDS5hZWxmLkFkZHJl", + "c3NCBYiP9QEBEjcKE21hbmFnZXJfaW5mb3NfYWRkZWQYBCABKAsyEy5jYS5N", + "YW5hZ2VySW5mb0xpc3RCBYiP9QEBEjkKFW1hbmFnZXJfaW5mb3NfcmVtb3Zl", + "ZBgFIAEoCzITLmNhLk1hbmFnZXJJbmZvTGlzdEIFiI/1AQESOwoVbG9naW5f", + "Z3VhcmRpYW5zX2FkZGVkGAYgASgLMhUuY2EuTG9naW5HdWFyZGlhbkxpc3RC", + "BYiP9QEBEj0KF2xvZ2luX2d1YXJkaWFuc191bmJvdW5kGAcgASgLMhUuY2Eu", + "TG9naW5HdWFyZGlhbkxpc3RCBYiP9QEBOgSguxgBIkUKFkNyZWF0b3JDb250", + "cm9sbGVyQWRkZWQSJQoHYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRkcmVzc0IF", + "iI/1AQE6BKC7GAEiRwoYQ3JlYXRvckNvbnRyb2xsZXJSZW1vdmVkEiUKB2Fk", + "ZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3NCBYiP9QEBOgSguxgBIkQKFVNl", + "cnZlckNvbnRyb2xsZXJBZGRlZBIlCgdhZGRyZXNzGAEgASgLMg0uYWVsZi5B", + "ZGRyZXNzQgWIj/UBAToEoLsYASJGChdTZXJ2ZXJDb250cm9sbGVyUmVtb3Zl", + "ZBIlCgdhZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzQgWIj/UBAToEoLsY", + "ASI7CgxBZG1pbkNoYW5nZWQSJQoHYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRk", + "cmVzc0IFiI/1AQE6BKC7GAEiUwokT3BlcmF0aW9uVHlwZUluU2lnbmF0dXJl", + "RW5hYmxlZElucHV0EisKI29wZXJhdGlvbl90eXBlX2luX3NpZ25hdHVyZV9l", + "bmFibGVkGAEgASgIIlMKG1NldENBQ29udHJhY3RBZGRyZXNzZXNJbnB1dBI0", + "ChVjYV9jb250cmFjdF9hZGRyZXNzZXMYASADKAsyFS5jYS5DQUNvbnRyYWN0", + "QWRkcmVzcyJFChFDQUNvbnRyYWN0QWRkcmVzcxIeCgdhZGRyZXNzGAEgASgL", + "Mg0uYWVsZi5BZGRyZXNzEhAKCGNoYWluX2lkGAIgASgFKn8KDEd1YXJkaWFu", + "VHlwZRIaChZHVUFSRElBTl9UWVBFX09GX0VNQUlMEAASGgoWR1VBUkRJQU5f", + "VFlQRV9PRl9QSE9ORRABEhsKF0dVQVJESUFOX1RZUEVfT0ZfR09PR0xFEAIS", + "GgoWR1VBUkRJQU5fVFlQRV9PRl9BUFBMRRADKjkKEVN0cmF0ZWd5VmFsdWVU", + "eXBlEgwKCFNUUkFURUdZEAASCAoETE9ORxABEgwKCFZBUklBQkxFEAIqpwEK", + "DFN0cmF0ZWd5TmFtZRIHCgNBbmQQABIGCgJPchABEgcKA05vdBACEgoKBklm", + "RWxzZRADEg4KCkxhcmdlclRoYW4QBBIRCg1Ob3RMYXJnZXJUaGFuEAUSDAoI", + "TGVzc1RoYW4QBhIPCgtOb3RMZXNzVGhhbhAHEgkKBUVxdWFsEAgSDAoITm90", + "RXF1YWwQCRIWChJSYXRpb0J5VGVuVGhvdXNhbmQQCiqZAQoNT3BlcmF0aW9u", + "VHlwZRILCgdVbmtub3duEAASEgoOQ3JlYXRlQ0FIb2xkZXIQARISCg5Tb2Np", + "YWxSZWNvdmVyeRACEg8KC0FkZEd1YXJkaWFuEAMSEgoOUmVtb3ZlR3VhcmRp", + "YW4QBBISCg5VcGRhdGVHdWFyZGlhbhAFEhoKFlJlbW92ZU90aGVyTWFuYWdl", + "ckluZm8QBjK/FwoKQ0FDb250cmFjdBI7CgpJbml0aWFsaXplEhMuY2EuSW5p", + "dGlhbGl6ZUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASQwoOQ3Jl", + "YXRlQ0FIb2xkZXISFy5jYS5DcmVhdGVDQUhvbGRlcklucHV0GhYuZ29vZ2xl", + "LnByb3RvYnVmLkVtcHR5IgASPQoLQWRkR3VhcmRpYW4SFC5jYS5BZGRHdWFy", + "ZGlhbklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASQwoOUmVtb3Zl", + "R3VhcmRpYW4SFy5jYS5SZW1vdmVHdWFyZGlhbklucHV0GhYuZ29vZ2xlLnBy", + "b3RvYnVmLkVtcHR5IgASQwoOVXBkYXRlR3VhcmRpYW4SFy5jYS5VcGRhdGVH", + "dWFyZGlhbklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASTQoTU2V0", + "R3VhcmRpYW5Gb3JMb2dpbhIcLmNhLlNldEd1YXJkaWFuRm9yTG9naW5JbnB1", + "dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElEKFVVuc2V0R3VhcmRpYW5G", + "b3JMb2dpbhIeLmNhLlVuc2V0R3VhcmRpYW5Gb3JMb2dpbklucHV0GhYuZ29v", + "Z2xlLnByb3RvYnVmLkVtcHR5IgASSwoSTWFuYWdlckZvcndhcmRDYWxsEhsu", + "Y2EuTWFuYWdlckZvcndhcmRDYWxsSW5wdXQaFi5nb29nbGUucHJvdG9idWYu", + "RW1wdHkiABJFCg9NYW5hZ2VyVHJhbnNmZXISGC5jYS5NYW5hZ2VyVHJhbnNm", + "ZXJJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEk0KE01hbmFnZXJU", + "cmFuc2ZlckZyb20SHC5jYS5NYW5hZ2VyVHJhbnNmZXJGcm9tSW5wdXQaFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkiABJDCg5Tb2NpYWxSZWNvdmVyeRIXLmNh", + "LlNvY2lhbFJlY292ZXJ5SW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHki", + "ABJDCg5BZGRNYW5hZ2VySW5mbxIXLmNhLkFkZE1hbmFnZXJJbmZvSW5wdXQa", + "Fi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJJChFSZW1vdmVNYW5hZ2VySW5m", + "bxIaLmNhLlJlbW92ZU1hbmFnZXJJbmZvSW5wdXQaFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkiABJTChZSZW1vdmVPdGhlck1hbmFnZXJJbmZvEh8uY2EuUmVt", + "b3ZlT3RoZXJNYW5hZ2VySW5mb0lucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5IgASSwoSVXBkYXRlTWFuYWdlckluZm9zEhsuY2EuVXBkYXRlTWFuYWdl", + "ckluZm9zSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJbChpBZGRW", + "ZXJpZmllclNlcnZlckVuZFBvaW50cxIjLmNhLkFkZFZlcmlmaWVyU2VydmVy", + "RW5kUG9pbnRzSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJhCh1S", + "ZW1vdmVWZXJpZmllclNlcnZlckVuZFBvaW50cxImLmNhLlJlbW92ZVZlcmlm", + "aWVyU2VydmVyRW5kUG9pbnRzSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1w", + "dHkiABJPChRSZW1vdmVWZXJpZmllclNlcnZlchIdLmNhLlJlbW92ZVZlcmlm", + "aWVyU2VydmVySW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI9CgtB", + "ZGRDQVNlcnZlchIULmNhLkFkZENBU2VydmVySW5wdXQaFi5nb29nbGUucHJv", + "dG9idWYuRW1wdHkiABJDCg5SZW1vdmVDQVNlcnZlchIXLmNhLlJlbW92ZUNB", + "U2VydmVySW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJHCg1HZXRI", + "b2xkZXJJbmZvEhYuY2EuR2V0SG9sZGVySW5mb0lucHV0GhcuY2EuR2V0SG9s", + "ZGVySW5mb091dHB1dCIFiIn3AQESUQoSR2V0VmVyaWZpZXJTZXJ2ZXJzEhYu", + "Z29vZ2xlLnByb3RvYnVmLkVtcHR5GhwuY2EuR2V0VmVyaWZpZXJTZXJ2ZXJz", + "T3V0cHV0IgWIifcBARJFCgxHZXRDQVNlcnZlcnMSFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkaFi5jYS5HZXRDQVNlcnZlcnNPdXRwdXQiBYiJ9wEBEnsKKlZh", + "bGlkYXRlQ0FIb2xkZXJJbmZvV2l0aE1hbmFnZXJJbmZvc0V4aXN0cxIzLmNh", + "LlZhbGlkYXRlQ0FIb2xkZXJJbmZvV2l0aE1hbmFnZXJJbmZvc0V4aXN0c0lu", + "cHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASQwoOU3luY0hvbGRlcklu", + "Zm8SFy5jYS5TeW5jSG9sZGVySW5mb0lucHV0GhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5IgASUAoQVmFsaWRhdGVTdHJhdGVneRIZLmNhLlZhbGlkYXRlU3Ry", + "YXRlZ3lJbnB1dBoaLmNhLlZhbGlkYXRlU3RyYXRlZ3lPdXRwdXQiBYiJ9wEB", + "ElcKGFNldENvbnRyYWN0RGVsZWdhdGlvbkZlZRIhLmNhLlNldENvbnRyYWN0", + "RGVsZWdhdGlvbkZlZUlucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS", + "WAoYR2V0Q29udHJhY3REZWxlZ2F0aW9uRmVlEhYuZ29vZ2xlLnByb3RvYnVm", + "LkVtcHR5GiIuY2EuR2V0Q29udHJhY3REZWxlZ2F0aW9uRmVlT3V0cHV0IgAS", + "RQoUQWRkQ3JlYXRvckNvbnRyb2xsZXISEy5jYS5Db250cm9sbGVySW5wdXQa", + "Fi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJIChdSZW1vdmVDcmVhdG9yQ29u", + "dHJvbGxlchITLmNhLkNvbnRyb2xsZXJJbnB1dBoWLmdvb2dsZS5wcm90b2J1", + "Zi5FbXB0eSIAEkwKFUdldENyZWF0b3JDb250cm9sbGVycxIWLmdvb2dsZS5w", + "cm90b2J1Zi5FbXB0eRoULmNhLkNvbnRyb2xsZXJPdXRwdXQiBYiJ9wEBEkQK", + "E0FkZFNlcnZlckNvbnRyb2xsZXISEy5jYS5Db250cm9sbGVySW5wdXQaFi5n", + "b29nbGUucHJvdG9idWYuRW1wdHkiABJHChZSZW1vdmVTZXJ2ZXJDb250cm9s", + "bGVyEhMuY2EuQ29udHJvbGxlcklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVt", + "cHR5IgASSwoUR2V0U2VydmVyQ29udHJvbGxlcnMSFi5nb29nbGUucHJvdG9i", + "dWYuRW1wdHkaFC5jYS5Db250cm9sbGVyT3V0cHV0IgWIifcBARI3CgtDaGFu", + "Z2VBZG1pbhIOLmNhLkFkbWluSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1w", + "dHkiABI6CghHZXRBZG1pbhIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoPLmNh", + "LkFkbWluT3V0cHV0IgWIifcBARJrCiVDaGFuZ2VPcGVyYXRpb25UeXBlSW5T", + "aWduYXR1cmVFbmFibGVkEiguY2EuT3BlcmF0aW9uVHlwZUluU2lnbmF0dXJl", + "RW5hYmxlZElucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASUwoWU2V0", + "Q0FDb250cmFjdEFkZHJlc3NlcxIfLmNhLlNldENBQ29udHJhY3RBZGRyZXNz", + "ZXNJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAGjnKyvYBC2FjczEy", + "LnByb3Rvssz2ASRQb3J0a2V5LkNvbnRyYWN0cy5DQS5DQUNvbnRyYWN0U3Rh", + "dGVCF6oCFFBvcnRrZXkuQ29udHJhY3RzLkNBYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::AElf.Types.CoreReflection.Descriptor, global::AElf.OptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::AuthorityInfoReflection.Descriptor, global::AElf.Standards.ACS12.Acs12Reflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Portkey.Contracts.CA.GuardianType), typeof(global::Portkey.Contracts.CA.StrategyValueType), typeof(global::Portkey.Contracts.CA.StrategyName), typeof(global::Portkey.Contracts.CA.OperationType), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.HolderInfo), global::Portkey.Contracts.CA.HolderInfo.Parser, new[]{ "CreatorAddress", "ManagerInfos", "GuardianList", "JudgementStrategy" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfo), global::Portkey.Contracts.CA.ManagerInfo.Parser, new[]{ "Address", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GuardianList), global::Portkey.Contracts.CA.GuardianList.Parser, new[]{ "Guardians" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.Guardian), global::Portkey.Contracts.CA.Guardian.Parser, new[]{ "Type", "VerifierId", "IdentifierHash", "Salt", "IsLoginGuardian" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerifierServer), global::Portkey.Contracts.CA.VerifierServer.Parser, new[]{ "Id", "Name", "ImageUrl", "EndPoints", "VerifierAddresses" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAServer), global::Portkey.Contracts.CA.CAServer.Parser, new[]{ "Name", "EndPoint" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerifierServerList), global::Portkey.Contracts.CA.VerifierServerList.Parser, new[]{ "VerifierServers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAServerList), global::Portkey.Contracts.CA.CAServerList.Parser, new[]{ "CaServers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ControllerList), global::Portkey.Contracts.CA.ControllerList.Parser, new[]{ "Controllers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfoList), global::Portkey.Contracts.CA.ManagerInfoList.Parser, new[]{ "ManagerInfos" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.LoginGuardianList), global::Portkey.Contracts.CA.LoginGuardianList.Parser, new[]{ "LoginGuardians" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.InitializeInput), global::Portkey.Contracts.CA.InitializeInput.Parser, new[]{ "ContractAdmin" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ControllerInput), global::Portkey.Contracts.CA.ControllerInput.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ControllerOutput), global::Portkey.Contracts.CA.ControllerOutput.Parser, new[]{ "Addresses" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AdminInput), global::Portkey.Contracts.CA.AdminInput.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AdminOutput), global::Portkey.Contracts.CA.AdminOutput.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CreateCAHolderInput), global::Portkey.Contracts.CA.CreateCAHolderInput.Parser, new[]{ "GuardianApproved", "ManagerInfo", "JudgementStrategy" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GuardianInfo), global::Portkey.Contracts.CA.GuardianInfo.Parser, new[]{ "Type", "IdentifierHash", "VerificationInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerificationInfo), global::Portkey.Contracts.CA.VerificationInfo.Parser, new[]{ "Id", "Signature", "VerificationDoc" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.StrategyNode), global::Portkey.Contracts.CA.StrategyNode.Parser, new[]{ "Name", "Type", "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.StrategyLongWrapper), global::Portkey.Contracts.CA.StrategyLongWrapper.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.StrategyStringWrapper), global::Portkey.Contracts.CA.StrategyStringWrapper.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ContractDelegationFee), global::Portkey.Contracts.CA.ContractDelegationFee.Parser, new[]{ "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.SetContractDelegationFeeInput), global::Portkey.Contracts.CA.SetContractDelegationFeeInput.Parser, new[]{ "DelegationFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GetContractDelegationFeeOutput), global::Portkey.Contracts.CA.GetContractDelegationFeeOutput.Parser, new[]{ "DelegationFee" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AddGuardianInput), global::Portkey.Contracts.CA.AddGuardianInput.Parser, new[]{ "CaHash", "GuardianToAdd", "GuardiansApproved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveGuardianInput), global::Portkey.Contracts.CA.RemoveGuardianInput.Parser, new[]{ "CaHash", "GuardianToRemove", "GuardiansApproved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.UpdateGuardianInput), global::Portkey.Contracts.CA.UpdateGuardianInput.Parser, new[]{ "CaHash", "GuardianToUpdatePre", "GuardianToUpdateNew", "GuardiansApproved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.SetGuardianForLoginInput), global::Portkey.Contracts.CA.SetGuardianForLoginInput.Parser, new[]{ "CaHash", "Guardian" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.UnsetGuardianForLoginInput), global::Portkey.Contracts.CA.UnsetGuardianForLoginInput.Parser, new[]{ "CaHash", "Guardian" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerForwardCallInput), global::Portkey.Contracts.CA.ManagerForwardCallInput.Parser, new[]{ "CaHash", "ContractAddress", "MethodName", "Args" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerTransferInput), global::Portkey.Contracts.CA.ManagerTransferInput.Parser, new[]{ "CaHash", "To", "Symbol", "Amount", "Memo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerTransferFromInput), global::Portkey.Contracts.CA.ManagerTransferFromInput.Parser, new[]{ "CaHash", "From", "To", "Symbol", "Amount", "Memo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GetHolderInfoInput), global::Portkey.Contracts.CA.GetHolderInfoInput.Parser, new[]{ "CaHash", "LoginGuardianIdentifierHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GetHolderInfoOutput), global::Portkey.Contracts.CA.GetHolderInfoOutput.Parser, new[]{ "CaHash", "CaAddress", "GuardianList", "ManagerInfos" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.SocialRecoveryInput), global::Portkey.Contracts.CA.SocialRecoveryInput.Parser, new[]{ "LoginGuardianIdentifierHash", "GuardiansApproved", "ManagerInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AddManagerInfoInput), global::Portkey.Contracts.CA.AddManagerInfoInput.Parser, new[]{ "CaHash", "ManagerInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveManagerInfoInput), global::Portkey.Contracts.CA.RemoveManagerInfoInput.Parser, new[]{ "CaHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveOtherManagerInfoInput), global::Portkey.Contracts.CA.RemoveOtherManagerInfoInput.Parser, new[]{ "CaHash", "ManagerInfo", "GuardiansApproved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.UpdateManagerInfosInput), global::Portkey.Contracts.CA.UpdateManagerInfosInput.Parser, new[]{ "CaHash", "ManagerInfos" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AddVerifierServerEndPointsInput), global::Portkey.Contracts.CA.AddVerifierServerEndPointsInput.Parser, new[]{ "Name", "ImageUrl", "EndPoints", "VerifierAddressList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveVerifierServerInput), global::Portkey.Contracts.CA.RemoveVerifierServerInput.Parser, new[]{ "Id" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveVerifierServerEndPointsInput), global::Portkey.Contracts.CA.RemoveVerifierServerEndPointsInput.Parser, new[]{ "Id", "EndPoints" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AddCAServerInput), global::Portkey.Contracts.CA.AddCAServerInput.Parser, new[]{ "Name", "EndPoints" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.RemoveCAServerInput), global::Portkey.Contracts.CA.RemoveCAServerInput.Parser, new[]{ "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GetVerifierServersOutput), global::Portkey.Contracts.CA.GetVerifierServersOutput.Parser, new[]{ "VerifierServers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GetCAServersOutput), global::Portkey.Contracts.CA.GetCAServersOutput.Parser, new[]{ "CaServers" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ValidateCAHolderInfoWithManagerInfosExistsInput), global::Portkey.Contracts.CA.ValidateCAHolderInfoWithManagerInfosExistsInput.Parser, new[]{ "CaHash", "ManagerInfos", "LoginGuardians", "NotLoginGuardians" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerificationTransactionInfo), global::Portkey.Contracts.CA.VerificationTransactionInfo.Parser, new[]{ "FromChainId", "ParentChainHeight", "TransactionBytes", "MerklePath" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.SyncHolderInfoInput), global::Portkey.Contracts.CA.SyncHolderInfoInput.Parser, new[]{ "VerificationTransactionInfo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ValidateStrategyInput), global::Portkey.Contracts.CA.ValidateStrategyInput.Parser, new[]{ "StrategyNode", "Variables" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ValidateStrategyOutput), global::Portkey.Contracts.CA.ValidateStrategyOutput.Parser, new[]{ "BoolResult", "Int64Result", "StrategyOutput" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAHolderCreated), global::Portkey.Contracts.CA.CAHolderCreated.Parser, new[]{ "Creator", "CaHash", "CaAddress", "Manager", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GuardianAdded), global::Portkey.Contracts.CA.GuardianAdded.Parser, new[]{ "CaHash", "CaAddress", "GuardianAdded_" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GuardianRemoved), global::Portkey.Contracts.CA.GuardianRemoved.Parser, new[]{ "CaHash", "CaAddress", "GuardianRemoved_" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.GuardianUpdated), global::Portkey.Contracts.CA.GuardianUpdated.Parser, new[]{ "CaHash", "CaAddress", "GuardianUpdatedPre", "GuardianUpdatedNew" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.LoginGuardianAdded), global::Portkey.Contracts.CA.LoginGuardianAdded.Parser, new[]{ "CaHash", "CaAddress", "Manager", "LoginGuardian" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfoSocialRecovered), global::Portkey.Contracts.CA.ManagerInfoSocialRecovered.Parser, new[]{ "CaHash", "CaAddress", "Manager", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfoAdded), global::Portkey.Contracts.CA.ManagerInfoAdded.Parser, new[]{ "CaHash", "CaAddress", "Manager", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfoRemoved), global::Portkey.Contracts.CA.ManagerInfoRemoved.Parser, new[]{ "CaHash", "CaAddress", "Manager", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ManagerInfoUpdated), global::Portkey.Contracts.CA.ManagerInfoUpdated.Parser, new[]{ "CaHash", "CaAddress", "Manager", "ExtraData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.LoginGuardianUnbound), global::Portkey.Contracts.CA.LoginGuardianUnbound.Parser, new[]{ "CaHash", "CaAddress", "Manager", "LoginGuardianIdentifierHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.LoginGuardianRemoved), global::Portkey.Contracts.CA.LoginGuardianRemoved.Parser, new[]{ "CaHash", "CaAddress", "Manager", "LoginGuardian" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerifierServerEndPointsAdded), global::Portkey.Contracts.CA.VerifierServerEndPointsAdded.Parser, new[]{ "VerifierServer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerifierServerEndPointsRemoved), global::Portkey.Contracts.CA.VerifierServerEndPointsRemoved.Parser, new[]{ "VerifierServer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.VerifierServerRemoved), global::Portkey.Contracts.CA.VerifierServerRemoved.Parser, new[]{ "VerifierServer" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAServerAdded), global::Portkey.Contracts.CA.CAServerAdded.Parser, new[]{ "CaSeverAdded" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAServerRemoved), global::Portkey.Contracts.CA.CAServerRemoved.Parser, new[]{ "CaServerRemoved" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAHolderSynced), global::Portkey.Contracts.CA.CAHolderSynced.Parser, new[]{ "Creator", "CaHash", "CaAddress", "ManagerInfosAdded", "ManagerInfosRemoved", "LoginGuardiansAdded", "LoginGuardiansUnbound" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CreatorControllerAdded), global::Portkey.Contracts.CA.CreatorControllerAdded.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CreatorControllerRemoved), global::Portkey.Contracts.CA.CreatorControllerRemoved.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ServerControllerAdded), global::Portkey.Contracts.CA.ServerControllerAdded.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.ServerControllerRemoved), global::Portkey.Contracts.CA.ServerControllerRemoved.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.AdminChanged), global::Portkey.Contracts.CA.AdminChanged.Parser, new[]{ "Address" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.OperationTypeInSignatureEnabledInput), global::Portkey.Contracts.CA.OperationTypeInSignatureEnabledInput.Parser, new[]{ "OperationTypeInSignatureEnabled" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.SetCAContractAddressesInput), global::Portkey.Contracts.CA.SetCAContractAddressesInput.Parser, new[]{ "CaContractAddresses" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Portkey.Contracts.CA.CAContractAddress), global::Portkey.Contracts.CA.CAContractAddress.Parser, new[]{ "Address", "ChainId" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum GuardianType { + [pbr::OriginalName("GUARDIAN_TYPE_OF_EMAIL")] OfEmail = 0, + [pbr::OriginalName("GUARDIAN_TYPE_OF_PHONE")] OfPhone = 1, + [pbr::OriginalName("GUARDIAN_TYPE_OF_GOOGLE")] OfGoogle = 2, + [pbr::OriginalName("GUARDIAN_TYPE_OF_APPLE")] OfApple = 3, + } + + internal enum StrategyValueType { + [pbr::OriginalName("STRATEGY")] Strategy = 0, + [pbr::OriginalName("LONG")] Long = 1, + [pbr::OriginalName("VARIABLE")] Variable = 2, + } + + internal enum StrategyName { + [pbr::OriginalName("And")] And = 0, + [pbr::OriginalName("Or")] Or = 1, + [pbr::OriginalName("Not")] Not = 2, + [pbr::OriginalName("IfElse")] IfElse = 3, + [pbr::OriginalName("LargerThan")] LargerThan = 4, + [pbr::OriginalName("NotLargerThan")] NotLargerThan = 5, + [pbr::OriginalName("LessThan")] LessThan = 6, + [pbr::OriginalName("NotLessThan")] NotLessThan = 7, + [pbr::OriginalName("Equal")] Equal = 8, + [pbr::OriginalName("NotEqual")] NotEqual = 9, + [pbr::OriginalName("RatioByTenThousand")] RatioByTenThousand = 10, + } + + internal enum OperationType { + [pbr::OriginalName("Unknown")] Unknown = 0, + [pbr::OriginalName("CreateCAHolder")] CreateCaholder = 1, + [pbr::OriginalName("SocialRecovery")] SocialRecovery = 2, + [pbr::OriginalName("AddGuardian")] AddGuardian = 3, + [pbr::OriginalName("RemoveGuardian")] RemoveGuardian = 4, + [pbr::OriginalName("UpdateGuardian")] UpdateGuardian = 5, + [pbr::OriginalName("RemoveOtherManagerInfo")] RemoveOtherManagerInfo = 6, + } + + #endregion + + #region Messages + /// + ///Data structure + /// + internal sealed partial class HolderInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HolderInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HolderInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HolderInfo(HolderInfo other) : this() { + creatorAddress_ = other.creatorAddress_ != null ? other.creatorAddress_.Clone() : null; + managerInfos_ = other.managerInfos_.Clone(); + guardianList_ = other.guardianList_ != null ? other.guardianList_.Clone() : null; + judgementStrategy_ = other.judgementStrategy_ != null ? other.judgementStrategy_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HolderInfo Clone() { + return new HolderInfo(this); + } + + /// Field number for the "creator_address" field. + public const int CreatorAddressFieldNumber = 1; + private global::AElf.Types.Address creatorAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CreatorAddress { + get { return creatorAddress_; } + set { + creatorAddress_ = value; + } + } + + /// Field number for the "manager_infos" field. + public const int ManagerInfosFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_managerInfos_codec + = pb::FieldCodec.ForMessage(18, global::Portkey.Contracts.CA.ManagerInfo.Parser); + private readonly pbc::RepeatedField managerInfos_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ManagerInfos { + get { return managerInfos_; } + } + + /// Field number for the "guardian_list" field. + public const int GuardianListFieldNumber = 3; + private global::Portkey.Contracts.CA.GuardianList guardianList_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianList GuardianList { + get { return guardianList_; } + set { + guardianList_ = value; + } + } + + /// Field number for the "judgement_strategy" field. + public const int JudgementStrategyFieldNumber = 4; + private global::Portkey.Contracts.CA.StrategyNode judgementStrategy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.StrategyNode JudgementStrategy { + get { return judgementStrategy_; } + set { + judgementStrategy_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as HolderInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(HolderInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CreatorAddress, other.CreatorAddress)) return false; + if(!managerInfos_.Equals(other.managerInfos_)) return false; + if (!object.Equals(GuardianList, other.GuardianList)) return false; + if (!object.Equals(JudgementStrategy, other.JudgementStrategy)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (creatorAddress_ != null) hash ^= CreatorAddress.GetHashCode(); + hash ^= managerInfos_.GetHashCode(); + if (guardianList_ != null) hash ^= GuardianList.GetHashCode(); + if (judgementStrategy_ != null) hash ^= JudgementStrategy.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (creatorAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CreatorAddress); + } + managerInfos_.WriteTo(output, _repeated_managerInfos_codec); + if (guardianList_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianList); + } + if (judgementStrategy_ != null) { + output.WriteRawTag(34); + output.WriteMessage(JudgementStrategy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (creatorAddress_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CreatorAddress); + } + managerInfos_.WriteTo(ref output, _repeated_managerInfos_codec); + if (guardianList_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianList); + } + if (judgementStrategy_ != null) { + output.WriteRawTag(34); + output.WriteMessage(JudgementStrategy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (creatorAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreatorAddress); + } + size += managerInfos_.CalculateSize(_repeated_managerInfos_codec); + if (guardianList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianList); + } + if (judgementStrategy_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(JudgementStrategy); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(HolderInfo other) { + if (other == null) { + return; + } + if (other.creatorAddress_ != null) { + if (creatorAddress_ == null) { + CreatorAddress = new global::AElf.Types.Address(); + } + CreatorAddress.MergeFrom(other.CreatorAddress); + } + managerInfos_.Add(other.managerInfos_); + if (other.guardianList_ != null) { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + GuardianList.MergeFrom(other.GuardianList); + } + if (other.judgementStrategy_ != null) { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + JudgementStrategy.MergeFrom(other.JudgementStrategy); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (creatorAddress_ == null) { + CreatorAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CreatorAddress); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(input, _repeated_managerInfos_codec); + break; + } + case 26: { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + input.ReadMessage(GuardianList); + break; + } + case 34: { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(JudgementStrategy); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (creatorAddress_ == null) { + CreatorAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CreatorAddress); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(ref input, _repeated_managerInfos_codec); + break; + } + case 26: { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + input.ReadMessage(GuardianList); + break; + } + case 34: { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(JudgementStrategy); + break; + } + } + } + } + #endif + + } + + public sealed partial class ManagerInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfo(ManagerInfo other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfo Clone() { + return new ManagerInfo(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 2; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfo other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 18: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public partial class GuardianList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GuardianList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianList(GuardianList other) : this() { + guardians_ = other.guardians_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianList Clone() { + return new GuardianList(this); + } + + /// Field number for the "guardians" field. + public const int GuardiansFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_guardians_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.Guardian.Parser); + private readonly pbc::RepeatedField guardians_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Guardians { + get { return guardians_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GuardianList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GuardianList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!guardians_.Equals(other.guardians_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= guardians_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + guardians_.WriteTo(output, _repeated_guardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + guardians_.WriteTo(ref output, _repeated_guardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += guardians_.CalculateSize(_repeated_guardians_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GuardianList other) { + if (other == null) { + return; + } + guardians_.Add(other.guardians_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + guardians_.AddEntriesFrom(input, _repeated_guardians_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + guardians_.AddEntriesFrom(ref input, _repeated_guardians_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class Guardian : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Guardian()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Guardian() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Guardian(Guardian other) : this() { + type_ = other.type_; + verifierId_ = other.verifierId_ != null ? other.verifierId_.Clone() : null; + identifierHash_ = other.identifierHash_ != null ? other.identifierHash_.Clone() : null; + salt_ = other.salt_; + isLoginGuardian_ = other.isLoginGuardian_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Guardian Clone() { + return new Guardian(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private global::Portkey.Contracts.CA.GuardianType type_ = global::Portkey.Contracts.CA.GuardianType.OfEmail; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianType Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "verifier_id" field. + public const int VerifierIdFieldNumber = 2; + private global::AElf.Types.Hash verifierId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash VerifierId { + get { return verifierId_; } + set { + verifierId_ = value; + } + } + + /// Field number for the "identifier_hash" field. + public const int IdentifierHashFieldNumber = 3; + private global::AElf.Types.Hash identifierHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash IdentifierHash { + get { return identifierHash_; } + set { + identifierHash_ = value; + } + } + + /// Field number for the "salt" field. + public const int SaltFieldNumber = 4; + private string salt_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Salt { + get { return salt_; } + set { + salt_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "is_login_guardian" field. + public const int IsLoginGuardianFieldNumber = 5; + private bool isLoginGuardian_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsLoginGuardian { + get { return isLoginGuardian_; } + set { + isLoginGuardian_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Guardian); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Guardian other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (!object.Equals(VerifierId, other.VerifierId)) return false; + if (!object.Equals(IdentifierHash, other.IdentifierHash)) return false; + if (Salt != other.Salt) return false; + if (IsLoginGuardian != other.IsLoginGuardian) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) hash ^= Type.GetHashCode(); + if (verifierId_ != null) hash ^= VerifierId.GetHashCode(); + if (identifierHash_ != null) hash ^= IdentifierHash.GetHashCode(); + if (Salt.Length != 0) hash ^= Salt.GetHashCode(); + if (IsLoginGuardian != false) hash ^= IsLoginGuardian.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (verifierId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(VerifierId); + } + if (identifierHash_ != null) { + output.WriteRawTag(26); + output.WriteMessage(IdentifierHash); + } + if (Salt.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Salt); + } + if (IsLoginGuardian != false) { + output.WriteRawTag(40); + output.WriteBool(IsLoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (verifierId_ != null) { + output.WriteRawTag(18); + output.WriteMessage(VerifierId); + } + if (identifierHash_ != null) { + output.WriteRawTag(26); + output.WriteMessage(IdentifierHash); + } + if (Salt.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Salt); + } + if (IsLoginGuardian != false) { + output.WriteRawTag(40); + output.WriteBool(IsLoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (verifierId_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerifierId); + } + if (identifierHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IdentifierHash); + } + if (Salt.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Salt); + } + if (IsLoginGuardian != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Guardian other) { + if (other == null) { + return; + } + if (other.Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + Type = other.Type; + } + if (other.verifierId_ != null) { + if (verifierId_ == null) { + VerifierId = new global::AElf.Types.Hash(); + } + VerifierId.MergeFrom(other.VerifierId); + } + if (other.identifierHash_ != null) { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + IdentifierHash.MergeFrom(other.IdentifierHash); + } + if (other.Salt.Length != 0) { + Salt = other.Salt; + } + if (other.IsLoginGuardian != false) { + IsLoginGuardian = other.IsLoginGuardian; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Type = (global::Portkey.Contracts.CA.GuardianType) input.ReadEnum(); + break; + } + case 18: { + if (verifierId_ == null) { + VerifierId = new global::AElf.Types.Hash(); + } + input.ReadMessage(VerifierId); + break; + } + case 26: { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(IdentifierHash); + break; + } + case 34: { + Salt = input.ReadString(); + break; + } + case 40: { + IsLoginGuardian = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = (global::Portkey.Contracts.CA.GuardianType) input.ReadEnum(); + break; + } + case 18: { + if (verifierId_ == null) { + VerifierId = new global::AElf.Types.Hash(); + } + input.ReadMessage(VerifierId); + break; + } + case 26: { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(IdentifierHash); + break; + } + case 34: { + Salt = input.ReadString(); + break; + } + case 40: { + IsLoginGuardian = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class VerifierServer : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifierServer()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServer() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServer(VerifierServer other) : this() { + id_ = other.id_ != null ? other.id_.Clone() : null; + name_ = other.name_; + imageUrl_ = other.imageUrl_; + endPoints_ = other.endPoints_.Clone(); + verifierAddresses_ = other.verifierAddresses_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServer Clone() { + return new VerifierServer(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::AElf.Types.Hash id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 2; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "image_url" field. + public const int ImageUrlFieldNumber = 3; + private string imageUrl_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ImageUrl { + get { return imageUrl_; } + set { + imageUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "end_points" field. + public const int EndPointsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_endPoints_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField endPoints_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField EndPoints { + get { return endPoints_; } + } + + /// Field number for the "verifier_addresses" field. + public const int VerifierAddressesFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_verifierAddresses_codec + = pb::FieldCodec.ForMessage(42, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField verifierAddresses_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VerifierAddresses { + get { return verifierAddresses_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerifierServer); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerifierServer other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Id, other.Id)) return false; + if (Name != other.Name) return false; + if (ImageUrl != other.ImageUrl) return false; + if(!endPoints_.Equals(other.endPoints_)) return false; + if(!verifierAddresses_.Equals(other.verifierAddresses_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (id_ != null) hash ^= Id.GetHashCode(); + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (ImageUrl.Length != 0) hash ^= ImageUrl.GetHashCode(); + hash ^= endPoints_.GetHashCode(); + hash ^= verifierAddresses_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Name.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Name); + } + if (ImageUrl.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ImageUrl); + } + endPoints_.WriteTo(output, _repeated_endPoints_codec); + verifierAddresses_.WriteTo(output, _repeated_verifierAddresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Name.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Name); + } + if (ImageUrl.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ImageUrl); + } + endPoints_.WriteTo(ref output, _repeated_endPoints_codec); + verifierAddresses_.WriteTo(ref output, _repeated_verifierAddresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); + } + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (ImageUrl.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ImageUrl); + } + size += endPoints_.CalculateSize(_repeated_endPoints_codec); + size += verifierAddresses_.CalculateSize(_repeated_verifierAddresses_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerifierServer other) { + if (other == null) { + return; + } + if (other.id_ != null) { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + Id.MergeFrom(other.Id); + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.ImageUrl.Length != 0) { + ImageUrl = other.ImageUrl; + } + endPoints_.Add(other.endPoints_); + verifierAddresses_.Add(other.verifierAddresses_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + Name = input.ReadString(); + break; + } + case 26: { + ImageUrl = input.ReadString(); + break; + } + case 34: { + endPoints_.AddEntriesFrom(input, _repeated_endPoints_codec); + break; + } + case 42: { + verifierAddresses_.AddEntriesFrom(input, _repeated_verifierAddresses_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + Name = input.ReadString(); + break; + } + case 26: { + ImageUrl = input.ReadString(); + break; + } + case 34: { + endPoints_.AddEntriesFrom(ref input, _repeated_endPoints_codec); + break; + } + case 42: { + verifierAddresses_.AddEntriesFrom(ref input, _repeated_verifierAddresses_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAServer : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAServer()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServer() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServer(CAServer other) : this() { + name_ = other.name_; + endPoint_ = other.endPoint_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServer Clone() { + return new CAServer(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "end_point" field. + public const int EndPointFieldNumber = 2; + private string endPoint_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string EndPoint { + get { return endPoint_; } + set { + endPoint_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAServer); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAServer other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (EndPoint != other.EndPoint) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (EndPoint.Length != 0) { + output.WriteRawTag(18); + output.WriteString(EndPoint); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (EndPoint.Length != 0) { + output.WriteRawTag(18); + output.WriteString(EndPoint); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (EndPoint.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(EndPoint); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAServer other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.EndPoint.Length != 0) { + EndPoint = other.EndPoint; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + EndPoint = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + EndPoint = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class VerifierServerList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifierServerList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerList(VerifierServerList other) : this() { + verifierServers_ = other.verifierServers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerList Clone() { + return new VerifierServerList(this); + } + + /// Field number for the "verifier_servers" field. + public const int VerifierServersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_verifierServers_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.VerifierServer.Parser); + private readonly pbc::RepeatedField verifierServers_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VerifierServers { + get { return verifierServers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerifierServerList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerifierServerList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!verifierServers_.Equals(other.verifierServers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= verifierServers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + verifierServers_.WriteTo(output, _repeated_verifierServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + verifierServers_.WriteTo(ref output, _repeated_verifierServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += verifierServers_.CalculateSize(_repeated_verifierServers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerifierServerList other) { + if (other == null) { + return; + } + verifierServers_.Add(other.verifierServers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + verifierServers_.AddEntriesFrom(input, _repeated_verifierServers_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + verifierServers_.AddEntriesFrom(ref input, _repeated_verifierServers_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAServerList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAServerList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerList(CAServerList other) : this() { + caServers_ = other.caServers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerList Clone() { + return new CAServerList(this); + } + + /// Field number for the "ca_servers" field. + public const int CaServersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_caServers_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.CAServer.Parser); + private readonly pbc::RepeatedField caServers_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CaServers { + get { return caServers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAServerList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAServerList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!caServers_.Equals(other.caServers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= caServers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + caServers_.WriteTo(output, _repeated_caServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + caServers_.WriteTo(ref output, _repeated_caServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += caServers_.CalculateSize(_repeated_caServers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAServerList other) { + if (other == null) { + return; + } + caServers_.Add(other.caServers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + caServers_.AddEntriesFrom(input, _repeated_caServers_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + caServers_.AddEntriesFrom(ref input, _repeated_caServers_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ControllerList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ControllerList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerList(ControllerList other) : this() { + controllers_ = other.controllers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerList Clone() { + return new ControllerList(this); + } + + /// Field number for the "controllers" field. + public const int ControllersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_controllers_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField controllers_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Controllers { + get { return controllers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ControllerList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ControllerList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!controllers_.Equals(other.controllers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= controllers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + controllers_.WriteTo(output, _repeated_controllers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + controllers_.WriteTo(ref output, _repeated_controllers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += controllers_.CalculateSize(_repeated_controllers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ControllerList other) { + if (other == null) { + return; + } + controllers_.Add(other.controllers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + controllers_.AddEntriesFrom(input, _repeated_controllers_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + controllers_.AddEntriesFrom(ref input, _repeated_controllers_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ManagerInfoList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoList(ManagerInfoList other) : this() { + managerInfos_ = other.managerInfos_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoList Clone() { + return new ManagerInfoList(this); + } + + /// Field number for the "manager_infos" field. + public const int ManagerInfosFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_managerInfos_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.ManagerInfo.Parser); + private readonly pbc::RepeatedField managerInfos_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ManagerInfos { + get { return managerInfos_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!managerInfos_.Equals(other.managerInfos_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= managerInfos_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + managerInfos_.WriteTo(output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + managerInfos_.WriteTo(ref output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += managerInfos_.CalculateSize(_repeated_managerInfos_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfoList other) { + if (other == null) { + return; + } + managerInfos_.Add(other.managerInfos_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + managerInfos_.AddEntriesFrom(input, _repeated_managerInfos_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + managerInfos_.AddEntriesFrom(ref input, _repeated_managerInfos_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class LoginGuardianList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoginGuardianList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianList(LoginGuardianList other) : this() { + loginGuardians_ = other.loginGuardians_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianList Clone() { + return new LoginGuardianList(this); + } + + /// Field number for the "login_guardians" field. + public const int LoginGuardiansFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_loginGuardians_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Types.Hash.Parser); + private readonly pbc::RepeatedField loginGuardians_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LoginGuardians { + get { return loginGuardians_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LoginGuardianList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LoginGuardianList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!loginGuardians_.Equals(other.loginGuardians_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= loginGuardians_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + loginGuardians_.WriteTo(output, _repeated_loginGuardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + loginGuardians_.WriteTo(ref output, _repeated_loginGuardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += loginGuardians_.CalculateSize(_repeated_loginGuardians_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LoginGuardianList other) { + if (other == null) { + return; + } + loginGuardians_.Add(other.loginGuardians_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + loginGuardians_.AddEntriesFrom(input, _repeated_loginGuardians_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + loginGuardians_.AddEntriesFrom(ref input, _repeated_loginGuardians_codec); + break; + } + } + } + } + #endif + + } + + /// + ///Input + /// + internal sealed partial class InitializeInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitializeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput(InitializeInput other) : this() { + contractAdmin_ = other.contractAdmin_ != null ? other.contractAdmin_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InitializeInput Clone() { + return new InitializeInput(this); + } + + /// Field number for the "contract_admin" field. + public const int ContractAdminFieldNumber = 1; + private global::AElf.Types.Address contractAdmin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ContractAdmin { + get { return contractAdmin_; } + set { + contractAdmin_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InitializeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InitializeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ContractAdmin, other.ContractAdmin)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (contractAdmin_ != null) hash ^= ContractAdmin.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (contractAdmin_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAdmin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (contractAdmin_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ContractAdmin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (contractAdmin_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAdmin); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InitializeInput other) { + if (other == null) { + return; + } + if (other.contractAdmin_ != null) { + if (contractAdmin_ == null) { + ContractAdmin = new global::AElf.Types.Address(); + } + ContractAdmin.MergeFrom(other.ContractAdmin); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (contractAdmin_ == null) { + ContractAdmin = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAdmin); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (contractAdmin_ == null) { + ContractAdmin = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAdmin); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ControllerInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ControllerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerInput(ControllerInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerInput Clone() { + return new ControllerInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ControllerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ControllerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ControllerInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ControllerOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ControllerOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerOutput(ControllerOutput other) : this() { + addresses_ = other.addresses_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ControllerOutput Clone() { + return new ControllerOutput(this); + } + + /// Field number for the "addresses" field. + public const int AddressesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_addresses_codec + = pb::FieldCodec.ForMessage(10, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField addresses_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Addresses { + get { return addresses_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ControllerOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ControllerOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!addresses_.Equals(other.addresses_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= addresses_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + addresses_.WriteTo(output, _repeated_addresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + addresses_.WriteTo(ref output, _repeated_addresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += addresses_.CalculateSize(_repeated_addresses_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ControllerOutput other) { + if (other == null) { + return; + } + addresses_.Add(other.addresses_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + addresses_.AddEntriesFrom(input, _repeated_addresses_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + addresses_.AddEntriesFrom(ref input, _repeated_addresses_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AdminInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdminInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminInput(AdminInput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminInput Clone() { + return new AdminInput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AdminInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AdminInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AdminInput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AdminOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdminOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminOutput(AdminOutput other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminOutput Clone() { + return new AdminOutput(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AdminOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AdminOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AdminOutput other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CreateCAHolderInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateCAHolderInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateCAHolderInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateCAHolderInput(CreateCAHolderInput other) : this() { + guardianApproved_ = other.guardianApproved_ != null ? other.guardianApproved_.Clone() : null; + managerInfo_ = other.managerInfo_ != null ? other.managerInfo_.Clone() : null; + judgementStrategy_ = other.judgementStrategy_ != null ? other.judgementStrategy_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreateCAHolderInput Clone() { + return new CreateCAHolderInput(this); + } + + /// Field number for the "guardian_approved" field. + public const int GuardianApprovedFieldNumber = 1; + private global::Portkey.Contracts.CA.GuardianInfo guardianApproved_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianInfo GuardianApproved { + get { return guardianApproved_; } + set { + guardianApproved_ = value; + } + } + + /// Field number for the "manager_info" field. + public const int ManagerInfoFieldNumber = 2; + private global::Portkey.Contracts.CA.ManagerInfo managerInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfo ManagerInfo { + get { return managerInfo_; } + set { + managerInfo_ = value; + } + } + + /// Field number for the "judgement_strategy" field. + public const int JudgementStrategyFieldNumber = 3; + private global::Portkey.Contracts.CA.StrategyNode judgementStrategy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.StrategyNode JudgementStrategy { + get { return judgementStrategy_; } + set { + judgementStrategy_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CreateCAHolderInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CreateCAHolderInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(GuardianApproved, other.GuardianApproved)) return false; + if (!object.Equals(ManagerInfo, other.ManagerInfo)) return false; + if (!object.Equals(JudgementStrategy, other.JudgementStrategy)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (guardianApproved_ != null) hash ^= GuardianApproved.GetHashCode(); + if (managerInfo_ != null) hash ^= ManagerInfo.GetHashCode(); + if (judgementStrategy_ != null) hash ^= JudgementStrategy.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (guardianApproved_ != null) { + output.WriteRawTag(10); + output.WriteMessage(GuardianApproved); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + if (judgementStrategy_ != null) { + output.WriteRawTag(26); + output.WriteMessage(JudgementStrategy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (guardianApproved_ != null) { + output.WriteRawTag(10); + output.WriteMessage(GuardianApproved); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + if (judgementStrategy_ != null) { + output.WriteRawTag(26); + output.WriteMessage(JudgementStrategy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (guardianApproved_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianApproved); + } + if (managerInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfo); + } + if (judgementStrategy_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(JudgementStrategy); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CreateCAHolderInput other) { + if (other == null) { + return; + } + if (other.guardianApproved_ != null) { + if (guardianApproved_ == null) { + GuardianApproved = new global::Portkey.Contracts.CA.GuardianInfo(); + } + GuardianApproved.MergeFrom(other.GuardianApproved); + } + if (other.managerInfo_ != null) { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + ManagerInfo.MergeFrom(other.ManagerInfo); + } + if (other.judgementStrategy_ != null) { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + JudgementStrategy.MergeFrom(other.JudgementStrategy); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (guardianApproved_ == null) { + GuardianApproved = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianApproved); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + case 26: { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(JudgementStrategy); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (guardianApproved_ == null) { + GuardianApproved = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianApproved); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + case 26: { + if (judgementStrategy_ == null) { + JudgementStrategy = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(JudgementStrategy); + break; + } + } + } + } + #endif + + } + + internal sealed partial class GuardianInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GuardianInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianInfo(GuardianInfo other) : this() { + type_ = other.type_; + identifierHash_ = other.identifierHash_ != null ? other.identifierHash_.Clone() : null; + verificationInfo_ = other.verificationInfo_ != null ? other.verificationInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianInfo Clone() { + return new GuardianInfo(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private global::Portkey.Contracts.CA.GuardianType type_ = global::Portkey.Contracts.CA.GuardianType.OfEmail; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianType Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "identifier_hash" field. + public const int IdentifierHashFieldNumber = 2; + private global::AElf.Types.Hash identifierHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash IdentifierHash { + get { return identifierHash_; } + set { + identifierHash_ = value; + } + } + + /// Field number for the "verification_info" field. + public const int VerificationInfoFieldNumber = 3; + private global::Portkey.Contracts.CA.VerificationInfo verificationInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.VerificationInfo VerificationInfo { + get { return verificationInfo_; } + set { + verificationInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GuardianInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GuardianInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (!object.Equals(IdentifierHash, other.IdentifierHash)) return false; + if (!object.Equals(VerificationInfo, other.VerificationInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) hash ^= Type.GetHashCode(); + if (identifierHash_ != null) hash ^= IdentifierHash.GetHashCode(); + if (verificationInfo_ != null) hash ^= VerificationInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (identifierHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(IdentifierHash); + } + if (verificationInfo_ != null) { + output.WriteRawTag(26); + output.WriteMessage(VerificationInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (identifierHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(IdentifierHash); + } + if (verificationInfo_ != null) { + output.WriteRawTag(26); + output.WriteMessage(VerificationInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (identifierHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IdentifierHash); + } + if (verificationInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerificationInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GuardianInfo other) { + if (other == null) { + return; + } + if (other.Type != global::Portkey.Contracts.CA.GuardianType.OfEmail) { + Type = other.Type; + } + if (other.identifierHash_ != null) { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + IdentifierHash.MergeFrom(other.IdentifierHash); + } + if (other.verificationInfo_ != null) { + if (verificationInfo_ == null) { + VerificationInfo = new global::Portkey.Contracts.CA.VerificationInfo(); + } + VerificationInfo.MergeFrom(other.VerificationInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Type = (global::Portkey.Contracts.CA.GuardianType) input.ReadEnum(); + break; + } + case 18: { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(IdentifierHash); + break; + } + case 26: { + if (verificationInfo_ == null) { + VerificationInfo = new global::Portkey.Contracts.CA.VerificationInfo(); + } + input.ReadMessage(VerificationInfo); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = (global::Portkey.Contracts.CA.GuardianType) input.ReadEnum(); + break; + } + case 18: { + if (identifierHash_ == null) { + IdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(IdentifierHash); + break; + } + case 26: { + if (verificationInfo_ == null) { + VerificationInfo = new global::Portkey.Contracts.CA.VerificationInfo(); + } + input.ReadMessage(VerificationInfo); + break; + } + } + } + } + #endif + + } + + internal sealed partial class VerificationInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerificationInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationInfo(VerificationInfo other) : this() { + id_ = other.id_ != null ? other.id_.Clone() : null; + signature_ = other.signature_; + verificationDoc_ = other.verificationDoc_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationInfo Clone() { + return new VerificationInfo(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::AElf.Types.Hash id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "signature" field. + public const int SignatureFieldNumber = 2; + private pb::ByteString signature_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Signature { + get { return signature_; } + set { + signature_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "verification_doc" field. + public const int VerificationDocFieldNumber = 3; + private string verificationDoc_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string VerificationDoc { + get { return verificationDoc_; } + set { + verificationDoc_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerificationInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerificationInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Id, other.Id)) return false; + if (Signature != other.Signature) return false; + if (VerificationDoc != other.VerificationDoc) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (id_ != null) hash ^= Id.GetHashCode(); + if (Signature.Length != 0) hash ^= Signature.GetHashCode(); + if (VerificationDoc.Length != 0) hash ^= VerificationDoc.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Signature.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Signature); + } + if (VerificationDoc.Length != 0) { + output.WriteRawTag(26); + output.WriteString(VerificationDoc); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Signature.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Signature); + } + if (VerificationDoc.Length != 0) { + output.WriteRawTag(26); + output.WriteString(VerificationDoc); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); + } + if (Signature.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Signature); + } + if (VerificationDoc.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(VerificationDoc); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerificationInfo other) { + if (other == null) { + return; + } + if (other.id_ != null) { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + Id.MergeFrom(other.Id); + } + if (other.Signature.Length != 0) { + Signature = other.Signature; + } + if (other.VerificationDoc.Length != 0) { + VerificationDoc = other.VerificationDoc; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + Signature = input.ReadBytes(); + break; + } + case 26: { + VerificationDoc = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + Signature = input.ReadBytes(); + break; + } + case 26: { + VerificationDoc = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class StrategyNode : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StrategyNode()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyNode() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyNode(StrategyNode other) : this() { + name_ = other.name_; + type_ = other.type_.Clone(); + value_ = other.value_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyNode Clone() { + return new StrategyNode(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private global::Portkey.Contracts.CA.StrategyName name_ = global::Portkey.Contracts.CA.StrategyName.And; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.StrategyName Name { + get { return name_; } + set { + name_ = value; + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_type_codec + = pb::FieldCodec.ForEnum(18, x => (int) x, x => (global::Portkey.Contracts.CA.StrategyValueType) x); + private readonly pbc::RepeatedField type_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Type { + get { return type_; } + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForBytes(26); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Value { + get { return value_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StrategyNode); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StrategyNode other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if(!type_.Equals(other.type_)) return false; + if(!value_.Equals(other.value_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name != global::Portkey.Contracts.CA.StrategyName.And) hash ^= Name.GetHashCode(); + hash ^= type_.GetHashCode(); + hash ^= value_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name != global::Portkey.Contracts.CA.StrategyName.And) { + output.WriteRawTag(8); + output.WriteEnum((int) Name); + } + type_.WriteTo(output, _repeated_type_codec); + value_.WriteTo(output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name != global::Portkey.Contracts.CA.StrategyName.And) { + output.WriteRawTag(8); + output.WriteEnum((int) Name); + } + type_.WriteTo(ref output, _repeated_type_codec); + value_.WriteTo(ref output, _repeated_value_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name != global::Portkey.Contracts.CA.StrategyName.And) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Name); + } + size += type_.CalculateSize(_repeated_type_codec); + size += value_.CalculateSize(_repeated_value_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StrategyNode other) { + if (other == null) { + return; + } + if (other.Name != global::Portkey.Contracts.CA.StrategyName.And) { + Name = other.Name; + } + type_.Add(other.type_); + value_.Add(other.value_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Name = (global::Portkey.Contracts.CA.StrategyName) input.ReadEnum(); + break; + } + case 18: + case 16: { + type_.AddEntriesFrom(input, _repeated_type_codec); + break; + } + case 26: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Name = (global::Portkey.Contracts.CA.StrategyName) input.ReadEnum(); + break; + } + case 18: + case 16: { + type_.AddEntriesFrom(ref input, _repeated_type_codec); + break; + } + case 26: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class StrategyLongWrapper : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StrategyLongWrapper()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyLongWrapper() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyLongWrapper(StrategyLongWrapper other) : this() { + value_ = other.value_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyLongWrapper Clone() { + return new StrategyLongWrapper(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private long value_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Value { + get { return value_; } + set { + value_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StrategyLongWrapper); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StrategyLongWrapper other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Value != other.Value) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Value != 0L) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Value != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Value != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Value != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StrategyLongWrapper other) { + if (other == null) { + return; + } + if (other.Value != 0L) { + Value = other.Value; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Value = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Value = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class StrategyStringWrapper : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StrategyStringWrapper()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyStringWrapper() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyStringWrapper(StrategyStringWrapper other) : this() { + value_ = other.value_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StrategyStringWrapper Clone() { + return new StrategyStringWrapper(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private string value_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Value { + get { return value_; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StrategyStringWrapper); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StrategyStringWrapper other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Value != other.Value) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Value.Length != 0) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Value.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Value.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Value.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StrategyStringWrapper other) { + if (other == null) { + return; + } + if (other.Value.Length != 0) { + Value = other.Value; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Value = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Value = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ContractDelegationFee : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ContractDelegationFee()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ContractDelegationFee() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ContractDelegationFee(ContractDelegationFee other) : this() { + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ContractDelegationFee Clone() { + return new ContractDelegationFee(this); + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 1; + private long amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ContractDelegationFee); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ContractDelegationFee other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Amount != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Amount != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ContractDelegationFee other) { + if (other == null) { + return; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Amount = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Amount = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class SetContractDelegationFeeInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetContractDelegationFeeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[23]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetContractDelegationFeeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetContractDelegationFeeInput(SetContractDelegationFeeInput other) : this() { + delegationFee_ = other.delegationFee_ != null ? other.delegationFee_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetContractDelegationFeeInput Clone() { + return new SetContractDelegationFeeInput(this); + } + + /// Field number for the "delegation_fee" field. + public const int DelegationFeeFieldNumber = 1; + private global::Portkey.Contracts.CA.ContractDelegationFee delegationFee_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ContractDelegationFee DelegationFee { + get { return delegationFee_; } + set { + delegationFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetContractDelegationFeeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetContractDelegationFeeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(DelegationFee, other.DelegationFee)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (delegationFee_ != null) hash ^= DelegationFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (delegationFee_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DelegationFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (delegationFee_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DelegationFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (delegationFee_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DelegationFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetContractDelegationFeeInput other) { + if (other == null) { + return; + } + if (other.delegationFee_ != null) { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + DelegationFee.MergeFrom(other.DelegationFee); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + input.ReadMessage(DelegationFee); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + input.ReadMessage(DelegationFee); + break; + } + } + } + } + #endif + + } + + internal sealed partial class GetContractDelegationFeeOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetContractDelegationFeeOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetContractDelegationFeeOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetContractDelegationFeeOutput(GetContractDelegationFeeOutput other) : this() { + delegationFee_ = other.delegationFee_ != null ? other.delegationFee_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetContractDelegationFeeOutput Clone() { + return new GetContractDelegationFeeOutput(this); + } + + /// Field number for the "delegation_fee" field. + public const int DelegationFeeFieldNumber = 1; + private global::Portkey.Contracts.CA.ContractDelegationFee delegationFee_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ContractDelegationFee DelegationFee { + get { return delegationFee_; } + set { + delegationFee_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetContractDelegationFeeOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetContractDelegationFeeOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(DelegationFee, other.DelegationFee)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (delegationFee_ != null) hash ^= DelegationFee.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (delegationFee_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DelegationFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (delegationFee_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DelegationFee); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (delegationFee_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DelegationFee); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetContractDelegationFeeOutput other) { + if (other == null) { + return; + } + if (other.delegationFee_ != null) { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + DelegationFee.MergeFrom(other.DelegationFee); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + input.ReadMessage(DelegationFee); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (delegationFee_ == null) { + DelegationFee = new global::Portkey.Contracts.CA.ContractDelegationFee(); + } + input.ReadMessage(DelegationFee); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AddGuardianInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddGuardianInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[25]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddGuardianInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddGuardianInput(AddGuardianInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + guardianToAdd_ = other.guardianToAdd_ != null ? other.guardianToAdd_.Clone() : null; + guardiansApproved_ = other.guardiansApproved_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddGuardianInput Clone() { + return new AddGuardianInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "guardian_to_add" field. + public const int GuardianToAddFieldNumber = 2; + private global::Portkey.Contracts.CA.GuardianInfo guardianToAdd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianInfo GuardianToAdd { + get { return guardianToAdd_; } + set { + guardianToAdd_ = value; + } + } + + /// Field number for the "guardians_approved" field. + public const int GuardiansApprovedFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_guardiansApproved_codec + = pb::FieldCodec.ForMessage(26, global::Portkey.Contracts.CA.GuardianInfo.Parser); + private readonly pbc::RepeatedField guardiansApproved_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GuardiansApproved { + get { return guardiansApproved_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddGuardianInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddGuardianInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(GuardianToAdd, other.GuardianToAdd)) return false; + if(!guardiansApproved_.Equals(other.guardiansApproved_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (guardianToAdd_ != null) hash ^= GuardianToAdd.GetHashCode(); + hash ^= guardiansApproved_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToAdd_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToAdd); + } + guardiansApproved_.WriteTo(output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToAdd_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToAdd); + } + guardiansApproved_.WriteTo(ref output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (guardianToAdd_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianToAdd); + } + size += guardiansApproved_.CalculateSize(_repeated_guardiansApproved_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddGuardianInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.guardianToAdd_ != null) { + if (guardianToAdd_ == null) { + GuardianToAdd = new global::Portkey.Contracts.CA.GuardianInfo(); + } + GuardianToAdd.MergeFrom(other.GuardianToAdd); + } + guardiansApproved_.Add(other.guardiansApproved_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToAdd_ == null) { + GuardianToAdd = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToAdd); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(input, _repeated_guardiansApproved_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToAdd_ == null) { + GuardianToAdd = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToAdd); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(ref input, _repeated_guardiansApproved_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveGuardianInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveGuardianInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[26]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveGuardianInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveGuardianInput(RemoveGuardianInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + guardianToRemove_ = other.guardianToRemove_ != null ? other.guardianToRemove_.Clone() : null; + guardiansApproved_ = other.guardiansApproved_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveGuardianInput Clone() { + return new RemoveGuardianInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "guardian_to_remove" field. + public const int GuardianToRemoveFieldNumber = 2; + private global::Portkey.Contracts.CA.GuardianInfo guardianToRemove_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianInfo GuardianToRemove { + get { return guardianToRemove_; } + set { + guardianToRemove_ = value; + } + } + + /// Field number for the "guardians_approved" field. + public const int GuardiansApprovedFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_guardiansApproved_codec + = pb::FieldCodec.ForMessage(26, global::Portkey.Contracts.CA.GuardianInfo.Parser); + private readonly pbc::RepeatedField guardiansApproved_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GuardiansApproved { + get { return guardiansApproved_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveGuardianInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveGuardianInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(GuardianToRemove, other.GuardianToRemove)) return false; + if(!guardiansApproved_.Equals(other.guardiansApproved_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (guardianToRemove_ != null) hash ^= GuardianToRemove.GetHashCode(); + hash ^= guardiansApproved_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToRemove_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToRemove); + } + guardiansApproved_.WriteTo(output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToRemove_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToRemove); + } + guardiansApproved_.WriteTo(ref output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (guardianToRemove_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianToRemove); + } + size += guardiansApproved_.CalculateSize(_repeated_guardiansApproved_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveGuardianInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.guardianToRemove_ != null) { + if (guardianToRemove_ == null) { + GuardianToRemove = new global::Portkey.Contracts.CA.GuardianInfo(); + } + GuardianToRemove.MergeFrom(other.GuardianToRemove); + } + guardiansApproved_.Add(other.guardiansApproved_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToRemove_ == null) { + GuardianToRemove = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToRemove); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(input, _repeated_guardiansApproved_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToRemove_ == null) { + GuardianToRemove = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToRemove); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(ref input, _repeated_guardiansApproved_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class UpdateGuardianInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UpdateGuardianInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[27]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateGuardianInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateGuardianInput(UpdateGuardianInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + guardianToUpdatePre_ = other.guardianToUpdatePre_ != null ? other.guardianToUpdatePre_.Clone() : null; + guardianToUpdateNew_ = other.guardianToUpdateNew_ != null ? other.guardianToUpdateNew_.Clone() : null; + guardiansApproved_ = other.guardiansApproved_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateGuardianInput Clone() { + return new UpdateGuardianInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "guardian_to_update_pre" field. + public const int GuardianToUpdatePreFieldNumber = 2; + private global::Portkey.Contracts.CA.GuardianInfo guardianToUpdatePre_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianInfo GuardianToUpdatePre { + get { return guardianToUpdatePre_; } + set { + guardianToUpdatePre_ = value; + } + } + + /// Field number for the "guardian_to_update_new" field. + public const int GuardianToUpdateNewFieldNumber = 3; + private global::Portkey.Contracts.CA.GuardianInfo guardianToUpdateNew_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianInfo GuardianToUpdateNew { + get { return guardianToUpdateNew_; } + set { + guardianToUpdateNew_ = value; + } + } + + /// Field number for the "guardians_approved" field. + public const int GuardiansApprovedFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_guardiansApproved_codec + = pb::FieldCodec.ForMessage(34, global::Portkey.Contracts.CA.GuardianInfo.Parser); + private readonly pbc::RepeatedField guardiansApproved_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GuardiansApproved { + get { return guardiansApproved_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UpdateGuardianInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UpdateGuardianInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(GuardianToUpdatePre, other.GuardianToUpdatePre)) return false; + if (!object.Equals(GuardianToUpdateNew, other.GuardianToUpdateNew)) return false; + if(!guardiansApproved_.Equals(other.guardiansApproved_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (guardianToUpdatePre_ != null) hash ^= GuardianToUpdatePre.GetHashCode(); + if (guardianToUpdateNew_ != null) hash ^= GuardianToUpdateNew.GetHashCode(); + hash ^= guardiansApproved_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToUpdatePre_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToUpdatePre); + } + if (guardianToUpdateNew_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianToUpdateNew); + } + guardiansApproved_.WriteTo(output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardianToUpdatePre_ != null) { + output.WriteRawTag(18); + output.WriteMessage(GuardianToUpdatePre); + } + if (guardianToUpdateNew_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianToUpdateNew); + } + guardiansApproved_.WriteTo(ref output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (guardianToUpdatePre_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianToUpdatePre); + } + if (guardianToUpdateNew_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianToUpdateNew); + } + size += guardiansApproved_.CalculateSize(_repeated_guardiansApproved_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UpdateGuardianInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.guardianToUpdatePre_ != null) { + if (guardianToUpdatePre_ == null) { + GuardianToUpdatePre = new global::Portkey.Contracts.CA.GuardianInfo(); + } + GuardianToUpdatePre.MergeFrom(other.GuardianToUpdatePre); + } + if (other.guardianToUpdateNew_ != null) { + if (guardianToUpdateNew_ == null) { + GuardianToUpdateNew = new global::Portkey.Contracts.CA.GuardianInfo(); + } + GuardianToUpdateNew.MergeFrom(other.GuardianToUpdateNew); + } + guardiansApproved_.Add(other.guardiansApproved_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToUpdatePre_ == null) { + GuardianToUpdatePre = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToUpdatePre); + break; + } + case 26: { + if (guardianToUpdateNew_ == null) { + GuardianToUpdateNew = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToUpdateNew); + break; + } + case 34: { + guardiansApproved_.AddEntriesFrom(input, _repeated_guardiansApproved_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardianToUpdatePre_ == null) { + GuardianToUpdatePre = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToUpdatePre); + break; + } + case 26: { + if (guardianToUpdateNew_ == null) { + GuardianToUpdateNew = new global::Portkey.Contracts.CA.GuardianInfo(); + } + input.ReadMessage(GuardianToUpdateNew); + break; + } + case 34: { + guardiansApproved_.AddEntriesFrom(ref input, _repeated_guardiansApproved_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class SetGuardianForLoginInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetGuardianForLoginInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[28]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGuardianForLoginInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGuardianForLoginInput(SetGuardianForLoginInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + guardian_ = other.guardian_ != null ? other.guardian_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetGuardianForLoginInput Clone() { + return new SetGuardianForLoginInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "guardian" field. + public const int GuardianFieldNumber = 2; + private global::Portkey.Contracts.CA.Guardian guardian_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian Guardian { + get { return guardian_; } + set { + guardian_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetGuardianForLoginInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetGuardianForLoginInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(Guardian, other.Guardian)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (guardian_ != null) hash ^= Guardian.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardian_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Guardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardian_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Guardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (guardian_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Guardian); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetGuardianForLoginInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.guardian_ != null) { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + Guardian.MergeFrom(other.Guardian); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(Guardian); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(Guardian); + break; + } + } + } + } + #endif + + } + + internal sealed partial class UnsetGuardianForLoginInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnsetGuardianForLoginInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[29]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UnsetGuardianForLoginInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UnsetGuardianForLoginInput(UnsetGuardianForLoginInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + guardian_ = other.guardian_ != null ? other.guardian_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UnsetGuardianForLoginInput Clone() { + return new UnsetGuardianForLoginInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "guardian" field. + public const int GuardianFieldNumber = 2; + private global::Portkey.Contracts.CA.Guardian guardian_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian Guardian { + get { return guardian_; } + set { + guardian_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UnsetGuardianForLoginInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UnsetGuardianForLoginInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(Guardian, other.Guardian)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (guardian_ != null) hash ^= Guardian.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardian_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Guardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (guardian_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Guardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (guardian_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Guardian); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UnsetGuardianForLoginInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.guardian_ != null) { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + Guardian.MergeFrom(other.Guardian); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(Guardian); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (guardian_ == null) { + Guardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(Guardian); + break; + } + } + } + } + #endif + + } + + public sealed partial class ManagerForwardCallInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerForwardCallInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[30]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerForwardCallInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerForwardCallInput(ManagerForwardCallInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + contractAddress_ = other.contractAddress_ != null ? other.contractAddress_.Clone() : null; + methodName_ = other.methodName_; + args_ = other.args_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerForwardCallInput Clone() { + return new ManagerForwardCallInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "contract_address" field. + public const int ContractAddressFieldNumber = 2; + private global::AElf.Types.Address contractAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address ContractAddress { + get { return contractAddress_; } + set { + contractAddress_ = value; + } + } + + /// Field number for the "method_name" field. + public const int MethodNameFieldNumber = 3; + private string methodName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string MethodName { + get { return methodName_; } + set { + methodName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "args" field. + public const int ArgsFieldNumber = 4; + private pb::ByteString args_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Args { + get { return args_; } + set { + args_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerForwardCallInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerForwardCallInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(ContractAddress, other.ContractAddress)) return false; + if (MethodName != other.MethodName) return false; + if (Args != other.Args) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (contractAddress_ != null) hash ^= ContractAddress.GetHashCode(); + if (MethodName.Length != 0) hash ^= MethodName.GetHashCode(); + if (Args.Length != 0) hash ^= Args.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (contractAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ContractAddress); + } + if (MethodName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(MethodName); + } + if (Args.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(Args); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (contractAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ContractAddress); + } + if (MethodName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(MethodName); + } + if (Args.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(Args); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (contractAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ContractAddress); + } + if (MethodName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodName); + } + if (Args.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Args); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerForwardCallInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.contractAddress_ != null) { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + ContractAddress.MergeFrom(other.ContractAddress); + } + if (other.MethodName.Length != 0) { + MethodName = other.MethodName; + } + if (other.Args.Length != 0) { + Args = other.Args; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 26: { + MethodName = input.ReadString(); + break; + } + case 34: { + Args = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (contractAddress_ == null) { + ContractAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(ContractAddress); + break; + } + case 26: { + MethodName = input.ReadString(); + break; + } + case 34: { + Args = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ManagerTransferInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerTransferInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[31]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferInput(ManagerTransferInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferInput Clone() { + return new ManagerTransferInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 2; + private global::AElf.Types.Address to_; + /// + /// The receiver of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 3; + private string symbol_ = ""; + /// + /// The token symbol to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 4; + private long amount_; + /// + /// The amount to to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 5; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerTransferInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerTransferInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (to_ != null) { + output.WriteRawTag(18); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerTransferInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 26: { + Symbol = input.ReadString(); + break; + } + case 32: { + Amount = input.ReadInt64(); + break; + } + case 42: { + Memo = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ManagerTransferFromInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerTransferFromInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[32]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferFromInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferFromInput(ManagerTransferFromInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + from_ = other.from_ != null ? other.from_.Clone() : null; + to_ = other.to_ != null ? other.to_.Clone() : null; + symbol_ = other.symbol_; + amount_ = other.amount_; + memo_ = other.memo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerTransferFromInput Clone() { + return new ManagerTransferFromInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 2; + private global::AElf.Types.Address from_; + /// + /// The source address of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to" field. + public const int ToFieldNumber = 3; + private global::AElf.Types.Address to_; + /// + /// The destination address of the token. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address To { + get { return to_; } + set { + to_ = value; + } + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 4; + private string symbol_ = ""; + /// + /// The symbol of the token to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 5; + private long amount_; + /// + /// The amount to transfer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "memo" field. + public const int MemoFieldNumber = 6; + private string memo_ = ""; + /// + /// The memo. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Memo { + get { return memo_; } + set { + memo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerTransferFromInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerTransferFromInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(From, other.From)) return false; + if (!object.Equals(To, other.To)) return false; + if (Symbol != other.Symbol) return false; + if (Amount != other.Amount) return false; + if (Memo != other.Memo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (from_ != null) hash ^= From.GetHashCode(); + if (to_ != null) hash ^= To.GetHashCode(); + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (Amount != 0L) hash ^= Amount.GetHashCode(); + if (Memo.Length != 0) hash ^= Memo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (from_ != null) { + output.WriteRawTag(18); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(26); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(50); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (from_ != null) { + output.WriteRawTag(18); + output.WriteMessage(From); + } + if (to_ != null) { + output.WriteRawTag(26); + output.WriteMessage(To); + } + if (Symbol.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Symbol); + } + if (Amount != 0L) { + output.WriteRawTag(40); + output.WriteInt64(Amount); + } + if (Memo.Length != 0) { + output.WriteRawTag(50); + output.WriteString(Memo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (to_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(To); + } + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (Amount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Amount); + } + if (Memo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Memo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerTransferFromInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.from_ != null) { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + From.MergeFrom(other.From); + } + if (other.to_ != null) { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + To.MergeFrom(other.To); + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.Amount != 0L) { + Amount = other.Amount; + } + if (other.Memo.Length != 0) { + Memo = other.Memo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 26: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 34: { + Symbol = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + case 50: { + Memo = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (from_ == null) { + From = new global::AElf.Types.Address(); + } + input.ReadMessage(From); + break; + } + case 26: { + if (to_ == null) { + To = new global::AElf.Types.Address(); + } + input.ReadMessage(To); + break; + } + case 34: { + Symbol = input.ReadString(); + break; + } + case 40: { + Amount = input.ReadInt64(); + break; + } + case 50: { + Memo = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GetHolderInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetHolderInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[33]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoInput(GetHolderInfoInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + loginGuardianIdentifierHash_ = other.loginGuardianIdentifierHash_ != null ? other.loginGuardianIdentifierHash_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoInput Clone() { + return new GetHolderInfoInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "login_guardian_identifier_hash" field. + public const int LoginGuardianIdentifierHashFieldNumber = 2; + private global::AElf.Types.Hash loginGuardianIdentifierHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash LoginGuardianIdentifierHash { + get { return loginGuardianIdentifierHash_; } + set { + loginGuardianIdentifierHash_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetHolderInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetHolderInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(LoginGuardianIdentifierHash, other.LoginGuardianIdentifierHash)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (loginGuardianIdentifierHash_ != null) hash ^= LoginGuardianIdentifierHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (loginGuardianIdentifierHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetHolderInfoInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.loginGuardianIdentifierHash_ != null) { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + LoginGuardianIdentifierHash.MergeFrom(other.LoginGuardianIdentifierHash); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + } + } + } + #endif + + } + + public partial class GetHolderInfoOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetHolderInfoOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[34]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoOutput(GetHolderInfoOutput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + guardianList_ = other.guardianList_ != null ? other.guardianList_.Clone() : null; + managerInfos_ = other.managerInfos_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetHolderInfoOutput Clone() { + return new GetHolderInfoOutput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "guardian_list" field. + public const int GuardianListFieldNumber = 3; + private global::Portkey.Contracts.CA.GuardianList guardianList_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.GuardianList GuardianList { + get { return guardianList_; } + set { + guardianList_ = value; + } + } + + /// Field number for the "manager_infos" field. + public const int ManagerInfosFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_managerInfos_codec + = pb::FieldCodec.ForMessage(34, global::Portkey.Contracts.CA.ManagerInfo.Parser); + private readonly pbc::RepeatedField managerInfos_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ManagerInfos { + get { return managerInfos_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetHolderInfoOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetHolderInfoOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(GuardianList, other.GuardianList)) return false; + if(!managerInfos_.Equals(other.managerInfos_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (guardianList_ != null) hash ^= GuardianList.GetHashCode(); + hash ^= managerInfos_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianList_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianList); + } + managerInfos_.WriteTo(output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianList_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianList); + } + managerInfos_.WriteTo(ref output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (guardianList_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianList); + } + size += managerInfos_.CalculateSize(_repeated_managerInfos_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetHolderInfoOutput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.guardianList_ != null) { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + GuardianList.MergeFrom(other.GuardianList); + } + managerInfos_.Add(other.managerInfos_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + input.ReadMessage(GuardianList); + break; + } + case 34: { + managerInfos_.AddEntriesFrom(input, _repeated_managerInfos_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianList_ == null) { + GuardianList = new global::Portkey.Contracts.CA.GuardianList(); + } + input.ReadMessage(GuardianList); + break; + } + case 34: { + managerInfos_.AddEntriesFrom(ref input, _repeated_managerInfos_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class SocialRecoveryInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SocialRecoveryInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[35]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SocialRecoveryInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SocialRecoveryInput(SocialRecoveryInput other) : this() { + loginGuardianIdentifierHash_ = other.loginGuardianIdentifierHash_ != null ? other.loginGuardianIdentifierHash_.Clone() : null; + guardiansApproved_ = other.guardiansApproved_.Clone(); + managerInfo_ = other.managerInfo_ != null ? other.managerInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SocialRecoveryInput Clone() { + return new SocialRecoveryInput(this); + } + + /// Field number for the "login_guardian_identifier_hash" field. + public const int LoginGuardianIdentifierHashFieldNumber = 1; + private global::AElf.Types.Hash loginGuardianIdentifierHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash LoginGuardianIdentifierHash { + get { return loginGuardianIdentifierHash_; } + set { + loginGuardianIdentifierHash_ = value; + } + } + + /// Field number for the "guardians_approved" field. + public const int GuardiansApprovedFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_guardiansApproved_codec + = pb::FieldCodec.ForMessage(18, global::Portkey.Contracts.CA.GuardianInfo.Parser); + private readonly pbc::RepeatedField guardiansApproved_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GuardiansApproved { + get { return guardiansApproved_; } + } + + /// Field number for the "manager_info" field. + public const int ManagerInfoFieldNumber = 3; + private global::Portkey.Contracts.CA.ManagerInfo managerInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfo ManagerInfo { + get { return managerInfo_; } + set { + managerInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SocialRecoveryInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SocialRecoveryInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(LoginGuardianIdentifierHash, other.LoginGuardianIdentifierHash)) return false; + if(!guardiansApproved_.Equals(other.guardiansApproved_)) return false; + if (!object.Equals(ManagerInfo, other.ManagerInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (loginGuardianIdentifierHash_ != null) hash ^= LoginGuardianIdentifierHash.GetHashCode(); + hash ^= guardiansApproved_.GetHashCode(); + if (managerInfo_ != null) hash ^= ManagerInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(LoginGuardianIdentifierHash); + } + guardiansApproved_.WriteTo(output, _repeated_guardiansApproved_codec); + if (managerInfo_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ManagerInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(LoginGuardianIdentifierHash); + } + guardiansApproved_.WriteTo(ref output, _repeated_guardiansApproved_codec); + if (managerInfo_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ManagerInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (loginGuardianIdentifierHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardianIdentifierHash); + } + size += guardiansApproved_.CalculateSize(_repeated_guardiansApproved_codec); + if (managerInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SocialRecoveryInput other) { + if (other == null) { + return; + } + if (other.loginGuardianIdentifierHash_ != null) { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + LoginGuardianIdentifierHash.MergeFrom(other.LoginGuardianIdentifierHash); + } + guardiansApproved_.Add(other.guardiansApproved_); + if (other.managerInfo_ != null) { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + ManagerInfo.MergeFrom(other.ManagerInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + case 18: { + guardiansApproved_.AddEntriesFrom(input, _repeated_guardiansApproved_codec); + break; + } + case 26: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + case 18: { + guardiansApproved_.AddEntriesFrom(ref input, _repeated_guardiansApproved_codec); + break; + } + case 26: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AddManagerInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddManagerInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddManagerInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddManagerInfoInput(AddManagerInfoInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + managerInfo_ = other.managerInfo_ != null ? other.managerInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddManagerInfoInput Clone() { + return new AddManagerInfoInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "manager_info" field. + public const int ManagerInfoFieldNumber = 2; + private global::Portkey.Contracts.CA.ManagerInfo managerInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfo ManagerInfo { + get { return managerInfo_; } + set { + managerInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddManagerInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddManagerInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(ManagerInfo, other.ManagerInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (managerInfo_ != null) hash ^= ManagerInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (managerInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddManagerInfoInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.managerInfo_ != null) { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + ManagerInfo.MergeFrom(other.ManagerInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveManagerInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveManagerInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveManagerInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveManagerInfoInput(RemoveManagerInfoInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveManagerInfoInput Clone() { + return new RemoveManagerInfoInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveManagerInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveManagerInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveManagerInfoInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveOtherManagerInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveOtherManagerInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[38]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveOtherManagerInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveOtherManagerInfoInput(RemoveOtherManagerInfoInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + managerInfo_ = other.managerInfo_ != null ? other.managerInfo_.Clone() : null; + guardiansApproved_ = other.guardiansApproved_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveOtherManagerInfoInput Clone() { + return new RemoveOtherManagerInfoInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "manager_info" field. + public const int ManagerInfoFieldNumber = 2; + private global::Portkey.Contracts.CA.ManagerInfo managerInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfo ManagerInfo { + get { return managerInfo_; } + set { + managerInfo_ = value; + } + } + + /// Field number for the "guardians_approved" field. + public const int GuardiansApprovedFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_guardiansApproved_codec + = pb::FieldCodec.ForMessage(26, global::Portkey.Contracts.CA.GuardianInfo.Parser); + private readonly pbc::RepeatedField guardiansApproved_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GuardiansApproved { + get { return guardiansApproved_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveOtherManagerInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveOtherManagerInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(ManagerInfo, other.ManagerInfo)) return false; + if(!guardiansApproved_.Equals(other.guardiansApproved_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (managerInfo_ != null) hash ^= ManagerInfo.GetHashCode(); + hash ^= guardiansApproved_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + guardiansApproved_.WriteTo(output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (managerInfo_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ManagerInfo); + } + guardiansApproved_.WriteTo(ref output, _repeated_guardiansApproved_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (managerInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfo); + } + size += guardiansApproved_.CalculateSize(_repeated_guardiansApproved_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveOtherManagerInfoInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.managerInfo_ != null) { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + ManagerInfo.MergeFrom(other.ManagerInfo); + } + guardiansApproved_.Add(other.guardiansApproved_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(input, _repeated_guardiansApproved_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (managerInfo_ == null) { + ManagerInfo = new global::Portkey.Contracts.CA.ManagerInfo(); + } + input.ReadMessage(ManagerInfo); + break; + } + case 26: { + guardiansApproved_.AddEntriesFrom(ref input, _repeated_guardiansApproved_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class UpdateManagerInfosInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UpdateManagerInfosInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[39]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateManagerInfosInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateManagerInfosInput(UpdateManagerInfosInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + managerInfos_ = other.managerInfos_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UpdateManagerInfosInput Clone() { + return new UpdateManagerInfosInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "manager_infos" field. + public const int ManagerInfosFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_managerInfos_codec + = pb::FieldCodec.ForMessage(18, global::Portkey.Contracts.CA.ManagerInfo.Parser); + private readonly pbc::RepeatedField managerInfos_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ManagerInfos { + get { return managerInfos_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UpdateManagerInfosInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UpdateManagerInfosInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if(!managerInfos_.Equals(other.managerInfos_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + hash ^= managerInfos_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + managerInfos_.WriteTo(output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + managerInfos_.WriteTo(ref output, _repeated_managerInfos_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + size += managerInfos_.CalculateSize(_repeated_managerInfos_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UpdateManagerInfosInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + managerInfos_.Add(other.managerInfos_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(input, _repeated_managerInfos_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(ref input, _repeated_managerInfos_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AddVerifierServerEndPointsInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddVerifierServerEndPointsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[40]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddVerifierServerEndPointsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddVerifierServerEndPointsInput(AddVerifierServerEndPointsInput other) : this() { + name_ = other.name_; + imageUrl_ = other.imageUrl_; + endPoints_ = other.endPoints_.Clone(); + verifierAddressList_ = other.verifierAddressList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddVerifierServerEndPointsInput Clone() { + return new AddVerifierServerEndPointsInput(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// If not exists, add; If does, insert + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "image_url" field. + public const int ImageUrlFieldNumber = 2; + private string imageUrl_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ImageUrl { + get { return imageUrl_; } + set { + imageUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "end_points" field. + public const int EndPointsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_endPoints_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField endPoints_ = new pbc::RepeatedField(); + /// + /// Add all, ignore if has duplicates + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField EndPoints { + get { return endPoints_; } + } + + /// Field number for the "verifier_address_list" field. + public const int VerifierAddressListFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_verifierAddressList_codec + = pb::FieldCodec.ForMessage(34, global::AElf.Types.Address.Parser); + private readonly pbc::RepeatedField verifierAddressList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VerifierAddressList { + get { return verifierAddressList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddVerifierServerEndPointsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddVerifierServerEndPointsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (ImageUrl != other.ImageUrl) return false; + if(!endPoints_.Equals(other.endPoints_)) return false; + if(!verifierAddressList_.Equals(other.verifierAddressList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (ImageUrl.Length != 0) hash ^= ImageUrl.GetHashCode(); + hash ^= endPoints_.GetHashCode(); + hash ^= verifierAddressList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (ImageUrl.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ImageUrl); + } + endPoints_.WriteTo(output, _repeated_endPoints_codec); + verifierAddressList_.WriteTo(output, _repeated_verifierAddressList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (ImageUrl.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ImageUrl); + } + endPoints_.WriteTo(ref output, _repeated_endPoints_codec); + verifierAddressList_.WriteTo(ref output, _repeated_verifierAddressList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (ImageUrl.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ImageUrl); + } + size += endPoints_.CalculateSize(_repeated_endPoints_codec); + size += verifierAddressList_.CalculateSize(_repeated_verifierAddressList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddVerifierServerEndPointsInput other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.ImageUrl.Length != 0) { + ImageUrl = other.ImageUrl; + } + endPoints_.Add(other.endPoints_); + verifierAddressList_.Add(other.verifierAddressList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + ImageUrl = input.ReadString(); + break; + } + case 26: { + endPoints_.AddEntriesFrom(input, _repeated_endPoints_codec); + break; + } + case 34: { + verifierAddressList_.AddEntriesFrom(input, _repeated_verifierAddressList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + ImageUrl = input.ReadString(); + break; + } + case 26: { + endPoints_.AddEntriesFrom(ref input, _repeated_endPoints_codec); + break; + } + case 34: { + verifierAddressList_.AddEntriesFrom(ref input, _repeated_verifierAddressList_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveVerifierServerInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveVerifierServerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[41]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerInput(RemoveVerifierServerInput other) : this() { + id_ = other.id_ != null ? other.id_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerInput Clone() { + return new RemoveVerifierServerInput(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::AElf.Types.Hash id_; + /// + /// If not exists, add; If does, insert + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash Id { + get { return id_; } + set { + id_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveVerifierServerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveVerifierServerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Id, other.Id)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (id_ != null) hash ^= Id.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveVerifierServerInput other) { + if (other == null) { + return; + } + if (other.id_ != null) { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + Id.MergeFrom(other.Id); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveVerifierServerEndPointsInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveVerifierServerEndPointsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[42]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerEndPointsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerEndPointsInput(RemoveVerifierServerEndPointsInput other) : this() { + id_ = other.id_ != null ? other.id_.Clone() : null; + endPoints_ = other.endPoints_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveVerifierServerEndPointsInput Clone() { + return new RemoveVerifierServerEndPointsInput(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::AElf.Types.Hash id_; + /// + /// If not exists, ignore + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "end_points" field. + public const int EndPointsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_endPoints_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField endPoints_ = new pbc::RepeatedField(); + /// + /// Remove all, ignore if do not exist + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField EndPoints { + get { return endPoints_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveVerifierServerEndPointsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveVerifierServerEndPointsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Id, other.Id)) return false; + if(!endPoints_.Equals(other.endPoints_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (id_ != null) hash ^= Id.GetHashCode(); + hash ^= endPoints_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + endPoints_.WriteTo(output, _repeated_endPoints_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (id_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Id); + } + endPoints_.WriteTo(ref output, _repeated_endPoints_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); + } + size += endPoints_.CalculateSize(_repeated_endPoints_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveVerifierServerEndPointsInput other) { + if (other == null) { + return; + } + if (other.id_ != null) { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + Id.MergeFrom(other.Id); + } + endPoints_.Add(other.endPoints_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + endPoints_.AddEntriesFrom(input, _repeated_endPoints_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (id_ == null) { + Id = new global::AElf.Types.Hash(); + } + input.ReadMessage(Id); + break; + } + case 18: { + endPoints_.AddEntriesFrom(ref input, _repeated_endPoints_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AddCAServerInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddCAServerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[43]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddCAServerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddCAServerInput(AddCAServerInput other) : this() { + name_ = other.name_; + endPoints_ = other.endPoints_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AddCAServerInput Clone() { + return new AddCAServerInput(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "end_points" field. + public const int EndPointsFieldNumber = 2; + private string endPoints_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string EndPoints { + get { return endPoints_; } + set { + endPoints_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AddCAServerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AddCAServerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (EndPoints != other.EndPoints) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (EndPoints.Length != 0) hash ^= EndPoints.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (EndPoints.Length != 0) { + output.WriteRawTag(18); + output.WriteString(EndPoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (EndPoints.Length != 0) { + output.WriteRawTag(18); + output.WriteString(EndPoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (EndPoints.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(EndPoints); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AddCAServerInput other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.EndPoints.Length != 0) { + EndPoints = other.EndPoints; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + EndPoints = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + EndPoints = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class RemoveCAServerInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveCAServerInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[44]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveCAServerInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveCAServerInput(RemoveCAServerInput other) : this() { + name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RemoveCAServerInput Clone() { + return new RemoveCAServerInput(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RemoveCAServerInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RemoveCAServerInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RemoveCAServerInput other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class GetVerifierServersOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetVerifierServersOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[45]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVerifierServersOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVerifierServersOutput(GetVerifierServersOutput other) : this() { + verifierServers_ = other.verifierServers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVerifierServersOutput Clone() { + return new GetVerifierServersOutput(this); + } + + /// Field number for the "verifier_servers" field. + public const int VerifierServersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_verifierServers_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.VerifierServer.Parser); + private readonly pbc::RepeatedField verifierServers_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VerifierServers { + get { return verifierServers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetVerifierServersOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetVerifierServersOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!verifierServers_.Equals(other.verifierServers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= verifierServers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + verifierServers_.WriteTo(output, _repeated_verifierServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + verifierServers_.WriteTo(ref output, _repeated_verifierServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += verifierServers_.CalculateSize(_repeated_verifierServers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetVerifierServersOutput other) { + if (other == null) { + return; + } + verifierServers_.Add(other.verifierServers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + verifierServers_.AddEntriesFrom(input, _repeated_verifierServers_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + verifierServers_.AddEntriesFrom(ref input, _repeated_verifierServers_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class GetCAServersOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetCAServersOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[46]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetCAServersOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetCAServersOutput(GetCAServersOutput other) : this() { + caServers_ = other.caServers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetCAServersOutput Clone() { + return new GetCAServersOutput(this); + } + + /// Field number for the "ca_servers" field. + public const int CaServersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_caServers_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.CAServer.Parser); + private readonly pbc::RepeatedField caServers_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CaServers { + get { return caServers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetCAServersOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetCAServersOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!caServers_.Equals(other.caServers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= caServers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + caServers_.WriteTo(output, _repeated_caServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + caServers_.WriteTo(ref output, _repeated_caServers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += caServers_.CalculateSize(_repeated_caServers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetCAServersOutput other) { + if (other == null) { + return; + } + caServers_.Add(other.caServers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + caServers_.AddEntriesFrom(input, _repeated_caServers_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + caServers_.AddEntriesFrom(ref input, _repeated_caServers_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ValidateCAHolderInfoWithManagerInfosExistsInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateCAHolderInfoWithManagerInfosExistsInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[47]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateCAHolderInfoWithManagerInfosExistsInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateCAHolderInfoWithManagerInfosExistsInput(ValidateCAHolderInfoWithManagerInfosExistsInput other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + managerInfos_ = other.managerInfos_.Clone(); + loginGuardians_ = other.loginGuardians_.Clone(); + notLoginGuardians_ = other.notLoginGuardians_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateCAHolderInfoWithManagerInfosExistsInput Clone() { + return new ValidateCAHolderInfoWithManagerInfosExistsInput(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "manager_infos" field. + public const int ManagerInfosFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_managerInfos_codec + = pb::FieldCodec.ForMessage(18, global::Portkey.Contracts.CA.ManagerInfo.Parser); + private readonly pbc::RepeatedField managerInfos_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ManagerInfos { + get { return managerInfos_; } + } + + /// Field number for the "login_guardians" field. + public const int LoginGuardiansFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_loginGuardians_codec + = pb::FieldCodec.ForMessage(26, global::AElf.Types.Hash.Parser); + private readonly pbc::RepeatedField loginGuardians_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LoginGuardians { + get { return loginGuardians_; } + } + + /// Field number for the "not_login_guardians" field. + public const int NotLoginGuardiansFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_notLoginGuardians_codec + = pb::FieldCodec.ForMessage(34, global::AElf.Types.Hash.Parser); + private readonly pbc::RepeatedField notLoginGuardians_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField NotLoginGuardians { + get { return notLoginGuardians_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ValidateCAHolderInfoWithManagerInfosExistsInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ValidateCAHolderInfoWithManagerInfosExistsInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if(!managerInfos_.Equals(other.managerInfos_)) return false; + if(!loginGuardians_.Equals(other.loginGuardians_)) return false; + if(!notLoginGuardians_.Equals(other.notLoginGuardians_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + hash ^= managerInfos_.GetHashCode(); + hash ^= loginGuardians_.GetHashCode(); + hash ^= notLoginGuardians_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + managerInfos_.WriteTo(output, _repeated_managerInfos_codec); + loginGuardians_.WriteTo(output, _repeated_loginGuardians_codec); + notLoginGuardians_.WriteTo(output, _repeated_notLoginGuardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + managerInfos_.WriteTo(ref output, _repeated_managerInfos_codec); + loginGuardians_.WriteTo(ref output, _repeated_loginGuardians_codec); + notLoginGuardians_.WriteTo(ref output, _repeated_notLoginGuardians_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + size += managerInfos_.CalculateSize(_repeated_managerInfos_codec); + size += loginGuardians_.CalculateSize(_repeated_loginGuardians_codec); + size += notLoginGuardians_.CalculateSize(_repeated_notLoginGuardians_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ValidateCAHolderInfoWithManagerInfosExistsInput other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + managerInfos_.Add(other.managerInfos_); + loginGuardians_.Add(other.loginGuardians_); + notLoginGuardians_.Add(other.notLoginGuardians_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(input, _repeated_managerInfos_codec); + break; + } + case 26: { + loginGuardians_.AddEntriesFrom(input, _repeated_loginGuardians_codec); + break; + } + case 34: { + notLoginGuardians_.AddEntriesFrom(input, _repeated_notLoginGuardians_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + managerInfos_.AddEntriesFrom(ref input, _repeated_managerInfos_codec); + break; + } + case 26: { + loginGuardians_.AddEntriesFrom(ref input, _repeated_loginGuardians_codec); + break; + } + case 34: { + notLoginGuardians_.AddEntriesFrom(ref input, _repeated_notLoginGuardians_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class VerificationTransactionInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerificationTransactionInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[48]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationTransactionInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationTransactionInfo(VerificationTransactionInfo other) : this() { + fromChainId_ = other.fromChainId_; + parentChainHeight_ = other.parentChainHeight_; + transactionBytes_ = other.transactionBytes_; + merklePath_ = other.merklePath_ != null ? other.merklePath_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerificationTransactionInfo Clone() { + return new VerificationTransactionInfo(this); + } + + /// Field number for the "from_chain_id" field. + public const int FromChainIdFieldNumber = 1; + private int fromChainId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FromChainId { + get { return fromChainId_; } + set { + fromChainId_ = value; + } + } + + /// Field number for the "parent_chain_height" field. + public const int ParentChainHeightFieldNumber = 2; + private long parentChainHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ParentChainHeight { + get { return parentChainHeight_; } + set { + parentChainHeight_ = value; + } + } + + /// Field number for the "transaction_bytes" field. + public const int TransactionBytesFieldNumber = 3; + private pb::ByteString transactionBytes_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString TransactionBytes { + get { return transactionBytes_; } + set { + transactionBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "merkle_path" field. + public const int MerklePathFieldNumber = 4; + private global::AElf.Types.MerklePath merklePath_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.MerklePath MerklePath { + get { return merklePath_; } + set { + merklePath_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerificationTransactionInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerificationTransactionInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromChainId != other.FromChainId) return false; + if (ParentChainHeight != other.ParentChainHeight) return false; + if (TransactionBytes != other.TransactionBytes) return false; + if (!object.Equals(MerklePath, other.MerklePath)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (FromChainId != 0) hash ^= FromChainId.GetHashCode(); + if (ParentChainHeight != 0L) hash ^= ParentChainHeight.GetHashCode(); + if (TransactionBytes.Length != 0) hash ^= TransactionBytes.GetHashCode(); + if (merklePath_ != null) hash ^= MerklePath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FromChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FromChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(TransactionBytes); + } + if (merklePath_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MerklePath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FromChainId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FromChainId); + } + if (ParentChainHeight != 0L) { + output.WriteRawTag(16); + output.WriteInt64(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(TransactionBytes); + } + if (merklePath_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MerklePath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (FromChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FromChainId); + } + if (ParentChainHeight != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ParentChainHeight); + } + if (TransactionBytes.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(TransactionBytes); + } + if (merklePath_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MerklePath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerificationTransactionInfo other) { + if (other == null) { + return; + } + if (other.FromChainId != 0) { + FromChainId = other.FromChainId; + } + if (other.ParentChainHeight != 0L) { + ParentChainHeight = other.ParentChainHeight; + } + if (other.TransactionBytes.Length != 0) { + TransactionBytes = other.TransactionBytes; + } + if (other.merklePath_ != null) { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + MerklePath.MergeFrom(other.MerklePath); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FromChainId = input.ReadInt32(); + break; + } + case 16: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 26: { + TransactionBytes = input.ReadBytes(); + break; + } + case 34: { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePath); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FromChainId = input.ReadInt32(); + break; + } + case 16: { + ParentChainHeight = input.ReadInt64(); + break; + } + case 26: { + TransactionBytes = input.ReadBytes(); + break; + } + case 34: { + if (merklePath_ == null) { + MerklePath = new global::AElf.Types.MerklePath(); + } + input.ReadMessage(MerklePath); + break; + } + } + } + } + #endif + + } + + internal sealed partial class SyncHolderInfoInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SyncHolderInfoInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[49]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SyncHolderInfoInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SyncHolderInfoInput(SyncHolderInfoInput other) : this() { + verificationTransactionInfo_ = other.verificationTransactionInfo_ != null ? other.verificationTransactionInfo_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SyncHolderInfoInput Clone() { + return new SyncHolderInfoInput(this); + } + + /// Field number for the "verification_transaction_info" field. + public const int VerificationTransactionInfoFieldNumber = 1; + private global::Portkey.Contracts.CA.VerificationTransactionInfo verificationTransactionInfo_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.VerificationTransactionInfo VerificationTransactionInfo { + get { return verificationTransactionInfo_; } + set { + verificationTransactionInfo_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SyncHolderInfoInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SyncHolderInfoInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(VerificationTransactionInfo, other.VerificationTransactionInfo)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (verificationTransactionInfo_ != null) hash ^= VerificationTransactionInfo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (verificationTransactionInfo_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerificationTransactionInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (verificationTransactionInfo_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerificationTransactionInfo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (verificationTransactionInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerificationTransactionInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SyncHolderInfoInput other) { + if (other == null) { + return; + } + if (other.verificationTransactionInfo_ != null) { + if (verificationTransactionInfo_ == null) { + VerificationTransactionInfo = new global::Portkey.Contracts.CA.VerificationTransactionInfo(); + } + VerificationTransactionInfo.MergeFrom(other.VerificationTransactionInfo); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (verificationTransactionInfo_ == null) { + VerificationTransactionInfo = new global::Portkey.Contracts.CA.VerificationTransactionInfo(); + } + input.ReadMessage(VerificationTransactionInfo); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (verificationTransactionInfo_ == null) { + VerificationTransactionInfo = new global::Portkey.Contracts.CA.VerificationTransactionInfo(); + } + input.ReadMessage(VerificationTransactionInfo); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ValidateStrategyInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateStrategyInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[50]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyInput(ValidateStrategyInput other) : this() { + strategyNode_ = other.strategyNode_ != null ? other.strategyNode_.Clone() : null; + variables_ = other.variables_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyInput Clone() { + return new ValidateStrategyInput(this); + } + + /// Field number for the "strategy_node" field. + public const int StrategyNodeFieldNumber = 1; + private global::Portkey.Contracts.CA.StrategyNode strategyNode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.StrategyNode StrategyNode { + get { return strategyNode_; } + set { + strategyNode_ = value; + } + } + + /// Field number for the "variables" field. + public const int VariablesFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_variables_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForInt64(16, 0L), 18); + private readonly pbc::MapField variables_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField Variables { + get { return variables_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ValidateStrategyInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ValidateStrategyInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(StrategyNode, other.StrategyNode)) return false; + if (!Variables.Equals(other.Variables)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (strategyNode_ != null) hash ^= StrategyNode.GetHashCode(); + hash ^= Variables.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (strategyNode_ != null) { + output.WriteRawTag(10); + output.WriteMessage(StrategyNode); + } + variables_.WriteTo(output, _map_variables_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (strategyNode_ != null) { + output.WriteRawTag(10); + output.WriteMessage(StrategyNode); + } + variables_.WriteTo(ref output, _map_variables_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (strategyNode_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StrategyNode); + } + size += variables_.CalculateSize(_map_variables_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ValidateStrategyInput other) { + if (other == null) { + return; + } + if (other.strategyNode_ != null) { + if (strategyNode_ == null) { + StrategyNode = new global::Portkey.Contracts.CA.StrategyNode(); + } + StrategyNode.MergeFrom(other.StrategyNode); + } + variables_.Add(other.variables_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (strategyNode_ == null) { + StrategyNode = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(StrategyNode); + break; + } + case 18: { + variables_.AddEntriesFrom(input, _map_variables_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (strategyNode_ == null) { + StrategyNode = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(StrategyNode); + break; + } + case 18: { + variables_.AddEntriesFrom(ref input, _map_variables_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ValidateStrategyOutput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValidateStrategyOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[51]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyOutput(ValidateStrategyOutput other) : this() { + boolResult_ = other.boolResult_; + int64Result_ = other.int64Result_; + strategyOutput_ = other.strategyOutput_ != null ? other.strategyOutput_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValidateStrategyOutput Clone() { + return new ValidateStrategyOutput(this); + } + + /// Field number for the "bool_result" field. + public const int BoolResultFieldNumber = 1; + private bool boolResult_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BoolResult { + get { return boolResult_; } + set { + boolResult_ = value; + } + } + + /// Field number for the "int64_result" field. + public const int Int64ResultFieldNumber = 2; + private long int64Result_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Result { + get { return int64Result_; } + set { + int64Result_ = value; + } + } + + /// Field number for the "strategy_output" field. + public const int StrategyOutputFieldNumber = 3; + private global::Portkey.Contracts.CA.StrategyNode strategyOutput_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.StrategyNode StrategyOutput { + get { return strategyOutput_; } + set { + strategyOutput_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ValidateStrategyOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ValidateStrategyOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BoolResult != other.BoolResult) return false; + if (Int64Result != other.Int64Result) return false; + if (!object.Equals(StrategyOutput, other.StrategyOutput)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (BoolResult != false) hash ^= BoolResult.GetHashCode(); + if (Int64Result != 0L) hash ^= Int64Result.GetHashCode(); + if (strategyOutput_ != null) hash ^= StrategyOutput.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BoolResult != false) { + output.WriteRawTag(8); + output.WriteBool(BoolResult); + } + if (Int64Result != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Int64Result); + } + if (strategyOutput_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StrategyOutput); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BoolResult != false) { + output.WriteRawTag(8); + output.WriteBool(BoolResult); + } + if (Int64Result != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Int64Result); + } + if (strategyOutput_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StrategyOutput); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (BoolResult != false) { + size += 1 + 1; + } + if (Int64Result != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Int64Result); + } + if (strategyOutput_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StrategyOutput); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ValidateStrategyOutput other) { + if (other == null) { + return; + } + if (other.BoolResult != false) { + BoolResult = other.BoolResult; + } + if (other.Int64Result != 0L) { + Int64Result = other.Int64Result; + } + if (other.strategyOutput_ != null) { + if (strategyOutput_ == null) { + StrategyOutput = new global::Portkey.Contracts.CA.StrategyNode(); + } + StrategyOutput.MergeFrom(other.StrategyOutput); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BoolResult = input.ReadBool(); + break; + } + case 16: { + Int64Result = input.ReadInt64(); + break; + } + case 26: { + if (strategyOutput_ == null) { + StrategyOutput = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(StrategyOutput); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + BoolResult = input.ReadBool(); + break; + } + case 16: { + Int64Result = input.ReadInt64(); + break; + } + case 26: { + if (strategyOutput_ == null) { + StrategyOutput = new global::Portkey.Contracts.CA.StrategyNode(); + } + input.ReadMessage(StrategyOutput); + break; + } + } + } + } + #endif + + } + + /// + /// LogEvent + /// CAHolder created + /// + internal sealed partial class CAHolderCreated : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAHolderCreated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[52]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderCreated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderCreated(CAHolderCreated other) : this() { + creator_ = other.creator_ != null ? other.creator_.Clone() : null; + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderCreated Clone() { + return new CAHolderCreated(this); + } + + /// Field number for the "creator" field. + public const int CreatorFieldNumber = 1; + private global::AElf.Types.Address creator_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Creator { + get { return creator_; } + set { + creator_ = value; + } + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 2; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 3; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 4; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 5; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAHolderCreated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAHolderCreated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Creator, other.Creator)) return false; + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (creator_ != null) hash ^= Creator.GetHashCode(); + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (creator_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Creator); + } + if (caHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(42); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (creator_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Creator); + } + if (caHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(42); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (creator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); + } + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAHolderCreated other) { + if (other == null) { + return; + } + if (other.creator_ != null) { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + Creator.MergeFrom(other.Creator); + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 18: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 26: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 34: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 42: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 18: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 26: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 34: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 42: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + ///Guardian added + /// + internal sealed partial class GuardianAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GuardianAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[53]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianAdded(GuardianAdded other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + guardianAdded_ = other.guardianAdded_ != null ? other.guardianAdded_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianAdded Clone() { + return new GuardianAdded(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "guardian_added" field. + public const int GuardianAdded_FieldNumber = 3; + private global::Portkey.Contracts.CA.Guardian guardianAdded_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian GuardianAdded_ { + get { return guardianAdded_; } + set { + guardianAdded_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GuardianAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GuardianAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(GuardianAdded_, other.GuardianAdded_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (guardianAdded_ != null) hash ^= GuardianAdded_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianAdded_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianAdded_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianAdded_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianAdded_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (guardianAdded_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianAdded_); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GuardianAdded other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.guardianAdded_ != null) { + if (guardianAdded_ == null) { + GuardianAdded_ = new global::Portkey.Contracts.CA.Guardian(); + } + GuardianAdded_.MergeFrom(other.GuardianAdded_); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianAdded_ == null) { + GuardianAdded_ = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianAdded_); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianAdded_ == null) { + GuardianAdded_ = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianAdded_); + break; + } + } + } + } + #endif + + } + + /// + ///Guardian removed + /// + internal sealed partial class GuardianRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GuardianRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[54]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianRemoved(GuardianRemoved other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + guardianRemoved_ = other.guardianRemoved_ != null ? other.guardianRemoved_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianRemoved Clone() { + return new GuardianRemoved(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "guardian_removed" field. + public const int GuardianRemoved_FieldNumber = 3; + private global::Portkey.Contracts.CA.Guardian guardianRemoved_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian GuardianRemoved_ { + get { return guardianRemoved_; } + set { + guardianRemoved_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GuardianRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GuardianRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(GuardianRemoved_, other.GuardianRemoved_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (guardianRemoved_ != null) hash ^= GuardianRemoved_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianRemoved_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianRemoved_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianRemoved_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianRemoved_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (guardianRemoved_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianRemoved_); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GuardianRemoved other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.guardianRemoved_ != null) { + if (guardianRemoved_ == null) { + GuardianRemoved_ = new global::Portkey.Contracts.CA.Guardian(); + } + GuardianRemoved_.MergeFrom(other.GuardianRemoved_); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianRemoved_ == null) { + GuardianRemoved_ = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianRemoved_); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianRemoved_ == null) { + GuardianRemoved_ = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianRemoved_); + break; + } + } + } + } + #endif + + } + + /// + ///Guardian updated + /// + internal sealed partial class GuardianUpdated : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GuardianUpdated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[55]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianUpdated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianUpdated(GuardianUpdated other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + guardianUpdatedPre_ = other.guardianUpdatedPre_ != null ? other.guardianUpdatedPre_.Clone() : null; + guardianUpdatedNew_ = other.guardianUpdatedNew_ != null ? other.guardianUpdatedNew_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GuardianUpdated Clone() { + return new GuardianUpdated(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "guardian_updated_pre" field. + public const int GuardianUpdatedPreFieldNumber = 3; + private global::Portkey.Contracts.CA.Guardian guardianUpdatedPre_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian GuardianUpdatedPre { + get { return guardianUpdatedPre_; } + set { + guardianUpdatedPre_ = value; + } + } + + /// Field number for the "guardian_updated_new" field. + public const int GuardianUpdatedNewFieldNumber = 4; + private global::Portkey.Contracts.CA.Guardian guardianUpdatedNew_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian GuardianUpdatedNew { + get { return guardianUpdatedNew_; } + set { + guardianUpdatedNew_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GuardianUpdated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GuardianUpdated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(GuardianUpdatedPre, other.GuardianUpdatedPre)) return false; + if (!object.Equals(GuardianUpdatedNew, other.GuardianUpdatedNew)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (guardianUpdatedPre_ != null) hash ^= GuardianUpdatedPre.GetHashCode(); + if (guardianUpdatedNew_ != null) hash ^= GuardianUpdatedNew.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianUpdatedPre_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianUpdatedPre); + } + if (guardianUpdatedNew_ != null) { + output.WriteRawTag(34); + output.WriteMessage(GuardianUpdatedNew); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (guardianUpdatedPre_ != null) { + output.WriteRawTag(26); + output.WriteMessage(GuardianUpdatedPre); + } + if (guardianUpdatedNew_ != null) { + output.WriteRawTag(34); + output.WriteMessage(GuardianUpdatedNew); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (guardianUpdatedPre_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianUpdatedPre); + } + if (guardianUpdatedNew_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GuardianUpdatedNew); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GuardianUpdated other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.guardianUpdatedPre_ != null) { + if (guardianUpdatedPre_ == null) { + GuardianUpdatedPre = new global::Portkey.Contracts.CA.Guardian(); + } + GuardianUpdatedPre.MergeFrom(other.GuardianUpdatedPre); + } + if (other.guardianUpdatedNew_ != null) { + if (guardianUpdatedNew_ == null) { + GuardianUpdatedNew = new global::Portkey.Contracts.CA.Guardian(); + } + GuardianUpdatedNew.MergeFrom(other.GuardianUpdatedNew); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianUpdatedPre_ == null) { + GuardianUpdatedPre = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianUpdatedPre); + break; + } + case 34: { + if (guardianUpdatedNew_ == null) { + GuardianUpdatedNew = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianUpdatedNew); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (guardianUpdatedPre_ == null) { + GuardianUpdatedPre = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianUpdatedPre); + break; + } + case 34: { + if (guardianUpdatedNew_ == null) { + GuardianUpdatedNew = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(GuardianUpdatedNew); + break; + } + } + } + } + #endif + + } + + /// + /// LoginGuardian added + /// + internal sealed partial class LoginGuardianAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoginGuardianAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[56]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianAdded(LoginGuardianAdded other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + loginGuardian_ = other.loginGuardian_ != null ? other.loginGuardian_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianAdded Clone() { + return new LoginGuardianAdded(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "login_guardian" field. + public const int LoginGuardianFieldNumber = 4; + private global::Portkey.Contracts.CA.Guardian loginGuardian_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian LoginGuardian { + get { return loginGuardian_; } + set { + loginGuardian_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LoginGuardianAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LoginGuardianAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (!object.Equals(LoginGuardian, other.LoginGuardian)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (loginGuardian_ != null) hash ^= LoginGuardian.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardian_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardian_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (loginGuardian_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardian); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LoginGuardianAdded other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.loginGuardian_ != null) { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + LoginGuardian.MergeFrom(other.LoginGuardian); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(LoginGuardian); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(LoginGuardian); + break; + } + } + } + } + #endif + + } + + /// + /// SocialRecovery + /// + public sealed partial class ManagerInfoSocialRecovered : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfoSocialRecovered()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[57]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoSocialRecovered() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoSocialRecovered(ManagerInfoSocialRecovered other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoSocialRecovered Clone() { + return new ManagerInfoSocialRecovered(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 4; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfoSocialRecovered); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfoSocialRecovered other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfoSocialRecovered other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ManagerInfo added + /// + internal sealed partial class ManagerInfoAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfoAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[58]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoAdded(ManagerInfoAdded other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoAdded Clone() { + return new ManagerInfoAdded(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 4; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfoAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfoAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfoAdded other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ManagerInfo removed + /// + internal sealed partial class ManagerInfoRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfoRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[59]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoRemoved(ManagerInfoRemoved other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoRemoved Clone() { + return new ManagerInfoRemoved(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 4; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfoRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfoRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfoRemoved other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ManagerInfo updated + /// + internal sealed partial class ManagerInfoUpdated : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManagerInfoUpdated()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[60]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoUpdated() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoUpdated(ManagerInfoUpdated other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + extraData_ = other.extraData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManagerInfoUpdated Clone() { + return new ManagerInfoUpdated(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "extra_data" field. + public const int ExtraDataFieldNumber = 4; + private string extraData_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExtraData { + get { return extraData_; } + set { + extraData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManagerInfoUpdated); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManagerInfoUpdated other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (ExtraData != other.ExtraData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (ExtraData.Length != 0) hash ^= ExtraData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (ExtraData.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ExtraData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (ExtraData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExtraData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ManagerInfoUpdated other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.ExtraData.Length != 0) { + ExtraData = other.ExtraData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + ExtraData = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// LoginGuardian unset + /// + internal sealed partial class LoginGuardianUnbound : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoginGuardianUnbound()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[61]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianUnbound() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianUnbound(LoginGuardianUnbound other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + loginGuardianIdentifierHash_ = other.loginGuardianIdentifierHash_ != null ? other.loginGuardianIdentifierHash_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianUnbound Clone() { + return new LoginGuardianUnbound(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "login_guardian_identifier_hash" field. + public const int LoginGuardianIdentifierHashFieldNumber = 4; + private global::AElf.Types.Hash loginGuardianIdentifierHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash LoginGuardianIdentifierHash { + get { return loginGuardianIdentifierHash_; } + set { + loginGuardianIdentifierHash_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LoginGuardianUnbound); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LoginGuardianUnbound other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (!object.Equals(LoginGuardianIdentifierHash, other.LoginGuardianIdentifierHash)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (loginGuardianIdentifierHash_ != null) hash ^= LoginGuardianIdentifierHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardianIdentifierHash_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (loginGuardianIdentifierHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardianIdentifierHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LoginGuardianUnbound other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.loginGuardianIdentifierHash_ != null) { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + LoginGuardianIdentifierHash.MergeFrom(other.LoginGuardianIdentifierHash); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardianIdentifierHash_ == null) { + LoginGuardianIdentifierHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(LoginGuardianIdentifierHash); + break; + } + } + } + } + #endif + + } + + /// + /// LoginGuardian removed + /// + internal sealed partial class LoginGuardianRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoginGuardianRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[62]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianRemoved(LoginGuardianRemoved other) : this() { + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + manager_ = other.manager_ != null ? other.manager_.Clone() : null; + loginGuardian_ = other.loginGuardian_ != null ? other.loginGuardian_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LoginGuardianRemoved Clone() { + return new LoginGuardianRemoved(this); + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 1; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 2; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager" field. + public const int ManagerFieldNumber = 3; + private global::AElf.Types.Address manager_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Manager { + get { return manager_; } + set { + manager_ = value; + } + } + + /// Field number for the "login_guardian" field. + public const int LoginGuardianFieldNumber = 4; + private global::Portkey.Contracts.CA.Guardian loginGuardian_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.Guardian LoginGuardian { + get { return loginGuardian_; } + set { + loginGuardian_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LoginGuardianRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LoginGuardianRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(Manager, other.Manager)) return false; + if (!object.Equals(LoginGuardian, other.LoginGuardian)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (manager_ != null) hash ^= Manager.GetHashCode(); + if (loginGuardian_ != null) hash ^= LoginGuardian.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardian_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caHash_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaAddress); + } + if (manager_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Manager); + } + if (loginGuardian_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LoginGuardian); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (manager_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); + } + if (loginGuardian_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardian); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LoginGuardianRemoved other) { + if (other == null) { + return; + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.manager_ != null) { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + Manager.MergeFrom(other.Manager); + } + if (other.loginGuardian_ != null) { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + LoginGuardian.MergeFrom(other.LoginGuardian); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(LoginGuardian); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 18: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 26: { + if (manager_ == null) { + Manager = new global::AElf.Types.Address(); + } + input.ReadMessage(Manager); + break; + } + case 34: { + if (loginGuardian_ == null) { + LoginGuardian = new global::Portkey.Contracts.CA.Guardian(); + } + input.ReadMessage(LoginGuardian); + break; + } + } + } + } + #endif + + } + + /// + /// VerifierServerEndPoints added + /// + internal sealed partial class VerifierServerEndPointsAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifierServerEndPointsAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[63]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsAdded(VerifierServerEndPointsAdded other) : this() { + verifierServer_ = other.verifierServer_ != null ? other.verifierServer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsAdded Clone() { + return new VerifierServerEndPointsAdded(this); + } + + /// Field number for the "verifier_server" field. + public const int VerifierServerFieldNumber = 1; + private global::Portkey.Contracts.CA.VerifierServer verifierServer_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.VerifierServer VerifierServer { + get { return verifierServer_; } + set { + verifierServer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerifierServerEndPointsAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerifierServerEndPointsAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(VerifierServer, other.VerifierServer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (verifierServer_ != null) hash ^= VerifierServer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (verifierServer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerifierServer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerifierServerEndPointsAdded other) { + if (other == null) { + return; + } + if (other.verifierServer_ != null) { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + VerifierServer.MergeFrom(other.VerifierServer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + } + #endif + + } + + /// + /// VerifierServerEndPoints removed + /// + internal sealed partial class VerifierServerEndPointsRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifierServerEndPointsRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[64]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsRemoved(VerifierServerEndPointsRemoved other) : this() { + verifierServer_ = other.verifierServer_ != null ? other.verifierServer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerEndPointsRemoved Clone() { + return new VerifierServerEndPointsRemoved(this); + } + + /// Field number for the "verifier_server" field. + public const int VerifierServerFieldNumber = 1; + private global::Portkey.Contracts.CA.VerifierServer verifierServer_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.VerifierServer VerifierServer { + get { return verifierServer_; } + set { + verifierServer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerifierServerEndPointsRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerifierServerEndPointsRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(VerifierServer, other.VerifierServer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (verifierServer_ != null) hash ^= VerifierServer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (verifierServer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerifierServer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerifierServerEndPointsRemoved other) { + if (other == null) { + return; + } + if (other.verifierServer_ != null) { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + VerifierServer.MergeFrom(other.VerifierServer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + } + #endif + + } + + /// + /// VerifierServer removed + /// + internal sealed partial class VerifierServerRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VerifierServerRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[65]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerRemoved(VerifierServerRemoved other) : this() { + verifierServer_ = other.verifierServer_ != null ? other.verifierServer_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VerifierServerRemoved Clone() { + return new VerifierServerRemoved(this); + } + + /// Field number for the "verifier_server" field. + public const int VerifierServerFieldNumber = 1; + private global::Portkey.Contracts.CA.VerifierServer verifierServer_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.VerifierServer VerifierServer { + get { return verifierServer_; } + set { + verifierServer_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VerifierServerRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VerifierServerRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(VerifierServer, other.VerifierServer)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (verifierServer_ != null) hash ^= VerifierServer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (verifierServer_ != null) { + output.WriteRawTag(10); + output.WriteMessage(VerifierServer); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (verifierServer_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VerifierServer); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VerifierServerRemoved other) { + if (other == null) { + return; + } + if (other.verifierServer_ != null) { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + VerifierServer.MergeFrom(other.VerifierServer); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (verifierServer_ == null) { + VerifierServer = new global::Portkey.Contracts.CA.VerifierServer(); + } + input.ReadMessage(VerifierServer); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAServerAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAServerAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[66]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerAdded(CAServerAdded other) : this() { + caSeverAdded_ = other.caSeverAdded_ != null ? other.caSeverAdded_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerAdded Clone() { + return new CAServerAdded(this); + } + + /// Field number for the "ca_sever_added" field. + public const int CaSeverAddedFieldNumber = 1; + private global::Portkey.Contracts.CA.CAServer caSeverAdded_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.CAServer CaSeverAdded { + get { return caSeverAdded_; } + set { + caSeverAdded_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAServerAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAServerAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaSeverAdded, other.CaSeverAdded)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caSeverAdded_ != null) hash ^= CaSeverAdded.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caSeverAdded_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaSeverAdded); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caSeverAdded_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaSeverAdded); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caSeverAdded_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaSeverAdded); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAServerAdded other) { + if (other == null) { + return; + } + if (other.caSeverAdded_ != null) { + if (caSeverAdded_ == null) { + CaSeverAdded = new global::Portkey.Contracts.CA.CAServer(); + } + CaSeverAdded.MergeFrom(other.CaSeverAdded); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caSeverAdded_ == null) { + CaSeverAdded = new global::Portkey.Contracts.CA.CAServer(); + } + input.ReadMessage(CaSeverAdded); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caSeverAdded_ == null) { + CaSeverAdded = new global::Portkey.Contracts.CA.CAServer(); + } + input.ReadMessage(CaSeverAdded); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAServerRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAServerRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[67]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerRemoved(CAServerRemoved other) : this() { + caServerRemoved_ = other.caServerRemoved_ != null ? other.caServerRemoved_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAServerRemoved Clone() { + return new CAServerRemoved(this); + } + + /// Field number for the "ca_server_removed" field. + public const int CaServerRemovedFieldNumber = 1; + private global::Portkey.Contracts.CA.CAServer caServerRemoved_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.CAServer CaServerRemoved { + get { return caServerRemoved_; } + set { + caServerRemoved_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAServerRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAServerRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CaServerRemoved, other.CaServerRemoved)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (caServerRemoved_ != null) hash ^= CaServerRemoved.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (caServerRemoved_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaServerRemoved); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (caServerRemoved_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CaServerRemoved); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (caServerRemoved_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaServerRemoved); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAServerRemoved other) { + if (other == null) { + return; + } + if (other.caServerRemoved_ != null) { + if (caServerRemoved_ == null) { + CaServerRemoved = new global::Portkey.Contracts.CA.CAServer(); + } + CaServerRemoved.MergeFrom(other.CaServerRemoved); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (caServerRemoved_ == null) { + CaServerRemoved = new global::Portkey.Contracts.CA.CAServer(); + } + input.ReadMessage(CaServerRemoved); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (caServerRemoved_ == null) { + CaServerRemoved = new global::Portkey.Contracts.CA.CAServer(); + } + input.ReadMessage(CaServerRemoved); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAHolderSynced : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAHolderSynced()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[68]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderSynced() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderSynced(CAHolderSynced other) : this() { + creator_ = other.creator_ != null ? other.creator_.Clone() : null; + caHash_ = other.caHash_ != null ? other.caHash_.Clone() : null; + caAddress_ = other.caAddress_ != null ? other.caAddress_.Clone() : null; + managerInfosAdded_ = other.managerInfosAdded_ != null ? other.managerInfosAdded_.Clone() : null; + managerInfosRemoved_ = other.managerInfosRemoved_ != null ? other.managerInfosRemoved_.Clone() : null; + loginGuardiansAdded_ = other.loginGuardiansAdded_ != null ? other.loginGuardiansAdded_.Clone() : null; + loginGuardiansUnbound_ = other.loginGuardiansUnbound_ != null ? other.loginGuardiansUnbound_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAHolderSynced Clone() { + return new CAHolderSynced(this); + } + + /// Field number for the "creator" field. + public const int CreatorFieldNumber = 1; + private global::AElf.Types.Address creator_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Creator { + get { return creator_; } + set { + creator_ = value; + } + } + + /// Field number for the "ca_hash" field. + public const int CaHashFieldNumber = 2; + private global::AElf.Types.Hash caHash_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Hash CaHash { + get { return caHash_; } + set { + caHash_ = value; + } + } + + /// Field number for the "ca_address" field. + public const int CaAddressFieldNumber = 3; + private global::AElf.Types.Address caAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address CaAddress { + get { return caAddress_; } + set { + caAddress_ = value; + } + } + + /// Field number for the "manager_infos_added" field. + public const int ManagerInfosAddedFieldNumber = 4; + private global::Portkey.Contracts.CA.ManagerInfoList managerInfosAdded_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfoList ManagerInfosAdded { + get { return managerInfosAdded_; } + set { + managerInfosAdded_ = value; + } + } + + /// Field number for the "manager_infos_removed" field. + public const int ManagerInfosRemovedFieldNumber = 5; + private global::Portkey.Contracts.CA.ManagerInfoList managerInfosRemoved_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.ManagerInfoList ManagerInfosRemoved { + get { return managerInfosRemoved_; } + set { + managerInfosRemoved_ = value; + } + } + + /// Field number for the "login_guardians_added" field. + public const int LoginGuardiansAddedFieldNumber = 6; + private global::Portkey.Contracts.CA.LoginGuardianList loginGuardiansAdded_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.LoginGuardianList LoginGuardiansAdded { + get { return loginGuardiansAdded_; } + set { + loginGuardiansAdded_ = value; + } + } + + /// Field number for the "login_guardians_unbound" field. + public const int LoginGuardiansUnboundFieldNumber = 7; + private global::Portkey.Contracts.CA.LoginGuardianList loginGuardiansUnbound_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Portkey.Contracts.CA.LoginGuardianList LoginGuardiansUnbound { + get { return loginGuardiansUnbound_; } + set { + loginGuardiansUnbound_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAHolderSynced); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAHolderSynced other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Creator, other.Creator)) return false; + if (!object.Equals(CaHash, other.CaHash)) return false; + if (!object.Equals(CaAddress, other.CaAddress)) return false; + if (!object.Equals(ManagerInfosAdded, other.ManagerInfosAdded)) return false; + if (!object.Equals(ManagerInfosRemoved, other.ManagerInfosRemoved)) return false; + if (!object.Equals(LoginGuardiansAdded, other.LoginGuardiansAdded)) return false; + if (!object.Equals(LoginGuardiansUnbound, other.LoginGuardiansUnbound)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (creator_ != null) hash ^= Creator.GetHashCode(); + if (caHash_ != null) hash ^= CaHash.GetHashCode(); + if (caAddress_ != null) hash ^= CaAddress.GetHashCode(); + if (managerInfosAdded_ != null) hash ^= ManagerInfosAdded.GetHashCode(); + if (managerInfosRemoved_ != null) hash ^= ManagerInfosRemoved.GetHashCode(); + if (loginGuardiansAdded_ != null) hash ^= LoginGuardiansAdded.GetHashCode(); + if (loginGuardiansUnbound_ != null) hash ^= LoginGuardiansUnbound.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (creator_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Creator); + } + if (caHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CaAddress); + } + if (managerInfosAdded_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ManagerInfosAdded); + } + if (managerInfosRemoved_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ManagerInfosRemoved); + } + if (loginGuardiansAdded_ != null) { + output.WriteRawTag(50); + output.WriteMessage(LoginGuardiansAdded); + } + if (loginGuardiansUnbound_ != null) { + output.WriteRawTag(58); + output.WriteMessage(LoginGuardiansUnbound); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (creator_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Creator); + } + if (caHash_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CaHash); + } + if (caAddress_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CaAddress); + } + if (managerInfosAdded_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ManagerInfosAdded); + } + if (managerInfosRemoved_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ManagerInfosRemoved); + } + if (loginGuardiansAdded_ != null) { + output.WriteRawTag(50); + output.WriteMessage(LoginGuardiansAdded); + } + if (loginGuardiansUnbound_ != null) { + output.WriteRawTag(58); + output.WriteMessage(LoginGuardiansUnbound); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (creator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); + } + if (caHash_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaHash); + } + if (caAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CaAddress); + } + if (managerInfosAdded_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfosAdded); + } + if (managerInfosRemoved_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManagerInfosRemoved); + } + if (loginGuardiansAdded_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardiansAdded); + } + if (loginGuardiansUnbound_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LoginGuardiansUnbound); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAHolderSynced other) { + if (other == null) { + return; + } + if (other.creator_ != null) { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + Creator.MergeFrom(other.Creator); + } + if (other.caHash_ != null) { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + CaHash.MergeFrom(other.CaHash); + } + if (other.caAddress_ != null) { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + CaAddress.MergeFrom(other.CaAddress); + } + if (other.managerInfosAdded_ != null) { + if (managerInfosAdded_ == null) { + ManagerInfosAdded = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + ManagerInfosAdded.MergeFrom(other.ManagerInfosAdded); + } + if (other.managerInfosRemoved_ != null) { + if (managerInfosRemoved_ == null) { + ManagerInfosRemoved = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + ManagerInfosRemoved.MergeFrom(other.ManagerInfosRemoved); + } + if (other.loginGuardiansAdded_ != null) { + if (loginGuardiansAdded_ == null) { + LoginGuardiansAdded = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + LoginGuardiansAdded.MergeFrom(other.LoginGuardiansAdded); + } + if (other.loginGuardiansUnbound_ != null) { + if (loginGuardiansUnbound_ == null) { + LoginGuardiansUnbound = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + LoginGuardiansUnbound.MergeFrom(other.LoginGuardiansUnbound); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 18: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 26: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 34: { + if (managerInfosAdded_ == null) { + ManagerInfosAdded = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + input.ReadMessage(ManagerInfosAdded); + break; + } + case 42: { + if (managerInfosRemoved_ == null) { + ManagerInfosRemoved = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + input.ReadMessage(ManagerInfosRemoved); + break; + } + case 50: { + if (loginGuardiansAdded_ == null) { + LoginGuardiansAdded = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + input.ReadMessage(LoginGuardiansAdded); + break; + } + case 58: { + if (loginGuardiansUnbound_ == null) { + LoginGuardiansUnbound = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + input.ReadMessage(LoginGuardiansUnbound); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (creator_ == null) { + Creator = new global::AElf.Types.Address(); + } + input.ReadMessage(Creator); + break; + } + case 18: { + if (caHash_ == null) { + CaHash = new global::AElf.Types.Hash(); + } + input.ReadMessage(CaHash); + break; + } + case 26: { + if (caAddress_ == null) { + CaAddress = new global::AElf.Types.Address(); + } + input.ReadMessage(CaAddress); + break; + } + case 34: { + if (managerInfosAdded_ == null) { + ManagerInfosAdded = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + input.ReadMessage(ManagerInfosAdded); + break; + } + case 42: { + if (managerInfosRemoved_ == null) { + ManagerInfosRemoved = new global::Portkey.Contracts.CA.ManagerInfoList(); + } + input.ReadMessage(ManagerInfosRemoved); + break; + } + case 50: { + if (loginGuardiansAdded_ == null) { + LoginGuardiansAdded = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + input.ReadMessage(LoginGuardiansAdded); + break; + } + case 58: { + if (loginGuardiansUnbound_ == null) { + LoginGuardiansUnbound = new global::Portkey.Contracts.CA.LoginGuardianList(); + } + input.ReadMessage(LoginGuardiansUnbound); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CreatorControllerAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreatorControllerAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[69]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerAdded(CreatorControllerAdded other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerAdded Clone() { + return new CreatorControllerAdded(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CreatorControllerAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CreatorControllerAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CreatorControllerAdded other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CreatorControllerRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreatorControllerRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[70]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerRemoved(CreatorControllerRemoved other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CreatorControllerRemoved Clone() { + return new CreatorControllerRemoved(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CreatorControllerRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CreatorControllerRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CreatorControllerRemoved other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ServerControllerAdded : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerControllerAdded()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[71]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerAdded() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerAdded(ServerControllerAdded other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerAdded Clone() { + return new ServerControllerAdded(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ServerControllerAdded); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ServerControllerAdded other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ServerControllerAdded other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class ServerControllerRemoved : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerControllerRemoved()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[72]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerRemoved() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerRemoved(ServerControllerRemoved other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ServerControllerRemoved Clone() { + return new ServerControllerRemoved(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ServerControllerRemoved); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ServerControllerRemoved other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ServerControllerRemoved other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class AdminChanged : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdminChanged()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[73]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminChanged() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminChanged(AdminChanged other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AdminChanged Clone() { + return new AdminChanged(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AdminChanged); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AdminChanged other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AdminChanged other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + } + } + } + #endif + + } + + internal sealed partial class OperationTypeInSignatureEnabledInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OperationTypeInSignatureEnabledInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[74]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OperationTypeInSignatureEnabledInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OperationTypeInSignatureEnabledInput(OperationTypeInSignatureEnabledInput other) : this() { + operationTypeInSignatureEnabled_ = other.operationTypeInSignatureEnabled_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OperationTypeInSignatureEnabledInput Clone() { + return new OperationTypeInSignatureEnabledInput(this); + } + + /// Field number for the "operation_type_in_signature_enabled" field. + public const int OperationTypeInSignatureEnabledFieldNumber = 1; + private bool operationTypeInSignatureEnabled_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OperationTypeInSignatureEnabled { + get { return operationTypeInSignatureEnabled_; } + set { + operationTypeInSignatureEnabled_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OperationTypeInSignatureEnabledInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OperationTypeInSignatureEnabledInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OperationTypeInSignatureEnabled != other.OperationTypeInSignatureEnabled) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (OperationTypeInSignatureEnabled != false) hash ^= OperationTypeInSignatureEnabled.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (OperationTypeInSignatureEnabled != false) { + output.WriteRawTag(8); + output.WriteBool(OperationTypeInSignatureEnabled); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (OperationTypeInSignatureEnabled != false) { + output.WriteRawTag(8); + output.WriteBool(OperationTypeInSignatureEnabled); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (OperationTypeInSignatureEnabled != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OperationTypeInSignatureEnabledInput other) { + if (other == null) { + return; + } + if (other.OperationTypeInSignatureEnabled != false) { + OperationTypeInSignatureEnabled = other.OperationTypeInSignatureEnabled; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OperationTypeInSignatureEnabled = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OperationTypeInSignatureEnabled = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + internal sealed partial class SetCAContractAddressesInput : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetCAContractAddressesInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[75]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetCAContractAddressesInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetCAContractAddressesInput(SetCAContractAddressesInput other) : this() { + caContractAddresses_ = other.caContractAddresses_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetCAContractAddressesInput Clone() { + return new SetCAContractAddressesInput(this); + } + + /// Field number for the "ca_contract_addresses" field. + public const int CaContractAddressesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_caContractAddresses_codec + = pb::FieldCodec.ForMessage(10, global::Portkey.Contracts.CA.CAContractAddress.Parser); + private readonly pbc::RepeatedField caContractAddresses_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CaContractAddresses { + get { return caContractAddresses_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetCAContractAddressesInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetCAContractAddressesInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!caContractAddresses_.Equals(other.caContractAddresses_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= caContractAddresses_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + caContractAddresses_.WriteTo(output, _repeated_caContractAddresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + caContractAddresses_.WriteTo(ref output, _repeated_caContractAddresses_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += caContractAddresses_.CalculateSize(_repeated_caContractAddresses_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetCAContractAddressesInput other) { + if (other == null) { + return; + } + caContractAddresses_.Add(other.caContractAddresses_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + caContractAddresses_.AddEntriesFrom(input, _repeated_caContractAddresses_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + caContractAddresses_.AddEntriesFrom(ref input, _repeated_caContractAddresses_codec); + break; + } + } + } + } + #endif + + } + + internal sealed partial class CAContractAddress : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CAContractAddress()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Portkey.Contracts.CA.CaContractReflection.Descriptor.MessageTypes[76]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAContractAddress() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAContractAddress(CAContractAddress other) : this() { + address_ = other.address_ != null ? other.address_.Clone() : null; + chainId_ = other.chainId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CAContractAddress Clone() { + return new CAContractAddress(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::AElf.Types.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::AElf.Types.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "chain_id" field. + public const int ChainIdFieldNumber = 2; + private int chainId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ChainId { + get { return chainId_; } + set { + chainId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CAContractAddress); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CAContractAddress other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if (ChainId != other.ChainId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + if (ChainId != 0) hash ^= ChainId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (ChainId != 0) { + output.WriteRawTag(16); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + if (ChainId != 0) { + output.WriteRawTag(16); + output.WriteInt32(ChainId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (ChainId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CAContractAddress other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.ChainId != 0) { + ChainId = other.ChainId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 16: { + ChainId = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (address_ == null) { + Address = new global::AElf.Types.Address(); + } + input.ReadMessage(Address); + break; + } + case 16: { + ChainId = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.AuthServer/LoginTokenExtensionGrant.cs b/src/AElf.CrossChainServer.AuthServer/LoginTokenExtensionGrant.cs new file mode 100644 index 0000000..9acf9c6 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/LoginTokenExtensionGrant.cs @@ -0,0 +1,92 @@ +using System.Collections.Immutable; +using System.Text; +using AElf.CrossChainServer.Auth.Options; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using OpenIddict.Abstractions; +using OpenIddict.Server.AspNetCore; +using Volo.Abp.Identity; +using Volo.Abp.OpenIddict; +using Volo.Abp.OpenIddict.ExtensionGrantTypes; +using IdentityUser = Volo.Abp.Identity.IdentityUser; +using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult; + +namespace AElf.CrossChainServer.Auth; + +public class LoginTokenExtensionGrant : ITokenExtensionGrant +{ + public string Name => AuthConstant.GrantType; + + public async Task HandleAsync(ExtensionGrantContext context) + { + // var scopeManager = context.HttpContext.RequestServices.GetRequiredService(); + var signInManager = context.HttpContext.RequestServices.GetRequiredService>(); + var userManager = context.HttpContext.RequestServices.GetRequiredService(); + var _logger = context.HttpContext.RequestServices.GetRequiredService>(); + var source = context.Request.GetParameter("source").ToString(); + var name = context.Request.GetParameter("user_name")?.ToString(); + var password = context.Request.GetParameter("password").ToString(); + _logger.LogInformation("Reconciliation name:{name}, {source}", name, source); + if (source != AuthConstant.ReconciliationSource) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "invalid source"); + } + + if (name.IsNullOrEmpty() || password.IsNullOrEmpty()) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "invalid name or password"); + } + + var user = await userManager.FindByNameAsync(name); + if (user == null) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "invalid user"); + } + + password = Encoding.UTF8.GetString(ByteArrayHelper.HexStringToByteArray(password)); + var result = await userManager.CheckPasswordAsync(user, password); + if (!result) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "invalid name or password"); + } + + var principal = await signInManager.CreateUserPrincipalAsync(user); + principal.SetScopes(context.Request.GetScopes()); + // principal.SetResources(await GetResourcesAsync(context.Request.GetScopes(), scopeManager)); + principal.SetAudiences("AElfCrossChainServer"); + + await context.HttpContext.RequestServices.GetRequiredService() + .HandleAsync(context.Request, principal); + + return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, principal); + } + + private ForbidResult GetForbidResult(string errorType, string errorDescription) + { + return new ForbidResult( + new[] { OpenIddictServerAspNetCoreDefaults.AuthenticationScheme }, + properties: new AuthenticationProperties(new Dictionary + { + [OpenIddictServerAspNetCoreConstants.Properties.Error] = errorType, + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription + }!)); + } + + protected virtual async Task> GetResourcesAsync(ImmutableArray scopes, + IOpenIddictScopeManager scopeManager) + { + var resources = new List(); + if (!scopes.Any()) + { + return resources; + } + + await foreach (var resource in scopeManager.ListResourcesAsync(scopes)) + { + resources.Add(resource); + } + + return resources; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/AuthConstant.cs b/src/AElf.CrossChainServer.AuthServer/Options/AuthConstant.cs new file mode 100644 index 0000000..5b839cf --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/AuthConstant.cs @@ -0,0 +1,20 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class AuthConstant +{ + public const string GetHolderInfo = "GetHolderInfo"; + public const string PortKeyAppId = "PortKey"; + public const string PortKeyVersion = "v1"; + public const string PortKeyVersion2 = "v2"; + public const string PortKeySource = "portkey"; + public const string NightElfAppId = "NightElf"; + public const string NightElfSource = "nightElf"; + public const string WalletSource = "wallet"; + public const string ReconciliationSource = "reconciliation"; + public const string GrantType = "login_credentials"; +} + +public static class ContractName +{ + public const string CrossChain = "AElf.ContractNames.CrossChain"; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/ChainInfo.cs b/src/AElf.CrossChainServer.AuthServer/Options/ChainInfo.cs new file mode 100644 index 0000000..60e3f4d --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/ChainInfo.cs @@ -0,0 +1,11 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class ChainInfo +{ + public string ChainId { get; set; } + public string BaseUrl { get; set; } + public string ContractAddress { get; set; } + public string ContractAddress2 { get; set; } + public string PublicKey { get; set; } + public bool IsMainChain { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/ChainOptions.cs b/src/AElf.CrossChainServer.AuthServer/Options/ChainOptions.cs new file mode 100644 index 0000000..a2d7c4a --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/ChainOptions.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class ChainOptions +{ + public Dictionary ChainInfos { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/ContractOptions.cs b/src/AElf.CrossChainServer.AuthServer/Options/ContractOptions.cs new file mode 100644 index 0000000..18158f6 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/ContractOptions.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class ContractOptions +{ + public string CommonPrivateKeyForCallTx { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/GraphQLOption.cs b/src/AElf.CrossChainServer.AuthServer/Options/GraphQLOption.cs new file mode 100644 index 0000000..8b0e1ac --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/GraphQLOption.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class GraphQlOption +{ + public string Url { get; set; } + public string Url2 { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/RecaptchaOptions.cs b/src/AElf.CrossChainServer.AuthServer/Options/RecaptchaOptions.cs new file mode 100644 index 0000000..44a6d86 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/RecaptchaOptions.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class RecaptchaOptions +{ + public string SecretKey { get; set; } + public string BaseUrl { get; set; } + public List ChainIds { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Options/TimeRangeOption.cs b/src/AElf.CrossChainServer.AuthServer/Options/TimeRangeOption.cs new file mode 100644 index 0000000..1cea49c --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Options/TimeRangeOption.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.Auth.Options; + +public class TimeRangeOption +{ + public int TimeRange { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/Program.cs b/src/AElf.CrossChainServer.AuthServer/Program.cs new file mode 100644 index 0000000..af7cb6a --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/Program.cs @@ -0,0 +1,59 @@ +using Serilog; +using Serilog.Events; + +namespace AElf.CrossChainServer.Auth; + +public class Program +{ + public static async Task Main(string[] args) + { + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .Build(); + + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.AuthServer", LogEventLevel.Warning) + .Enrich.FromLogContext() + .ReadFrom.Configuration(configuration) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting CrossChainServer.AuthServer"); + var builder = WebApplication.CreateBuilder(args); + builder.Configuration.AddJsonFile("apollo.appsettings.json"); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseApollo() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "CrossChainServer.AuthServer terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler.cs b/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler.cs new file mode 100644 index 0000000..3518c44 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler.cs @@ -0,0 +1,588 @@ +using System.Collections.Immutable; +using System.Text; +using AElf.Client.Dto; +using AElf.Client.Service; +using AElf.CrossChainServer.Auth.Common; +using AElf.CrossChainServer.Auth.DTOs; +using AElf.CrossChainServer.Auth.Options; +using AElf.CrossChainServer.CrossChain; +using AElf.Types; +using Google.Protobuf; +using GraphQL; +using GraphQL.Client.Http; +using GraphQL.Client.Serializer.Newtonsoft; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Newtonsoft.Json.Linq; +using OpenIddict.Abstractions; +using OpenIddict.Server.AspNetCore; +using Portkey.Contracts.CA; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Identity; +using Volo.Abp.Linq; +using Volo.Abp.OpenIddict; +using Volo.Abp.OpenIddict.ExtensionGrantTypes; +using IdentityUser = Volo.Abp.Identity.IdentityUser; +using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult; + +namespace AElf.CrossChainServer.Auth; + +public partial class SignatureGrantHandler : ITokenExtensionGrant +{ + private HttpClient _httpClient; + private IAbpDistributedLock _distributedLock; + private ILogger _logger; + private IOptionsSnapshot _chainOptions; + private IOptionsSnapshot _graphQlOptions; + private IOptionsSnapshot _contractOptions; + private ICrossChainUserRepository _crossChainUserRepository; + private IAsyncQueryableExecuter _asyncExecuter; + + + private readonly string _lockKeyPrefix = "CrossChainServer:Auth:SignatureGrantHandler:"; + + public async Task HandleAsync(ExtensionGrantContext context) + { + var publicKeyVal = context.Request.GetParameter("pubkey").ToString(); + var signatureVal = context.Request.GetParameter("signature").ToString(); + var plainText = context.Request.GetParameter("plain_text").ToString(); + var caHash = context.Request.GetParameter("ca_hash")?.ToString(); + var chainId = context.Request.GetParameter("chain_id")?.ToString(); + var scope = context.Request.GetParameter("scope").ToString(); + var version = context.Request.GetParameter("version")?.ToString(); + var source = context.Request.GetParameter("source").ToString(); + var sourceType = context.Request.GetParameter("sourceType")?.ToString(); + + _logger = context.HttpContext.RequestServices.GetRequiredService>(); + _logger.LogDebug( + "before publicKeyVal:{publicKeyVal}, signatureVal:{signatureVal}, plainText:{plainText}, caHash:{caHash}, chainId:{chainId}, version:{version}, source:{source}, sourceType:{sourceType}", + publicKeyVal, signatureVal, plainText, caHash, chainId, version, source, sourceType); + + var invalidParamResult = CheckParams(publicKeyVal, signatureVal, plainText, caHash, chainId, scope, version, + source, sourceType); + if (invalidParamResult != null) + { + return invalidParamResult; + } + + _logger.LogDebug( + "publicKeyVal:{publicKeyVal}, signatureVal:{signatureVal}, plainText:{plainText}, caHash:{caHash}, chainId:{chainId}, version:{version}, source:{source}", + publicKeyVal, signatureVal, plainText, caHash, chainId, version, source); + + var rawText = Encoding.UTF8.GetString(ByteArrayHelper.HexStringToByteArray(plainText)); + _logger.LogDebug("rawText:{rawText}", rawText); + var nonce = rawText.TrimEnd().Substring(rawText.LastIndexOf("Nonce:") + 6); + _logger.LogDebug("nonce:{nonce}", nonce); + var publicKey = ByteArrayHelper.HexStringToByteArray(publicKeyVal); + _logger.LogDebug("publicKey:{publicKey}", publicKey); + var signature = ByteArrayHelper.HexStringToByteArray(signatureVal); + _logger.LogDebug("signature:{signature}", signature); + var timestamp = long.Parse(nonce); + _logger.LogDebug("timestamp:{timestamp}", timestamp); + var time = DateTime.UnixEpoch.AddMilliseconds(timestamp); + _logger.LogDebug("time:{time}", time); + var timeRangeConfig = context.HttpContext.RequestServices + .GetRequiredService>().Value; + + if (time < DateTime.UtcNow.AddMinutes(-timeRangeConfig.TimeRange) || + time > DateTime.UtcNow.AddMinutes(timeRangeConfig.TimeRange)) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, + $"The time should be {timeRangeConfig.TimeRange} minutes before and after the current time."); + } + + if (!await CheckSignature(source, sourceType, signature, plainText, publicKey)) + { + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "Signature validation failed."); + } + + //Find manager by caHash + _contractOptions = context.HttpContext.RequestServices.GetRequiredService>(); + _crossChainUserRepository = context.HttpContext.RequestServices.GetRequiredService(); + _distributedLock = context.HttpContext.RequestServices.GetRequiredService(); + _graphQlOptions = context.HttpContext.RequestServices.GetRequiredService>(); + _chainOptions = context.HttpContext.RequestServices.GetRequiredService>(); + _asyncExecuter = context.HttpContext.RequestServices.GetRequiredService(); + + IdentityUser user = null; + var address = string.Empty; + if (source == AuthConstant.PortKeySource || source == AuthConstant.NightElfSource) + { + address = Address.FromPublicKey(publicKey).ToBase58(); + _logger.LogDebug("address:{address}", address); + } + + _logger.LogDebug("before create User, source: {source}", source); + if (source == AuthConstant.PortKeySource) + { + var managerCheck = await CheckAddressAsync(chainId, + AuthConstant.PortKeyVersion2.Equals(version) ? _graphQlOptions.Value.Url2 : _graphQlOptions.Value.Url, + caHash, address, version, _chainOptions.Value); + if (!managerCheck.HasValue || !managerCheck.Value) + { + _logger.LogError("Manager validation failed. caHash:{caHash}, address:{address}, chainId:{chainId}", + caHash, address, chainId); + return GetForbidResult(OpenIddictConstants.Errors.InvalidRequest, "Manager validation failed."); + } + + _logger.LogDebug( + "before var userManager = context.HttpContext.RequestServices.GetRequiredService();"); + var userManager = context.HttpContext.RequestServices.GetRequiredService(); + user = await userManager.FindByNameAsync(caHash); + if (user == null) + { + _logger.LogDebug("before CreatePortKeyUserAsync(userManager, userId, caHash, version)"); + var userId = await GetUserIdAsync(chainId, caHash, version); + var createUserResult = await CreatePortKeyUserAsync(userManager, userId, caHash, version); + if (!createUserResult) + { + return GetForbidResult(OpenIddictConstants.Errors.ServerError, "Create user failed."); + } + + user = await userManager.GetByIdAsync(userId); + } + else + { + _logger.LogDebug("check user data consistency, userId:{userId}", user.Id.ToString()); + var queryable = + await _crossChainUserRepository.WithDetailsAsync(y => y.AddressInfos); + var query = queryable.Where(x => x.Id == user.Id); + var userInfo = await _asyncExecuter.FirstOrDefaultAsync(query); + if (userInfo == null || userInfo.AddressInfos.IsNullOrEmpty() || userInfo.AddressInfos.Count == 1) + { + _logger.LogDebug("save user info into storage, userId:{userId}", user.Id.ToString()); + var addressInfos = await GetAddressInfosAsync(caHash, version); + await _crossChainUserRepository.InsertAsync(new() + { + Id = user.Id, + CaHash = caHash, + AppId = AuthConstant.PortKeyAppId, + AddressInfos = addressInfos + }); + _logger.LogDebug("save user success, userId:{userId}", user.Id.ToString()); + } + } + } + else if (source == AuthConstant.NightElfSource) + { + var userManager = context.HttpContext.RequestServices.GetRequiredService(); + user = await userManager.FindByNameAsync(address); + if (user == null) + { + _httpClient = context.HttpContext.RequestServices.GetRequiredService() + .CreateClient(); + var userId = GuidHelper.UniqGuid(address); + var createUserResult = await CreateUserAsync(userManager, userId, address); + if (!createUserResult) + { + return GetForbidResult(OpenIddictConstants.Errors.ServerError, "Create user failed."); + } + + user = await userManager.GetByIdAsync(userId); + } + else + { + _logger.LogDebug("check user data consistency, userId:{userId}", user.Id.ToString()); + var queryable = + await _crossChainUserRepository.WithDetailsAsync(y => y.AddressInfos); + var query = queryable.Where(x => x.Id == user.Id); + var userInfo = await _asyncExecuter.FirstOrDefaultAsync(query); + if (userInfo == null || userInfo.AddressInfos.IsNullOrEmpty()) + { + _logger.LogDebug("save user info into storage again, userId:{userId}", user.Id.ToString()); + await _crossChainUserRepository.InsertAsync(new() + { + Id = user.Id, + AppId = AuthConstant.NightElfAppId, + AddressInfos = new() { new() { Id = new Guid(), Address = address, UserId = user.Id } } + }); + _logger.LogDebug("save user success, userId:{userId}", user.Id.ToString()); + } + } + } + else + { + var userManager = context.HttpContext.RequestServices.GetRequiredService(); + address = Encoding.UTF8.GetString(publicKey); + var fullAddress = string.Concat(sourceType.ToLower(), CommonConstant.Underline, address); + user = await userManager.FindByNameAsync(fullAddress); + if (user == null) + { + _logger.LogDebug("check new wallet user data, address:{address}", fullAddress); + _httpClient = context.HttpContext.RequestServices.GetRequiredService() + .CreateClient(); + var userId = GuidHelper.UniqGuid(fullAddress); + var createUserResult = await CreateUserAsync(userManager, userId, fullAddress, sourceType); + if (!createUserResult) + { + return GetForbidResult(OpenIddictConstants.Errors.ServerError, "Create user failed."); + } + + user = await userManager.GetByIdAsync(userId); + } + } + + var userClaimsPrincipalFactory = context.HttpContext.RequestServices + .GetRequiredService>(); + var signInManager = context.HttpContext.RequestServices.GetRequiredService>(); + var principal = await signInManager.CreateUserPrincipalAsync(user); + var claimsPrincipal = await userClaimsPrincipalFactory.CreateAsync(user); + claimsPrincipal.SetScopes("CrossChainServer"); + claimsPrincipal.SetResources(await GetResourcesAsync(context, principal.GetScopes())); + claimsPrincipal.SetAudiences("CrossChainServer"); + + await context.HttpContext.RequestServices.GetRequiredService() + .HandleAsync(context.Request, principal); + + return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, claimsPrincipal); + } + + private async Task GetUserIdAsync(string chainId, string caHash, string version) + { + try + { + if (!AuthConstant.PortKeyVersion2.Equals(version)) return Guid.NewGuid(); + var virtualAddress = Hash.LoadFromHex(caHash); + var contractAddress = Address.FromBase58(_chainOptions.Value.ChainInfos[chainId].ContractAddress2); + var address = Address.FromPublicKey(contractAddress.Value + .Concat(virtualAddress.Value.ToByteArray().ComputeHash()) + .ToArray()); + return GuidHelper.UniqGuid(address.ToBase58()); + } + catch (Exception e) + { + _logger.LogError(e, "GetUserId error, chainId:{chainId}, caHash:{caHash}, version:{version}", + chainId, caHash, version); + return Guid.NewGuid(); + } + } + + private ForbidResult CheckParams(string publicKeyVal, string signatureVal, string plainText, string caHash, + string chainId, string scope, string version, string source, string sourceType) + { + var errors = new List(); + if (string.IsNullOrWhiteSpace(source) || + !(source == AuthConstant.PortKeySource || + source == AuthConstant.NightElfSource || + source == AuthConstant.WalletSource)) + { + errors.Add("invalid parameter source."); + } + + if (string.IsNullOrWhiteSpace(publicKeyVal)) + { + errors.Add("invalid parameter publish_key."); + } + + if (string.IsNullOrWhiteSpace(signatureVal)) + { + errors.Add("invalid parameter signature."); + } + + if (string.IsNullOrWhiteSpace(plainText)) + { + errors.Add("invalid parameter plainText."); + } + + if (source == AuthConstant.PortKeySource && string.IsNullOrWhiteSpace(caHash)) + { + errors.Add("invalid parameter ca_hash."); + } + + if (source == AuthConstant.PortKeySource && string.IsNullOrWhiteSpace(chainId)) + { + errors.Add("invalid parameter chain_id."); + } + + if (source == AuthConstant.WalletSource && !Enum.TryParse(sourceType, true, out _)) + { + errors.Add("invalid parameter sourceType."); + } + + if (string.IsNullOrWhiteSpace(scope)) + { + errors.Add("invalid parameter scope."); + } + + if (!(string.IsNullOrWhiteSpace(version) || AuthConstant.PortKeyVersion.Equals(version) || + AuthConstant.PortKeyVersion2.Equals(version)) + || (source == AuthConstant.WalletSource && !AuthConstant.PortKeyVersion2.Equals(version))) + { + errors.Add("invalid parameter version."); + } + + if (errors.Count > 0) + { + return new ForbidResult( + new[] { OpenIddictServerAspNetCoreDefaults.AuthenticationScheme }, + properties: new AuthenticationProperties(new Dictionary + { + [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidRequest, + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = GetErrorMessage(errors) + }!)); + } + + return null; + } + + private string GetErrorMessage(List errors) + { + var message = string.Empty; + + errors?.ForEach(t => message += $"{t}, "); + + return message.Contains(',') ? message.TrimEnd().TrimEnd(',') : message; + } + + private async Task CreatePortKeyUserAsync(IdentityUserManager userManager, Guid userId, string caHash, + string version) + { + var result = false; + await using var handle = await _distributedLock.TryAcquireAsync(name: _lockKeyPrefix + caHash); + if (handle != null) + { + var user = new IdentityUser(userId, userName: caHash, email: Guid.NewGuid().ToString("N") + "@ABP.IO"); + var identityResult = await userManager.CreateAsync(user); + if (identityResult.Succeeded) + { + _logger.LogDebug("save user info into storage, userId:{userId}", userId.ToString()); + var addressInfos = await GetAddressInfosAsync(caHash, version); + await _crossChainUserRepository.InsertAsync(new() + { + Id = userId, + CaHash = caHash, + AppId = AuthConstant.PortKeyAppId, + AddressInfos = addressInfos + }); + _logger.LogDebug("create user success, userId:{userId}", userId.ToString()); + } + + result = identityResult.Succeeded; + } + else + { + _logger.LogError("do not get lock, keys already exits, userId:{userId}", userId.ToString()); + } + + return result; + } + + private async Task CreateUserAsync(IdentityUserManager userManager, Guid userId, string address, + string sourceType = null) + { + var result = false; + await using var handle = await _distributedLock.TryAcquireAsync(name: _lockKeyPrefix + address); + if (handle != null) + { + var user = new IdentityUser(userId, userName: address, email: Guid.NewGuid().ToString("N") + "@ABP.IO"); + var identityResult = await userManager.CreateAsync(user); + + if (identityResult.Succeeded) + { + _logger.LogDebug("save user info into storage, userId:{userId}", userId.ToString()); + await _crossChainUserRepository.InsertAsync(new() + { + Id = userId, + AppId = sourceType.IsNullOrEmpty() + ? AuthConstant.NightElfAppId + : Enum.TryParse(sourceType, true, out var w) + ? w.ToString() + : sourceType, + AddressInfos = new List { new() { Id = Guid.NewGuid(),Address = address } } + }); + _logger.LogDebug("create user success, userId:{userId}", userId.ToString()); + } + + result = identityResult.Succeeded; + } + else + { + _logger.LogError("do not get lock, keys already exits, userId:{userId}", userId.ToString()); + } + + return result; + } + + private async Task> GetAddressInfosAsync(string caHash, string version) + { + var addressInfos = new List(); + var holderInfoDto = await GetHolderInfosAsync( + AuthConstant.PortKeyVersion2.Equals(version) ? _graphQlOptions.Value.Url2 : _graphQlOptions.Value.Url, + caHash); + + var chainIds = new List(); + if (holderInfoDto != null && !holderInfoDto.CaHolderInfo.IsNullOrEmpty()) + { + addressInfos.AddRange(holderInfoDto.CaHolderInfo.Select(t => new AddressInfoDto + { Id = Guid.NewGuid(), ChainId = t.ChainId, Address = t.CaAddress })); + chainIds = holderInfoDto.CaHolderInfo.Select(t => t.ChainId).ToList(); + } + + var chains = _chainOptions.Value.ChainInfos.Select(key => _chainOptions.Value.ChainInfos[key.Key]) + .Select(chainOptionsChainInfo => chainOptionsChainInfo.ChainId).Where(t => !chainIds.Contains(t)); + + foreach (var chainId in chains) + { + try + { + var addressInfo = await GetAddressInfoAsync(chainId, caHash, version); + addressInfos.Add(addressInfo); + } + catch (Exception e) + { + _logger.LogError(e, "get holder from chain error, caHash:{caHash}", caHash); + } + } + + return addressInfos; + } + + private async Task GetAddressInfoAsync(string chainId, string caHash, string version) + { + var param = new GetHolderInfoInput + { + CaHash = Hash.LoadFromHex(caHash), + LoginGuardianIdentifierHash = Hash.Empty + }; + + var output = + await CallTransactionAsync(chainId, AuthConstant.GetHolderInfo, version, + param, false, _chainOptions.Value); + + return new AddressInfoDto() + { + Id = Guid.NewGuid(), + Address = output.CaAddress.ToBase58(), + ChainId = chainId + }; + } + + private async Task GetHolderInfosAsync(string url, string caHash) + { + using var graphQlClient = new GraphQLHttpClient(url, new NewtonsoftJsonSerializer()); + var request = new GraphQLRequest + { + Query = @" + query($caHash:String,$skipCount:Int!,$maxResultCount:Int!) { + caHolderInfo(dto: {caHash:$caHash,skipCount:$skipCount,maxResultCount:$maxResultCount}){ + id,chainId,caHash,caAddress,originChainId,managerInfos{address,extraData}} + }", + Variables = new + { + caHash, skipCount = 0, maxResultCount = 10 + } + }; + + var graphQlResponse = await graphQlClient.SendQueryAsync(request); + return graphQlResponse.Data; + } + + private async Task CheckAddressAsync(string chainId, string graphQlUrl, string caHash, string manager, + string version, ChainOptions chainOptions) + { + var graphQlResult = await CheckAddressFromGraphQlAsync(graphQlUrl, caHash, manager); + if (!graphQlResult.HasValue || !graphQlResult.Value) + { + _logger.LogDebug("graphql is invalid."); + return await CheckAddressFromContractAsync(chainId, caHash, manager, version, chainOptions); + } + + return true; + } + + private async Task CheckAddressFromGraphQlAsync(string url, string caHash, + string managerAddress) + { + var cHolderInfos = await GetHolderInfosAsync(url, caHash); + var caHolder = cHolderInfos?.CaHolderInfo?.SelectMany(t => t.ManagerInfos); + return caHolder?.Any(t => t.Address == managerAddress); + } + + private async Task CheckAddressFromContractAsync(string chainId, string caHash, string manager, + string version, ChainOptions chainOptions) + { + var param = new GetHolderInfoInput + { + CaHash = Hash.LoadFromHex(caHash), + LoginGuardianIdentifierHash = Hash.Empty + }; + + var output = await CallTransactionAsync(chainId, AuthConstant.GetHolderInfo, version, + param, false, chainOptions); + + return output?.ManagerInfos?.Any(t => t.Address.ToBase58() == manager); + } + + private async Task CallTransactionAsync(string chainId, string methodName, string version, IMessage param, + bool isCrossChain, ChainOptions chainOptions) where T : class, IMessage, new() + { + try + { + var chainInfo = chainOptions.ChainInfos[chainId]; + + var client = new AElfClient(chainInfo.BaseUrl); + await client.IsConnectedAsync(); + var address = client.GetAddressFromPrivateKey(_contractOptions.Value.CommonPrivateKeyForCallTx); + + var contractAddress = isCrossChain + ? (await client.GetContractAddressByNameAsync(HashHelper.ComputeFrom(ContractName.CrossChain))) + .ToBase58() + : AuthConstant.PortKeyVersion2.Equals(version) + ? chainInfo.ContractAddress2 + : chainInfo.ContractAddress; + + var transaction = await client.GenerateTransactionAsync(address, contractAddress, methodName, param); + var txWithSign = client.SignTransaction(_contractOptions.Value.CommonPrivateKeyForCallTx, transaction); + var result = + await client.ExecuteTransactionAsync(new() { RawTransaction = txWithSign.ToByteArray().ToHex() }); + var value = new T(); + value.MergeFrom(ByteArrayHelper.HexStringToByteArray(result)); + return value; + } + catch (Exception e) + { + if (methodName != AuthConstant.GetHolderInfo) + { + _logger.LogError(e, "CallTransaction error, chain id:{chainId}, methodName:{methodName}", chainId, + methodName); + } + + _logger.LogError(e, "CallTransaction error, chain id:{chainId}, methodName:{methodName}", chainId, + methodName); + return null; + } + } + + private ForbidResult GetForbidResult(string errorType, string errorDescription) + { + return new ForbidResult( + new[] { OpenIddictServerAspNetCoreDefaults.AuthenticationScheme }, + properties: new AuthenticationProperties(new Dictionary + { + [OpenIddictServerAspNetCoreConstants.Properties.Error] = errorType, + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription + }!)); + } + + private async Task> GetResourcesAsync(ExtensionGrantContext context, + ImmutableArray scopes) + { + var resources = new List(); + if (!scopes.Any()) + { + return resources; + } + + await foreach (var resource in context.HttpContext.RequestServices.GetRequiredService() + .ListResourcesAsync(scopes)) + { + resources.Add(resource); + } + + return resources; + } + + public string Name { get; } = "signature"; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler_Check.cs b/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler_Check.cs new file mode 100644 index 0000000..45394e6 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/SignatureGrantHandler_Check.cs @@ -0,0 +1,78 @@ +using System.Text; +using AElf.CrossChainServer.Auth.Common; +using AElf.CrossChainServer.Auth.Options; +using AElf.ExceptionHandler; +using NBitcoin.DataEncoders; +using Nethereum.Hex.HexConvertors.Extensions; +using Nethereum.Signer; +using Nethereum.Util; +using Solnet.Wallet; + +namespace AElf.CrossChainServer.Auth; + +public partial class SignatureGrantHandler +{ + [ExceptionHandler(typeof(Exception), TargetType = typeof(SignatureGrantHandler), + MethodName = nameof(SignatureGrantHandlerExceptionAsync))] + public async Task CheckSignature(string source, string sourceType, byte[] signature, string message, + byte[] publicKey) + { + switch (source) + { + case AuthConstant.PortKeySource: + case AuthConstant.NightElfSource: + var hash = Encoding.UTF8.GetBytes(message).ComputeHash(); + _logger.LogInformation("hash:{hash}", hash); + return AElf.Cryptography.CryptoHelper.VerifySignature(signature, hash, publicKey); + case AuthConstant.WalletSource: + if (!Enum.TryParse(sourceType, true, out var walletType)) return false; + var addressRaw = Encoding.UTF8.GetString(publicKey); + switch (walletType) + { + case WalletEnum.EVM: + var signatureRaw = Encoding.UTF8.GetString(signature); + var messageRaw = Encoding.UTF8.GetString(ByteArrayHelper.HexStringToByteArray(message)); + var account = new EthereumMessageSigner().EncodeUTF8AndEcRecover(messageRaw, signatureRaw); + return addressRaw == account?.EnsureHexPrefix(); + case WalletEnum.Solana: + var messageByte = ByteArrayHelper.HexStringToByteArray(message); + var pubKey = new PublicKey(addressRaw); + return pubKey.Verify(messageByte, signature); + case WalletEnum.TRX: + signature = ByteArrayHelper.HexStringToByteArray(Encoding.UTF8.GetString(signature)); + messageRaw = Encoding.UTF8.GetString(ByteArrayHelper.HexStringToByteArray(message)); + var fullMessage = String.Concat("\x19TRON Signed Message:\n", messageRaw.Length, messageRaw); + var messageHash = new Sha3Keccack().CalculateHash(Encoding.UTF8.GetBytes(fullMessage)); + if (signature.Length != 65) + throw new ArgumentException("Invalid signature length"); + var r = new Span(signature, 0, 32).ToArray(); + var s = new Span(signature, 32, 32).ToArray(); + var v = signature[64]; + if (v < 27) v += 27; + var ecKey = EthECKey.RecoverFromSignature(EthECDSASignatureFactory.FromComponents(r, s, v), + messageHash); + var userAddress = ecKey.GetPublicAddress(); + var trxAddress = new Base58CheckEncoder().DecodeData(addressRaw); + return userAddress.ToLowerInvariant() + .EndsWith(BitConverter.ToString(trxAddress, 1).Replace("-", "").ToLowerInvariant()); + case WalletEnum.TON: + return true; + default: + return false; + } + default: + return false; + } + } + + public async Task SignatureGrantHandlerExceptionAsync(Exception ex, string source, string sourceType, + byte[] signature, string message, byte[] publicKey) + { + _logger.LogError(ex, "Signature Check failed."); + return new FlowBehavior + { + ExceptionHandlingStrategy = ExceptionHandlingStrategy.Return, + ReturnValue = false + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/apollosetting.json b/src/AElf.CrossChainServer.AuthServer/apollosetting.json new file mode 100644 index 0000000..64b010a --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/apollosetting.json @@ -0,0 +1,14 @@ +{ + "ClientId": "CrossChainServer_Authserver", + "apollo": { + "UseApollo" : false, + "AppId": "CrossChainServer", + "MetaServer": "http://localhost:8080", + "ConfigServer": [ + "http://localhost:8080" + ], + "Namespaces": [ + "appsettings.json" + ] + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.AuthServer/appsettings.json b/src/AElf.CrossChainServer.AuthServer/appsettings.json new file mode 100644 index 0000000..ea5a673 --- /dev/null +++ b/src/AElf.CrossChainServer.AuthServer/appsettings.json @@ -0,0 +1,89 @@ +{ + "App": { + "SelfUrl": "https://localhost:44377", + "ClientUrl": "http://localhost:4200", + "CorsOrigins": "https://*.CrossChainServer.com,http://localhost:4200,https://localhost:44336,https://localhost:44389", + "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44346,https://localhost:44336,https://localhost:44320" + }, + "Kestrel": { + "EndPoints": { + "Http": { + "Url": "http://*:8080/" + } + } + }, + "AuthServer": { + "IssuerUri": "http://localhost:8080" + }, + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Port=3306;Database=CrossChainServer;Uid=root;Pwd=;Command Timeout=120;" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "localhost", + "Port": "5672" + } + }, + "EventBus": { + "ClientName": "AuthHandler", + "ExchangeName": "CrossChainServer" + } + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "StringEncryption": { + "DefaultPassPhrase": "DVb2B8QjyeArjCTY" + }, + "TimeRange": 1440, + "ExpirationHour": 48, + "GraphQL": { + "Url": "https://dapp-portkey-test.portkey.finance/Portkey_DID/PortKeyIndexerCASchema/graphql", + "Url2": "https://dapp-aa-portkey-test.portkey.finance/Portkey_V2_DID/PortKeyIndexerCASchema/graphql" + }, + "ElasticUris": { + "Uris": [ + "http://127.0.0.1:9200" + ] + }, + "IndexSetting": { + "NumberOfShards": 5, + "NumberOfReplicas": 1, + "IndexPrefix": "CrossChainServer" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Default": "Debug", + "System": "Warning", + "Microsoft": "Warning", + "Orleans": "Warning" + } + }, + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff}{Offset:zzz}][{Level:u3}] [{SourceContext}] {Message}{NewLine}{Exception}" + } + }, + { + "Name": "RollingFile", + "Args": { + "pathFormat": "Logs/log-{Date}.log", + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff}{Offset:zzz}][{Level:u3}] [{SourceContext}] {Message}{NewLine}{Exception}", + "rollOnFileSizeLimit": true, + "rollingInterval": "Day", + "retainedFileCountLimit": 15 + } + } + ] + }, + "OpenTelemetry": { + "ServiceName": "CrossChain.AuthServer", + "ServiceVersion": "1.0.0", + "CollectorEndpoint": "http://localhost:4315" + } +} diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/AElf.CrossChainServer.ContractEventHandler.Core.csproj b/src/AElf.CrossChainServer.ContractEventHandler.Core/AElf.CrossChainServer.ContractEventHandler.Core.csproj new file mode 100644 index 0000000..b5e8b68 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/AElf.CrossChainServer.ContractEventHandler.Core.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + AElf.CrossChainServer.ContractEventHandler + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/ContractEventHandlerAutoMapperProfile.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/ContractEventHandlerAutoMapperProfile.cs new file mode 100644 index 0000000..e7898c8 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/ContractEventHandlerAutoMapperProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + public class ContractEventHandlerAutoMapperProfile : Profile + { + public ContractEventHandlerAutoMapperProfile() + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/CrossChainServerContractEventHandlerCoreModule.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/CrossChainServerContractEventHandlerCoreModule.cs new file mode 100644 index 0000000..24b9893 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/CrossChainServerContractEventHandlerCoreModule.cs @@ -0,0 +1,24 @@ +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.Core; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + [DependsOn( + typeof(CrossChainServerApplicationModule), + typeof(AElfNodeEventHandlerCoreModule), + typeof(AElfEventHandlerBackgroundJobModule), + typeof(CrossChainServerDomainSharedModule) + )] + public class CrossChainServerContractEventHandlerCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommitmentRevealedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommitmentRevealedProcessor.cs new file mode 100644 index 0000000..0857d5b --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommitmentRevealedProcessor.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class CommitmentRevealedProcessor : AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public CommitmentRevealedProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, + IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(CommitmentRevealed eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput() + { + Step = OracleStep.CommitmentRevealed, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommittedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommittedProcessor.cs new file mode 100644 index 0000000..79fae64 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CommittedProcessor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class CommittedProcessor : AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public CommittedProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(Committed eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput() + { + Step = OracleStep.Committed, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainReceivedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainReceivedProcessor.cs new file mode 100644 index 0000000..6a6f4fb --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainReceivedProcessor.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.MultiToken; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class CrossChainReceivedProcessor: AElfEventProcessorBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + + public CrossChainReceivedProcessor(ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService, IChainAppService chainAppService) + { + _crossChainTransferAppService = crossChainTransferAppService; + _tokenAppService = tokenAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(CrossChainReceived eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var fromChain = await _chainAppService.GetByAElfChainIdAsync(eventDetailsEto.FromChainId); + if (fromChain == null) + { + return; + } + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId =chain.Id, + Symbol = eventDetailsEto.Symbol + }); + + await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput() + { + ReceiveAmount = eventDetailsEto.Amount / (decimal)Math.Pow(10, token.Decimals), + ReceiveTime = txInfoDto.BlockTime, + FromChainId = fromChain.Id, + ReceiveTransactionId = txInfoDto.TransactionId, + ToChainId = chain.Id, + TransferTransactionId = eventDetailsEto.TransferTransactionId.ToHex(), + ReceiveTokenId = token.Id, + FromAddress = eventDetailsEto.From.ToBase58(), + ToAddress = eventDetailsEto.To.ToBase58() + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainTransferredProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainTransferredProcessor.cs new file mode 100644 index 0000000..dda2015 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/CrossChainTransferredProcessor.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.MultiToken; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; +using CrossChainTransferInput = AElf.CrossChainServer.CrossChain.CrossChainTransferInput; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class CrossChainTransferredProcessor: AElfEventProcessorBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + + public CrossChainTransferredProcessor(ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService, IChainAppService chainAppService) + { + _crossChainTransferAppService = crossChainTransferAppService; + _tokenAppService = tokenAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(CrossChainTransferred eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var toChain = await _chainAppService.GetByAElfChainIdAsync(eventDetailsEto.ToChainId); + if (toChain == null) + { + return; + } + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId =chain.Id, + Symbol = eventDetailsEto.Symbol + }); + + await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TransferAmount = eventDetailsEto.Amount / (decimal)Math.Pow(10, token.Decimals), + FromAddress = eventDetailsEto.From.ToBase58(), + ToAddress = eventDetailsEto.To.ToBase58(), + TransferTokenId = token.Id, + FromChainId = chain.Id, + ToChainId = toChain.Id, + TransferBlockHeight = txInfoDto.BlockNumber, + TransferTime = txInfoDto.BlockTime, + TransferTransactionId = txInfoDto.TransactionId + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ParentChainIndexedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ParentChainIndexedProcessor.cs new file mode 100644 index 0000000..eecd149 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ParentChainIndexedProcessor.cs @@ -0,0 +1,40 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.CrossChain; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ParentChainIndexedProcessor: AElfEventProcessorBase +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly IChainAppService _chainAppService; + + public ParentChainIndexedProcessor(ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService, + IChainAppService chainAppService) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(ParentChainIndexed eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var indexChain = await _chainAppService.GetByAElfChainIdAsync(eventDetailsEto.ChainId); + if (indexChain == null) + { + return; + } + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + BlockHeight = txInfoDto.BlockNumber, + BlockTime = txInfoDto.BlockTime, + ChainId = chain.Id, + IndexChainId = indexChain.Id, + IndexBlockHeight = eventDetailsEto.IndexedHeight + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithAggregationProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithAggregationProcessor.cs new file mode 100644 index 0000000..5bbff43 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithAggregationProcessor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class QueryCompletedWithAggregationProcessor : AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public QueryCompletedWithAggregationProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(QueryCompletedWithAggregation eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput() + { + Step = OracleStep.QueryCompleted, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithoutAggregationProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithoutAggregationProcessor.cs new file mode 100644 index 0000000..219cbc3 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCompletedWithoutAggregationProcessor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class QueryCompletedWithoutAggregationProcessor : AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public QueryCompletedWithoutAggregationProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(QueryCompletedWithoutAggregation eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput() + { + Step = OracleStep.QueryCompleted, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCreatedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCreatedProcessor.cs new file mode 100644 index 0000000..3ac8980 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/QueryCreatedProcessor.cs @@ -0,0 +1,46 @@ +using System; +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class QueryCreatedProcessor: AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public QueryCreatedProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(QueryCreated eventDetailsEto, EventContext txInfoDto) + { + if (!eventDetailsEto.QueryInfo.Title.StartsWith("record_receipts")) + { + return; + } + + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var receiptHash = eventDetailsEto.QueryInfo.Options[0].Split(".")[0]; + var starIndex = Convert.ToInt64(eventDetailsEto.QueryInfo.Options[0].Split(".")[1]); + var endIndex = Convert.ToInt64(eventDetailsEto.QueryInfo.Options[1].Split(".")[1]); + + for (var i = starIndex; i <= endIndex; i++) + { + await _oracleQueryInfoAppService.CreateAsync(new CreateOracleQueryInfoInput + { + Option = $"{receiptHash}.{i}", + Step = OracleStep.QueryCreated, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReceiptCreatedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReceiptCreatedProcessor.cs new file mode 100644 index 0000000..2ea7667 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReceiptCreatedProcessor.cs @@ -0,0 +1,50 @@ +using System; +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Bridge; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ReceiptCreatedProcessor : AElfEventProcessorBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + + public ReceiptCreatedProcessor(ITokenAppService tokenAppService, + ICrossChainTransferAppService crossChainTransferAppService, IChainAppService chainAppService) + { + _tokenAppService = tokenAppService; + _crossChainTransferAppService = crossChainTransferAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(ReceiptCreated eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = eventDetailsEto.Symbol + }); + + + await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TransferAmount = eventDetailsEto.Amount / (decimal)Math.Pow(10, token.Decimals), + FromAddress = eventDetailsEto.Owner.ToBase58(), + ToAddress = eventDetailsEto.TargetAddress, + TransferTokenId = token.Id, + FromChainId = chain.Id, + ToChainId = eventDetailsEto.TargetChainId, + TransferBlockHeight = txInfoDto.BlockNumber, + TransferTime = txInfoDto.BlockTime, + TransferTransactionId = txInfoDto.TransactionId, + ReceiptId = eventDetailsEto.ReceiptId + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportConfirmedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportConfirmedProcessor.cs new file mode 100644 index 0000000..a76e535 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportConfirmedProcessor.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Report; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ReportConfirmedProcessor: AElfEventProcessorBase +{ + private readonly IReportInfoAppService _reportInfoAppService; + private readonly IChainAppService _chainAppService; + private readonly ITokenAppService _tokenAppService; + + public ReportConfirmedProcessor(IReportInfoAppService reportInfoAppService, ITokenAppService tokenAppService, IChainAppService chainAppService) + { + _reportInfoAppService = reportInfoAppService; + _tokenAppService = tokenAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(ReportConfirmed eventDetailsEto, EventContext txInfoDto) + { + if (!eventDetailsEto.IsAllNodeConfirmed) + { + return; + } + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _reportInfoAppService.UpdateStepAsync(chain.Id, eventDetailsEto.RoundId, eventDetailsEto.Token, + eventDetailsEto.TargetChainId, ReportStep.Confirmed, txInfoDto.BlockNumber); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportProposedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportProposedProcessor.cs new file mode 100644 index 0000000..8fe18d9 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/ReportProposedProcessor.cs @@ -0,0 +1,41 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Report; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ReportProposedProcessor: AElfEventProcessorBase +{ + private readonly IReportInfoAppService _reportInfoAppService; + private readonly IChainAppService _chainAppService; + + public ReportProposedProcessor(IReportInfoAppService reportInfoAppService, + IChainAppService chainAppService) + { + _reportInfoAppService = reportInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(ReportProposed eventDetailsEto, EventContext txInfoDto) + { + if (!eventDetailsEto.QueryInfo.Title.StartsWith("lock_token_")) + { + return; + } + + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _reportInfoAppService.CreateAsync(new CreateReportInfoInput + { + ChainId = chain.Id, + ReceiptId = eventDetailsEto.QueryInfo.Title.Split("_")[2], + ReceiptHash = eventDetailsEto.QueryInfo.Options[0], + RoundId = eventDetailsEto.RoundId, + Token = eventDetailsEto.Token, + TargetChainId = eventDetailsEto.TargetChainId, + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SideChainIndexedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SideChainIndexedProcessor.cs new file mode 100644 index 0000000..13e8cf7 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SideChainIndexedProcessor.cs @@ -0,0 +1,39 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.CrossChain; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class SideChainIndexedProcessor: AElfEventProcessorBase +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly IChainAppService _chainAppService; + + public SideChainIndexedProcessor(ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService, IChainAppService chainAppService) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(SideChainIndexed eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + var indexChain = await _chainAppService.GetByAElfChainIdAsync(eventDetailsEto.ChainId); + if (indexChain == null) + { + return; + } + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + BlockHeight = txInfoDto.BlockNumber, + BlockTime = txInfoDto.BlockTime, + ChainId = chain.Id, + IndexChainId = indexChain.Id, + IndexBlockHeight = eventDetailsEto.IndexedHeight + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SufficientCommitmentsCollectedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SufficientCommitmentsCollectedProcessor.cs new file mode 100644 index 0000000..bb94c12 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/SufficientCommitmentsCollectedProcessor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class SufficientCommitmentsCollectedProcessor : AElfEventProcessorBase +{ + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + private readonly IChainAppService _chainAppService; + + public SufficientCommitmentsCollectedProcessor(IOracleQueryInfoAppService oracleQueryInfoAppService, IChainAppService chainAppService) + { + _oracleQueryInfoAppService = oracleQueryInfoAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(SufficientCommitmentsCollected eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput() + { + Step = OracleStep.SufficientCommitmentsCollected, + ChainId = chain.Id, + QueryId = eventDetailsEto.QueryId.ToHex(), + LastUpdateHeight = txInfoDto.BlockNumber + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/TokenSwappedProcessor.cs b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/TokenSwappedProcessor.cs new file mode 100644 index 0000000..5f68731 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler.Core/Processors/TokenSwappedProcessor.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.BackgroundJob; +using AElf.AElfNode.EventHandler.BackgroundJob.Processors; +using AElf.Contracts.Bridge; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class TokenSwappedProcessor: AElfEventProcessorBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IChainAppService _chainAppService; + + public TokenSwappedProcessor(ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService, IChainAppService chainAppService) + { + _crossChainTransferAppService = crossChainTransferAppService; + _tokenAppService = tokenAppService; + _chainAppService = chainAppService; + } + + protected override async Task HandleEventAsync(TokenSwapped eventDetailsEto, EventContext txInfoDto) + { + var chain = await _chainAppService.GetByAElfChainIdAsync(txInfoDto.ChainId); + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = eventDetailsEto.Symbol + }); + + await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput() + { + ReceiveAmount = eventDetailsEto.Amount / (decimal)Math.Pow(10, token.Decimals), + ReceiveTime = txInfoDto.BlockTime, + FromChainId = eventDetailsEto.FromChainId, + ReceiveTransactionId = txInfoDto.TransactionId, + ToChainId = chain.Id, + ReceiveTokenId = token.Id, + ToAddress = eventDetailsEto.Address.ToBase58(), + ReceiptId = eventDetailsEto.ReceiptId + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler/AElf.CrossChainServer.ContractEventHandler.csproj b/src/AElf.CrossChainServer.ContractEventHandler/AElf.CrossChainServer.ContractEventHandler.csproj new file mode 100644 index 0000000..8039bde --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler/AElf.CrossChainServer.ContractEventHandler.csproj @@ -0,0 +1,35 @@ + + + + net8.0 + Exe + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + Always + + + + diff --git a/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerContractEventHandlerModule.cs b/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerContractEventHandlerModule.cs new file mode 100644 index 0000000..828c618 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerContractEventHandlerModule.cs @@ -0,0 +1,82 @@ +using AElf.AElfNode.EventHandler.BackgroundJob.Options; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using StackExchange.Redis; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.BlobStoring.Aliyun; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(CrossChainServerEntityFrameworkCoreModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(CrossChainServerContractEventHandlerCoreModule), + typeof(AbpBlobStoringAliyunModule), + typeof(AbpEventBusRabbitMqModule) + )] + public class CrossChainServerContractEventHandlerModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + + ConfigureCache(configuration); + ConfigureRedis(context, configuration); + + context.Services.AddHostedService(); + + Configure(options => + { + configuration.GetSection("AElfEventProcessors").Bind(options); + }); + } + + private void ConfigureCache(IConfiguration configuration) + { + Configure(options => + { + options.KeyPrefix = "CrossChainServer:"; + }); + } + + private void ConfigureRedis( + ServiceConfigurationContext context, + IConfiguration configuration) + { + var config = configuration["Redis:Configuration"]; + if (string.IsNullOrEmpty(config)) + { + return; + } + + var redis = ConnectionMultiplexer.Connect(config); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "CrossChainServer-Protection-Keys"); + } + + // private void ConfigureEthereumEventBackgroundJobOption(IConfiguration configuration) + // { + // Configure(options => + // { + // var parallelConfigurationSection = configuration.GetSection("RabbitEthereumEventParallelConfiguration"); + // options.ConnectionName = parallelConfigurationSection.GetSection("ConnectionName").Value; + // options.QueueName = parallelConfigurationSection.GetSection("QueueName").Value; + // options.ParallelWorker = int.Parse(parallelConfigurationSection.GetSection("WorkerCount").Value); + // }); + // } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerHostedService.cs b/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerHostedService.cs new file mode 100644 index 0000000..1eccb3f --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler/CrossChainServerHostedService.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Volo.Abp; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + public class CrossChainServerHostedService : IHostedService + { + private readonly IAbpApplicationWithExternalServiceProvider _application; + private readonly IServiceProvider _serviceProvider; + + public CrossChainServerHostedService( + IAbpApplicationWithExternalServiceProvider application, + IServiceProvider serviceProvider) + { + _application = application; + _serviceProvider = serviceProvider; + } + + public Task StartAsync(CancellationToken cancellationToken) + { + _application.Initialize(_serviceProvider); + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + _application.Shutdown(); + return Task.CompletedTask; + } + } +} diff --git a/src/AElf.CrossChainServer.ContractEventHandler/Program.cs b/src/AElf.CrossChainServer.ContractEventHandler/Program.cs new file mode 100644 index 0000000..a8070ad --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler/Program.cs @@ -0,0 +1,59 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + public class Program + { + public static async Task Main(string[] args) + { + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .Build(); + + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .ReadFrom.Configuration(configuration) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting AElf.CrossChainServer.ContractEventHandler."); + await CreateHostBuilder(args).RunConsoleAsync(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } + + internal static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureServices((hostContext, services) => + { + services.AddApplication(); + }) + .UseAutofac() + .UseSerilog(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.ContractEventHandler/appsettings.json b/src/AElf.CrossChainServer.ContractEventHandler/appsettings.json new file mode 100644 index 0000000..cf52905 --- /dev/null +++ b/src/AElf.CrossChainServer.ContractEventHandler/appsettings.json @@ -0,0 +1,194 @@ +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Port=3306;Database=CrossChainServer;Uid=root;Pwd=123456;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "StringEncryption": { + "DefaultPassPhrase": "RDjeywn1asnmJgNm" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "127.0.0.1", + "Port": "5672", + "UserName": "admin", + "Password": "123456" + } + }, + "EventBus": { + "ClientName": "AElfCrossChain-ContractHandler", + "ExchangeName": "AElfCrossChain" + } + }, + "ElasticUris": { + "Uris":["http://127.0.0.1:9200"] + }, + "IndexSetting": { + "IndexPrefix": "eBridgeServer" + }, + "ChainApi": { + "ChainNodeApis": { + "MainChain_AELF": "http://192.168.67.47:8000/", + "SideChain_tDVV": "http://192.168.67.31:8000/", + "SideChain_tDVW": "http://192.168.67.204:8000/" + } + }, + "AElfEventProcessors": { + "IsCheckFork": true, + "IsDeleteForkTx": true, + "IsAddStatusFilter": true, + "JobCategory": "CrossChain", + "NodeUrlDic": { + "9992731": "http://192.168.67.47:8000/", + "1866392": "http://192.168.67.31:8000/", + "1931928": "http://192.168.67.204:8000/" + }, + "ProcessorKeyList": [ + { + "ContractAddress": "JRmBduh4nXWi1aXgdUsj5gJrzeZb2LxmrAbf7W99faZSvoAaE", + "EventName": "CrossChainReceived", + "ProcessorName": "CrossChainReceivedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "JRmBduh4nXWi1aXgdUsj5gJrzeZb2LxmrAbf7W99faZSvoAaE", + "EventName": "CrossChainTransferred", + "ProcessorName": "CrossChainTransferredProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "2SQ9LeGZYSWmfJcYuQkDQxgd3HzwjamAaaL4Tge2eFSXw2cseq", + "EventName": "ParentChainIndexed", + "ProcessorName": "ParentChainIndexedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "2SQ9LeGZYSWmfJcYuQkDQxgd3HzwjamAaaL4Tge2eFSXw2cseq", + "EventName": "SideChainIndexed", + "ProcessorName": "SideChainIndexedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "7RzVGiuVWkvL4VfVHdZfQF2Tri3sgLe9U991bohHFfSRZXuGX", + "EventName": "CrossChainReceived", + "ProcessorName": "CrossChainReceivedProcessor", + "ChainId": 1866392 + }, + { + "ContractAddress": "7RzVGiuVWkvL4VfVHdZfQF2Tri3sgLe9U991bohHFfSRZXuGX", + "EventName": "CrossChainTransferred", + "ProcessorName": "CrossChainTransferredProcessor", + "ChainId": 1866392 + }, + { + "ContractAddress": "2snHc8AMh9QMbCAa7XXmdZZVM5EBZUUPDdLjemwUJkBnL6k8z9", + "EventName": "ParentChainIndexed", + "ProcessorName": "ParentChainIndexedProcessor", + "ChainId": 1866392 + }, + { + "ContractAddress": "2snHc8AMh9QMbCAa7XXmdZZVM5EBZUUPDdLjemwUJkBnL6k8z9", + "EventName": "SideChainIndexed", + "ProcessorName": "SideChainIndexedProcessor", + "ChainId": 1866392 + }, + { + "ContractAddress": "ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx", + "EventName": "CrossChainReceived", + "ProcessorName": "CrossChainReceivedProcessor", + "ChainId": 1931928 + }, + { + "ContractAddress": "ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx", + "EventName": "CrossChainTransferred", + "ProcessorName": "CrossChainTransferredProcessor", + "ChainId": 1931928 + }, + { + "ContractAddress": "2PC7Jhb5V6iZXxz8uQUWvWubYkAoCVhtRGSL7VhTWX85R8DBuN", + "EventName": "ParentChainIndexed", + "ProcessorName": "ParentChainIndexedProcessor", + "ChainId": 1931928 + }, + { + "ContractAddress": "2PC7Jhb5V6iZXxz8uQUWvWubYkAoCVhtRGSL7VhTWX85R8DBuN", + "EventName": "SideChainIndexed", + "ProcessorName": "SideChainIndexedProcessor", + "ChainId": 1931928 + }, + { + "ContractAddress": "Oracle", + "EventName": "CommitmentRevealed", + "ProcessorName": "CommitmentRevealedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Oracle", + "EventName": "Committed", + "ProcessorName": "CommittedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Oracle", + "EventName": "QueryCompletedWithAggregation", + "ProcessorName": "QueryCompletedWithAggregationProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Oracle", + "EventName": "QueryCompletedWithoutAggregation", + "ProcessorName": "QueryCompletedWithoutAggregationProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Oracle", + "EventName": "QueryCreated", + "ProcessorName": "QueryCreatedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Report", + "EventName": "ReportConfirmed", + "ProcessorName": "ReportConfirmedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Report", + "EventName": "ReportProposed", + "ProcessorName": "ReportProposedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Report", + "EventName": "SufficientCommitmentsCollected", + "ProcessorName": "SufficientCommitmentsCollectedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Bridge", + "EventName": "ReceiptCreated", + "ProcessorName": "ReceiptCreatedProcessor", + "ChainId": 9992731 + }, + { + "ContractAddress": "Bridge", + "EventName": "TokenSwapped", + "ProcessorName": "TokenSwappedProcessor", + "ChainId": 9992731 + } + ] + }, + "Serilog": { + "WriteTo": [ + { + "Name": "RollingFile", + "Args": { + "pathFormat": "Logs/log-{Date}.log", + "retainedFileCountLimit": 2 + } + } + ] + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/AElf.CrossChainServer.DbMigrator.csproj b/src/AElf.CrossChainServer.DbMigrator/AElf.CrossChainServer.DbMigrator.csproj new file mode 100644 index 0000000..a8b3ef7 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/AElf.CrossChainServer.DbMigrator.csproj @@ -0,0 +1,43 @@ + + + + + + Exe + net8.0 + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.DbMigrator/CrossChainServerDbMigratorModule.cs b/src/AElf.CrossChainServer.DbMigrator/CrossChainServerDbMigratorModule.cs new file mode 100644 index 0000000..6ed7900 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/CrossChainServerDbMigratorModule.cs @@ -0,0 +1,19 @@ +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.DbMigrator; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(CrossChainServerEntityFrameworkCoreModule), + typeof(CrossChainServerApplicationContractsModule) +)] +public class CrossChainServerDbMigratorModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => options.IsJobExecutionEnabled = false); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/DbMigratorHostedService.cs b/src/AElf.CrossChainServer.DbMigrator/DbMigratorHostedService.cs new file mode 100644 index 0000000..6555984 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/DbMigratorHostedService.cs @@ -0,0 +1,51 @@ +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using AElf.CrossChainServer.Data; +using Serilog; +using Volo.Abp; +using Volo.Abp.Data; + +namespace AElf.CrossChainServer.DbMigrator; + +public class DbMigratorHostedService : IHostedService +{ + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly IConfiguration _configuration; + + public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration) + { + _hostApplicationLifetime = hostApplicationLifetime; + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + options.Services.AddLogging(c => c.AddSerilog()); + options.AddDataMigrationEnvironment(); + })) + { + await application.InitializeAsync(); + + await application + .ServiceProvider + .GetRequiredService() + .MigrateAsync(); + + await application.ShutdownAsync(); + + _hostApplicationLifetime.StopApplication(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/src/AElf.CrossChainServer.DbMigrator/Program.cs b/src/AElf.CrossChainServer.DbMigrator/Program.cs new file mode 100644 index 0000000..e54415a --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/Program.cs @@ -0,0 +1,39 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Serilog; +using Serilog.Events; + +namespace AElf.CrossChainServer.DbMigrator; + +class Program +{ + static async Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Information() + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) +#if DEBUG + .MinimumLevel.Override("AElf.CrossChainServer", LogEventLevel.Debug) +#else + .MinimumLevel.Override("AElf.CrossChainServer", LogEventLevel.Information) +#endif + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureLogging((context, logging) => logging.ClearProviders()) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/src/AElf.CrossChainServer.DbMigrator/appsettings.json b/src/AElf.CrossChainServer.DbMigrator/appsettings.json new file mode 100644 index 0000000..64dddc2 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/appsettings.json @@ -0,0 +1,211 @@ +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Port=3306;Database=eBridgeServerV4;Uid=root;Pwd=12345678;" + }, + "Chain": [ + { + "Id": "MainChain_AELF", + "Name": "MainChain AELF", + "Type": 0, + "IsMainChain": true, + "AElfChainId": 9992731, + "BlockChain": "AElf" + }, + { + "Id": "SideChain_tDVW", + "Name": "SideChain tDVW", + "Type": 0, + "IsMainChain": false, + "AElfChainId": 1931928, + "BlockChain": "AElf" + }, + { + "Id": "Sepolia", + "Name": "Sepolia", + "Type": 1, + "IsMainChain": true, + "AElfChainId": 0, + "BlockChain": "ETH" + }, + { + "Id": "BSCTest", + "Name": "BSCTest", + "Type": 1, + "IsMainChain": true, + "AElfChainId": 0, + "BlockChain": "BSC" + }, + { + "Id": "BaseSepolia", + "Name": "BaseSepolia", + "Type": 1, + "IsMainChain": true, + "AElfChainId": 0, + "BlockChain": "ETH" + }, + { + "Id": "TonTest", + "Name": "TonTest", + "Type": 2, + "IsMainChain": true, + "AElfChainId": 1100, + "BlockChain": "TVM" + } + ], + "IndexerSettings": [ + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.OracleQuery", + "ChainId": "MainChain_AELF", + "Value": "250909426" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.Report", + "ChainId": "MainChain_AELF", + "Value": "250909426" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.CrossChainTransfer", + "ChainId": "MainChain_AELF", + "Value": "250909426" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.CrossChainIndexing", + "ChainId": "MainChain_AELF", + "Value": "250909426" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.OracleQuery", + "ChainId": "SideChain_tDVW", + "Value": "150488754" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.Report", + "ChainId": "SideChain_tDVW", + "Value": "150488754" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.CrossChainTransfer", + "ChainId": "SideChain_tDVW", + "Value": "150488754" + }, + { + "TypePrefix": "Confirmed", + "SyncType": "CrossChainServer.IndexerSync.CrossChainIndexing", + "ChainId": "SideChain_tDVW", + "Value": "150488754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.OracleQuery", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.Report", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.CrossChainTransfer", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.CrossChainIndexing", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.OracleQuery", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.Report", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.CrossChainTransfer", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.CrossChainIndexing", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.PoolLiquidity", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.PoolLiquidity", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.UserLiquidity", + "ChainId": "MainChain_AELF", + "Value": "250911426" + }, + { + "TypePrefix": "", + "SyncType": "CrossChainServer.IndexerSync.UserLiquidity", + "ChainId": "SideChain_tDVW", + "Value": "150490754" + } + ], + "OpenIddict": { + "Applications": { + "CrossChainServer_Web": { + "ClientId": "CrossChainServer_Web", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44393" + }, + "CrossChainServer_App": { + "ClientId": "CrossChainServer_App", + "ClientSecret": "1q2w3e*", + "RootUrl": "http://localhost:4200" + }, + "CrossChainServer_BlazorServerTiered": { + "ClientId": "CrossChainServer_BlazorServerTiered", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44340" + }, + "CrossChainServer_Swagger": { + "ClientId": "CrossChainServer_Swagger", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44320" + } + } + }, + "ElasticUris": { + "Uris": [ + "http://127.0.0.1:9200" + ] + }, + "IndexSetting": { + "NumberOfShards": 5, + "NumberOfReplicas": 1, + "IndexPrefix": "eBridgeServerV4" + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/appsettings.secrets.json b/src/AElf.CrossChainServer.DbMigrator/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/tempkey.jwk b/src/AElf.CrossChainServer.DbMigrator/tempkey.jwk new file mode 100644 index 0000000..425df78 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/tempkey.jwk @@ -0,0 +1 @@ +{"alg":"RS256","d":"EW3mkJAwiQIVx1cHXpuHVC0u4O5AFW-wsm9KhM8bt8urlNoL6XhpFVN9PrHjD5tX-FWIRciM_RqtUtW92wSt6h1k1BSmL2iXh4R7l20ms9hUpaK1UEHyosfctv_hEu8QzrcJd2Vb3gfNQemvz6wRqaQ-Tlp1Yu31dnJqNouT7zsTC5ds6HMjOfXKAImTX_dH_NuavDdrd_iOiMSWTzFlic_ftKiqrHgz13oVrla8RXIU1uUx3ZyHwP8qqly-wgDFL3ff9NM6684qUOaNVNO4TluRZZT64tAfMjEvVpElOdMM7-lJAHhwlzWWUsG44QGieVaTNHjsTLfAfSHgFEbgMQ","dp":"GWV16tpnZWdI08x7TzkoRkcfsOxPEHVH24syE5-k-HWa--xO4nh9E-m5wAaTsF8XhnkG_UGPjR3tvyL7q8ilRrVwWuGoZGXSfazK-yy41BVJpYK7ucojxPKF8C3kPB-p1CeozlJn7bVtwqaIC-NSh1IY8ahpZBVGuI4ZBPoqYGE","dq":"NF9Rn8W1kA1dM1cZ8S1NQIm9UrR-W60H1hV6kr4BhhSIsYbCYlIf6FYXBkPqxBqVj2e0fc5U5D9qAv97r36tYScwf6IjKEkauXZt07miKCEqENai-lTSwnnaLvOkISPm-m2bhZAHO6AI0KJmnKYk6CIGw2d8Vx5lTj7_-VFSpDE","e":"AQAB","kid":"263360938017DD8B93E0FDD8FE15C13B","kty":"RSA","n":"pI_MdR_4X3iHQhfCUlU_fSpLl3vuBwR6CzFkIFSyuLuNuaLGT0AqZ0T190hS48X4e5tM6uzcDlWZGkCfWpJcENQ_c-gl141C0rhHnpZ_Xkc3g4ozSB8DUYjWYkqOvapfDXcMmgIq0JFuqPfUdPHzlDGHegC1py9Xiu9v55O8NKwwmKGRa1ztjIMIEOpczqfdJVUyFVTjyK9mJJnlw16iSA0oR95zhsIFXZV3QqKJqzYlQqS3IUj6WADx9iceWGvK485Ina2Cce5Pw5u23R21oPp02sqgjQPmV-TEak0pQC3yiJos7W8XqZyX41evxeXlgaF4NwKpoCgeGAjAI75hwQ","p":"1tEPNYlkTjJtiG-EJ0STebPOkpGks1tVzRX-HFb7pF0oGI8X4ZTu1QHnvWaMljqtUUxwSC3jJQ34xCd6Nc0FIg4-IJQhgVQmtQoyv-QdGjz7_tK1ei4tK2zdmD8ONUIlZWsVedQQZFtOo8KARzcPST0zRW4xUC3SMyyXS9Wvupk","q":"xBxJ0sONSthDLVGMkY5L-EMirBjwlfIvYNHvVBz3FC-bdKB8Kz6bQbQ5KshnUyE6NwQBmhADFILqH8qfLymVGqiVpS0e9Oqo1PwKVC8-P6V2XGTOT9wmmtHvVkvP-gheSjI6YOHK3rpLbRNxWDYVcnRbAA_pC2t0lfWePQraQWk","qi":"jHaVGoGwTAWFqGoTi91ZYgwRhlr48cK2vTDrWioFoaDHANzGcbLODCuh4vLlG9jR4LEmWUUNztm6GhGLIlASl03hOJnaCAm-IcxGFzI2djVbQbmshvsP8bja3aYHAHsx_EcKuv4xCAgpqTWt1LtXPp3_tdRlD1BQFF5HyS8BR2c"} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/tempkey.rsa b/src/AElf.CrossChainServer.DbMigrator/tempkey.rsa new file mode 100644 index 0000000..494c201 --- /dev/null +++ b/src/AElf.CrossChainServer.DbMigrator/tempkey.rsa @@ -0,0 +1,13 @@ +{ + "KeyId": "f788zGVUZh9H-HbWL1S-Mg", + "Parameters": { + "D": "F19hbC5PLO872DszGiJnVoU55ee7XGXmNf0KEKndJ/uGBv5lWklXA0QF80h1ytWXde0jV5isQPB1t7mPhRQlDoDTkywLi1CeOgBPbxzHEfLjZZ5c4olfeX0IJX9BDqgUntY0H1a/+Om/eDu4OZUz3EIJFFZBgz46YZSyTT6ZDvAEdpC/o66sNJmxvJIp+8zVoVDSqBUzxmc+oEamXLg7r2jdymxJMxau1kQFxEGLOrJnNxGsEe8UrYA3qSsm8m/Xg4uOh7RYgnuEEt88+KTvRq+CAMWhN3YNLtOJ3NmXowwE7e1Ma+jih9+UVfxZn14P5+SOJbQ2bYV2sCV+2vBiCQ==", + "DP": "oPiGO/qdOQfFEAS9fMInQnsrNylIZVpDYEVoDJ6/jQfE/IpuwxGcmsaGvCob3SKxZiJRLCWpwJYo1hCh/JOSVGWMkVyELky56nbbkkV5ymKLSGZ4JoetdQs+GchnPdR+k2P9Ij1Kjk13ylubN3htzNhcBASJpOfSEv5pPVzGKX0=", + "DQ": "z6imxLABHkyftbfUUtpeOlPanEHgpuIjmUdp3T1Ju1jziE63UEhuj0GPAXOF17uYxixwYE8JhOJ7+TyIK9oZeI3zH2OzJqQh8f5PCQ/E+0ULXZDeNV/ShDLCTufu3Fis9Rt64uTp/H/l21oMQ79jc0ysa8DTz1ReJLRc5qjL41U=", + "Exponent": "AQAB", + "InverseQ": "ieZcvSt5XYukKJKhXpv5Dm/1RD7iH88cZnhLSTEVTMoOUHoYWmApY5pNLGahbfjA9bxnkBWDYex/i7wE9uNNY5CsA6ovUaQLVJDt3kHvR9W+9QtN8D6jjG2TuRbbOdEg4RqhfjUaDfDIgTJX2Wxc8U98FOvOyGw1HzwUPFZKecM=", + "Modulus": "vk4z1Bmtmbo+gxITcY+FIlXzcO2wTOGlOXK5GMYj/6PUMFt7lbqkc72AkPsrAo5/JE8LYLhWj7fzSKbjvtowHCz5m2t+FlUYmuiKpvvnJsTqvQrckNlbZ1nm071q5PhP3Dar/OksfBhPtAX+c3+NjDnM/w53ccJJNaBDO/s9JYoN7vH5n6ed1pMSK71hmg4MPsxChcnc1f1PpnG2mqyJ253+GEUbj/kRyeBSmCCr9aadov2ZzxIKVaFNagJEHOzanQmorSLpP25GfOHCuy27Zkef94V/qU9elzjbH4uIKslVGx5T6H99TYh0sUGu11NytYJa5WNAZWow95CzurC2vw==", + "P": "4GMCQy+XTNzR5TsgFcdAZv2K6TcQR13fHVvPoxQp/b32V5YUJOBFEUAtqociy5ro4+KzpXP5WPSk1ZtznGKuNZyLq8gTnhpB3rwd0sdo4zxKnQ5nu+n1UhlhWNxg5A9V5TaciUAyPrHWJfLoYTQWygNTgJELQH5zZXi2ihC2uiU=", + "Q": "2R36pamnLAJggkPJxiW5qH6HizZ+bkQVg0BBftMLzkAM8Y9CwTW75GRUzGEJFpMckkw0GZSYb1Uwl3DVUpkcQ8LZ91IPYdPpDlYUshhIxl184M55pnO14besKxJtMZ64zhHKVAR2pBMO0n6W4/1iBXkkQqyPViJxdfvXPJMBbhM=" + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/AElf.CrossChainServer.Domain.Shared.csproj b/src/AElf.CrossChainServer.Domain.Shared/AElf.CrossChainServer.Domain.Shared.csproj new file mode 100644 index 0000000..4b00a6d --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/AElf.CrossChainServer.Domain.Shared.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + AElf.CrossChainServer + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.Domain.Shared/BridgeContract/TransferType.cs b/src/AElf.CrossChainServer.Domain.Shared/BridgeContract/TransferType.cs new file mode 100644 index 0000000..337ca34 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/BridgeContract/TransferType.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.BridgeContract; + +public enum TransferType +{ + Transfer, + Receive +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Chains/BlockchainType.cs b/src/AElf.CrossChainServer.Domain.Shared/Chains/BlockchainType.cs new file mode 100644 index 0000000..10a49c6 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Chains/BlockchainType.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.Chains; + +public enum BlockchainType +{ + AElf, + Evm, + Tvm +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainDailyLimitEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainDailyLimitEto.cs new file mode 100644 index 0000000..a666217 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainDailyLimitEto.cs @@ -0,0 +1,15 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainDailyLimitEto +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal RemainAmount { get; set; } + public long RefreshTime { get; set; } + public decimal DailyLimit { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainIndexingInfoEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainIndexingInfoEto.cs new file mode 100644 index 0000000..8970c2f --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainIndexingInfoEto.cs @@ -0,0 +1,14 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +[Serializable] +public class CrossChainIndexingInfoEto +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } + public string IndexChainId { get; set; } + public long IndexBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainLimitType.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainLimitType.cs new file mode 100644 index 0000000..a6868f4 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainLimitType.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.CrossChain; + +public enum CrossChainLimitType +{ + Receipt, + Swap +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainRateLimitEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainRateLimitEto.cs new file mode 100644 index 0000000..ec61e75 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainRateLimitEto.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimitEto +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal CurrentAmount { get; set; } + public decimal Capacity { get; set; } + public decimal Rate { get; set; } + public bool IsEnable { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainStatus.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainStatus.cs new file mode 100644 index 0000000..4782868 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainStatus.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.CrossChain; + +public enum CrossChainStatus +{ + Transferred, + Indexed, + Received +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainTransferEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainTransferEto.cs new file mode 100644 index 0000000..eecbff1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainTransferEto.cs @@ -0,0 +1,33 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +[Serializable] +public class CrossChainTransferEto +{ + public Guid Id { get; set; } + public CrossChainType Type { get; set; } + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public string InlineTransferTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public decimal TransferAmount { get; set; } + public decimal ReceiveAmount { get; set; } + public Guid TransferTokenId { get; set; } + public Guid ReceiveTokenId { get; set; } + public CrossChainStatus Status { get; set; } + public string ReceiptId { get; set; } + public double Progress { get; set; } + public DateTime ProgressUpdateTime { get; set; } + public string TraceId { get; set; } + public ReceiptStatus TransferStatus { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } + public long ReceiveBlockHeight { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainType.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainType.cs new file mode 100644 index 0000000..5f2448c --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainType.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.CrossChain; + +public enum CrossChainType +{ + Homogeneous, + Heterogeneous +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReceiptStatus.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReceiptStatus.cs new file mode 100644 index 0000000..4791a46 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReceiptStatus.cs @@ -0,0 +1,8 @@ +namespace AElf.CrossChainServer.CrossChain; + +public enum ReceiptStatus +{ + Initializing, + Pending, + Confirmed +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainErrorCodes.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainErrorCodes.cs new file mode 100644 index 0000000..472d2d1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer; + +public static class CrossChainServerDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainSharedModule.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainSharedModule.cs new file mode 100644 index 0000000..86dd1e3 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerDomainSharedModule.cs @@ -0,0 +1,58 @@ +using AElf.CrossChainServer.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) +)] +public class CrossChainServerDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + CrossChainServerGlobalFeatureConfigurator.Configure(); + CrossChainServerModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/CrossChainServer"); + + options.DefaultResourceType = typeof(CrossChainServerResource); + }); + + Configure(options => + { + options.MapCodeNamespace("CrossChainServer", typeof(CrossChainServerResource)); + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerGlobalFeatureConfigurator.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..ea66157 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer; + +public static class CrossChainServerGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerModuleExtensionConfigurator.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerModuleExtensionConfigurator.cs new file mode 100644 index 0000000..f2f16fb --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChainServerModuleExtensionConfigurator.cs @@ -0,0 +1,68 @@ +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer; + +public static class CrossChainServerModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + IdentityUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ar.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ar.json new file mode 100644 index 0000000..3e5227a --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ar.json @@ -0,0 +1,8 @@ +{ + "culture": "ar", + "texts": { + "Menu:Home": "الرئيسية", + "Welcome": "مرحبا", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/cs.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/cs.json new file mode 100644 index 0000000..5a0bbf6 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/cs.json @@ -0,0 +1,8 @@ +{ + "culture": "cs", + "texts": { + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/de-DE.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/de-DE.json new file mode 100644 index 0000000..aca4528 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/de-DE.json @@ -0,0 +1,8 @@ +{ + "culture": "de-DE", + "texts": { + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en-GB.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en-GB.json new file mode 100644 index 0000000..d2ca079 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en-GB.json @@ -0,0 +1,8 @@ +{ + "culture": "en-GB", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en.json new file mode 100644 index 0000000..d2a6a98 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/en.json @@ -0,0 +1,8 @@ +{ + "culture": "en", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/es.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/es.json new file mode 100644 index 0000000..31b4b59 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/es.json @@ -0,0 +1,8 @@ +{ + "culture": "es", + "texts": { + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fi.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fi.json new file mode 100644 index 0000000..a318859 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fi.json @@ -0,0 +1,8 @@ +{ + "culture": "fi", + "texts": { + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fr.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fr.json new file mode 100644 index 0000000..e76eac0 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/fr.json @@ -0,0 +1,8 @@ +{ + "culture": "fr", + "texts": { + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hi.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hi.json new file mode 100644 index 0000000..a1676bf --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hi.json @@ -0,0 +1,8 @@ +{ + "culture": "hi", + "texts": { + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hu.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hu.json new file mode 100644 index 0000000..c7b6a33 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/hu.json @@ -0,0 +1,8 @@ +{ + "culture": "hu", + "texts": { + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/is.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/is.json new file mode 100644 index 0000000..190df90 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/is.json @@ -0,0 +1,8 @@ +{ + "culture": "is", + "texts": { + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/it.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/it.json new file mode 100644 index 0000000..82ce42b --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/it.json @@ -0,0 +1,8 @@ +{ + "culture": "it", + "texts": { + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/nl.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/nl.json new file mode 100644 index 0000000..9ba8da4 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/nl.json @@ -0,0 +1,8 @@ +{ + "culture": "nl", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pl-PL.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pl-PL.json new file mode 100644 index 0000000..33412f3 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pl-PL.json @@ -0,0 +1,8 @@ +{ + "culture": "pl-PL", + "texts": { + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pt-BR.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pt-BR.json new file mode 100644 index 0000000..8c818a0 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/pt-BR.json @@ -0,0 +1,8 @@ +{ + "culture": "pt-BR", + "texts": { + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ro-RO.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ro-RO.json new file mode 100644 index 0000000..1fe5601 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ro-RO.json @@ -0,0 +1,8 @@ +{ + "culture": "ro-RO", + "texts": { + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ru.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ru.json new file mode 100644 index 0000000..8464e44 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/ru.json @@ -0,0 +1,8 @@ +{ + "culture": "ru", + "texts": { + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sk.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sk.json new file mode 100644 index 0000000..4f35aaf --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sk.json @@ -0,0 +1,8 @@ +{ + "culture": "sk", + "texts": { + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sl.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sl.json new file mode 100644 index 0000000..a066ef2 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/sl.json @@ -0,0 +1,8 @@ +{ + "culture": "sl", + "texts": { + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/tr.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/tr.json new file mode 100644 index 0000000..2cc911e --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/tr.json @@ -0,0 +1,8 @@ +{ + "culture": "tr", + "texts": { + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/vi.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/vi.json new file mode 100644 index 0000000..c115a35 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/vi.json @@ -0,0 +1,8 @@ +{ + "culture": "vi", + "texts": { + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hans.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hans.json new file mode 100644 index 0000000..23790bd --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hans.json @@ -0,0 +1,8 @@ +{ + "culture": "zh-Hans", + "texts": { + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io." + } + } \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hant.json b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hant.json new file mode 100644 index 0000000..31e0ab5 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServer/zh-Hant.json @@ -0,0 +1,8 @@ +{ + "culture": "zh-Hant", + "texts": { + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServerResource.cs b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServerResource.cs new file mode 100644 index 0000000..95dcf9d --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Localization/CrossChainServerResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace AElf.CrossChainServer.Localization; + +[LocalizationResourceName("CrossChainServer")] +public class CrossChainServerResource +{ + +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/src/AElf.CrossChainServer.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..90082c2 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace AElf.CrossChainServer.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = false; +} diff --git a/src/AElf.CrossChainServer.Domain.Shared/Notify/EnumHelper.cs b/src/AElf.CrossChainServer.Domain.Shared/Notify/EnumHelper.cs new file mode 100644 index 0000000..a2df4cb --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Notify/EnumHelper.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel; + +namespace AElf.CrossChainServer.Notify; + +public class EnumHelper +{ + public static string GetDescription(Enum value) + { + var field = value.GetType().GetField(value.ToString()); + var attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute; + + return attribute == null ? value.ToString() : attribute.Description; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/Notify/NotifyRequest.cs b/src/AElf.CrossChainServer.Domain.Shared/Notify/NotifyRequest.cs new file mode 100644 index 0000000..7cb838e --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/Notify/NotifyRequest.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Notify; + +public class NotifyRequest +{ + // Message template + public string Template { get; set; } + + // Message Parameters + public Dictionary Params { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/ThirdUserTokenIssueInfoEto.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/ThirdUserTokenIssueInfoEto.cs new file mode 100644 index 0000000..02cbba0 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/ThirdUserTokenIssueInfoEto.cs @@ -0,0 +1,22 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class ThirdUserTokenIssueInfoEto +{ + public Guid Id { get; set; } + public string Address { get; set; } + public string WalletAddress { get; set; } + public string Symbol { get; set; } + public string ChainId { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string TokenName { get; set; } + public string TokenImage { get; set; } + public string OtherChainId { get; set; } + public string TotalSupply { get; set; } + public string ContractAddress { get; set; } + public string BindingId { get; set; } + public string ThirdTokenId { get; set; } + public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrder/TokenApplyOrderEto.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrder/TokenApplyOrderEto.cs new file mode 100644 index 0000000..88137d5 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrder/TokenApplyOrderEto.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using AElf.CrossChainServer.Chains; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenApplyOrderEto +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string UserAddress { get; set; } + public string Status { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + public string ChainId { get; set; } + public string ChainName { get; set; } + public string TokenName { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public List StatusChangedRecords { get; set; } +} + +public class StatusChangedRecordDto +{ + public Guid Id { get; set; } + public Guid OrderId { get; set; } + public string Status { get; set; } + public DateTime Time { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrderStatus.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrderStatus.cs new file mode 100644 index 0000000..e56cdaf --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/TokenApplyOrderStatus.cs @@ -0,0 +1,12 @@ +namespace AElf.CrossChainServer.TokenAccess; + +public enum TokenApplyOrderStatus +{ + Unissued, + Issuing, + Issued, + PoolInitializing, + PoolInitialized, + Complete, + Failed +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/UserTokenAccessInfoEto.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/UserTokenAccessInfoEto.cs new file mode 100644 index 0000000..9953a92 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenAccess/UserTokenAccessInfoEto.cs @@ -0,0 +1,16 @@ +using System; + +namespace AElf.CrossChainServer.TokenAccess; + +public class UserTokenAccessInfoEto +{ + public Guid Id { get; set; } + public string Symbol { get; set; } + public string Address { get; set; } + public string OfficialWebsite { get; set; } + public string OfficialTwitter { get; set; } + public string Title { get; set; } + public string PersonName { get; set; } + public string TelegramHandler { get; set; } + public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenPool/PoolLiquidityEto.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenPool/PoolLiquidityEto.cs new file mode 100644 index 0000000..820e002 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenPool/PoolLiquidityEto.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityEto +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public decimal Liquidity { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/TokenPool/UserLiquidityEto.cs b/src/AElf.CrossChainServer.Domain.Shared/TokenPool/UserLiquidityEto.cs new file mode 100644 index 0000000..1c07899 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain.Shared/TokenPool/UserLiquidityEto.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityEto +{ + public Guid Id { get; set; } + public string ChainId { get; set; } + public decimal Liquidity { get; set; } + public string Provider { get; set; } + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/AElf.CrossChainServer.Domain.csproj b/src/AElf.CrossChainServer.Domain/AElf.CrossChainServer.Domain.csproj new file mode 100644 index 0000000..0f2ec89 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/AElf.CrossChainServer.Domain.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.Domain/Chains/Chain.cs b/src/AElf.CrossChainServer.Domain/Chains/Chain.cs new file mode 100644 index 0000000..10d77ae --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Chains/Chain.cs @@ -0,0 +1,22 @@ +using AElf.CrossChainServer.Entities; +using JetBrains.Annotations; +using Nest; + +namespace AElf.CrossChainServer.Chains +{ + public class Chain : CrossChainServerEntity + { + [Keyword] + [NotNull] + public string Name { get; set; } + + public BlockchainType Type { get; set; } + + public bool IsMainChain { get; set; } + + public int AElfChainId { get; set; } + + [Keyword] + public string BlockChain { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Chains/ChainDataSeedContributor.cs b/src/AElf.CrossChainServer.Domain/Chains/ChainDataSeedContributor.cs new file mode 100644 index 0000000..8a5537f --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Chains/ChainDataSeedContributor.cs @@ -0,0 +1,72 @@ +using System.Threading.Tasks; +using AElf.Indexing.Elasticsearch; +using Microsoft.Extensions.Configuration; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.Chains; + +public class ChainDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IChainRepository _chainRepository; + private readonly INESTRepository _chainIndexRepository; + + public ChainDataSeedContributor( + IConfiguration configuration, IChainRepository chainRepository, + INESTRepository chainIndexRepository) + { + _configuration = configuration; + _chainRepository = chainRepository; + _chainIndexRepository = chainIndexRepository; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + var configurationSection = _configuration.GetSection("Chain"); + foreach (var section in configurationSection.GetChildren()) + { + var id = section.GetValue("Id"); + var name = section.GetValue("Name"); + var type = section.GetValue("Type"); + var isMainChain = section.GetValue("IsMainChain"); + var aelfChainId = section.GetValue("AElfChainId"); + var blockChain = section.GetValue("BlockChain"); + + var chain = await _chainRepository.FindAsync(id); + if (chain == null) + { + chain = await _chainRepository.InsertAsync(new Chain + { + Id = id, + Name = name, + Type = type, + IsMainChain = isMainChain, + AElfChainId = aelfChainId, + BlockChain = blockChain + }); + } + else + { + chain.Name = name; + chain.Type = type; + chain.IsMainChain = isMainChain; + chain.AElfChainId = aelfChainId; + chain.BlockChain = blockChain; + await _chainRepository.UpdateAsync(chain); + } + + await _chainIndexRepository.AddOrUpdateAsync(new ChainIndex + { + Id = chain.Id, + Name = chain.Name, + Type = chain.Type, + IsMainChain = chain.IsMainChain, + AElfChainId = aelfChainId, + BlockChain = blockChain + }); + } + } +} diff --git a/src/AElf.CrossChainServer.Domain/Chains/ChainIndex.cs b/src/AElf.CrossChainServer.Domain/Chains/ChainIndex.cs new file mode 100644 index 0000000..b116f6b --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Chains/ChainIndex.cs @@ -0,0 +1,8 @@ +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.Chains; + +public class ChainIndex : Chain, IIndexBuild +{ + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Chains/IChainRepository.cs b/src/AElf.CrossChainServer.Domain/Chains/IChainRepository.cs new file mode 100644 index 0000000..edf48aa --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Chains/IChainRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.Chains +{ + public interface IChainRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimit.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimit.cs new file mode 100644 index 0000000..b51d62f --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimit.cs @@ -0,0 +1,8 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainDailyLimit : CrossChainDailyLimitBase +{ + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitBase.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitBase.cs new file mode 100644 index 0000000..4f80619 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitBase.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainDailyLimitBase : MultiChainEntity +{ + [Keyword] + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal RemainAmount { get; set; } + public long RefreshTime { get; set; } + public decimal DailyLimit { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitIndex.cs new file mode 100644 index 0000000..a4ddb2c --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainDailyLimitIndex.cs @@ -0,0 +1,9 @@ +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainDailyLimitIndex : CrossChainDailyLimitBase, IIndexBuild +{ + public Token Token { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfo.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfo.cs new file mode 100644 index 0000000..c4d68c6 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfo.cs @@ -0,0 +1,14 @@ +using System; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainIndexingInfo : MultiChainEntity +{ + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } + [Keyword] + public string IndexChainId { get; set; } + public long IndexBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfoIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfoIndex.cs new file mode 100644 index 0000000..3402f73 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainIndexingInfoIndex.cs @@ -0,0 +1,7 @@ +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainIndexingInfoIndex : CrossChainIndexingInfo, IIndexBuild +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimit.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimit.cs new file mode 100644 index 0000000..d930571 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimit.cs @@ -0,0 +1,8 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimit : CrossChainRateLimitBase +{ + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitBase.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitBase.cs new file mode 100644 index 0000000..f60cf38 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitBase.cs @@ -0,0 +1,16 @@ +using System; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimitBase : MultiChainEntity +{ + [Keyword] + public string TargetChainId { get; set; } + public CrossChainLimitType Type { get; set; } + public decimal CurrentAmount { get; set; } + public decimal Capacity { get; set; } + public decimal Rate { get; set; } + public bool IsEnable { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitIndex.cs new file mode 100644 index 0000000..6c06fc4 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainRateLimitIndex.cs @@ -0,0 +1,9 @@ +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainRateLimitIndex : CrossChainRateLimitBase, IIndexBuild +{ + public Token Token { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransfer.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransfer.cs new file mode 100644 index 0000000..58309e2 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransfer.cs @@ -0,0 +1,9 @@ +using System; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransfer : CrossChainTransferBase +{ + public Guid TransferTokenId { get; set; } + public Guid ReceiveTokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs new file mode 100644 index 0000000..fcdfaf9 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs @@ -0,0 +1,41 @@ +using System; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferBase : CrossChainServerEntity +{ + public CrossChainType Type { get; set; } + [Keyword] + public string FromChainId { get; set; } + [Keyword] + public string ToChainId { get; set; } + [Keyword] + public string FromAddress { get; set; } + [Keyword] + public string ToAddress { get; set; } + [Keyword] + public string TransferTransactionId { get; set; } + [Keyword] + public string ReceiveTransactionId { get; set; } + [Keyword] + public string InlineTransferTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public long ReceiveBlockHeight { get; set; } + public decimal TransferAmount { get; set; } + public decimal ReceiveAmount { get; set; } + public CrossChainStatus Status { get; set; } + [Keyword] + public string ReceiptId { get; set; } + public int Progress { get; set; } + public DateTime ProgressUpdateTime { get; set; } + public int ReceiveTransactionAttemptTimes { get; set; } + [Keyword] + public string TraceId { get; set; } + + public ReceiptStatus TransferStatus { get; set; } + public ReceiptStatus ReceiveStatus { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferIndex.cs new file mode 100644 index 0000000..b0b35d1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferIndex.cs @@ -0,0 +1,10 @@ +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferIndex : CrossChainTransferBase, IIndexBuild +{ + public Token TransferToken { get; set; } + public Token ReceiveToken { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainDailyLimitRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainDailyLimitRepository.cs new file mode 100644 index 0000000..0254e7d --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainDailyLimitRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.CrossChain +{ + public interface ICrossChainDailyLimitRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainIndexingInfoRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainIndexingInfoRepository.cs new file mode 100644 index 0000000..9833ecc --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainIndexingInfoRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.CrossChain +{ + public interface ICrossChainIndexingInfoRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainRateLimitRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainRateLimitRepository.cs new file mode 100644 index 0000000..e7e2ecc --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainRateLimitRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.CrossChain +{ + public interface ICrossChainRateLimitRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainTransferRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainTransferRepository.cs new file mode 100644 index 0000000..52c55cc --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainTransferRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.CrossChain +{ + public interface ICrossChainTransferRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainUserRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainUserRepository.cs new file mode 100644 index 0000000..99d7e0f --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/ICrossChainUserRepository.cs @@ -0,0 +1,8 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.CrossChain; + +public interface ICrossChainUserRepository : IRepository +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/WalletUserDto.cs b/src/AElf.CrossChainServer.Domain/CrossChain/WalletUserDto.cs new file mode 100644 index 0000000..33a4801 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChain/WalletUserDto.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.CrossChain; + +public class WalletUserDto : CrossChainServerEntity +{ + [Keyword] public string AppId { get; set; } + [Keyword] public string CaHash { get; set; } + public List AddressInfos { get; set; } + public long CreateTime { get; set; } + public long ModificationTime { get; set; } + + public WalletUserDto() + { + AddressInfos = new List(); + } +} + + +public class AddressInfoDto : CrossChainServerEntity +{ + [Keyword] public Guid UserId { get; set; } + public string ChainId { get; set; } + public string Address { get; set; } + public WalletUserDto WalletUser { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs b/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs new file mode 100644 index 0000000..67f4111 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs @@ -0,0 +1,33 @@ +using Volo.Abp.Identity; + +namespace AElf.CrossChainServer; + +public static class CrossChainServerConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; + + public const string AElfMainChainId = "MainChain_AELF"; + public const string AElfMainChain = "AELF"; + + public const int HalfOfTheProgress = 50; + public const int FullOfTheProgress = 100; + public const long DefaultDailyLimitRefreshTime = 86400; + public const long DefaultRateLimitSeconds = 60; + + public const string TonTransferredOpCode = "0xfcaf1515"; + public const string TonReceivedOpCode = "0x3d76fd5a"; + public const string TonDailyLimitChangedOpCode = "0x40839634"; + public const string TonLimitConsumedOpCode = "0xb9ac7cea"; + public const string TonRateLimitChangedOpCode = "0xef662842"; + public const string At = "@"; + public const string SuccessHttpCode = "20000"; + public const int DefaultEvmTokenDecimal = 18; + public const string AddressZero = "0x0000000000000000000000000000000000000000"; + public const string TonCoinAddress = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c"; + public const int TonCoinTokenDecimal = 9; + public const string TonCoinTokenSymbol = "TON"; + + +} diff --git a/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs b/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs new file mode 100644 index 0000000..43d5563 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs @@ -0,0 +1,111 @@ +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using AElf.CrossChainServer.MultiTenancy; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.ExceptionHandler.ABP; +using AElf.Indexing.Elasticsearch; +using AElf.Indexing.Elasticsearch.Options; +using Volo.Abp.AuditLogging; +using Volo.Abp.AutoMapper; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Caching; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerDomainSharedModule), + typeof(AbpCachingModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule), + typeof(AElfIndexingElasticsearchModule), + typeof(AOPExceptionModule) +)] +public class CrossChainServerDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { options.AddMaps(); }); + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => { options.IsEnabled = MultiTenancyConsts.IsEnabled; }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + + Configure(x => { x.AddModule(typeof(CrossChainServerDomainModule)); }); + + Configure(options => + { + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + + options.AutoEventSelectors.Add(); + options.EtoMappings.Add(); + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Data/CrossChainServerDbMigrationService.cs b/src/AElf.CrossChainServer.Domain/Data/CrossChainServerDbMigrationService.cs new file mode 100644 index 0000000..7d5a915 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Data/CrossChainServerDbMigrationService.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Serilog; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace AElf.CrossChainServer.Data; + +public class CrossChainServerDbMigrationService : ITransientDependency +{ + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public CrossChainServerDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Log.Information("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Log.Information($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Log.Information("Successfully completed {tenantName} tenant database migrations.", tenant.Name); + } + + Log.Information("Successfully completed all database migrations."); + Log.Information("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant tenant = null) + { + Log.Information( + "Migrating schema for {name} database...", tenant == null ? "host" : tenant.Name + " tenant"); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant tenant = null) + { + Log.Information($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, + IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, + IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Log.Warning("Couldn't determinate if any migrations exist : {message}", e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Log.Information("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Data/ICrossChainServerDbSchemaMigrator.cs b/src/AElf.CrossChainServer.Domain/Data/ICrossChainServerDbSchemaMigrator.cs new file mode 100644 index 0000000..726590b --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Data/ICrossChainServerDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Data; + +public interface ICrossChainServerDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/src/AElf.CrossChainServer.Domain/Data/NullCrossChainServerDbSchemaMigrator.cs b/src/AElf.CrossChainServer.Domain/Data/NullCrossChainServerDbSchemaMigrator.cs new file mode 100644 index 0000000..1bd5498 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Data/NullCrossChainServerDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Data; + +/* This is used if database provider does't define + * ICrossChainServerDbSchemaMigrator implementation. + */ +public class NullCrossChainServerDbSchemaMigrator : ICrossChainServerDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs b/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs new file mode 100644 index 0000000..661c80e --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs @@ -0,0 +1,27 @@ +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AutoMapper; + +namespace AElf.CrossChainServer +{ + public class DomainAutoMapperProfile : Profile + { + public DomainAutoMapperProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Entities/CrossChainServerEntity.cs b/src/AElf.CrossChainServer.Domain/Entities/CrossChainServerEntity.cs new file mode 100644 index 0000000..33a8836 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Entities/CrossChainServerEntity.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; + +namespace AElf.CrossChainServer.Entities; + +/// +[Serializable] +public abstract class CrossChainServerEntity : IEntity +{ + protected CrossChainServerEntity() + { + EntityHelper.TrySetTenantId(this); + } + + /// + public override string ToString() + { + return $"[ENTITY: {GetType().Name}] Keys = {GetKeys().JoinAsString(", ")}"; + } + + public abstract object[] GetKeys(); + + public bool EntityEquals(IEntity other) + { + return EntityHelper.EntityEquals(this, other); + } +} + +/// +[Serializable] +public abstract class CrossChainServerEntity : CrossChainServerEntity, IEntity +{ + /// + public virtual TKey Id { get; set; } + + public override object[] GetKeys() + { + return new object[] { Id }; + } + + /// + public override string ToString() + { + return $"[ENTITY: {GetType().Name}] Id = {Id}"; + } +} diff --git a/src/AElf.CrossChainServer.Domain/Entities/IMultiChain.cs b/src/AElf.CrossChainServer.Domain/Entities/IMultiChain.cs new file mode 100644 index 0000000..2c65331 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Entities/IMultiChain.cs @@ -0,0 +1,7 @@ +namespace AElf.CrossChainServer.Entities +{ + public interface IMultiChain + { + string ChainId { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Entities/MultiChainEntity.cs b/src/AElf.CrossChainServer.Domain/Entities/MultiChainEntity.cs new file mode 100644 index 0000000..c3106df --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Entities/MultiChainEntity.cs @@ -0,0 +1,10 @@ +using Nest; + +namespace AElf.CrossChainServer.Entities +{ + public class MultiChainEntity : CrossChainServerEntity, IMultiChain + { + [Keyword] + public virtual string ChainId { get; set; } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Notify/LarkCartMessage.cs b/src/AElf.CrossChainServer.Domain/Notify/LarkCartMessage.cs new file mode 100644 index 0000000..f5d7a04 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Notify/LarkCartMessage.cs @@ -0,0 +1,116 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Notify; + +public class LarkCardMessage : LarkGroupRobotMessageBase +{ + public LarkCardMessage() : base(LarkMessageTypeEnum.Interactive) + { + Card = new CardMessage(); + } + + public CardMessage Card { get; set; } + + + public static CardMessageBuilder Builder() + { + return new CardMessageBuilder(); + } + + // classes + public class CardMessage + { + + public List Elements { get; set; } + public CardHeader Header { get; set; } + + } + + + public class CardHeader + { + public CardHeader(string title, string template = "default") + { + Template = template; + Title = new TextElement(title); + } + + public string Template { get; set; } + public ContentElement Title { get; set; } + } + + public abstract class ElementBase + { + public string Tag { get; set; } + + public ElementBase(string tag) + { + Tag = tag; + } + } + + public class ContentElement: ElementBase + { + public string Content { get; set; } + + public ContentElement(string tag, string content) : base(tag) + { + Content = content; + } + } + + public class TextElement : ContentElement + { + public TextElement(string content) : base("plain_text", content) + { + } + } + + public class MarkdownElementText : ContentElement + { + public MarkdownElementText(string content) : base("markdown", content) + { + } + } + +} + +public class CardMessageBuilder : LarkMessageBuilder +{ + private readonly LarkCardMessage _message = new(); + + public LarkCardMessage Build() + { + return base.Build(_message); + } + + public CardMessageBuilder WithSignature(string secret) + { + WithSign(secret); + return this; + } + + public CardMessageBuilder WithTitle(string title, string template = "default") + { + _message.Card.Header = new LarkCardMessage.CardHeader(title, template); + return this; + } + + public CardMessageBuilder AddMarkdownContent(string content) + { + _message.Card.Elements ??= new(); + _message.Card.Elements.Add(new LarkCardMessage.MarkdownElementText(content)); + return this; + } + + public CardMessageBuilder AddMarkdownContents(List contents) + { + _message.Card.Elements ??= new(); + foreach (var content in contents) + { + _message.Card.Elements.Add(new LarkCardMessage.MarkdownElementText(content)); + } + return this; + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Notify/LarkGroupRobotMessage.cs b/src/AElf.CrossChainServer.Domain/Notify/LarkGroupRobotMessage.cs new file mode 100644 index 0000000..d8ecfcc --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Notify/LarkGroupRobotMessage.cs @@ -0,0 +1,72 @@ +#nullable enable +using System; +using System.ComponentModel; +using System.Security.Cryptography; +using System.Text; +using Newtonsoft.Json; + +namespace AElf.CrossChainServer.Notify; + +public enum LarkMessageTypeEnum +{ + [Description("text")] Text = 0, + [Description("post")] Post = 1, + [Description("share_chat")] ShareChat = 2, + [Description("image")] Image = 3, + [Description("interactive")] Interactive = 4, + +} + +public abstract class LarkGroupRobotMessageBase +{ + [JsonProperty("msg_type")] public string MessageType { get; set; } + public string? Timestamp { get; set; } + public string? Sign { get; set; } + + public LarkGroupRobotMessageBase(LarkMessageTypeEnum messageType) + { + MessageType = EnumHelper.GetDescription(messageType); + } +} + +public class LarkMessageBuilder +{ + public string? Timestamp { get; set; } + public string? Sign { get; set; } + + /// + /// card message builder + /// + /// + public static CardMessageBuilder CardMessageBuilder() + { + return LarkCardMessage.Builder(); + } + + protected void WithSign(string secret) + { + if (secret.IsNullOrEmpty()) return; + + var ts = (int)new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds(); + Timestamp = ts.ToString(); + Sign = GenSign(secret, ts); + } + + + public T Build(T message) where T : LarkGroupRobotMessageBase + { + message.Sign = Sign; + message.Timestamp = Timestamp; + return message; + } + + private static string GenSign(string secret, int timestamp) + { + var stringToSign = timestamp + "\n" + secret; + var encoding = new UTF8Encoding(); + using var hmacSha256 = new HMACSHA256(encoding.GetBytes(stringToSign)); + var hashMessage = hmacSha256.ComputeHash(Array.Empty()); + return Convert.ToBase64String(hashMessage); + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/OpenIddict/GrantTypeConstants.cs b/src/AElf.CrossChainServer.Domain/OpenIddict/GrantTypeConstants.cs new file mode 100644 index 0000000..67ba9d1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/OpenIddict/GrantTypeConstants.cs @@ -0,0 +1,9 @@ +namespace AElf.CrossChainServer.OpenIddict; + +public class GrantTypeConstants +{ + public const string SIGNATURE = "signature"; + public const string PERMISSIONS_SIGNATURE = "gt:signature"; + public const string LOGIN_CREDENTIALS = "login_credentials"; + public const string PERMISSIONS_LOGIN_CREDENTIALS = "gt:login_credentials"; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/src/AElf.CrossChainServer.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..22c8b7b --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,377 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("CrossChainServer") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor + { + Name = "CrossChainServer", DisplayName = "CrossChainServer API", Resources = { "CrossChainServer" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List + { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "CrossChainServer" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + //Console Test / Angular Client + var consoleAndAngularClientId = configurationSection["CrossChainServer_App:ClientId"]; + if (!consoleAndAngularClientId.IsNullOrWhiteSpace()) + { + var consoleAndAngularClientRootUrl = configurationSection["CrossChainServer_App:RootUrl"]?.TrimEnd('/'); + await CreateApplicationAsync( + name: consoleAndAngularClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Console Test / Angular Application", + secret: null, + grantTypes: new List + { + OpenIddictConstants.GrantTypes.AuthorizationCode, + OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.RefreshToken, + GrantTypeConstants.SIGNATURE, + GrantTypeConstants.LOGIN_CREDENTIALS, + "LinkLogin", + "Impersonation" + }, + scopes: commonScopes, + redirectUri: consoleAndAngularClientRootUrl, + postLogoutRedirectUri: consoleAndAngularClientRootUrl, + clientUri: consoleAndAngularClientRootUrl, + logoUri: "/images/clients/angular.svg" + ); + } + + + // Swagger Client + var swaggerClientId = configurationSection["CrossChainServer_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["CrossChainServer_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl, + logoUri: "/images/clients/swagger.svg" + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null, + string? clientUri = null, + string? logoUri = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor + { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + LogoUri = logoUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] + { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + // For transaction signature + if (grantType == GrantTypeConstants.SIGNATURE) + { + application.Permissions.Add(GrantTypeConstants.PERMISSIONS_SIGNATURE); + } + + if (grantType == GrantTypeConstants.LOGIN_CREDENTIALS) + { + application.Permissions.Add(GrantTypeConstants.PERMISSIONS_LOGIN_CREDENTIALS); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] + { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = + JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().RemovePostFix("/"))); + client.PostLogoutRedirectUris = + JsonSerializer.Serialize( + application.PostLogoutRedirectUris.Select(q => q.ToString().RemovePostFix("/"))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == + JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().RemovePostFix("/"))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == + JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Properties/AssemblyInfo.cs b/src/AElf.CrossChainServer.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7b2f6bb --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("AElf.CrossChainServer.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("AElf.CrossChainServer.TestBase")] diff --git a/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettingDefinitionProvider.cs b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettingDefinitionProvider.cs new file mode 100644 index 0000000..22a5adf --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettingDefinitionProvider.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Settings; + +namespace AElf.CrossChainServer.Settings; + +public class CrossChainServerSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + context.Add(new SettingDefinition(CrossChainServerSettings.CrossChainTransferIndexerSync)); + context.Add(new SettingDefinition(CrossChainServerSettings.CrossChainIndexingIndexerSync)); + context.Add(new SettingDefinition(CrossChainServerSettings.OracleQueryIndexerSync)); + context.Add(new SettingDefinition(CrossChainServerSettings.ReportIndexerSync)); + } +} diff --git a/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs new file mode 100644 index 0000000..d151968 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs @@ -0,0 +1,23 @@ +namespace AElf.CrossChainServer.Settings; + +public static class CrossChainServerSettings +{ + private const string Prefix = "CrossChainServer"; + + //Add your own setting names here. Example: + public const string CrossChainTransferIndexerSync = Prefix + ".IndexerSync.CrossChainTransfer"; + public const string CrossChainIndexingIndexerSync = Prefix + ".IndexerSync.CrossChainIndexing"; + public const string OracleQueryIndexerSync = Prefix + ".IndexerSync.OracleQuery"; + public const string ReportIndexerSync = Prefix + ".IndexerSync.Report"; + public const string PoolLiquidityIndexerSync = Prefix + ".IndexerSync.PoolLiquidity"; + public const string UserLiquidityIndexerSync = Prefix + ".IndexerSync.UserLiquidity"; + public const string EvmPoolLiquidityIndexerSync = Prefix + ".EvmIndexerSync.PoolLiquidity"; + public const string EvmUserLiquidityIndexerSync = Prefix + ".EvmIndexerSync.UserLiquidity"; + public const string TonIndexTransactionSync = Prefix + ".TonIndex.Transaction"; + public const string EvmNewReceiptIndexerSync = Prefix + ".EvmIndexerSync.NewReceipt"; + public const string EvmTokenSwappedIndexerSync = Prefix + ".EvmIndexerSync.TokenSwapped"; + public const string EvmDailyLimitSetIndexerSync = Prefix + ".EvmIndexerSync.DailyLimitSet"; + public const string EvmRateLimitSetIndexerSync = Prefix + ".EvmIndexerSync.RateLimitSet"; + public const string EvmDailyLimitConsumedIndexerSync = Prefix + ".EvmIndexerSync.DailyLimitConsumed"; + public const string EvmRateLimitConsumedIndexerSync = Prefix + ".EvmIndexerSync.RateLimitConsumed"; +} diff --git a/src/AElf.CrossChainServer.Domain/Settings/ISettingManager.cs b/src/AElf.CrossChainServer.Domain/Settings/ISettingManager.cs new file mode 100644 index 0000000..51b199c --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/ISettingManager.cs @@ -0,0 +1,45 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Settings; + +public interface ISettingManager +{ + Task GetOrNullAsync(string chainId, string name); + Task SetAsync(string chainId, string name, string value); +} + +public class SettingManager : ISettingManager, ITransientDependency +{ + private readonly ISettingsRepository _settingsRepository; + + public SettingManager(ISettingsRepository settingsRepository) + { + _settingsRepository = settingsRepository; + } + + public async Task GetOrNullAsync(string chainId, string name) + { + var settings = await _settingsRepository.FindAsync(o=>o.ChainId == chainId && o.Name == name); + return settings?.Value; + } + + public async Task SetAsync(string chainId, string name, string value) + { + var settings = await _settingsRepository.FindAsync(o=>o.ChainId == chainId && o.Name == name); + if (settings == null) + { + await _settingsRepository.InsertAsync(new Settings + { + ChainId = chainId, + Name = name, + Value = value + }); + } + else + { + settings.Value = value; + await _settingsRepository.UpdateAsync(settings); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Settings/ISettingsRepository.cs b/src/AElf.CrossChainServer.Domain/Settings/ISettingsRepository.cs new file mode 100644 index 0000000..50024af --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/ISettingsRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.Settings +{ + public interface ISettingsRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Settings/SettingDataSeedContributor.cs b/src/AElf.CrossChainServer.Domain/Settings/SettingDataSeedContributor.cs new file mode 100644 index 0000000..0e84c19 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/SettingDataSeedContributor.cs @@ -0,0 +1,40 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Uow; +using Microsoft.Extensions.Configuration; + + +namespace AElf.CrossChainServer.Settings; + +public class SettingDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly ISettingManager _settingManager; + + public SettingDataSeedContributor(IConfiguration configuration, ISettingManager settingManager) + { + _configuration = configuration; + _settingManager = settingManager; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + var configurationSection = _configuration.GetSection("IndexerSettings"); + foreach (var section in configurationSection.GetChildren()) + { + var typePrefix = section.GetValue("TypePrefix"); + var syncType = section.GetValue("SyncType"); + var chainId = section.GetValue("ChainId"); + var value = section.GetValue("Value"); + var settingKey = GetSettingKey(typePrefix, syncType); + await _settingManager.SetAsync(chainId, settingKey, value); + } + } + + private string GetSettingKey(string typePrefix,string syncType) + { + return string.IsNullOrWhiteSpace(typePrefix)? syncType : $"{typePrefix}-{syncType}"; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Settings/Settings.cs b/src/AElf.CrossChainServer.Domain/Settings/Settings.cs new file mode 100644 index 0000000..c4a64b9 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Settings/Settings.cs @@ -0,0 +1,10 @@ +using System; +using AElf.CrossChainServer.Entities; + +namespace AElf.CrossChainServer.Settings; + +public class Settings : MultiChainEntity +{ + public string Name { get; set; } + public string Value { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/IThirdUserTokenIssueRepository.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/IThirdUserTokenIssueRepository.cs new file mode 100644 index 0000000..3622bf9 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/IThirdUserTokenIssueRepository.cs @@ -0,0 +1,8 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +public interface IThirdUserTokenIssueRepository : IRepository +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueBase.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueBase.cs new file mode 100644 index 0000000..9992225 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueBase.cs @@ -0,0 +1,25 @@ +using System; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +public class ThirdUserTokenIssueBase : CrossChainServerEntity +{ + [Keyword] public string Address { get; set; } + // evm chain address + [Keyword] public string WalletAddress { get; set; } + [Keyword] public string Symbol { get; set; } + // aelf chain id + [Keyword] public string ChainId { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } + [Keyword] public string TokenName { get; set; } + [Text(Index = false)] public string TokenImage { get; set; } + [Keyword] public string OtherChainId { get; set; } + public string TotalSupply { get; set; } + public string ContractAddress { get; set; } + [Keyword] public string BindingId { get; set; } + [Keyword] public string ThirdTokenId { get; set; } + public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueIndex.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueIndex.cs new file mode 100644 index 0000000..9277cc9 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueIndex.cs @@ -0,0 +1,7 @@ +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +public class ThirdUserTokenIssueIndex : ThirdUserTokenIssueBase, IIndexBuild +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfo.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfo.cs new file mode 100644 index 0000000..583c31e --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/ThirdUserTokenIssue/ThirdUserTokenIssueInfo.cs @@ -0,0 +1,6 @@ + +namespace AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +public class ThirdUserTokenIssueInfo : ThirdUserTokenIssueBase +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/ITokenApplyOrderRepository.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/ITokenApplyOrderRepository.cs new file mode 100644 index 0000000..64167f4 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/ITokenApplyOrderRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface ITokenApplyOrderRepository : IRepository +{ + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrder.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrder.cs new file mode 100644 index 0000000..141d231 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrder.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Entities; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenApplyOrder : TokenApplyOrderBase +{ + public string ChainId { get; set; } + public string ChainName { get; set; } + public string TokenName { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + public string Icon { get; set; } + public string PoolAddress { get; set; } + public string ContractAddress { get; set; } + public List StatusChangedRecords { get; set; } + + public TokenApplyOrder() + { + StatusChangedRecords = new List(); + } +} + +public class StatusChangedRecord : CrossChainServerEntity +{ + public Guid OrderId { get; set; } + public string Status { get; set; } + public DateTime Time { get; set; } + public TokenApplyOrder Order { get; set; } //Navigation property +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderBase.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderBase.cs new file mode 100644 index 0000000..a3dfaa0 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderBase.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using AElf.CrossChainServer.Entities; +using Nest; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenApplyOrderBase : CrossChainServerEntity +{ + [Keyword] public string Symbol { get; set; } + [Keyword] public string UserAddress { get; set; } + [Keyword] public string Status { get; set; } + public long CreateTime { get; set; } + public long UpdateTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderIndex.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderIndex.cs new file mode 100644 index 0000000..e286c62 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/TokenApplyOrder/TokenApplyOrderIndex.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using AElf.Indexing.Elasticsearch; +using Nest; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenApplyOrderIndex : TokenApplyOrderBase, IIndexBuild +{ + public ChainTokenInfoIndex ChainTokenInfo { get; set; } + public Dictionary StatusChangedRecord { get; set; } +} + +public class ChainTokenInfoIndex +{ + [Keyword] public string Symbol { get; set; } + [Keyword] public string ChainId { get; set; } + [Keyword] public string ChainName { get; set; } + [Keyword] public string TokenName { get; set; } + public decimal TotalSupply { get; set; } + public int Decimals { get; set; } + [Text(Index = false)] public string Icon { get; set; } + [Keyword] public string PoolAddress { get; set; } + [Keyword] public string ContractAddress { get; set; } + [Keyword] public string Status { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/IUserAccessTokenInfoRepository.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/IUserAccessTokenInfoRepository.cs new file mode 100644 index 0000000..bb483f1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/IUserAccessTokenInfoRepository.cs @@ -0,0 +1,9 @@ +using System; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.TokenAccess; + +public interface IUserAccessTokenInfoRepository : IRepository +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfo.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfo.cs new file mode 100644 index 0000000..fd8dea7 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfo.cs @@ -0,0 +1,5 @@ +namespace AElf.CrossChainServer.TokenAccess.UserTokenAccess; + +public class UserTokenAccessInfo : UserTokenAccessInfoBase +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoBase.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoBase.cs new file mode 100644 index 0000000..3f27f8f --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoBase.cs @@ -0,0 +1,18 @@ +using System; +using AElf.CrossChainServer.Entities; +using JetBrains.Annotations; +using Nest; + +namespace AElf.CrossChainServer.TokenAccess.UserTokenAccess; + +public class UserTokenAccessInfoBase : CrossChainServerEntity +{ + [Keyword] public string Symbol { get; set; } + [Keyword] public string Address { get; set; } + [Keyword] [CanBeNull] public string OfficialWebsite { get; set; } + [Keyword] [CanBeNull] public string OfficialTwitter { get; set; } + [Keyword] [CanBeNull] public string Title { get; set; } + [Keyword] [CanBeNull] public string PersonName { get; set; } + [Keyword] [CanBeNull] public string TelegramHandler { get; set; } + [Keyword] public string Email { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoIndex.cs b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoIndex.cs new file mode 100644 index 0000000..6c50891 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenAccess/UserTokenAccess/UserTokenAccessInfoIndex.cs @@ -0,0 +1,8 @@ +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.TokenAccess.UserTokenAccess; + +public class UserTokenAccessInfoIndex : UserTokenAccessInfoBase, IIndexBuild +{ + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/IPoolLiquidityRepository.cs b/src/AElf.CrossChainServer.Domain/TokenPool/IPoolLiquidityRepository.cs new file mode 100644 index 0000000..a86c3b2 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/IPoolLiquidityRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.TokenPool; + +public interface IPoolLiquidityRepository : IRepository +{ + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/IUserLiquidityRepository.cs b/src/AElf.CrossChainServer.Domain/TokenPool/IUserLiquidityRepository.cs new file mode 100644 index 0000000..e0147ec --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/IUserLiquidityRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.TokenPool; + +public interface IUserLiquidityRepository : IRepository +{ + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/LiquidityBase.cs b/src/AElf.CrossChainServer.Domain/TokenPool/LiquidityBase.cs new file mode 100644 index 0000000..df5f411 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/LiquidityBase.cs @@ -0,0 +1,12 @@ +using System; +using AElf.CrossChainServer.Entities; +using AElf.CrossChainServer.Tokens; +using Nest; + +namespace AElf.CrossChainServer.TokenPool; + +public class LiquidityBase : CrossChainServerEntity +{ + [Keyword] public string ChainId { get; set; } + public decimal Liquidity { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfo.cs b/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfo.cs new file mode 100644 index 0000000..b9d4919 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfo.cs @@ -0,0 +1,8 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityInfo : LiquidityBase +{ + public Guid TokenId { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfoIndex.cs b/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfoIndex.cs new file mode 100644 index 0000000..47c8c2a --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/PoolLiquidityInfoIndex.cs @@ -0,0 +1,9 @@ +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityInfoIndex : LiquidityBase,IIndexBuild +{ + public Token TokenInfo { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfo.cs b/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfo.cs new file mode 100644 index 0000000..c260663 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfo.cs @@ -0,0 +1,9 @@ +using System; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityInfo : LiquidityBase +{ + public Guid TokenId { get; set; } + public string Provider { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfoIndex.cs b/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfoIndex.cs new file mode 100644 index 0000000..89061c1 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/TokenPool/UserLiquidityInfoIndex.cs @@ -0,0 +1,12 @@ +using AElf.Indexing.Elasticsearch; +using Nest; +using Token = AElf.CrossChainServer.Tokens.Token; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityInfoIndex : LiquidityBase,IIndexBuild +{ + public Token TokenInfo { get; set; } + [Keyword] + public string Provider { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Tokens/ITokenRepository.cs b/src/AElf.CrossChainServer.Domain/Tokens/ITokenRepository.cs new file mode 100644 index 0000000..38a1868 --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Tokens/ITokenRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace AElf.CrossChainServer.Tokens +{ + public interface ITokenRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/Tokens/Token.cs b/src/AElf.CrossChainServer.Domain/Tokens/Token.cs new file mode 100644 index 0000000..f9b23af --- /dev/null +++ b/src/AElf.CrossChainServer.Domain/Tokens/Token.cs @@ -0,0 +1,19 @@ +using System; +using AElf.CrossChainServer.Entities; +using JetBrains.Annotations; +using Nest; + +namespace AElf.CrossChainServer.Tokens +{ + public class Token : MultiChainEntity + { + [NotNull] [Keyword] public virtual string Address { get; set; } + + [NotNull] [Keyword] public virtual string Symbol { get; set; } + + public virtual int Decimals { get; set; } + public virtual int IssueChainId { get; set; } + public virtual bool IsBurnable { get; set; } + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/AElf.CrossChainServer.EntityFrameworkCore.csproj b/src/AElf.CrossChainServer.EntityFrameworkCore/AElf.CrossChainServer.EntityFrameworkCore.csproj new file mode 100644 index 0000000..794cf0b --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/AElf.CrossChainServer.EntityFrameworkCore.csproj @@ -0,0 +1,30 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers + compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native + + + + diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Chains/EfCoreChainRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Chains/EfCoreChainRepository.cs new file mode 100644 index 0000000..3f4a638 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Chains/EfCoreChainRepository.cs @@ -0,0 +1,14 @@ +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.Chains +{ + public class EfCoreChainRepository : EfCoreCacheRepository, IChainRepository + { + public EfCoreChainRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainDailyLimitRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainDailyLimitRepository.cs new file mode 100644 index 0000000..78ae59a --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainDailyLimitRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.CrossChain +{ + public class EfCoreCrossChainDailyLimitRepository : EfCoreRepository, ICrossChainDailyLimitRepository + { + public EfCoreCrossChainDailyLimitRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainIndexingInfoRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainIndexingInfoRepository.cs new file mode 100644 index 0000000..77b493e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainIndexingInfoRepository.cs @@ -0,0 +1,16 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.CrossChain +{ + public class EfCoreCrossChainIndexingInfoRepository : EfCoreRepository, ICrossChainIndexingInfoRepository + { + public EfCoreCrossChainIndexingInfoRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainRateLimitRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainRateLimitRepository.cs new file mode 100644 index 0000000..1b621f9 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainRateLimitRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.CrossChain +{ + public class EfCoreCrossChainRateLimitRepository : EfCoreRepository, ICrossChainRateLimitRepository + { + public EfCoreCrossChainRateLimitRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainTransferRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainTransferRepository.cs new file mode 100644 index 0000000..59d0acc --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainTransferRepository.cs @@ -0,0 +1,16 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.CrossChain +{ + public class EfCoreCrossChainTransferRepository : EfCoreRepository, ICrossChainTransferRepository + { + public EfCoreCrossChainTransferRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainUserRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainUserRepository.cs new file mode 100644 index 0000000..9e1d03e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreCrossChainUserRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.CrossChain; + +public class EfCoreCrossChainUserRepository : EfCoreRepository, + ICrossChainUserRepository +{ + public EfCoreCrossChainUserRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EfCoreCacheRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EfCoreCacheRepository.cs new file mode 100644 index 0000000..7223c12 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EfCoreCacheRepository.cs @@ -0,0 +1,82 @@ +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer +{ + public class EfCoreCacheRepository + : EfCoreRepository + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity + { + private IDistributedCache Cache => + this.LazyServiceProvider.LazyGetService>(); + + public EfCoreCacheRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + + public override async Task GetAsync( + TKey id, + bool includeDetails = true, + CancellationToken cancellationToken = default(CancellationToken)) + { + var entity = await Cache.GetAsync(id.ToString(), token: cancellationToken); + if (entity == null) + { + entity = await base.GetAsync(id, includeDetails, cancellationToken); + await Cache.SetAsync(id.ToString(), entity, token: cancellationToken); + } + + return entity; + } + + public override async Task FindAsync( + TKey id, + bool includeDetails = true, + CancellationToken cancellationToken = default(CancellationToken)) + { + var entity = await Cache.GetAsync(id.ToString(), token: cancellationToken); + if (entity == null) + { + entity = await base.FindAsync(id, includeDetails, cancellationToken); + await Cache.SetAsync(id.ToString(), entity, token: cancellationToken); + } + + return entity; + } + + public override async Task DeleteAsync( + TKey id, + bool autoSave = false, + CancellationToken cancellationToken = default(CancellationToken)) + { + await base.DeleteAsync(id, autoSave, cancellationToken); + await Cache.RemoveAsync(id.ToString(), token: cancellationToken); + } + + public override async Task InsertAsync( + TEntity entity, + bool autoSave = false, + CancellationToken cancellationToken = default(CancellationToken)) + { + var insertedEntity = await base.InsertAsync(entity, autoSave, cancellationToken); + await Cache.SetAsync(insertedEntity.ToString(), insertedEntity, token: cancellationToken); + return insertedEntity; + } + + public override async Task UpdateAsync( + TEntity entity, + bool autoSave = false, + CancellationToken cancellationToken = default(CancellationToken)) + { + var updatedEntity = await base.UpdateAsync(entity, autoSave, cancellationToken); + await Cache.SetAsync(updatedEntity.Id.ToString(), updatedEntity, token: cancellationToken); + return updatedEntity; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs new file mode 100644 index 0000000..8390103 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs @@ -0,0 +1,215 @@ +using AElf.CrossChainServer.BridgeContract; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class CrossChainServerDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + // Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public DbSet Chains { get; set; } + public DbSet Tokens { get; set; } + public DbSet CrossChainIndexingInfos { get; set; } + public DbSet CrossChainTransfers { get; set; } + public DbSet WalletUsers { get; set; } + public DbSet WalletUserAddressInfos { get; set; } + public DbSet Settings { get; set; } + public DbSet CrossChainDailyLimits { get; set; } + public DbSet CrossChainRateLimits { get; set; } + public DbSet PoolLiquidityInfos { get; set; } + public DbSet UserLiquidityInfos { get; set; } + public DbSet TokenApplyOrders { get; set; } + public DbSet StatusChangedRecords { get; set; } + public DbSet UserTokenAccessInfos { get; set; } + public DbSet ThirdUserTokenIssuesInfos { get; set; } + + public CrossChainServerDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureFeatureManagement(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "Chains", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "Tokens", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "CrossChainIndexingInfos", + CrossChainServerConsts.DbSchema); + b.HasIndex(o => o.BlockTime); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "CrossChainTransfers", CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.FromChainId, o.ToChainId, o.TransferTransactionId }).IsUnique(); + b.HasIndex(o => new { o.FromChainId, o.ToChainId, o.InlineTransferTransactionId }); + b.HasIndex(o => new { o.FromChainId, o.ToChainId, o.ReceiptId }); + b.HasIndex(o => new { o.Status, o.ProgressUpdateTime }); + b.ConfigureByConvention(); + }); + + builder.Entity(entity => + { + entity.ToTable(CrossChainServerConsts.DbTablePrefix + "WalletUsers", CrossChainServerConsts.DbSchema); + entity.HasKey(e => e.Id); + entity.HasMany(x => x.AddressInfos) + .WithOne(x => x.WalletUser) + .HasForeignKey(x => x.UserId) + .IsRequired(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "WalletUserAddressInfos", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "Settings", CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.ChainId, o.Name }); + b.ConfigureByConvention(); + }); + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "CrossChainDailyLimits", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "CrossChainRateLimits", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "UserTokenAccessInfo", CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.Address, o.Symbol }).IsUnique(); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "TokenApplyOrder", CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + b.HasIndex(o => new { o.UserAddress, o.Symbol }); + //Define the relation + b.HasMany(x => x.StatusChangedRecords) + .WithOne(x => x.Order) + .HasForeignKey(x => x.OrderId) + .IsRequired(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "ApplyOrderStatusChangedRecord", + CrossChainServerConsts.DbSchema); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "PoolLiquidityInfos", CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.ChainId, o.TokenId }).IsUnique(); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "UserLiquidityInfos", CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.ChainId, o.TokenId, o.Provider }).IsUnique(); + b.ConfigureByConvention(); + }); + + builder.Entity(b => + { + b.ToTable(CrossChainServerConsts.DbTablePrefix + "ThirdUserTokenIssueInfo", + CrossChainServerConsts.DbSchema); + b.HasIndex(o => new { o.Symbol, o.OtherChainId }).IsUnique(); + b.ConfigureByConvention(); + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContextFactory.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContextFactory.cs new file mode 100644 index 0000000..be3eb95 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContextFactory.cs @@ -0,0 +1,32 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class CrossChainServerDbContextFactory : IDesignTimeDbContextFactory +{ + public CrossChainServerDbContext CreateDbContext(string[] args) + { + var configuration = BuildConfiguration(); + + CrossChainServerEfCoreEntityExtensionMappings.Configure(); + + var builder = new DbContextOptionsBuilder() + .UseMySql(configuration.GetConnectionString("Default"), MySqlServerVersion.LatestSupportedServerVersion); + + return new CrossChainServerDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../AElf.CrossChainServer.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEfCoreEntityExtensionMappings.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..d17067c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEfCoreEntityExtensionMappings.cs @@ -0,0 +1,41 @@ +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +public static class CrossChainServerEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + CrossChainServerGlobalFeatureConfigurator.Configure(); + CrossChainServerModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE CrossChainServerModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreModule.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..806fb1c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreModule.cs @@ -0,0 +1,52 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.MySQL; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +[DependsOn( + typeof(CrossChainServerDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) +)] +public class CrossChainServerEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + CrossChainServerEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + + Configure(options => + { + /* The main point to change your DBMS. + * See also CrossChainServerMigrationsDbContextFactory for EF Core tooling. */ + options.UseMySQL(); + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCrossChainServerDbSchemaMigrator.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCrossChainServerDbSchemaMigrator.cs new file mode 100644 index 0000000..0a199ed --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCrossChainServerDbSchemaMigrator.cs @@ -0,0 +1,33 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using AElf.CrossChainServer.Data; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +public class EntityFrameworkCoreCrossChainServerDbSchemaMigrator + : ICrossChainServerDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCoreCrossChainServerDbSchemaMigrator(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolving the CrossChainServerDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.Designer.cs new file mode 100644 index 0000000..7c78a48 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.Designer.cs @@ -0,0 +1,2446 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220706102450_Init")] + partial class Init + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainServerTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("int"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("int"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.cs new file mode 100644 index 0000000..0edd5db --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220706102450_Init.cs @@ -0,0 +1,1684 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ImpersonatorUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ImpersonatorTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorTenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExecutionTime = table.Column(type: "datetime(6)", nullable: false), + ExecutionDuration = table.Column(type: "int", nullable: false), + ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + HttpMethod = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Url = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Exceptions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Comments = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + HttpStatusCode = table.Column(type: "int", nullable: true), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + JobName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + JobArgs = table.Column(type: "longtext", maxLength: 1048576, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + NextTryTime = table.Column(type: "datetime(6)", nullable: false), + LastTryTime = table.Column(type: "datetime(6)", nullable: true), + IsAbandoned = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + Priority = table.Column(type: "tinyint unsigned", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Required = table.Column(type: "tinyint(1)", nullable: false), + IsStatic = table.Column(type: "tinyint(1)", nullable: false), + Regex = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RegexDescription = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ValueType = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpFeatureValues", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SourceUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SourceTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TargetUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TargetTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Code = table.Column(type: "varchar(95)", maxLength: 95, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDefault = table.Column(type: "tinyint(1)", nullable: false), + IsStatic = table.Column(type: "tinyint(1)", nullable: false), + IsPublic = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Identity = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Action = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Surname = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SecurityStamp = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsExternal = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "datetime(6)", nullable: true), + LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppChains", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + IsMainChain = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppChains", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppCrossChainIndexingInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + BlockHeight = table.Column(type: "bigint", nullable: false), + BlockTime = table.Column(type: "datetime(6)", nullable: false), + IndexChainId = table.Column(type: "int", nullable: false), + IndexBlockHeight = table.Column(type: "bigint", nullable: false), + ChainId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppCrossChainIndexingInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppCrossChainTransfers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TransferTokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ReceiveTokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "int", nullable: false), + FromChainId = table.Column(type: "int", nullable: false), + ToChainId = table.Column(type: "int", nullable: false), + FromAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ToAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TransferTransactionId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiveTransactionId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TransferTime = table.Column(type: "datetime(6)", nullable: false), + TransferBlockHeight = table.Column(type: "bigint", nullable: false), + ReceiveTime = table.Column(type: "datetime(6)", nullable: false), + TransferAmount = table.Column(type: "decimal(65,30)", nullable: false), + ReceiveAmount = table.Column(type: "decimal(65,30)", nullable: false), + Status = table.Column(type: "int", nullable: false), + ReceiptId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Progress = table.Column(type: "double", nullable: false), + ProgressUpdateTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppCrossChainTransfers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppTokens", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Address = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Symbol = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Decimals = table.Column(type: "int", nullable: false), + ChainId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppTokens", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + AllowedAccessTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Required = table.Column(type: "tinyint(1)", nullable: false), + Emphasize = table.Column(type: "tinyint(1)", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LogoUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + ProtocolType = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + RequireClientSecret = table.Column(type: "tinyint(1)", nullable: false), + RequireConsent = table.Column(type: "tinyint(1)", nullable: false), + AllowRememberConsent = table.Column(type: "tinyint(1)", nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(type: "tinyint(1)", nullable: false), + RequirePkce = table.Column(type: "tinyint(1)", nullable: false), + AllowPlainTextPkce = table.Column(type: "tinyint(1)", nullable: false), + RequireRequestObject = table.Column(type: "tinyint(1)", nullable: false), + AllowAccessTokensViaBrowser = table.Column(type: "tinyint(1)", nullable: false), + FrontChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + FrontChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), + BackChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BackChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), + AllowOfflineAccess = table.Column(type: "tinyint(1)", nullable: false), + IdentityTokenLifetime = table.Column(type: "int", nullable: false), + AllowedIdentityTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AccessTokenLifetime = table.Column(type: "int", nullable: false), + AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), + ConsentLifetime = table.Column(type: "int", nullable: true), + AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), + SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), + RefreshTokenUsage = table.Column(type: "int", nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(type: "tinyint(1)", nullable: false), + RefreshTokenExpiration = table.Column(type: "int", nullable: false), + AccessTokenType = table.Column(type: "int", nullable: false), + EnableLocalLogin = table.Column(type: "tinyint(1)", nullable: false), + IncludeJwtId = table.Column(type: "tinyint(1)", nullable: false), + AlwaysSendClientClaims = table.Column(type: "tinyint(1)", nullable: false), + ClientClaimsPrefix = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PairWiseSubjectSalt = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserSsoLifetime = table.Column(type: "int", nullable: true), + UserCodeType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceCodeLifetime = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DeviceCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + UserCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: false), + Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + Required = table.Column(type: "tinyint(1)", nullable: false), + Emphasize = table.Column(type: "tinyint(1)", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + Expiration = table.Column(type: "datetime(6)", nullable: true), + ConsumedTime = table.Column(type: "datetime(6)", nullable: true), + Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ServiceName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + MethodName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Parameters = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExecutionTime = table.Column(type: "datetime(6)", nullable: false), + ExecutionDuration = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ChangeTime = table.Column(type: "datetime(6)", nullable: false), + ChangeType = table.Column(type: "tinyint unsigned", nullable: false), + EntityTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + EntityId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + EntityTypeFullName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUn~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProviderKey = table.Column(type: "varchar(196)", maxLength: 196, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderDisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUn~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Value = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceClaims", + columns: table => new + { + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceProperties", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceScopes", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceSecrets", + columns: table => new + { + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeClaims", + columns: table => new + { + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeProperties", + columns: table => new + { + ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Origin = table.Column(type: "varchar(150)", maxLength: 150, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Client~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GrantType = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Provider = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_Cl~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PostLogoutRedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCli~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clien~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Description = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceClaims", + columns: table => new + { + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceProperties", + columns: table => new + { + IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + EntityChangeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + NewValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OriginalValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PropertyName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + PropertyTypeFullName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_AuditLogId", + table: "AbpAuditLogActions", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Execution~", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", + table: "AbpFeatureValues", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_Expiration", + table: "IdentityServerPersistedGrants", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpFeatureValues"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "AppChains"); + + migrationBuilder.DropTable( + name: "AppCrossChainIndexingInfos"); + + migrationBuilder.DropTable( + name: "AppCrossChainTransfers"); + + migrationBuilder.DropTable( + name: "AppTokens"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.Designer.cs new file mode 100644 index 0000000..022213c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.Designer.cs @@ -0,0 +1,2509 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220728035126_EventHandler")] + partial class EventHandler + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainServerTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("int"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("int"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.cs new file mode 100644 index 0000000..b129f06 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220728035126_EventHandler.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class EventHandler : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AELFSaveData", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Data = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AELFSaveData", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AELFTransactionWithLogsInfo", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ChainId = table.Column(type: "int", nullable: false), + SaveTicks = table.Column(type: "bigint", nullable: false), + IsFork = table.Column(type: "tinyint(1)", nullable: false), + Category = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TransactionId = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockNumber = table.Column(type: "bigint", nullable: false), + BlockHash = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockTime = table.Column(type: "datetime(6)", maxLength: 16, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AELFTransactionWithLogsInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AELFTransactionWithLogsInfo_SaveTicks", + table: "AELFTransactionWithLogsInfo", + column: "SaveTicks"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AELFSaveData"); + + migrationBuilder.DropTable( + name: "AELFTransactionWithLogsInfo"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.Designer.cs new file mode 100644 index 0000000..373d63c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.Designer.cs @@ -0,0 +1,2598 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220825115333_Heterogeneous")] + partial class Heterogeneous + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("longtext"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("longtext"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("UpdateTime") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("Token") + .HasColumnType("longtext"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.cs new file mode 100644 index 0000000..b837c95 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220825115333_Heterogeneous.cs @@ -0,0 +1,222 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Heterogeneous : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppTokens", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ToChainId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "FromChainId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "IndexChainId", + table: "AppCrossChainIndexingInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppCrossChainIndexingInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChains", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "AElfChainId", + table: "AppChains", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "AppBridgeContractSyncInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TargetChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "int", nullable: false), + SyncIndex = table.Column(type: "bigint", nullable: false), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppBridgeContractSyncInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppOracleQueryInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + QueryId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Option = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Step = table.Column(type: "int", nullable: false), + UpdateTime = table.Column(type: "datetime(6)", nullable: false), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppOracleQueryInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppReportInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoundId = table.Column(type: "bigint", nullable: false), + Token = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TargetChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiptId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiptHash = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Step = table.Column(type: "int", nullable: false), + QueryTimes = table.Column(type: "int", nullable: false), + TransmitHeight = table.Column(type: "bigint", nullable: false), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppReportInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AppBridgeContractSyncInfos"); + + migrationBuilder.DropTable( + name: "AppOracleQueryInfos"); + + migrationBuilder.DropTable( + name: "AppReportInfos"); + + migrationBuilder.DropColumn( + name: "AElfChainId", + table: "AppChains"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppTokens", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ToChainId", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "FromChainId", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "IndexChainId", + table: "AppCrossChainIndexingInfos", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppCrossChainIndexingInfos", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChains", + type: "int", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.Designer.cs new file mode 100644 index 0000000..a8be8e0 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.Designer.cs @@ -0,0 +1,2601 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220826062134_Add_Chain_BlockChain")] + partial class Add_Chain_BlockChain + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("longtext"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("longtext"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("UpdateTime") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("Token") + .HasColumnType("longtext"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.cs new file mode 100644 index 0000000..d3c3ca8 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826062134_Add_Chain_BlockChain.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Chain_BlockChain : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "BlockChain", + table: "AppChains", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "BlockChain", + table: "AppChains"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.Designer.cs new file mode 100644 index 0000000..9ae6a9e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.Designer.cs @@ -0,0 +1,2613 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220826080535_Add_Index")] + partial class Add_Index + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("UpdateTime") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.cs new file mode 100644 index 0000000..dcf3aa6 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220826080535_Add_Index.cs @@ -0,0 +1,245 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Index : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Token", + table: "AppReportInfos", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppReportInfos", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "QueryId", + table: "AppOracleQueryInfos", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppOracleQueryInfos", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "TransferTransactionId", + table: "AppCrossChainTransfers", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ToChainId", + table: "AppCrossChainTransfers", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ReceiptId", + table: "AppCrossChainTransfers", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "FromChainId", + table: "AppCrossChainTransfers", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token", + table: "AppReportInfos", + columns: new[] { "ChainId", "RoundId", "Token" }); + + migrationBuilder.CreateIndex( + name: "IX_AppOracleQueryInfos_ChainId_QueryId", + table: "AppOracleQueryInfos", + columns: new[] { "ChainId", "QueryId" }); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_ReceiptId", + table: "AppCrossChainTransfers", + columns: new[] { "FromChainId", "ToChainId", "ReceiptId" }); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers", + columns: new[] { "FromChainId", "ToChainId", "TransferTransactionId" }); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_Status_ProgressUpdateTime", + table: "AppCrossChainTransfers", + columns: new[] { "Status", "ProgressUpdateTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainIndexingInfos_BlockTime", + table: "AppCrossChainIndexingInfos", + column: "BlockTime"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token", + table: "AppReportInfos"); + + migrationBuilder.DropIndex( + name: "IX_AppOracleQueryInfos_ChainId_QueryId", + table: "AppOracleQueryInfos"); + + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_ReceiptId", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_Status_ProgressUpdateTime", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropIndex( + name: "IX_AppCrossChainIndexingInfos_BlockTime", + table: "AppCrossChainIndexingInfos"); + + migrationBuilder.AlterColumn( + name: "Token", + table: "AppReportInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppReportInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "QueryId", + table: "AppOracleQueryInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ChainId", + table: "AppOracleQueryInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "TransferTransactionId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ToChainId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ReceiptId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "FromChainId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.Designer.cs new file mode 100644 index 0000000..dae2d4a --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.Designer.cs @@ -0,0 +1,2619 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20220914082913_Modify_ReportInfo")] + partial class Modify_ReportInfo + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("double"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("UpdateTime") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.Property("UpdateTime") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.cs new file mode 100644 index 0000000..2c225c4 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20220914082913_Modify_ReportInfo.cs @@ -0,0 +1,78 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Modify_ReportInfo : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token", + table: "AppReportInfos"); + + migrationBuilder.AlterColumn( + name: "TargetChainId", + table: "AppReportInfos", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "QueryTransactionId", + table: "AppReportInfos", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "UpdateTime", + table: "AppReportInfos", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.CreateIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token_TargetChainId", + table: "AppReportInfos", + columns: new[] { "ChainId", "RoundId", "Token", "TargetChainId" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token_TargetChainId", + table: "AppReportInfos"); + + migrationBuilder.DropColumn( + name: "QueryTransactionId", + table: "AppReportInfos"); + + migrationBuilder.DropColumn( + name: "UpdateTime", + table: "AppReportInfos"); + + migrationBuilder.AlterColumn( + name: "TargetChainId", + table: "AppReportInfos", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token", + table: "AppReportInfos", + columns: new[] { "ChainId", "RoundId", "Token" }); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.Designer.cs new file mode 100644 index 0000000..c196ef5 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.Designer.cs @@ -0,0 +1,2622 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20230331081919_Update_CrossChainTransfer")] + partial class Update_CrossChainTransfer + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.cs new file mode 100644 index 0000000..72c57b3 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230331081919_Update_CrossChainTransfer.cs @@ -0,0 +1,87 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Update_CrossChainTransfer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "UpdateTime", + table: "AppReportInfos"); + + migrationBuilder.DropColumn( + name: "UpdateTime", + table: "AppOracleQueryInfos"); + + migrationBuilder.AddColumn( + name: "LastUpdateHeight", + table: "AppReportInfos", + type: "bigint", + nullable: false, + defaultValue: 0L); + + migrationBuilder.AddColumn( + name: "LastUpdateHeight", + table: "AppOracleQueryInfos", + type: "bigint", + nullable: false, + defaultValue: 0L); + + migrationBuilder.AlterColumn( + name: "Progress", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + oldClrType: typeof(double), + oldType: "double"); + + migrationBuilder.AddColumn( + name: "TransferNeedToBeApproved", + table: "AppCrossChainTransfers", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastUpdateHeight", + table: "AppReportInfos"); + + migrationBuilder.DropColumn( + name: "LastUpdateHeight", + table: "AppOracleQueryInfos"); + + migrationBuilder.DropColumn( + name: "TransferNeedToBeApproved", + table: "AppCrossChainTransfers"); + + migrationBuilder.AddColumn( + name: "UpdateTime", + table: "AppReportInfos", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "UpdateTime", + table: "AppOracleQueryInfos", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AlterColumn( + name: "Progress", + table: "AppCrossChainTransfers", + type: "double", + nullable: false, + oldClrType: typeof(int), + oldType: "int"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.Designer.cs new file mode 100644 index 0000000..5d7f8bc --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.Designer.cs @@ -0,0 +1,2643 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20230406022952_Add_Settings")] + partial class Add_Settings + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.cs new file mode 100644 index 0000000..ac2bff7 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230406022952_Add_Settings.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Settings : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AppSettings", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppSettings", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppSettings_ChainId_Name", + table: "AppSettings", + columns: new[] { "ChainId", "Name" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AppSettings"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.Designer.cs new file mode 100644 index 0000000..1264382 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.Designer.cs @@ -0,0 +1,2646 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20230913082359_Add_Report_ResendTimes")] + partial class Add_Report_ResendTimes + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId"); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.cs new file mode 100644 index 0000000..248a8a1 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20230913082359_Add_Report_ResendTimes.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Report_ResendTimes : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ResendTimes", + table: "AppReportInfos", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ResendTimes", + table: "AppReportInfos"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.Designer.cs new file mode 100644 index 0000000..9390df2 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.Designer.cs @@ -0,0 +1,2647 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20240618065115_Add_Unique_Index_CrossChainTransfer")] + partial class Add_Unique_Index_CrossChainTransfer + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.cs new file mode 100644 index 0000000..1eb6d90 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240618065115_Add_Unique_Index_CrossChainTransfer.cs @@ -0,0 +1,34 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Unique_Index_CrossChainTransfer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers"); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers", + columns: new[] { "FromChainId", "ToChainId", "TransferTransactionId" }, + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers"); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_TransferTransac~", + table: "AppCrossChainTransfers", + columns: new[] { "FromChainId", "ToChainId", "TransferTransactionId" }); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.Designer.cs new file mode 100644 index 0000000..c79c5a9 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.Designer.cs @@ -0,0 +1,2650 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20240620073118_Add_Report_ReceiptInfo")] + partial class Add_Report_ReceiptInfo + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.SaveData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("AELFSaveData", (string)null); + }); + + modelBuilder.Entity("AElf.AElfNode.EventHandler.Core.Domains.Entities.TransactionWithLogsInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("BlockHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("BlockNumber") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasMaxLength(16) + .HasColumnType("datetime(6)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("int"); + + b.Property("IsFork") + .HasColumnType("tinyint(1)"); + + b.Property("SaveTicks") + .HasColumnType("bigint"); + + b.Property("TransactionId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SaveTicks"); + + b.ToTable("AELFTransactionWithLogsInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiptInfo") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.cs new file mode 100644 index 0000000..7566926 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20240620073118_Add_Report_ReceiptInfo.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Report_ReceiptInfo : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ReceiptInfo", + table: "AppReportInfos", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ReceiptInfo", + table: "AppReportInfos"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.Designer.cs new file mode 100644 index 0000000..115f59e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.Designer.cs @@ -0,0 +1,2590 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20241012035347_Add_Receive_Retry_Times")] + partial class Add_Receive_Retry_Times + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiptInfo") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.cs new file mode 100644 index 0000000..4a7d047 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20241012035347_Add_Receive_Retry_Times.cs @@ -0,0 +1,80 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + public partial class Add_Receive_Retry_Times : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AELFSaveData"); + + migrationBuilder.DropTable( + name: "AELFTransactionWithLogsInfo"); + + migrationBuilder.AddColumn( + name: "ReceiveTransactionAttemptTimes", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ReceiveTransactionAttemptTimes", + table: "AppCrossChainTransfers"); + + migrationBuilder.CreateTable( + name: "AELFSaveData", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Data = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Key = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AELFSaveData", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AELFTransactionWithLogsInfo", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + BlockHash = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BlockNumber = table.Column(type: "bigint", nullable: false), + BlockTime = table.Column(type: "datetime(6)", maxLength: 16, nullable: false), + Category = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ChainId = table.Column(type: "int", nullable: false), + IsFork = table.Column(type: "tinyint(1)", nullable: false), + SaveTicks = table.Column(type: "bigint", nullable: false), + TransactionId = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AELFTransactionWithLogsInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AELFTransactionWithLogsInfo_SaveTicks", + table: "AELFTransactionWithLogsInfo", + column: "SaveTicks"); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.Designer.cs new file mode 100644 index 0000000..91dd7ae --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.Designer.cs @@ -0,0 +1,2646 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20250114164022_Add_Ton_And_Token")] + partial class Add_Ton_And_Token + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AppWalletUserAddressInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainDailyLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("DailyLimit") + .HasColumnType("decimal(65,30)"); + + b.Property("RefreshTime") + .HasColumnType("bigint"); + + b.Property("RemainAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainDailyLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainRateLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Capacity") + .HasColumnType("decimal(65,30)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("CurrentAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("IsEnable") + .HasColumnType("tinyint(1)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainRateLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("InlineTransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TraceId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "InlineTransferTransactionId"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiptInfo") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AppId") + .HasColumnType("longtext"); + + b.Property("CaHash") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("ModificationTime") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppWalletUsers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("OrderId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Time") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("AppApplyOrderStatusChangedRecord", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue.ThirdUserTokenIssueInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("BindingId") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("OtherChainId") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("ThirdTokenId") + .HasColumnType("longtext"); + + b.Property("TokenImage") + .HasColumnType("longtext"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("longtext"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("WalletAddress") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol", "OtherChainId") + .IsUnique(); + + b.ToTable("AppThirdUserTokenIssueInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ChainName") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("PoolAddress") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("decimal(65,30)"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("UserAddress") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserAddress", "Symbol"); + + b.ToTable("AppTokenApplyOrder", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.UserTokenAccess.UserTokenAccessInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("OfficialTwitter") + .HasColumnType("longtext"); + + b.Property("OfficialWebsite") + .HasColumnType("longtext"); + + b.Property("PersonName") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TelegramHandler") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol") + .IsUnique(); + + b.ToTable("AppUserTokenAccessInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.PoolLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId") + .IsUnique(); + + b.ToTable("AppPoolLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.UserLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("Provider") + .HasColumnType("varchar(255)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId", "Provider") + .IsUnique(); + + b.ToTable("AppUserLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("IsBurnable") + .HasColumnType("tinyint(1)"); + + b.Property("IssueChainId") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.HasOne("AElf.CrossChainServer.CrossChain.WalletUserDto", "WalletUser") + .WithMany("AddressInfos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WalletUser"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.HasOne("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", "Order") + .WithMany("StatusChangedRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Navigation("AddressInfos"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Navigation("StatusChangedRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.cs new file mode 100644 index 0000000..c1b87b1 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250114164022_Add_Ton_And_Token.cs @@ -0,0 +1,2150 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + /// + public partial class Add_Ton_And_Token : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + + migrationBuilder.AddColumn( + name: "IsBurnable", + table: "AppTokens", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "IssueChainId", + table: "AppTokens", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "InlineTransferTransactionId", + table: "AppCrossChainTransfers", + type: "varchar(255)", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "TraceId", + table: "AppCrossChainTransfers", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpUsers", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpUsers", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpUsers", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpUsers", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpUsers", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "LastPasswordChangeTime", + table: "AbpUsers", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "ShouldChangePasswordOnNextLogin", + table: "AbpUsers", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.UpdateData( + table: "AbpTenants", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpTenants", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpTenants", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpTenants", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpTenants", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "NormalizedName", + table: "AbpTenants", + type: "varchar(64)", + maxLength: 64, + nullable: false, + defaultValue: "") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpSecurityLogs", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpSecurityLogs", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpSecurityLogs", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpSecurityLogs", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpRoles", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpRoles", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpRoles", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpRoles", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpRoles", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.UpdateData( + table: "AbpOrganizationUnits", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpOrganizationUnits", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpOrganizationUnits", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpOrganizationUnits", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpOrganizationUnits", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "AbpEntityChanges", + type: "varchar(128)", + maxLength: 128, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(128)", + oldMaxLength: 128) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpClaimTypes", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpClaimTypes", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpClaimTypes", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpClaimTypes", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpBackgroundJobs", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpBackgroundJobs", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpBackgroundJobs", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpBackgroundJobs", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpAuditLogs", + keyColumn: "ExtraProperties", + keyValue: null, + column: "ExtraProperties", + value: ""); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpAuditLogs", + type: "longtext", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpAuditLogs", + keyColumn: "ConcurrencyStamp", + keyValue: null, + column: "ConcurrencyStamp", + value: ""); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpAuditLogs", + type: "varchar(40)", + maxLength: 40, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultValue = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsVisibleToClients = table.Column(type: "tinyint(1)", nullable: false), + IsAvailableToHost = table.Column(type: "tinyint(1)", nullable: false), + AllowedProviders = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ValueType = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + MultiTenancySide = table.Column(type: "tinyint unsigned", nullable: false), + Providers = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IpAddresses = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SignedIn = table.Column(type: "datetime(6)", nullable: false), + LastAccessed = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpSettingDefinitions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultValue = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsVisibleToClients = table.Column(type: "tinyint(1)", nullable: false), + Providers = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsInherited = table.Column(type: "tinyint(1)", nullable: false), + IsEncrypted = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + SourceUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TargetUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + StartTime = table.Column(type: "datetime(6)", nullable: false), + EndTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppCrossChainDailyLimits", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TargetChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + RemainAmount = table.Column(type: "decimal(65,30)", nullable: false), + RefreshTime = table.Column(type: "bigint", nullable: false), + DailyLimit = table.Column(type: "decimal(65,30)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppCrossChainDailyLimits", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppCrossChainRateLimits", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TargetChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + CurrentAmount = table.Column(type: "decimal(65,30)", nullable: false), + Capacity = table.Column(type: "decimal(65,30)", nullable: false), + Rate = table.Column(type: "decimal(65,30)", nullable: false), + IsEnable = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppCrossChainRateLimits", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppPoolLiquidityInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Liquidity = table.Column(type: "decimal(65,30)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppPoolLiquidityInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppThirdUserTokenIssueInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Address = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + WalletAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Symbol = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreateTime = table.Column(type: "bigint", nullable: false), + UpdateTime = table.Column(type: "bigint", nullable: false), + TokenName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TokenImage = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OtherChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TotalSupply = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ContractAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BindingId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ThirdTokenId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppThirdUserTokenIssueInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppTokenApplyOrder", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ChainName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TokenName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TotalSupply = table.Column(type: "decimal(65,30)", nullable: false), + Decimals = table.Column(type: "int", nullable: false), + Icon = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PoolAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ContractAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Symbol = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreateTime = table.Column(type: "bigint", nullable: false), + UpdateTime = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppTokenApplyOrder", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppUserLiquidityInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Provider = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Liquidity = table.Column(type: "decimal(65,30)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppUserLiquidityInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppUserTokenAccessInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Symbol = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Address = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OfficialWebsite = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OfficialTwitter = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PersonName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TelegramHandler = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppUserTokenAccessInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppWalletUsers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AppId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CaHash = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreateTime = table.Column(type: "bigint", nullable: false), + ModificationTime = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppWalletUsers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientSecret = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConsentType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayNames = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + JsonWebKeySet = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Permissions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PostLogoutRedirectUris = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Properties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RedirectUris = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Requirements = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Settings = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientUri = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LogoUri = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Descriptions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayNames = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Properties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Resources = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppApplyOrderStatusChangedRecord", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrderId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Status = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Time = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppApplyOrderStatusChangedRecord", x => x.Id); + table.ForeignKey( + name: "FK_AppApplyOrderStatusChangedRecord_AppTokenApplyOrder_OrderId", + column: x => x.OrderId, + principalTable: "AppTokenApplyOrder", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppWalletUserAddressInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Address = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppWalletUserAddressInfos", x => x.Id); + table.ForeignKey( + name: "FK_AppWalletUserAddressInfos_AppWalletUsers_UserId", + column: x => x.UserId, + principalTable: "AppWalletUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CreationDate = table.Column(type: "datetime(6)", nullable: true), + Properties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Scopes = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Subject = table.Column(type: "varchar(400)", maxLength: 400, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictAuthorizations_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + AuthorizationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CreationDate = table.Column(type: "datetime(6)", nullable: true), + ExpirationDate = table.Column(type: "datetime(6)", nullable: true), + Payload = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Properties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RedemptionDate = table.Column(type: "datetime(6)", nullable: true), + ReferenceId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Subject = table.Column(type: "varchar(400)", maxLength: 400, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "OpenIddictAuthorizations", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_InlineTransferT~", + table: "AppCrossChainTransfers", + columns: new[] { "FromChainId", "ToChainId", "InlineTransferTransactionId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettingDefinitions_Name", + table: "AbpSettingDefinitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppApplyOrderStatusChangedRecord_OrderId", + table: "AppApplyOrderStatusChangedRecord", + column: "OrderId"); + + migrationBuilder.CreateIndex( + name: "IX_AppPoolLiquidityInfos_ChainId_TokenId", + table: "AppPoolLiquidityInfos", + columns: new[] { "ChainId", "TokenId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppThirdUserTokenIssueInfo_Address_Symbol_OtherChainId", + table: "AppThirdUserTokenIssueInfo", + columns: new[] { "Address", "Symbol", "OtherChainId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppTokenApplyOrder_UserAddress_Symbol", + table: "AppTokenApplyOrder", + columns: new[] { "UserAddress", "Symbol" }); + + migrationBuilder.CreateIndex( + name: "IX_AppUserLiquidityInfos_ChainId_TokenId_Provider", + table: "AppUserLiquidityInfos", + columns: new[] { "ChainId", "TokenId", "Provider" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppUserTokenAccessInfo_Address_Symbol", + table: "AppUserTokenAccessInfo", + columns: new[] { "Address", "Symbol" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppWalletUserAddressInfos_UserId", + table: "AppWalletUserAddressInfos", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictApplications_ClientId", + table: "OpenIddictApplications", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "OpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictScopes_Name", + table: "OpenIddictScopes", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "OpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_AuthorizationId", + table: "OpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ReferenceId", + table: "OpenIddictTokens", + column: "ReferenceId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.DropTable( + name: "AbpSettingDefinitions"); + + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + + migrationBuilder.DropTable( + name: "AppApplyOrderStatusChangedRecord"); + + migrationBuilder.DropTable( + name: "AppCrossChainDailyLimits"); + + migrationBuilder.DropTable( + name: "AppCrossChainRateLimits"); + + migrationBuilder.DropTable( + name: "AppPoolLiquidityInfos"); + + migrationBuilder.DropTable( + name: "AppThirdUserTokenIssueInfo"); + + migrationBuilder.DropTable( + name: "AppUserLiquidityInfos"); + + migrationBuilder.DropTable( + name: "AppUserTokenAccessInfo"); + + migrationBuilder.DropTable( + name: "AppWalletUserAddressInfos"); + + migrationBuilder.DropTable( + name: "OpenIddictScopes"); + + migrationBuilder.DropTable( + name: "OpenIddictTokens"); + + migrationBuilder.DropTable( + name: "AppTokenApplyOrder"); + + migrationBuilder.DropTable( + name: "AppWalletUsers"); + + migrationBuilder.DropTable( + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "OpenIddictApplications"); + + migrationBuilder.DropIndex( + name: "IX_AppCrossChainTransfers_FromChainId_ToChainId_InlineTransferT~", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants"); + + migrationBuilder.DropColumn( + name: "IsBurnable", + table: "AppTokens"); + + migrationBuilder.DropColumn( + name: "IssueChainId", + table: "AppTokens"); + + migrationBuilder.DropColumn( + name: "InlineTransferTransactionId", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropColumn( + name: "TraceId", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropColumn( + name: "EntityVersion", + table: "AbpUsers"); + + migrationBuilder.DropColumn( + name: "LastPasswordChangeTime", + table: "AbpUsers"); + + migrationBuilder.DropColumn( + name: "ShouldChangePasswordOnNextLogin", + table: "AbpUsers"); + + migrationBuilder.DropColumn( + name: "EntityVersion", + table: "AbpTenants"); + + migrationBuilder.DropColumn( + name: "NormalizedName", + table: "AbpTenants"); + + migrationBuilder.DropColumn( + name: "EntityVersion", + table: "AbpRoles"); + + migrationBuilder.DropColumn( + name: "EntityVersion", + table: "AbpOrganizationUnits"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpUsers", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpUsers", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpTenants", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpTenants", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpSecurityLogs", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpSecurityLogs", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpRoles", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpRoles", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpOrganizationUnits", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpOrganizationUnits", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "AbpEntityChanges", + keyColumn: "EntityId", + keyValue: null, + column: "EntityId", + value: ""); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "AbpEntityChanges", + type: "varchar(128)", + maxLength: 128, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(128)", + oldMaxLength: 128, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpClaimTypes", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpClaimTypes", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpBackgroundJobs", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpBackgroundJobs", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExtraProperties", + table: "AbpAuditLogs", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpAuditLogs", + type: "varchar(40)", + maxLength: 40, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(40)", + oldMaxLength: 40) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AllowedAccessTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Emphasize = table.Column(type: "tinyint(1)", nullable: false), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Required = table.Column(type: "tinyint(1)", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), + AccessTokenLifetime = table.Column(type: "int", nullable: false), + AccessTokenType = table.Column(type: "int", nullable: false), + AllowAccessTokensViaBrowser = table.Column(type: "tinyint(1)", nullable: false), + AllowOfflineAccess = table.Column(type: "tinyint(1)", nullable: false), + AllowPlainTextPkce = table.Column(type: "tinyint(1)", nullable: false), + AllowRememberConsent = table.Column(type: "tinyint(1)", nullable: false), + AllowedIdentityTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AlwaysIncludeUserClaimsInIdToken = table.Column(type: "tinyint(1)", nullable: false), + AlwaysSendClientClaims = table.Column(type: "tinyint(1)", nullable: false), + AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), + BackChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), + BackChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientClaimsPrefix = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConsentLifetime = table.Column(type: "int", nullable: true), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceCodeLifetime = table.Column(type: "int", nullable: false), + EnableLocalLogin = table.Column(type: "tinyint(1)", nullable: false), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + FrontChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), + FrontChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IdentityTokenLifetime = table.Column(type: "int", nullable: false), + IncludeJwtId = table.Column(type: "tinyint(1)", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LogoUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PairWiseSubjectSalt = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ProtocolType = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + RefreshTokenExpiration = table.Column(type: "int", nullable: false), + RefreshTokenUsage = table.Column(type: "int", nullable: false), + RequireClientSecret = table.Column(type: "tinyint(1)", nullable: false), + RequireConsent = table.Column(type: "tinyint(1)", nullable: false), + RequirePkce = table.Column(type: "tinyint(1)", nullable: false), + RequireRequestObject = table.Column(type: "tinyint(1)", nullable: false), + SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(type: "tinyint(1)", nullable: false), + UserCodeType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserSsoLifetime = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Emphasize = table.Column(type: "tinyint(1)", nullable: false), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Required = table.Column(type: "tinyint(1)", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConsumedTime = table.Column(type: "datetime(6)", nullable: true), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: true), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceClaims", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceProperties", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceScopes", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceSecrets", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeClaims", + columns: table => new + { + ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeProperties", + columns: table => new + { + ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Origin = table.Column(type: "varchar(150)", maxLength: 150, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Client~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GrantType = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Provider = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_Cl~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PostLogoutRedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCli~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clien~", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceClaims", + columns: table => new + { + IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceProperties", + columns: table => new + { + IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_Expiration", + table: "IdentityServerPersistedGrants", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.Designer.cs new file mode 100644 index 0000000..0818c5e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.Designer.cs @@ -0,0 +1,2646 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20250118042034_Update_Third_Token_Index")] + partial class Update_Third_Token_Index + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AppWalletUserAddressInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainDailyLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("DailyLimit") + .HasColumnType("decimal(65,30)"); + + b.Property("RefreshTime") + .HasColumnType("bigint"); + + b.Property("RemainAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainDailyLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainRateLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Capacity") + .HasColumnType("decimal(65,30)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("CurrentAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("IsEnable") + .HasColumnType("tinyint(1)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainRateLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("InlineTransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TraceId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferNeedToBeApproved") + .HasColumnType("tinyint(1)"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "InlineTransferTransactionId"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiptInfo") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AppId") + .HasColumnType("longtext"); + + b.Property("CaHash") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("ModificationTime") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppWalletUsers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("OrderId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Time") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("AppApplyOrderStatusChangedRecord", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue.ThirdUserTokenIssueInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("BindingId") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("OtherChainId") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("ThirdTokenId") + .HasColumnType("longtext"); + + b.Property("TokenImage") + .HasColumnType("longtext"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("longtext"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("WalletAddress") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Symbol", "OtherChainId") + .IsUnique(); + + b.ToTable("AppThirdUserTokenIssueInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ChainName") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("PoolAddress") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("decimal(65,30)"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("UserAddress") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserAddress", "Symbol"); + + b.ToTable("AppTokenApplyOrder", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.UserTokenAccess.UserTokenAccessInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("OfficialTwitter") + .HasColumnType("longtext"); + + b.Property("OfficialWebsite") + .HasColumnType("longtext"); + + b.Property("PersonName") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TelegramHandler") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol") + .IsUnique(); + + b.ToTable("AppUserTokenAccessInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.PoolLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId") + .IsUnique(); + + b.ToTable("AppPoolLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.UserLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("Provider") + .HasColumnType("varchar(255)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId", "Provider") + .IsUnique(); + + b.ToTable("AppUserLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("IsBurnable") + .HasColumnType("tinyint(1)"); + + b.Property("IssueChainId") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.HasOne("AElf.CrossChainServer.CrossChain.WalletUserDto", "WalletUser") + .WithMany("AddressInfos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WalletUser"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.HasOne("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", "Order") + .WithMany("StatusChangedRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Navigation("AddressInfos"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Navigation("StatusChangedRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.cs new file mode 100644 index 0000000..81d6347 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250118042034_Update_Third_Token_Index.cs @@ -0,0 +1,60 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + /// + public partial class Update_Third_Token_Index : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppThirdUserTokenIssueInfo_Address_Symbol_OtherChainId", + table: "AppThirdUserTokenIssueInfo"); + + migrationBuilder.AlterColumn( + name: "Address", + table: "AppThirdUserTokenIssueInfo", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppThirdUserTokenIssueInfo_Symbol_OtherChainId", + table: "AppThirdUserTokenIssueInfo", + columns: new[] { "Symbol", "OtherChainId" }, + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AppThirdUserTokenIssueInfo_Symbol_OtherChainId", + table: "AppThirdUserTokenIssueInfo"); + + migrationBuilder.AlterColumn( + name: "Address", + table: "AppThirdUserTokenIssueInfo", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppThirdUserTokenIssueInfo_Address_Symbol_OtherChainId", + table: "AppThirdUserTokenIssueInfo", + columns: new[] { "Address", "Symbol", "OtherChainId" }, + unique: true); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.Designer.cs new file mode 100644 index 0000000..5897d49 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.Designer.cs @@ -0,0 +1,2652 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20250422164715_For_Check_Transaction_Confirmed")] + partial class For_Check_Transaction_Confirmed + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AElf.CrossChainServer.BridgeContract.BridgeContractSyncInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("SyncIndex") + .HasColumnType("bigint"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBridgeContractSyncInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AppWalletUserAddressInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainDailyLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("DailyLimit") + .HasColumnType("decimal(65,30)"); + + b.Property("RefreshTime") + .HasColumnType("bigint"); + + b.Property("RemainAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainDailyLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainRateLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Capacity") + .HasColumnType("decimal(65,30)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("CurrentAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("IsEnable") + .HasColumnType("tinyint(1)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainRateLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("InlineTransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveBlockHeight") + .HasColumnType("bigint"); + + b.Property("ReceiveStatus") + .HasColumnType("int"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TraceId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferStatus") + .HasColumnType("int"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "InlineTransferTransactionId"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.OracleQueryInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("Option") + .HasColumnType("longtext"); + + b.Property("QueryId") + .HasColumnType("varchar(255)"); + + b.Property("Step") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "QueryId"); + + b.ToTable("AppOracleQueryInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.ReportInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("LastUpdateHeight") + .HasColumnType("bigint"); + + b.Property("QueryTimes") + .HasColumnType("int"); + + b.Property("QueryTransactionId") + .HasColumnType("longtext"); + + b.Property("ReceiptHash") + .HasColumnType("longtext"); + + b.Property("ReceiptId") + .HasColumnType("longtext"); + + b.Property("ReceiptInfo") + .HasColumnType("longtext"); + + b.Property("ResendTimes") + .HasColumnType("int"); + + b.Property("RoundId") + .HasColumnType("bigint"); + + b.Property("Step") + .HasColumnType("int"); + + b.Property("TargetChainId") + .HasColumnType("varchar(255)"); + + b.Property("Token") + .HasColumnType("varchar(255)"); + + b.Property("TransmitHeight") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "RoundId", "Token", "TargetChainId"); + + b.ToTable("AppReportInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AppId") + .HasColumnType("longtext"); + + b.Property("CaHash") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("ModificationTime") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppWalletUsers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("OrderId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Time") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("AppApplyOrderStatusChangedRecord", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue.ThirdUserTokenIssueInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("BindingId") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("OtherChainId") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("ThirdTokenId") + .HasColumnType("longtext"); + + b.Property("TokenImage") + .HasColumnType("longtext"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("longtext"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("WalletAddress") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Symbol", "OtherChainId") + .IsUnique(); + + b.ToTable("AppThirdUserTokenIssueInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ChainName") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("PoolAddress") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("decimal(65,30)"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("UserAddress") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserAddress", "Symbol"); + + b.ToTable("AppTokenApplyOrder", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.UserTokenAccess.UserTokenAccessInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("OfficialTwitter") + .HasColumnType("longtext"); + + b.Property("OfficialWebsite") + .HasColumnType("longtext"); + + b.Property("PersonName") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TelegramHandler") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol") + .IsUnique(); + + b.ToTable("AppUserTokenAccessInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.PoolLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId") + .IsUnique(); + + b.ToTable("AppPoolLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.UserLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("Provider") + .HasColumnType("varchar(255)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId", "Provider") + .IsUnique(); + + b.ToTable("AppUserLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("IsBurnable") + .HasColumnType("tinyint(1)"); + + b.Property("IssueChainId") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.HasOne("AElf.CrossChainServer.CrossChain.WalletUserDto", "WalletUser") + .WithMany("AddressInfos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WalletUser"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.HasOne("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", "Order") + .WithMany("StatusChangedRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Navigation("AddressInfos"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Navigation("StatusChangedRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.cs new file mode 100644 index 0000000..ddba969 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.cs @@ -0,0 +1,62 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + /// + public partial class For_Check_Transaction_Confirmed : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "TransferNeedToBeApproved", + table: "AppCrossChainTransfers"); + + migrationBuilder.AddColumn( + name: "ReceiveBlockHeight", + table: "AppCrossChainTransfers", + type: "bigint", + nullable: false, + defaultValue: 0L); + + migrationBuilder.AddColumn( + name: "ReceiveStatus", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "TransferStatus", + table: "AppCrossChainTransfers", + type: "int", + nullable: false, + defaultValue: 0); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ReceiveBlockHeight", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropColumn( + name: "ReceiveStatus", + table: "AppCrossChainTransfers"); + + migrationBuilder.DropColumn( + name: "TransferStatus", + table: "AppCrossChainTransfers"); + + migrationBuilder.AddColumn( + name: "TransferNeedToBeApproved", + table: "AppCrossChainTransfers", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.Designer.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.Designer.cs new file mode 100644 index 0000000..97da9ca --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.Designer.cs @@ -0,0 +1,2549 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + [Migration("20250519074042_For_Remove_Unused_Tables")] + partial class For_Remove_Unused_Tables + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AppWalletUserAddressInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainDailyLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("DailyLimit") + .HasColumnType("decimal(65,30)"); + + b.Property("RefreshTime") + .HasColumnType("bigint"); + + b.Property("RemainAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainDailyLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainRateLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Capacity") + .HasColumnType("decimal(65,30)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("CurrentAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("IsEnable") + .HasColumnType("tinyint(1)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainRateLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("InlineTransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveBlockHeight") + .HasColumnType("bigint"); + + b.Property("ReceiveStatus") + .HasColumnType("int"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TraceId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferStatus") + .HasColumnType("int"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "InlineTransferTransactionId"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AppId") + .HasColumnType("longtext"); + + b.Property("CaHash") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("ModificationTime") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppWalletUsers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("OrderId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Time") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("AppApplyOrderStatusChangedRecord", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue.ThirdUserTokenIssueInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("BindingId") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("OtherChainId") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("ThirdTokenId") + .HasColumnType("longtext"); + + b.Property("TokenImage") + .HasColumnType("longtext"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("longtext"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("WalletAddress") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Symbol", "OtherChainId") + .IsUnique(); + + b.ToTable("AppThirdUserTokenIssueInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ChainName") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("PoolAddress") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("decimal(65,30)"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("UserAddress") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserAddress", "Symbol"); + + b.ToTable("AppTokenApplyOrder", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.UserTokenAccess.UserTokenAccessInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("OfficialTwitter") + .HasColumnType("longtext"); + + b.Property("OfficialWebsite") + .HasColumnType("longtext"); + + b.Property("PersonName") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TelegramHandler") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol") + .IsUnique(); + + b.ToTable("AppUserTokenAccessInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.PoolLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId") + .IsUnique(); + + b.ToTable("AppPoolLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.UserLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("Provider") + .HasColumnType("varchar(255)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId", "Provider") + .IsUnique(); + + b.ToTable("AppUserLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("IsBurnable") + .HasColumnType("tinyint(1)"); + + b.Property("IssueChainId") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.HasOne("AElf.CrossChainServer.CrossChain.WalletUserDto", "WalletUser") + .WithMany("AddressInfos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WalletUser"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.HasOne("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", "Order") + .WithMany("StatusChangedRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Navigation("AddressInfos"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Navigation("StatusChangedRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.cs new file mode 100644 index 0000000..2afbe8a --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.cs @@ -0,0 +1,109 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + /// + public partial class For_Remove_Unused_Tables : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AppBridgeContractSyncInfos"); + + migrationBuilder.DropTable( + name: "AppOracleQueryInfos"); + + migrationBuilder.DropTable( + name: "AppReportInfos"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AppBridgeContractSyncInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SyncIndex = table.Column(type: "bigint", nullable: false), + TargetChainId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TokenId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Type = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppBridgeContractSyncInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppOracleQueryInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateHeight = table.Column(type: "bigint", nullable: false), + Option = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + QueryId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Step = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppOracleQueryInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppReportInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateHeight = table.Column(type: "bigint", nullable: false), + QueryTimes = table.Column(type: "int", nullable: false), + QueryTransactionId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiptHash = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiptId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiptInfo = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ResendTimes = table.Column(type: "int", nullable: false), + RoundId = table.Column(type: "bigint", nullable: false), + Step = table.Column(type: "int", nullable: false), + TargetChainId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Token = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TransmitHeight = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppReportInfos", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AppOracleQueryInfos_ChainId_QueryId", + table: "AppOracleQueryInfos", + columns: new[] { "ChainId", "QueryId" }); + + migrationBuilder.CreateIndex( + name: "IX_AppReportInfos_ChainId_RoundId_Token_TargetChainId", + table: "AppReportInfos", + columns: new[] { "ChainId", "RoundId", "Token", "TargetChainId" }); + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/CrossChainServerDbContextModelSnapshot.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/CrossChainServerDbContextModelSnapshot.cs new file mode 100644 index 0000000..b64e752 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/CrossChainServerDbContextModelSnapshot.cs @@ -0,0 +1,2546 @@ +// +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace AElf.CrossChainServer.Migrations +{ + [DbContext(typeof(CrossChainServerDbContext))] + partial class CrossChainServerDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AElf.CrossChainServer.Chains.Chain", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AElfChainId") + .HasColumnType("int"); + + b.Property("BlockChain") + .HasColumnType("longtext"); + + b.Property("IsMainChain") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppChains", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AppWalletUserAddressInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainDailyLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("DailyLimit") + .HasColumnType("decimal(65,30)"); + + b.Property("RefreshTime") + .HasColumnType("bigint"); + + b.Property("RemainAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainDailyLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainIndexingInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BlockHeight") + .HasColumnType("bigint"); + + b.Property("BlockTime") + .HasColumnType("datetime(6)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("IndexBlockHeight") + .HasColumnType("bigint"); + + b.Property("IndexChainId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("BlockTime"); + + b.ToTable("AppCrossChainIndexingInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainRateLimit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Capacity") + .HasColumnType("decimal(65,30)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("CurrentAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("IsEnable") + .HasColumnType("tinyint(1)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("TargetChainId") + .HasColumnType("longtext"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppCrossChainRateLimits", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.CrossChainTransfer", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromChainId") + .HasColumnType("varchar(255)"); + + b.Property("InlineTransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("ProgressUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiptId") + .HasColumnType("varchar(255)"); + + b.Property("ReceiveAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceiveBlockHeight") + .HasColumnType("bigint"); + + b.Property("ReceiveStatus") + .HasColumnType("int"); + + b.Property("ReceiveTime") + .HasColumnType("datetime(6)"); + + b.Property("ReceiveTokenId") + .HasColumnType("char(36)"); + + b.Property("ReceiveTransactionAttemptTimes") + .HasColumnType("int"); + + b.Property("ReceiveTransactionId") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("ToAddress") + .HasColumnType("longtext"); + + b.Property("ToChainId") + .HasColumnType("varchar(255)"); + + b.Property("TraceId") + .HasColumnType("longtext"); + + b.Property("TransferAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("TransferBlockHeight") + .HasColumnType("bigint"); + + b.Property("TransferStatus") + .HasColumnType("int"); + + b.Property("TransferTime") + .HasColumnType("datetime(6)"); + + b.Property("TransferTokenId") + .HasColumnType("char(36)"); + + b.Property("TransferTransactionId") + .HasColumnType("varchar(255)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Status", "ProgressUpdateTime"); + + b.HasIndex("FromChainId", "ToChainId", "InlineTransferTransactionId"); + + b.HasIndex("FromChainId", "ToChainId", "ReceiptId"); + + b.HasIndex("FromChainId", "ToChainId", "TransferTransactionId") + .IsUnique(); + + b.ToTable("AppCrossChainTransfers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AppId") + .HasColumnType("longtext"); + + b.Property("CaHash") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("ModificationTime") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AppWalletUsers", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Settings.Settings", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "Name"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("OrderId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Time") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("AppApplyOrderStatusChangedRecord", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue.ThirdUserTokenIssueInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("BindingId") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("OtherChainId") + .HasColumnType("varchar(255)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("ThirdTokenId") + .HasColumnType("longtext"); + + b.Property("TokenImage") + .HasColumnType("longtext"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("longtext"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("WalletAddress") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Symbol", "OtherChainId") + .IsUnique(); + + b.ToTable("AppThirdUserTokenIssueInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("ChainName") + .HasColumnType("longtext"); + + b.Property("ContractAddress") + .HasColumnType("longtext"); + + b.Property("CreateTime") + .HasColumnType("bigint"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("PoolAddress") + .HasColumnType("longtext"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TokenName") + .HasColumnType("longtext"); + + b.Property("TotalSupply") + .HasColumnType("decimal(65,30)"); + + b.Property("UpdateTime") + .HasColumnType("bigint"); + + b.Property("UserAddress") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserAddress", "Symbol"); + + b.ToTable("AppTokenApplyOrder", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.UserTokenAccess.UserTokenAccessInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("OfficialTwitter") + .HasColumnType("longtext"); + + b.Property("OfficialWebsite") + .HasColumnType("longtext"); + + b.Property("PersonName") + .HasColumnType("longtext"); + + b.Property("Symbol") + .HasColumnType("varchar(255)"); + + b.Property("TelegramHandler") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Address", "Symbol") + .IsUnique(); + + b.ToTable("AppUserTokenAccessInfo", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.PoolLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId") + .IsUnique(); + + b.ToTable("AppPoolLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenPool.UserLiquidityInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ChainId") + .HasColumnType("varchar(255)"); + + b.Property("Liquidity") + .HasColumnType("decimal(65,30)"); + + b.Property("Provider") + .HasColumnType("varchar(255)"); + + b.Property("TokenId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChainId", "TokenId", "Provider") + .IsUnique(); + + b.ToTable("AppUserLiquidityInfos", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.Tokens.Token", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ChainId") + .HasColumnType("longtext"); + + b.Property("Decimals") + .HasColumnType("int"); + + b.Property("IsBurnable") + .HasColumnType("tinyint(1)"); + + b.Property("IssueChainId") + .HasColumnType("int"); + + b.Property("Symbol") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime(6)"); + + b.Property("NextTryTime") + .HasColumnType("datetime(6)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.AddressInfoDto", b => + { + b.HasOne("AElf.CrossChainServer.CrossChain.WalletUserDto", "WalletUser") + .WithMany("AddressInfos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WalletUser"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.StatusChangedRecord", b => + { + b.HasOne("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", "Order") + .WithMany("StatusChangedRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AElf.CrossChainServer.CrossChain.WalletUserDto", b => + { + b.Navigation("AddressInfos"); + }); + + modelBuilder.Entity("AElf.CrossChainServer.TokenAccess.TokenApplyOrder", b => + { + b.Navigation("StatusChangedRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Properties/AssemblyInfo.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ab1fe99 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("AElf.CrossChainServer.EntityFrameworkCore.Tests")] diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Settings/EfCoreSettingsRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Settings/EfCoreSettingsRepository.cs new file mode 100644 index 0000000..02f97c3 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Settings/EfCoreSettingsRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.Settings +{ + public class EfCoreSettingsRepository : EfCoreCacheRepository, ISettingsRepository + { + public EfCoreSettingsRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreThirdUserTokenIssueRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreThirdUserTokenIssueRepository.cs new file mode 100644 index 0000000..b3dc612 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreThirdUserTokenIssueRepository.cs @@ -0,0 +1,16 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.TokenAccess; + +public class EfCoreThirdUserTokenIssueRepository : EfCoreRepository, + IThirdUserTokenIssueRepository +{ + public EfCoreThirdUserTokenIssueRepository(IDbContextProvider dbContextProvider) : base( + dbContextProvider) + { + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreTokenApplyOrderRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreTokenApplyOrderRepository.cs new file mode 100644 index 0000000..ca1bbae --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreTokenApplyOrderRepository.cs @@ -0,0 +1,14 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.TokenAccess; + +public class EfCoreTokenApplyOrderRepository : EfCoreRepository, + ITokenApplyOrderRepository +{ + public EfCoreTokenApplyOrderRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreUserAccessTokenInfoRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreUserAccessTokenInfoRepository.cs new file mode 100644 index 0000000..9ce0ca6 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenAccess/EfCoreUserAccessTokenInfoRepository.cs @@ -0,0 +1,16 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.TokenAccess; + +public class EfCoreUserAccessTokenInfoRepository : EfCoreRepository, + IUserAccessTokenInfoRepository +{ + public EfCoreUserAccessTokenInfoRepository(IDbContextProvider dbContextProvider) : base( + dbContextProvider) + { + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCorePoolLiquidityRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCorePoolLiquidityRepository.cs new file mode 100644 index 0000000..af51256 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCorePoolLiquidityRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.TokenPool; + +public class EfCorePoolLiquidityRepository : EfCoreRepository, IPoolLiquidityRepository +{ + public EfCorePoolLiquidityRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCoreUserLiquidityRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCoreUserLiquidityRepository.cs new file mode 100644 index 0000000..55a91e8 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/TokenPool/EfCoreUserLiquidityRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.TokenPool; + +public class EfCoreUserLiquidityRepository : EfCoreRepository, IUserLiquidityRepository +{ + public EfCoreUserLiquidityRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/Tokens/EfCoreTokenRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/Tokens/EfCoreTokenRepository.cs new file mode 100644 index 0000000..e5b189f --- /dev/null +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Tokens/EfCoreTokenRepository.cs @@ -0,0 +1,15 @@ +using System; +using AElf.CrossChainServer.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace AElf.CrossChainServer.Tokens +{ + public class EfCoreTokenRepository : EfCoreCacheRepository, ITokenRepository + { + public EfCoreTokenRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/AElf.CrossChainServer.EntityHandler.Core.csproj b/src/AElf.CrossChainServer.EntityHandler.Core/AElf.CrossChainServer.EntityHandler.Core.csproj new file mode 100644 index 0000000..7d2d295 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/AElf.CrossChainServer.EntityHandler.Core.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainDailyLimitEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainDailyLimitEntityHandler.cs new file mode 100644 index 0000000..f75044c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainDailyLimitEntityHandler.cs @@ -0,0 +1,36 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core +{ + public class CrossChainDailyLimitEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> + { + private readonly ICrossChainLimitAppService _crossChainLimitAppService; + private readonly IObjectMapper _objectMapper; + + public CrossChainDailyLimitEntityHandler( + IObjectMapper objectMapper, ICrossChainLimitAppService crossChainLimitAppService) + { + _objectMapper = objectMapper; + _crossChainLimitAppService = crossChainLimitAppService; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainLimitAppService.SetCrossChainDailyLimitIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainLimitAppService.SetCrossChainDailyLimitIndexAsync(input); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainIndexingInfoEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainIndexingInfoEntityHandler.cs new file mode 100644 index 0000000..b701485 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainIndexingInfoEntityHandler.cs @@ -0,0 +1,35 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core +{ + public class CrossChainIndexingInfoEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> + { + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly IObjectMapper _objectMapper; + + public CrossChainIndexingInfoEntityHandler( + IObjectMapper objectMapper, ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService) + { + _objectMapper = objectMapper; + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainIndexingInfoAppService.AddIndexAsync(input); + } + + public async Task HandleEventAsync(EntityDeletedEto eventData) + { + await _crossChainIndexingInfoAppService.DeleteIndexAsync(eventData.Entity.Id); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainRateLimitEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainRateLimitEntityHandler.cs new file mode 100644 index 0000000..e1eb56e --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainRateLimitEntityHandler.cs @@ -0,0 +1,36 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core +{ + public class CrossChainRateLimitEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> + { + private readonly ICrossChainLimitAppService _crossChainLimitAppService; + private readonly IObjectMapper _objectMapper; + + public CrossChainRateLimitEntityHandler( + IObjectMapper objectMapper, ICrossChainLimitAppService crossChainLimitAppService) + { + _objectMapper = objectMapper; + _crossChainLimitAppService = crossChainLimitAppService; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainLimitAppService.SetCrossChainRateLimitIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainLimitAppService.SetCrossChainRateLimitIndexAsync(input); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainServerEntityHandlerCoreModule.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainServerEntityHandlerCoreModule.cs new file mode 100644 index 0000000..eab5fdf --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainServerEntityHandlerCoreModule.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.EntityHandler.Core +{ + [DependsOn( + typeof(CrossChainServerApplicationContractsModule) + )] + public class CrossChainServerEntityHandlerCoreModule: AbpModule + { + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs new file mode 100644 index 0000000..de4f383 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs @@ -0,0 +1,43 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core +{ + public class CrossChainTransferEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler>, + IDistributedEventHandler> + + { + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly IObjectMapper _objectMapper; + + public CrossChainTransferEntityHandler(ICrossChainTransferAppService crossChainTransferAppService, + IObjectMapper objectMapper) + { + _crossChainTransferAppService = crossChainTransferAppService; + _objectMapper = objectMapper; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainTransferAppService.AddIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _crossChainTransferAppService.UpdateIndexAsync(input); + } + + public async Task HandleEventAsync(EntityDeletedEto eventData) + { + await _crossChainTransferAppService.DeleteIndexAsync(eventData.Entity.Id); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/PoolLiquidityEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/PoolLiquidityEntityHandler.cs new file mode 100644 index 0000000..30c06b8 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/PoolLiquidityEntityHandler.cs @@ -0,0 +1,36 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.TokenPool; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core; + +public class PoolLiquidityEntityHandler: ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> +{ + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly IObjectMapper _objectMapper; + + public PoolLiquidityEntityHandler(IPoolLiquidityInfoAppService poolLiquidityInfoAppService, + IObjectMapper objectMapper) + { + _poolLiquidityInfoAppService = poolLiquidityInfoAppService; + _objectMapper = objectMapper; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _poolLiquidityInfoAppService.AddIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _poolLiquidityInfoAppService.UpdateIndexAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/ThirdUserTokenIssueInfoEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/ThirdUserTokenIssueInfoEntityHandler.cs new file mode 100644 index 0000000..bc00121 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/ThirdUserTokenIssueInfoEntityHandler.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenAccess; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core; + +public class ThirdUserTokenIssueInfoEntityHandler:ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> +{ + private readonly ITokenAccessAppService _tokenAccessAppService; + private readonly IObjectMapper _objectMapper; + + public ThirdUserTokenIssueInfoEntityHandler(ITokenAccessAppService tokenAccessAppService, IObjectMapper objectMapper) + { + _tokenAccessAppService = tokenAccessAppService; + _objectMapper = objectMapper; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.AddThirdUserTokenIssueInfoIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.UpdateThirdUserTokenIssueInfoIndexAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/TokenApplyOrderEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/TokenApplyOrderEntityHandler.cs new file mode 100644 index 0000000..e6ea6e8 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/TokenApplyOrderEntityHandler.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenPool; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core; + +public class TokenApplyOrderEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> +{ + private readonly ITokenAccessAppService _tokenAccessAppService; + private readonly IObjectMapper _objectMapper; + + public TokenApplyOrderEntityHandler( + IObjectMapper objectMapper, ITokenAccessAppService tokenAccessAppService) + { + _objectMapper = objectMapper; + _tokenAccessAppService = tokenAccessAppService; + } + + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.AddTokenApplyOrderIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.UpdateTokenApplyOrderIndexAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/UserLiquidityEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/UserLiquidityEntityHandler.cs new file mode 100644 index 0000000..10ee868 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/UserLiquidityEntityHandler.cs @@ -0,0 +1,35 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenPool; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core; + +public class UserLiquidityEntityHandler:ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> +{ + private readonly IUserLiquidityInfoAppService _userLiquidityInfoAppService; + private readonly IObjectMapper _objectMapper; + + public UserLiquidityEntityHandler(IUserLiquidityInfoAppService userLiquidityInfoAppService, + IObjectMapper objectMapper) + { + _userLiquidityInfoAppService = userLiquidityInfoAppService; + _objectMapper = objectMapper; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _userLiquidityInfoAppService.AddIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _userLiquidityInfoAppService.UpdateIndexAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/UserTokenAccessInfoEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/UserTokenAccessInfoEntityHandler.cs new file mode 100644 index 0000000..225a62d --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler.Core/UserTokenAccessInfoEntityHandler.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenAccess; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace AElf.CrossChainServer.EntityHandler.Core; + +public class UserTokenAccessInfoEntityHandler : ITransientDependency, + IDistributedEventHandler>, + IDistributedEventHandler> +{ + private readonly IObjectMapper _objectMapper; + private readonly ITokenAccessAppService _tokenAccessAppService; + + public UserTokenAccessInfoEntityHandler(IObjectMapper objectMapper, ITokenAccessAppService tokenAccessAppService) + { + _objectMapper = objectMapper; + _tokenAccessAppService = tokenAccessAppService; + } + + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.AddUserTokenAccessInfoIndexAsync(input); + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var input = _objectMapper.Map(eventData.Entity); + await _tokenAccessAppService.UpdateUserTokenAccessInfoIndexAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/AElf.CrossChainServer.EntityHandler.csproj b/src/AElf.CrossChainServer.EntityHandler/AElf.CrossChainServer.EntityHandler.csproj new file mode 100644 index 0000000..68a6656 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/AElf.CrossChainServer.EntityHandler.csproj @@ -0,0 +1,43 @@ + + + + Exe + net8.0 + + + + + + + + + + + + + + + + + + + + + PreserveNewest + Always + + + true + PreserveNewest + PreserveNewest + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.EntityHandler/CrossChainServerEntityHandlerModule.cs b/src/AElf.CrossChainServer.EntityHandler/CrossChainServerEntityHandlerModule.cs new file mode 100644 index 0000000..3b198d2 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/CrossChainServerEntityHandlerModule.cs @@ -0,0 +1,89 @@ +using AElf.CrossChainServer.EntityFrameworkCore; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.DependencyInjection; +using StackExchange.Redis; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.Modularity; +using Microsoft.Extensions.Configuration; +using AElf.CrossChainServer.EntityHandler.Core; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Worker; +using AElf.ExceptionHandler.ABP; +using Microsoft.Extensions.Options; +using Volo.Abp; +using Volo.Abp.Auditing; +using Volo.Abp.BlobStoring; +using Volo.Abp.BlobStoring.Aliyun; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.EntityHandler +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(CrossChainServerEntityFrameworkCoreModule), + typeof(AbpEventBusRabbitMqModule), + typeof(CrossChainServerEntityHandlerCoreModule), + typeof(AbpBlobStoringAliyunModule), + typeof(CrossChainServerWorkerModule), + typeof(CrossChainServerApplicationModule), + typeof(AOPExceptionModule) + )] + public class CrossChainServerEntityHandlerModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + ConfigureCache(configuration); + ConfigureRedis(context, configuration); + ConfigureBlob(configuration); + ConfigureAuditLog(configuration); + context.Services.AddHostedService(); + } + + private void ConfigureBlob(IConfiguration configuration) + { + Configure(options => + { + options.Containers.ConfigureDefault(container => + { + container.UseAliyun(_ => + { + }); + }); + }); + } + + private void ConfigureCache(IConfiguration configuration) + { + Configure(options => + { + options.KeyPrefix = "CrossChainServer:"; + }); + } + + private void ConfigureRedis( + ServiceConfigurationContext context, + IConfiguration configuration) + { + var config = configuration["Redis:Configuration"]; + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "CrossChainServer-Protection-Keys"); + } + + private void ConfigureAuditLog(IConfiguration configuration) + { + Configure(options => + { + options.IsEnabled = false; + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/CrossChainServerHostedService.cs b/src/AElf.CrossChainServer.EntityHandler/CrossChainServerHostedService.cs new file mode 100644 index 0000000..f643e8f --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/CrossChainServerHostedService.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Volo.Abp; + +namespace AElf.CrossChainServer.EntityHandler +{ + public class CrossChainServerHostedService : IHostedService + { + private readonly IAbpApplicationWithExternalServiceProvider _application; + private readonly IServiceProvider _serviceProvider; + + public CrossChainServerHostedService( + IAbpApplicationWithExternalServiceProvider application, + IServiceProvider serviceProvider) + { + _application = application; + _serviceProvider = serviceProvider; + } + + public Task StartAsync(CancellationToken cancellationToken) + { + _application.Initialize(_serviceProvider); + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + _application.Shutdown(); + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/Extension/ApolloConfigurationExtension.cs b/src/AElf.CrossChainServer.EntityHandler/Extension/ApolloConfigurationExtension.cs new file mode 100644 index 0000000..60e4893 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/Extension/ApolloConfigurationExtension.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Serilog; + +namespace AElf.CrossChainServer.EntityHandler.Extension; + +public static class ApolloConfigurationExtension +{ + public static IHostBuilder UseApollo(this IHostBuilder builder) + { + return builder + .ConfigureAppConfiguration((config) => + { + var apolloOption = config.Build().GetSection("apollo"); + if (apolloOption.GetSection("UseApollo").Get()) + { + Log.Information("Add apollo AppId:{App} Server:{Server}, Namespaces:{Namespaces}", + apolloOption.GetSection("AppId").Get(), + apolloOption.GetSection("MetaServer").Get(), + string.Join(",", apolloOption.GetSection("Namespaces").Get>()) + ); + config.AddApollo(apolloOption); + } + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/Program.cs b/src/AElf.CrossChainServer.EntityHandler/Program.cs new file mode 100644 index 0000000..cd94a1c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/Program.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.EntityHandler.Extension; +using AElf.ExceptionHandler.ABP; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace AElf.CrossChainServer.EntityHandler +{ + public class Program + { + public static async Task Main(string[] args) + { + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .Build(); + + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .ReadFrom.Configuration(configuration) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting AElf.CrossChainServer.EntityHandler."); + await CreateHostBuilder(args).RunConsoleAsync(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } + + internal static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureServices((hostContext, services) => + { + services.AddApplication(); + }) + .ConfigureAppConfiguration((h,c)=>c.AddJsonFile("apollo.appsettings.json")) + .UseApollo() + .UseAutofac() + .UseAElfExceptionHandler() + .UseSerilog(); + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/apollo.appsetting.json b/src/AElf.CrossChainServer.EntityHandler/apollo.appsetting.json new file mode 100644 index 0000000..d5a2e50 --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/apollo.appsetting.json @@ -0,0 +1,11 @@ +{ + "ClientId": "CrossChainServer_EntityEventHandler", + "apollo": { + "UseApollo" : false, + "AppId": "CrossChainServer", + "MetaServer": "http://127.0.0.1:8070", + "Namespaces": [ + "entityhandler_appsettings.json" + ] + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler/appsettings.json b/src/AElf.CrossChainServer.EntityHandler/appsettings.json new file mode 100644 index 0000000..e11d53c --- /dev/null +++ b/src/AElf.CrossChainServer.EntityHandler/appsettings.json @@ -0,0 +1,155 @@ +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Port=3306;Database=CrossChainServer;Uid=root;Pwd=123456;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "StringEncryption": { + "DefaultPassPhrase": "RDjeywn1asnmJgNm" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "127.0.0.1", + "Port": "5672", + "UserName": "guest", + "Password": "guest" + } + }, + "EventBus": { + "ClientName": "AElfCrossChain-EntityHandler", + "ExchangeName": "AElfCrossChain" + } + }, + "ElasticUris": { + "Uris": [ + "http://127.0.0.1:9200" + ] + }, + "IndexSetting": { + "IndexPrefix": "eBridgeServer" + }, + "ChainApi": { + "ChainNodeApis": { + "MainChain_AELF": "http://192.168.67.47:8000/", + "SideChain_tDVV": "http://192.168.67.31:8000/", + "SideChain_tDVW": "http://192.168.67.204:8000/", + "Kovan": "https://kovan.infura.io/v3/" + } + }, + "TokenPrice": { + "CoinIdMapping": { + "ELF": "aelf", + "AEUSD": "tether", + "ETH": "ethereum", + "BNB": "binancecoin", + "BTC": "bitcoin" + } + }, + "BridgeContract": { + "ContractAddresses": { + "Kovan": { + "BridgeInContract": "0x40536e47BA0541d5940B29b0423652b797d7FdcA", + "BridgeOutContract": "0xf8F862Aaeb9cb101383d27044202aBbe3a057eCC" + } + } + }, + "ReportContract": { + "ContractAddresses": { + "MainChain_AELF": "", + "SideChain_tDVV": "" + } + }, + "CrossChainContract": { + "ContractAddresses": { + "MainChain_AELF": "", + "SideChain_tDVV": "" + } + }, + "TokenContract": { + "ContractAddresses": { + "MainChain_AELF": "", + "SideChain_tDVV": "" + } + }, + "Account": { + "PrivateKeys": { + "MainChain_AELF": "", + "SideChain_tDVV": "" + } + }, + "BridgeContractSync": { + "Tokens": { + "Kovan": { + "0": [ + {"Address": "0xb085f10C869022E8588825f901a54C1ACeb13A07", "Symbol": "ELF", "TargetChainId":"MainChain_AELF"}, + {"Address": "0xb085f10C869022E8588825f901a54C1ACeb13A07", "Symbol": "ELF", "TargetChainId":"SideChain_tDVV"} + ], + "1": [ + {"Address": "0xb085f10C869022E8588825f901a54C1ACeb13A07", "Symbol": "ELF", "TargetChainId":"MainChain_AELF"}, + {"Address": "0xb085f10C869022E8588825f901a54C1ACeb13A07", "Symbol": "ELF", "TargetChainId":"SideChain_tDVV"} + ] + } + } + }, + "BlockConfirmation": { + "ConfirmationCount": { + "Kovan": 12, + "BSC": 100 + } + }, + "ReportJobCategory": { + "Mapping": { + "MainChain_AELF": "", + "SideChain_tDVV": "", + "SideChain_tDVW": "" + } + }, + "TokenSymbolMapping": { + "Mapping": { + "NewGoerli": { + "MainChain_AELF": { + "ETH": "WETH" + }, + "SideChain_tDVV": { + "ETH": "WETH" + } + }, + "Goreli": { + "MainChain_AELF": { + "ETH": "WETH" + }, + "SideChain_tDVV": { + "ETH": "WETH" + } + } + } + }, + "GraphQLClients": { + "Mapping": { + "CrossChainServerClient": "http://192.168.67.84:8083/AElfIndexer_DApp/CrossChainServerIndexerCASchema/graphql", + "CrossChainClient": "http://192.168.67.84:8083/AElfIndexer_eBridge/EbridgeIndexerPluginSchema/graphql" + } + }, + "OpenTelemetry": { + "ServiceName": "eBridge.EntityHandler", + "ServiceVersion": "1.0.0", + "CollectorEndpoint": "http://localhost:4315" + }, + "Serilog": { + "Properties": { + "Application": "CrossChainServer.Api", + "Environment": "Development" + }, + "WriteTo": [ + { + "Name": "RollingFile", + "Args": { + "pathFormat": "Logs/log-{Date}.log", + "formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact" + } + } + ] + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/AElf.CrossChainServer.EvmIndexer.csproj b/src/AElf.CrossChainServer.EvmIndexer/AElf.CrossChainServer.EvmIndexer.csproj new file mode 100644 index 0000000..17aec21 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/AElf.CrossChainServer.EvmIndexer.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.EvmIndexer/ContractEventSubscriptionInfo.cs b/src/AElf.CrossChainServer.EvmIndexer/ContractEventSubscriptionInfo.cs new file mode 100644 index 0000000..17b0899 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/ContractEventSubscriptionInfo.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +namespace AElf.CrossChainServer.EvmIndexer; + +public class ContractEventSubscriptionInfo +{ + public string ContractAddress { get; set; } + public List EventTypes { get; set; } = new(); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/CrossChainServerEvmIndexerModule.cs b/src/AElf.CrossChainServer.EvmIndexer/CrossChainServerEvmIndexerModule.cs new file mode 100644 index 0000000..cb516cb --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/CrossChainServerEvmIndexerModule.cs @@ -0,0 +1,32 @@ +using AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; +using AElf.CrossChainServer.EvmIndexer.Processor.Bridge; +using AElf.CrossChainServer.Worker.EvmIndexerSync; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.BackgroundJobs.RabbitMQ; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.EvmIndexer; + +[DependsOn( + typeof(AbpBackgroundJobsRabbitMqModule) +)] +public class CrossChainServerEvmIndexerModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("EvmContractSync")); + + context.Services.AddTransient, NewReceiptEventProcessor>(); + context.Services.AddTransient, TokenSwappedEventProcessor>(); + context.Services.AddSingleton(); + context.Services.AddSingleton(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + context.AddBackgroundWorkerAsync(); + } +} diff --git a/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/NewReceiptEvent.cs b/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/NewReceiptEvent.cs new file mode 100644 index 0000000..9771c08 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/NewReceiptEvent.cs @@ -0,0 +1,37 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; +/* + *event NewReceipt( + * string receiptId, + * address asset, + * address owner, + * uint256 amount, + * string targetChainId, + * bytes32 targetAddress, + * uint256 blockTime + *); + */ +[Event("NewReceipt")] +public class NewReceiptEvent: IEventDTO +{ + [Parameter("string", "receiptId", 1, false)] + public string ReceiptId { get; set; } + [Parameter("address", "asset", 2, false)] + public string Asset { get; set; } + [Parameter("address", "owner", 3, false)] + public string Owner { get; set; } + + [Parameter("uint256", "amount", 4, false)] + public BigInteger Amount { get; set; } + + [Parameter("string", "targetChainId", 5, false)] + public string TargetChainId { get; set; } + + [Parameter("bytes32", "targetAddress", 6, false)] + public byte[] TargetAddress { get; set; } + [Parameter("uint256","blockTime",7,false)] + public BigInteger BlockTime { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/TokenSwappedEvent.cs b/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/TokenSwappedEvent.cs new file mode 100644 index 0000000..ca6508c --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/TokenSwappedEvent.cs @@ -0,0 +1,35 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; + +[Event("TokenSwapEvent")] +/* + * event TokenSwapEvent( + * address receiveAddress, + * address token, + * uint256 amount, + * string receiptId, + * string fromChainId, + * uint256 blockTime + * ); + */ +public class TokenSwappedEvent : IEventDTO +{ + [Parameter("address", "receiveAddress", 1, false)] + public string ReceiveAddress { get; set; } + + [Parameter("address", "token", 2, false)] + public string Token { get; set; } + + [Parameter("uint256", "amount", 3, false)] + public BigInteger Amount { get; set; } + + [Parameter("string", "receiptId", 4, false)] + public string ReceiptId { get; set; } + + [Parameter("string", "fromChainId", 5, false)] + public string FromChainId { get; set; } + [Parameter("uint256","blockTime",6,false)] + public BigInteger BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/NewReceiptReceivedMessageDto.cs b/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/NewReceiptReceivedMessageDto.cs new file mode 100644 index 0000000..b548746 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/NewReceiptReceivedMessageDto.cs @@ -0,0 +1,24 @@ +using System.Numerics; + +namespace AElf.CrossChainServer.EvmIndexer.Dtos.MessageDto; + +public class NewReceiptReceivedMessageDto +{ + public string TransactionId { get; set; } + public string BlockHash { get; set; } + public long BlockNumber { get; set; } + public string ReceiptId { get; set; } + + public string Asset { get; set; } + + public string Owner { get; set; } + + + public BigInteger Amount { get; set; } + + + public string TargetChainId { get; set; } + + public byte[] TargetAddress { get; set; } + public BigInteger BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/TokenSwappedMessageDto.cs b/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/TokenSwappedMessageDto.cs new file mode 100644 index 0000000..c25517d --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/TokenSwappedMessageDto.cs @@ -0,0 +1,20 @@ +using System.Numerics; + +namespace AElf.CrossChainServer.EvmIndexer.Dtos.MessageDto; + +public class TokenSwappedMessageDto +{ + public string TransactionId { get; set; } + public long BlockNumber { get; set; } + public string ReceiveAddress { get; set; } + + public string Token { get; set; } + + public BigInteger Amount { get; set; } + + public string ReceiptId { get; set; } + + public string FromChainId { get; set; } + + public BigInteger BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/EvmContractSyncOptions.cs b/src/AElf.CrossChainServer.EvmIndexer/EvmContractSyncOptions.cs new file mode 100644 index 0000000..9d230b5 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/EvmContractSyncOptions.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmContractSyncOptions +{ + public bool Enabled { get; set; } = true; + public Dictionary IndexerInfos { get; set; } + public int SyncPeriod { get; set; } = 60 * 1000; // 1min + +} + +public class IndexerInfo +{ + public string WsUrl { get; set; } = "wss://sepolia.infura.io/ws/v3/a22808b9b0f14e9dbb098f2b03604ce2"; + public string TokenPoolContract { get; set; } = ""; + public string BridgeInContract { get; set; } = ""; + public string BridgeOutContract { get; set; } = ""; + public string LimiterContract { get; set; } = ""; + public int PingDelay { get; set; } = 5000; + +} diff --git a/src/AElf.CrossChainServer.EvmIndexer/EvmIndexerHandlerWorker.cs b/src/AElf.CrossChainServer.EvmIndexer/EvmIndexerHandlerWorker.cs new file mode 100644 index 0000000..5cfee0b --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/EvmIndexerHandlerWorker.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; +using AElf.CrossChainServer.Worker.EvmIndexerSync; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Nethereum.JsonRpc.WebSocketStreamingClient; +using Nethereum.RPC.Reactive.Eth; +using Serilog; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.EvmIndexer; + +public class EvmIndexerHandlerWorker + : AsyncPeriodicBackgroundWorkerBase +{ + private readonly EvmContractSyncOptions _evmContractSyncOptions; + private readonly IEvmEventSubscriptionManager _evmEventSubscriptionManager; + private readonly Dictionary _clients = new(); + + public EvmIndexerHandlerWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + IOptionsSnapshot evmContractSyncOptions, IEvmEventSubscriptionManager evmEventSubscriptionManager) : base( + timer, + serviceScopeFactory) + { + _evmEventSubscriptionManager = evmEventSubscriptionManager; + _evmContractSyncOptions = evmContractSyncOptions.Value; + Timer.Period = _evmContractSyncOptions.SyncPeriod; + foreach (var (chainId, indexerInfo) in _evmContractSyncOptions.IndexerInfos) + { + _clients[chainId] = new StreamingWebSocketClient(indexerInfo.WsUrl); + } + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + Log.Debug("[EvmIndexerHandlerWorker]Start handle evm transaction search"); + foreach (var kv in _clients) + { + var chainId = kv.Key; + var client = kv.Value; + + if (!client.IsStarted) + { + Log.Warning( + $"[EvmIndexerHandlerWorker]{chainId} WebSocket is not started, connecting or reconnecting..."); + await InitializeWebSocketAsync(chainId, _evmContractSyncOptions.IndexerInfos[chainId]); + continue; + } + + try + { + Log.Information($"[EvmIndexerHandlerWorker]{chainId} Sending Ping..."); + + var handler = new EthBlockNumberObservableHandler(client); + handler.GetResponseAsObservable().Subscribe(blockNumber => + Log.Information($"[EvmIndexerHandlerWorker]{chainId} Block Height: {blockNumber.Value}") + ); + + await handler.SendRequestAsync(); + } + catch (Exception ex) + { + Log.Error(ex, $"[EvmIndexerHandlerWorker]{chainId} Ping failed, attempting reconnection..."); + await client.StopAsync(); + await InitializeWebSocketAsync(chainId, _evmContractSyncOptions.IndexerInfos[chainId]); + } + } + } + + private async Task InitializeWebSocketAsync(string chainId, IndexerInfo indexerInfo) + { + if (_clients.TryGetValue(chainId, out var existingClient) && existingClient.IsStarted) + { + Log.Information($"[{chainId}] WebSocket already running, skipping initialization."); + return; + } + + Log.Information($"[{chainId}] Initializing WebSocket..."); + + var client = new StreamingWebSocketClient(indexerInfo.WsUrl); + _clients[chainId] = client; + + await client.StartAsync(); + var subscription = new List + { + new() + { + ContractAddress = indexerInfo.BridgeInContract, + EventTypes = + [ + typeof(NewReceiptEvent) + ] + }, + new() + { + ContractAddress = indexerInfo.BridgeOutContract, + EventTypes = + [ + typeof(TokenSwappedEvent) + ] + } + }; + + await _evmEventSubscriptionManager.SubscribeAsync(chainId, + subscription, client, indexerInfo.PingDelay); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/IEventSubscriber.cs b/src/AElf.CrossChainServer.EvmIndexer/IEventSubscriber.cs new file mode 100644 index 0000000..36a3485 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/IEventSubscriber.cs @@ -0,0 +1,59 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; +using Nethereum.JsonRpc.WebSocketStreamingClient; +using Nethereum.RPC.Reactive.Eth.Subscriptions; +using Serilog; + +namespace AElf.CrossChainServer.EvmIndexer; + +public interface IEventSubscriber +{ + Task SubscribeEventAsync(string chainId, StreamingWebSocketClient client, + Action> onEventDecoded, + string contractAddress) where TEventDto : IEventDTO, new(); +} + +public class EventSubscriber + : IEventSubscriber +{ + public async Task SubscribeEventAsync(string chainId, StreamingWebSocketClient client, + Action> onEventDecoded, string contractAddress) + where TEventDto : IEventDTO, new() + { + Log.Debug("[EventProcessorBase] Starting subscription on Network. ChainId:{ChainId}",chainId); + var filter = Event.GetEventABI().CreateFilterInput(contractAddress); + + var eventSubscription = new EthLogsObservableSubscription(client); + eventSubscription.GetSubscriptionDataResponsesAsObservable().Subscribe(log => + { + Log.Debug( + $"[EventProcessorBase] Block: {log.BlockHash}, BlockHeight: {log.BlockNumber}"); + try + { + var decoded = Event.DecodeEvent(log); + if (decoded == null) + { + Log.Warning( + $"[EventProcessorBase]DecodeEvent failed at BlockHeight: {log.BlockNumber}"); + return; + } + + onEventDecoded(decoded); + } + catch (Exception e) + { + Log.Error(e, $"[EventProcessorBase] Failed to decode event."); + } + }, + exception => + Log.Error( + $"[EventProcessorBase]ChainId:{chainId}. Subscription error: {exception.Message}") + ); + await eventSubscription.SubscribeAsync(filter); + Log.Debug($"[EventProcessorBase]ChainId:{chainId}. Subscription successful for {typeof(TEventDto).Name}"); + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/IEvmEventProcessor.cs b/src/AElf.CrossChainServer.EvmIndexer/IEvmEventProcessor.cs new file mode 100644 index 0000000..09ccac3 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/IEvmEventProcessor.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.EvmIndexer; + +public interface IEvmEventProcessor where TEventDto : IEventDTO, new() +{ + Task HandleAsync(string chainId, EventLog eventLog); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/IEvmEventSubscriptionManager.cs b/src/AElf.CrossChainServer.EvmIndexer/IEvmEventSubscriptionManager.cs new file mode 100644 index 0000000..b45e765 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/IEvmEventSubscriptionManager.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Nethereum.JsonRpc.WebSocketStreamingClient; +using Serilog; + +namespace AElf.CrossChainServer.EvmIndexer; + +public interface IEvmEventSubscriptionManager +{ + Task SubscribeAsync(string chainId, IEnumerable subscriptions, + StreamingWebSocketClient client, int pingDelay, CancellationToken cancellationToken = default); +} + +public class EvmEventSubscriptionManager( + IEventSubscriber eventSubscriber, + IServiceProvider serviceProvider) + : IEvmEventSubscriptionManager +{ + public async Task SubscribeAsync(string chainId, IEnumerable subscriptions, + StreamingWebSocketClient client, int pingDelay, CancellationToken cancellationToken = default) + { + if (subscriptions == null) + { + Log.Warning("[EvmEventSubscriptionManager] No subscriptions provided for chainId: {ChainId}", chainId); + return; + } + + foreach (var info in subscriptions) + { + foreach (var eventType in info.EventTypes) + { + Log.Debug( + "[EvmEventSubscriptionManager] Subscribing to event {EventType} on contract {Contract} for chainId: {ChainId}", + eventType.Name, info.ContractAddress, chainId); + + var method = typeof(EvmEventSubscriptionManager) + .GetMethod(nameof(StartSubscriptionAsync), BindingFlags.NonPublic | BindingFlags.Instance)! + .MakeGenericMethod(eventType); + + await (Task)method.Invoke(this, [chainId, client, info.ContractAddress])!; + } + } + } + + private async Task StartSubscriptionAsync( + string chainId, + StreamingWebSocketClient client, + string contractAddress) + where TEventDto : IEventDTO, new() + { + var handler = serviceProvider.GetRequiredService>(); + + await eventSubscriber.SubscribeEventAsync( + chainId, + client, + async eventLog => await handler.HandleAsync(chainId, eventLog), + contractAddress); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/NewReceiptEventProcessor.cs b/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/NewReceiptEventProcessor.cs new file mode 100644 index 0000000..1b3c7e0 --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/NewReceiptEventProcessor.cs @@ -0,0 +1,64 @@ +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.EvmIndexer.Dtos; +using AElf.CrossChainServer.EvmIndexer.Dtos.Event; +using AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; +using AElf.CrossChainServer.EvmIndexer.Dtos.MessageDto; +using AElf.CrossChainServer.Tokens; +using AElf.Types; +using Nethereum.BlockchainProcessing.BlockStorage.Entities.Mapping; +using Nethereum.Contracts; +using Nethereum.Util; +using Newtonsoft.Json; +using Serilog; + +namespace AElf.CrossChainServer.EvmIndexer.Processor.Bridge; + +public class NewReceiptEventProcessor( + ITokenAppService tokenAppService, + ICrossChainTransferAppService crossChainTransferAppService) : IEvmEventProcessor +{ + public async Task HandleAsync(string chainId, EventLog eventLog) + { + var message = GenerateNewReceiptReceivedMessage(eventLog); + Log.Debug("[NewReceiptEventProcessor] Received Event NewReceipt --> {EventData}", + JsonConvert.SerializeObject(message)); + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = message.Asset + }); + await crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TransferTransactionId = message.TransactionId, + FromAddress = message.Owner, + ReceiptId = message.ReceiptId[2..], + ToAddress = Address.FromBytes(message.TargetAddress).ToBase58(), + TransferAmount = (decimal)((BigDecimal)message.Amount / BigInteger.Pow(10, token.Decimals)), + TransferTime = DateTimeHelper.FromUnixTimeMilliseconds((long)message.BlockTime * 1000), + FromChainId = chainId, + ToChainId = message.TargetChainId, + TransferBlockHeight = message.BlockNumber, + TransferTokenId = token.Id, + TransferStatus = ReceiptStatus.Pending + }); + } + + private NewReceiptReceivedMessageDto GenerateNewReceiptReceivedMessage(EventLog eventData) + { + return new NewReceiptReceivedMessageDto + { + TransactionId = eventData.Log.TransactionHash, + BlockHash = eventData.Log.BlockHash, + BlockNumber = eventData.Log.BlockNumber.ToLong(), + Owner = eventData.Event.Owner, + Asset = eventData.Event.Asset, + Amount = eventData.Event.Amount, + TargetChainId = eventData.Event.TargetChainId, + TargetAddress = eventData.Event.TargetAddress, + ReceiptId = eventData.Event.ReceiptId, + BlockTime = eventData.Event.BlockTime + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/TokenSwappedEventProcessor.cs b/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/TokenSwappedEventProcessor.cs new file mode 100644 index 0000000..e8357ec --- /dev/null +++ b/src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/TokenSwappedEventProcessor.cs @@ -0,0 +1,60 @@ +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.EvmIndexer.Dtos; +using AElf.CrossChainServer.EvmIndexer.Dtos.Event; +using AElf.CrossChainServer.EvmIndexer.Dtos.Event.Bridge; +using AElf.CrossChainServer.EvmIndexer.Dtos.MessageDto; +using AElf.CrossChainServer.Tokens; +using Nethereum.BlockchainProcessing.BlockStorage.Entities.Mapping; +using Nethereum.Contracts; +using Nethereum.Util; +using Newtonsoft.Json; +using Serilog; + +namespace AElf.CrossChainServer.EvmIndexer.Processor.Bridge; + +public class TokenSwappedEventProcessor( + ITokenAppService tokenAppService, + ICrossChainTransferAppService crossChainTransferAppService) : IEvmEventProcessor +{ + public async Task HandleAsync(string chainId, EventLog eventLog) + { + var message = GenerateTokenSwappedMessage(eventLog); + Log.Debug("[TokenSwappedEventProcessor] Received Event TokenSwapped --> {EventData}", + JsonConvert.SerializeObject(message)); + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = message.Token + }); + await crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput + { + ReceiveTransactionId = message.TransactionId, + ReceiptId = message.ReceiptId, + ToAddress = message.ReceiveAddress, + FromChainId = message.FromChainId, + ToChainId = chainId, + ReceiveAmount = (decimal)((BigDecimal)message.Amount / BigInteger.Pow(10, token.Decimals)), + ReceiveTime = DateTimeHelper.FromUnixTimeMilliseconds((long)message.BlockTime * 1000), + ReceiveTokenId = token.Id, + ReceiveStatus = ReceiptStatus.Pending, + ReceiveBlockHeight = message.BlockNumber + }); + } + + private TokenSwappedMessageDto GenerateTokenSwappedMessage(EventLog eventData) + { + return new TokenSwappedMessageDto + { + TransactionId = eventData.Log.TransactionHash, + BlockNumber = eventData.Log.BlockNumber.ToLong(), + ReceiveAddress = eventData.Event.ReceiveAddress, + Token = eventData.Event.Token, + Amount = eventData.Event.Amount, + ReceiptId = eventData.Event.ReceiptId, + FromChainId = eventData.Event.FromChainId, + BlockTime = eventData.Event.BlockTime + }; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Client/AElf.CrossChainServer.HttpApi.Client.csproj b/src/AElf.CrossChainServer.HttpApi.Client/AElf.CrossChainServer.HttpApi.Client.csproj new file mode 100644 index 0000000..8b1034d --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Client/AElf.CrossChainServer.HttpApi.Client.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.HttpApi.Client/CrossChainServerHttpApiClientModule.cs b/src/AElf.CrossChainServer.HttpApi.Client/CrossChainServerHttpApiClientModule.cs new file mode 100644 index 0000000..7514776 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Client/CrossChainServerHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class CrossChainServerHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(CrossChainServerApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/src/AElf.CrossChainServer.HttpApi.Host/AElf.CrossChainServer.HttpApi.Host.csproj b/src/AElf.CrossChainServer.HttpApi.Host/AElf.CrossChainServer.HttpApi.Host.csproj new file mode 100644 index 0000000..cffaf06 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/AElf.CrossChainServer.HttpApi.Host.csproj @@ -0,0 +1,42 @@ + + + + + + net8.0 + AElf.CrossChainServer + true + AElf.CrossChainServer-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.HttpApi.Host/Controllers/HomeController.cs b/src/AElf.CrossChainServer.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..b35f09e --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace AElf.CrossChainServer.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/src/AElf.CrossChainServer.HttpApi.Host/CrossChainServerHttpApiHostModule.cs b/src/AElf.CrossChainServer.HttpApi.Host/CrossChainServerHttpApiHostModule.cs new file mode 100644 index 0000000..cc2142e --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/CrossChainServerHttpApiHostModule.cs @@ -0,0 +1,238 @@ +using System; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using AElf.CrossChainServer.EntityFrameworkCore; +using AElf.CrossChainServer.Filter; +using AElf.CrossChainServer.HttpClient; +using StackExchange.Redis; +using Microsoft.OpenApi.Models; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Swashbuckle; +using Volo.Abp.VirtualFileSystem; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), + typeof(CrossChainServerApplicationModule), + typeof(AbpEventBusRabbitMqModule), + typeof(CrossChainServerEntityFrameworkCoreModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpIdentityDomainModule), + typeof(AbpSwashbuckleModule) +)] +public class CrossChainServerHttpApiHostModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + context.Services.AddHttpClient(); + context.Services.AddScoped(); + + ConfigureConventionalControllers(); + ConfigureAuthentication(context, configuration); + ConfigureLocalization(); + ConfigureCache(configuration); + ConfigureVirtualFileSystem(context); + ConfigureDataProtection(context, configuration, hostingEnvironment); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + context.Services.AddTransient(); + } + + private void ConfigureCache(IConfiguration configuration) + { + Configure(options => { options.KeyPrefix = "CrossChainServer:"; }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}AElf.CrossChainServer.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}AElf.CrossChainServer.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}AElf.CrossChainServer.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}AElf.CrossChainServer.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(CrossChainServerApplicationModule).Assembly); + }); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options => + { + options.Authority = configuration["AuthServer:Authority"]; + options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); + options.Audience = "CrossChainServer"; + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGen(options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "CrossChainServer API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme() + { + Name = "Authorization", + Scheme = "bearer", + Description = "Specify the authorization token.", + In = ParameterLocation.Header, + Type = SecuritySchemeType.Http, + }); + + options.AddSecurityRequirement(new OpenApiSecurityRequirement() + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" } + }, + new string[] { } + } + }); + }); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("is", "is", "Icelandic")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("ro-RO", "ro-RO", "Română")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + } + + private void ConfigureDataProtection( + ServiceConfigurationContext context, + IConfiguration configuration, + IWebHostEnvironment hostingEnvironment) + { + var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("CrossChainServer"); + if (!hostingEnvironment.IsDevelopment()) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "CrossChainServer-Protection-Keys"); + } + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + + app.UseAbpRequestLocalization(); + app.UseAuthorization(); + + // if (env.IsDevelopment()) + // { + app.UseSwagger(); + app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); }); + // } + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseUnitOfWork(); + app.UseConfiguredEndpoints(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/Extension/ApolloConfigurationExtension.cs b/src/AElf.CrossChainServer.HttpApi.Host/Extension/ApolloConfigurationExtension.cs new file mode 100644 index 0000000..fb296d4 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/Extension/ApolloConfigurationExtension.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Serilog; + +namespace AElf.CrossChainServer.Extension; + +public static class ApolloConfigurationExtension +{ + public static IHostBuilder UseApollo(this IHostBuilder builder) + { + return builder + .ConfigureAppConfiguration((config) => + { + var apolloOption = config.Build().GetSection("apollo"); + if (apolloOption.GetSection("UseApollo").Get()) + { + Log.Information("Add apollo AppId:{App} Server:{Server}, Namespaces:{Namespaces}", + apolloOption.GetSection("AppId").Get(), + apolloOption.GetSection("MetaServer").Get(), + string.Join(",", apolloOption.GetSection("Namespaces").Get>()) + ); + config.AddApollo(apolloOption); + } + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/Program.cs b/src/AElf.CrossChainServer.HttpApi.Host/Program.cs new file mode 100644 index 0000000..5ccb520 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/Program.cs @@ -0,0 +1,61 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.Extension; +using AElf.ExceptionHandler.ABP; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace AElf.CrossChainServer; + +public class Program +{ + public async static Task Main(string[] args) + { + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .Build(); + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .ReadFrom.Configuration(configuration) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting AElf.CrossChainServer.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Configuration.AddJsonFile("apollo.appsettings.json"); + builder.Host.AddAppSettingsSecretsJson() + .UseApollo() + .UseAutofac() + .UseAElfExceptionHandler() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/src/AElf.CrossChainServer.HttpApi.Host/Properties/launchSettings.json b/src/AElf.CrossChainServer.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..cda6d68 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44320", + "sslPort": 44320 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "AElf.CrossChainServer.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44320", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/apollo.appsettings.json b/src/AElf.CrossChainServer.HttpApi.Host/apollo.appsettings.json new file mode 100644 index 0000000..509ba3f --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/apollo.appsettings.json @@ -0,0 +1,14 @@ +{ + "ClientId": "CrossChainServer_HttpApi", + "apollo": { + "UseApollo" : false, + "AppId": "CrossChainServer", + "MetaServer": "http://localhost:8080", + "ConfigServer": [ + "http://localhost:8080" + ], + "Namespaces": [ + "httpapi_appsettings.json" + ] + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/appsettings.Development.json b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/AElf.CrossChainServer.HttpApi.Host/appsettings.json b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..843e87c --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.json @@ -0,0 +1,112 @@ +{ + "App": { + "CorsOrigins": "https://*.CrossChainServer.com,http://localhost:4200" + }, + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Port=3306;Database=AElfCrossChain;Uid=root;Pwd=123456;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "AuthServer": { + "Authority": "https://localhost:44316", + "RequireHttpsMetadata": "true", + "SwaggerClientId": "CrossChainServer_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "Kestrel": { + "EndPoints": { + "Http": { + "Url": "http://*:8090/" + } + } + }, + "StringEncryption": { + "DefaultPassPhrase": "Or7FKveUF7w9PuVs" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "127.0.0.1", + "Port": "5672", + "UserName": "admin", + "Password": "123456" + } + }, + "EventBus": { + "ClientName": "AElfCrossChain-Api", + "ExchangeName": "AElf-CrossChain-Test" + } + }, + "ElasticUris": { + "Uris":["http://127.0.0.1:9200"] + }, + "IndexSetting": { + "IndexPrefix": "eBridgeServer" + }, + "TokenPrice": { + "CoinIdMapping": { + "ELF": "aelf", + "AEUSD":"tether", + "ETH": "ethereum", + "BNB": "binancecoin", + "BTC": "bitcoin" + } + }, + "ChainApi": { + "ChainNodeApis": { + "MainChain_AELF": "http://192.168.67.47:8000/", + "SideChain_tDVV": "http://192.168.67.31:8000/", + "SideChain_tDVW": "http://192.168.67.204:8000/" + } + }, + "ChainExplorerApi": { + "ApiKeys": { + "Ethereum": "", + "BSC": "" + } + }, + "BridgeContract": { + "ContractAddresses": { + "Ethereum": { + "BridgeInContract": "", + "BridgeOutContract": "" + } + } + }, + "GraphQLClients": { + "Mapping": { + "CrossChainServerClient": "http://192.168.67.84:8083/AElfIndexer_DApp/CrossChainServerIndexerCASchema/graphql", + "CrossChainClient": "http://192.168.67.84:8083/AElfIndexer_eBridge/EbridgeIndexerPluginSchema/graphql" + } + }, + "CrossChainLimits": { + "ChainIdInfo": { + "TokenFirstChainId":"Sepolia", + "ToChainId":"AELF" + } + }, + "SyncStateService":{ + "BaseUrl":"https://gcptest-indexer-api.aefinder.io", + "SyncStateUri":"/api/apps/sync-state/ebridgeserverconfirm" + }, + "Serilog": { + "Properties": { + "Application": "CrossChainServer.Api", + "Environment": "Development" + }, + "WriteTo": [ + { + "Name": "Console", + "Args": { + "formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact" + } + } + ] + }, + "OpenTelemetry": { + "ServiceName": "eBridge.HttpApi.Host", + "ServiceVersion": "1.0.0", + "CollectorEndpoint": "http://localhost:4315" + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/appsettings.secrets.json b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/tempkey.jwk b/src/AElf.CrossChainServer.HttpApi.Host/tempkey.jwk new file mode 100644 index 0000000..17236ee --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/tempkey.jwk @@ -0,0 +1 @@ +{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"EQxNIJCLSocpUUcRgKIo7ky1cgHsEINDhMt9mkPFUB66CLRqeBGRHSUoK9lTNkApj2vM0HAVGdM7fMKvecmpETB1aYjONuKT9EHv7fixK2pgd8HlCNwqYPPkGdlcZ6h7poXRRqQEz4XOSl9HqisGv3BqbMNQIQhj8ca_TJpFPh2UpLBYjswR5YqUtFZtKIoahMdJR7ysMXCLUmET-lEGYQzDNqiS3qBS7cEyd-7yphtcMhTRmG73vh_UIjljAmZH9P4Hi-yybGtMj_z-YFLIczDAFDvt3AZ2GjNsX2ywq3mU4S0RWRzdeIkNmLEa63_B65-13me_xD5SgeqPEwQ0dQ","DP":"Eh92EoYqUWLrd8bNajNXa7UHLMLuQAexJkADdsiJ9rAKMKws321K4OHbB--OYTkKmURdwN9orAz54lEVyQ6mrnyuJ_1IZtM1a_FrT0PjyvUsFwdI_nkzXYqchUmY4EyLd8Cq3OZ692a2oImx_aM2nV-2Bqp0WiF2DZfUGsHENYc","DQ":"u8Nxw_Lw-PUkqU7e9XZq05GOo20UVOQMlIcxCr-3vpot-EJO9m90VfV5DI3Py5xa2RrQ93ueuHkZHEmsFFfMxmV_OLV6yaO_roN0UXEHBciFnl8Qh81aLGCdH6ptNHnVi7abDWQrmORdwCDZKexfFQNuTo0vWmMdaN1b1mlnbks","E":"AQAB","K":null,"KeyId":"6E05C19E4163731FFDDC3C1F20C3B988","Kid":"6E05C19E4163731FFDDC3C1F20C3B988","Kty":"RSA","N":"ru4XM6baaBHKOnREcnWAUavmIthxSZpGTh56UZSlIYy7Zd1qrRKvbMBxjQa8ciB1V3ja2qPVlxSIweu6cAhzjHdi9fLDWCu47da5QK0eBnmaMtZ3ohjmbsu8aY2Jo-2x9jLlNDKkEy8CDSEmGGWu5NTTrVd0DK_Bj1Gb2b69wsuKuJV4TxVqbBMzAlhOXCdAFDXCDwa6iOu7q5FC1cqmUc5ycB8jqVKYj2Czyim_ZNiTDuFgweMPkYCYUS_kaynIzi8OjW36LP2cuTs8TuUB4qZK2Kcid6jo1KSSUY5E_PFyNk4FTFssCcFXVbpBhtr0t5Ql4oyOu2Y4HgQKJjTsbQ","Oth":null,"P":"6cHWFHfBGTQwtLCa1Fr5Wg71QfUrBpjsf6FdZruQ6kjmMGMIF3y3Gn0MVWE0yoN-IEtTJTEAH7lb0GLB4kupzODyE9KsnspAwDTDuZ-4MgeCdCdM7ILjkg-5DfZVpa7ez-Pqt10nJGlNtFb9Mf2x70n7yWh_MroggBHSFFk6W_c","Q":"v5NEFvWQz_ioPsskObcjb1gbqcjlSP7q9oBtPfcneDbLeBBinrQx75Q6d52v8_8No-LRitY-rRrle2nwlY0SJY9yv0Ai8PcCkE-oRmOdfWjcH0fl2cVNNbcw6j_X0mb0CalTnJEfpSFz6Xfqphjx-PzSI454DJqeyjHou1bEebs","QI":"5neJYpmzHrSTiOXPEJb_1g4SXSFRjrWQRQujNzvsOXuM80s3CvttCGw35RLRXv8PnIHt0o7StMIHlL3Hv5Z4LS84A061DtKA6pgShO2YjjWSCjMNeQv9Qopm3D-fQm9J1Iptz3Ie4MvLqAKuREdnBR8oW3dU17z-9o48xrK8FLc","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true,"SignatureProviderObjectPoolCacheSize":48}} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi.Host/tempkey.rsa b/src/AElf.CrossChainServer.HttpApi.Host/tempkey.rsa new file mode 100644 index 0000000..ed0defa --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi.Host/tempkey.rsa @@ -0,0 +1 @@ +{"KeyId":"600caa200caf5d805eba9f06ace9e236","Parameters":{"D":"KCNDHA96eimN+UqchSKocgYITGflaAIwxzCS5KqSTkYAFliPthQx7LySuLor4F1+uLvwnh3ZocyI3y43GZu+eVHD256sxdV8/UsQz1HC23RRFqcUiAZjze8K5VMVStrBOxaa/Ds1U9/bpuNE7jZdcgFIEHsdZtCACqwtlE4nlIs1/GLiokqjBOESgxJMy9WUeDbWcvoo+YdwgKf5jt6AZHOYSS+TokLL+Y7TEfGMXe3jZD9VtSMkBSM8wGB89zNGR0FZB9maCG/BCoRJqxdYRyeb4FFXJclQtK3DexyDVqlNZQaNKVHu0tVAnVNKKcd7Iex8gA+5DNqqucUA7C/F6Q==","DP":"fr9iaNb1W4YZ/NJ56+N3SCeDQYuKobq1qeaQWmHlQsOHKoHhNZJQZ5x0M9PQilou16AwVlNGCJncMwxsSUxXn6itG0LcBnvfMeo2v3xKcij1BtFR9qfXecwEn2nnhI3mpXtZxyCdP3NIYUp9qViLJUjGJqrbQk+OIAGRQd2rRe0=","DQ":"o1umLkDodtwvpCsDguQYSjd3iob+WHNmfe/9HyjADmUehP8b9SpUgcrb+QF301J8YmQMnYZKWW5rEwKOtwsWNswgXfMnXeWerlZmz0tj9y38YczS70liU0vETsRefhrRCaXHraMvneqYNNedhsrCNalWK+DNwcixi4L59vA8ofs=","Exponent":"AQAB","InverseQ":"btd1nwwxl/E3ryfDi2bN12TuVDvv7yoPvryIlLgu+FiLpe4vaA1omDLliQBcl7oeyA563HBUop4D5oE7si+jD64N8XgFz37dD3KqUokeQ4lrTSSOePT1K+nWIl30sqDd7YE4auz4CvSjm2wXmN31+CXW1hp3YWN2972yrUt+R5U=","Modulus":"uwMB6reAVtm/Cq0BRPZ0ozBq6g3wDh2kzqFKBf8I7u8d9p7i5ExLSrOWPupHwPr/IW1VUn2TKHrJ8OnyYhznKIRxqlxj0U3D2GXijz5kfFOoHK+mlfKaDMqweRoS0UzEz58kMlgwUoDraUj6dTHTPCVPo3TqA2ImRw50j6D+jobFrY5321EFvlirZViMPDAgB8Ca7wGCqNBcCxvIPYw1O6WZmcVmjG7umelD3XjcUIQlEbIyAmi/3gXAo7NdPmgOamla6bnSWsy429HfsNpXyCfPBzV3QS3ubpTekWPoPcOVZbWwVPYtFQbhRh8PmWATRx0cV6oePZNZGxGeJl8WYQ==","P":"wplelBfVmiOPmr6iUxtOgIzuvwSqvP6Rqmh8dhaGDiJjU8OqZ0tZhuh0G+xnMLPIHb2fMeg0dqZMJZ5iXaIi1QycYn/JKz1i4cUonJ6IIQeKKf67tvzn/BY0V0N8rJw8hVfzou+/5sRBCbiHtJ2KIN1YJQuWGFFfrZJOJzc95ss=","Q":"9gTGKoDiOdrY8kqIXJ2nMhoeNryAH4q3EUrROJ7simqc28oYlGx24Sco/wOoeB2xxrdcF5JYOlyJ7H2YY/huLvJISaw/wHLPskiKiYQ78tuNwW0ip+5ceB1dSToHcEe3sR30+OeTh0Z4ZKoqthKziFGIt3EhEgiGq1gjZuWB5gM="}} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/AElf.CrossChainServer.HttpApi.csproj b/src/AElf.CrossChainServer.HttpApi/AElf.CrossChainServer.HttpApi.csproj new file mode 100644 index 0000000..551d2c3 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/AElf.CrossChainServer.HttpApi.csproj @@ -0,0 +1,23 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/ChainController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/ChainController.cs new file mode 100644 index 0000000..875a035 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/ChainController.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Controllers +{ + [RemoteService] + [Area("app")] + [ControllerName("Chain")] + [Route("api/app/chains")] + public class ChainController : CrossChainServerController + { + private readonly IChainAppService _chainAppService; + + public ChainController(IChainAppService chainAppService) + { + _chainAppService = chainAppService; + } + + [HttpGet] + public Task> GetChainsAsync(GetChainsInput input) + { + return _chainAppService.GetListAsync(input); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainIndexingController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainIndexingController.cs new file mode 100644 index 0000000..1b3a48b --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainIndexingController.cs @@ -0,0 +1,35 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace AElf.CrossChainServer.Controllers; + +[RemoteService] +[Area("app")] +[ControllerName("CrossChainIndexing")] +[Route("api/app/cross-chain-indexing")] +public class CrossChainIndexingController +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + + public CrossChainIndexingController(ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + } + + /// + /// Calculate cross chain indexing progress. + /// + /// + /// + /// the height to be indexed. + /// + [HttpGet] + [Route("progress")] + public Task CalculateProgressAsync(string fromChainId, string toChainId, long height) + { + return _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync(fromChainId, toChainId, height); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainLimitController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainLimitController.cs new file mode 100644 index 0000000..7aa9265 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainLimitController.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer; + +[RemoteService] +[Area("app")] +[ControllerName("CrossChainLimit")] +[Route("api/app/limiter")] +public class CrossChainLimitController +{ + private readonly ICrossChainLimitInfoAppService _crossChainLimitInfoAppService; + + public CrossChainLimitController(ICrossChainLimitInfoAppService crossChainLimitInfoAppService) + { + _crossChainLimitInfoAppService = crossChainLimitInfoAppService; + } + + [HttpGet] + [Route("dailyLimits")] + public Task> GetCrossChainDailyLimitsAsync() + { + return _crossChainLimitInfoAppService.GetCrossChainDailyLimitsAsync(); + } + + [HttpGet] + [Route("rateLimits")] + public Task> GetCrossChainRateLimitsAsync() + { + return _crossChainLimitInfoAppService.GetCrossChainRateLimitsAsync(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainServerController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainServerController.cs new file mode 100644 index 0000000..8cbd731 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainServerController.cs @@ -0,0 +1,14 @@ +using AElf.CrossChainServer.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace AElf.CrossChainServer.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class CrossChainServerController : AbpControllerBase +{ + protected CrossChainServerController() + { + LocalizationResource = typeof(CrossChainServerResource); + } +} diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainTransferController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainTransferController.cs new file mode 100644 index 0000000..805bb43 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/CrossChainTransferController.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Indexer; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Controllers; + +[RemoteService] +[Area("app")] +[ControllerName("CrossChainTransfer")] +[Route("api/app/cross-chain-transfers")] +public class CrossChainTransferController +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + + public CrossChainTransferController(ICrossChainTransferAppService crossChainTransferAppService,IIndexerAppService indexerAppService) + { + _crossChainTransferAppService = crossChainTransferAppService; + } + + [HttpGet] + public Task> GetListAsync(GetCrossChainTransfersInput input) + { + return _crossChainTransferAppService.GetListAsync(input); + } + + [HttpGet] + [Route("status")] + public Task> GetStatusAsync(GetCrossChainTransferStatusInput input) + { + return _crossChainTransferAppService.GetStatusAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/TokenAccessController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/TokenAccessController.cs new file mode 100644 index 0000000..44d3606 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/TokenAccessController.cs @@ -0,0 +1,161 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Filter; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenPool; +using Asp.Versioning; +using JetBrains.Annotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace AElf.CrossChainServer.Controllers; + +[RemoteService] +[Area("app")] +[ControllerName("Application")] +[Route("api/ebridge/application/")] +public class TokenAccessController : CrossChainServerController +{ + private readonly ITokenAccessAppService _tokenAccessAppService; + private readonly ILiquidityAppService _liquidityAppService; + + public TokenAccessController(ITokenAccessAppService tokenAccessAppService, ILiquidityAppService liquidityAppService) + { + _tokenAccessAppService = tokenAccessAppService; + _liquidityAppService = liquidityAppService; + } + + [HttpGet("token/config")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetTokenConfigAsync(GetTokenConfigInput input) + { + return await _tokenAccessAppService.GetTokenConfigAsync(input); + } + + + [HttpGet("token-white-list")] + [ServiceFilter(typeof(ResultFilter))] + public async Task>> GetTokenWhitelistAsync() + { + return await _tokenAccessAppService.GetTokenWhitelistAsync(); + } + + [Authorize] + [HttpGet("tokens")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetAvailableTokensAsync(GetAvailableTokensInput input) + { + return await _tokenAccessAppService.GetAvailableTokensAsync(input); + } + + [Authorize] + [HttpGet("token-detail")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetAvailableTokenDetailAsync(string symbol) + { + return await _tokenAccessAppService.GetAvailableTokenDetailAsync(symbol); + } + + [Authorize] + [HttpPost("commit-basic-info")] + [ServiceFilter(typeof(ResultFilter))] + public async Task CommitTokenAccessInfoAsync(UserTokenAccessInfoInput input) + { + return await _tokenAccessAppService.CommitTokenAccessInfoAsync(input); + } + + [Authorize] + [HttpGet("user-token-access-info")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetUserTokenAccessInfoAsync(UserTokenAccessInfoBaseInput input) + { + return await _tokenAccessAppService.GetUserTokenAccessInfoAsync(input); + } + + [Authorize] + [HttpGet("check-chain-access-status")] + [ServiceFilter(typeof(ResultFilter))] + public async Task CheckChainAccessStatusAsync(CheckChainAccessStatusInput input) + { + return await _tokenAccessAppService.CheckChainAccessStatusAsync(input); + } + + [Authorize] + [HttpPost("add-chain")] + [ServiceFilter(typeof(ResultFilter))] + public async Task AddChainAsync(AddChainInput input) + { + return await _tokenAccessAppService.AddChainAsync(input); + } + + [Authorize] + [HttpPost("prepare-binding-issue")] + [ServiceFilter(typeof(ResultFilter))] + public async Task PrepareBindingIssueAsync(PrepareBindIssueInput input) + { + return await _tokenAccessAppService.PrepareBindingIssueAsync(input); + } + + [Authorize] + [HttpPost("issue-binding")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetBindingIssueAsync(UserTokenBindingDto input) + { + return await _tokenAccessAppService.GetBindingIssueAsync(input); + } + + [Authorize] + [HttpGet("list")] + [ServiceFilter(typeof(ResultFilter))] + public async Task> GetTokenApplyOrderListAsync( + GetTokenApplyOrderListInput input) + { + return await _tokenAccessAppService.GetTokenApplyOrderListAsync(input); + } + + [Authorize] + [HttpGet("detail")] + [ServiceFilter(typeof(ResultFilter))] + public async Task> GetTokenApplyOrderDetailAsync(GetTokenApplyOrderInput input) + { + return await _tokenAccessAppService.GetTokenApplyOrderDetailAsync(input); + } + + [HttpGet("pool-overview")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetPoolOverviewAsync([CanBeNull] string addresses) + { + return await _liquidityAppService.GetPoolOverviewAsync(addresses); + } + + [HttpGet("pool-list")] + [ServiceFilter(typeof(ResultFilter))] + public async Task> GetPoolListAsync(GetPoolListInput input) + { + return await _liquidityAppService.GetPoolListAsync(input); + } + + [HttpGet("pool-detail")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetPoolDetailAsync(GetPoolDetailInput input) + { + return await _liquidityAppService.GetPoolDetailAsync(input); + } + + [HttpGet("token/price")] + [ServiceFilter(typeof(ResultFilter))] + public async Task GetTokenPriceAsync(GetTokenPriceInput input) + { + return await _tokenAccessAppService.GetTokenPriceAsync(input); + } + + [Authorize(Roles = "admin")] + [HttpPost("trigger-order-status-change")] + [ServiceFilter(typeof(ResultFilter))] + public async Task TriggerOrderStatusChangeAsync(TriggerOrderStatusChangeInput input) + { + return await _tokenAccessAppService.TriggerOrderStatusChangeAsync(input); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Controllers/TokenController.cs b/src/AElf.CrossChainServer.HttpApi/Controllers/TokenController.cs new file mode 100644 index 0000000..66328d5 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Controllers/TokenController.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Tokens; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace AElf.CrossChainServer.Controllers +{ + [RemoteService] + [Area("app")] + [ControllerName("Token")] + [Route("api/app/tokens")] + public class TokenController : CrossChainServerController + { + private readonly ITokenAppService _tokenAppService; + + public TokenController(ITokenAppService tokenAppService) + { + _tokenAppService = tokenAppService; + } + + [HttpGet] + public Task GetAsync(GetTokenInput input) + { + return _tokenAppService.GetAsync(input); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/CrossChainServerHttpApiModule.cs b/src/AElf.CrossChainServer.HttpApi/CrossChainServerHttpApiModule.cs new file mode 100644 index 0000000..633c08c --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/CrossChainServerHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using AElf.CrossChainServer.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) +)] +public class CrossChainServerHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDto.cs b/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDto.cs new file mode 100644 index 0000000..985fdb3 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDto.cs @@ -0,0 +1,11 @@ +using System; + +namespace AElf.CrossChainServer.Filter; +public class ResponseDto +{ + public string Code { get; set; } + + public object Data { get; set; } + + public string Message { get; set; } = string.Empty; +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDtoExtensions.cs b/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDtoExtensions.cs new file mode 100644 index 0000000..be8b866 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Filter/ResponseDtoExtensions.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Filter; + +public static class ResponseDtoExtension +{ + public static ResponseDto ObjectResult(this ResponseDto responseDto, object data) + { + responseDto.Code = "20000"; + responseDto.Data = data; + return responseDto; + } + + public static ResponseDto NoContent(this ResponseDto responseDto) + { + responseDto.Code = "20004"; + responseDto.Message = "No content"; + return responseDto; + } + + public static ResponseDto EmptyResult(this ResponseDto responseDto) + { + responseDto.Code = "20001"; + responseDto.Message = "Empty result"; + return responseDto; + } + + public static ResponseDto StatusCodeResult(this ResponseDto responseDto, int statusCode, string name) + { + responseDto.Code = "20010"; + responseDto.Message = $"State code: {statusCode}, {name}"; + return responseDto; + } + + public static ResponseDto UnhandledExceptionResult(this ResponseDto responseDto, string code, string message) + { + responseDto.Code = code; + responseDto.Message = message; + return responseDto; + } + + public static ValidationResponseDto ValidationResult( + this ValidationResponseDto responseDto, + IList validationErrors) + { + responseDto.Code = "-1"; + responseDto.Message = "Your request is not valid!"; + responseDto.ValidationErrors = validationErrors; + return responseDto; + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Filter/ResultFilter.cs b/src/AElf.CrossChainServer.HttpApi/Filter/ResultFilter.cs new file mode 100644 index 0000000..691c902 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Filter/ResultFilter.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace AElf.CrossChainServer.Filter; + +public class ResultFilter : IAsyncResultFilter +{ + public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) + { + if (context.Result is EmptyResult || context.Result is NoContentResult) + { + context.HttpContext.Response.StatusCode = 200; + context.Result = new ObjectResult(new ResponseDto().NoContent()); + } + else if (context.Result is ObjectResult objectResult) + { + if (!(objectResult.Value is ResponseDto)) + { + context.Result = new ObjectResult(new ResponseDto().ObjectResult(objectResult.Value)); + } + } + else if (context.Result is StatusCodeResult statusCodeResult) + { + context.Result = + new ObjectResult(new ResponseDto().StatusCodeResult(context.HttpContext.Response.StatusCode, + context.Result.GetType().Name)); + context.HttpContext.Response.StatusCode = 200; + } + + await next(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Filter/ValidationResponseDto.cs b/src/AElf.CrossChainServer.HttpApi/Filter/ValidationResponseDto.cs new file mode 100644 index 0000000..49596d0 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Filter/ValidationResponseDto.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace AElf.CrossChainServer.Filter; + +public class ValidationResponseDto : ResponseDto +{ + public IList ValidationErrors { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.HttpApi/Models/Test/TestModel.cs b/src/AElf.CrossChainServer.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..8cbadf8 --- /dev/null +++ b/src/AElf.CrossChainServer.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace AElf.CrossChainServer.Models.Test; + +public class TestModel +{ + public string Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj b/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj new file mode 100644 index 0000000..b2af182 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AElf.CrossChainServer.Worker/CheckAElfTransactionConfirmedWorker.cs b/src/AElf.CrossChainServer.Worker/CheckAElfTransactionConfirmedWorker.cs new file mode 100644 index 0000000..0ce6cb7 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/CheckAElfTransactionConfirmedWorker.cs @@ -0,0 +1,51 @@ +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class CheckAElfConfirmedTransactionWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly IChainAppService _chainAppService; + + public CheckAElfConfirmedTransactionWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + ICrossChainTransferAppService crossChainTransferAppService, IChainAppService chainAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, + serviceScopeFactory) + { + Timer.Period = workerSyncPeriodOptions.Value.CheckAElfConfirmedTransactionPeriod; + _crossChainTransferAppService = crossChainTransferAppService; + _chainAppService = chainAppService; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + var chainList = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.AElf + }); + Log.Debug("Start to check aelf confirmed transfer transaction."); + var tasks = + chainList.Items.Select(o => o.Id).Select(async chainId => + { + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync(chainId); + }); + + await Task.WhenAll(tasks); + Log.Debug("Start to check aelf confirmed receive transaction."); + var tasksReceive = + chainList.Items.Select(o => o.Id).Select(async chainId => + { + await _crossChainTransferAppService.CheckReceiveTransactionConfirmedAsync(chainId); + }); + + await Task.WhenAll(tasksReceive); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/CheckEvmTransactionConfirmedWorker.cs b/src/AElf.CrossChainServer.Worker/CheckEvmTransactionConfirmedWorker.cs new file mode 100644 index 0000000..40a1adb --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/CheckEvmTransactionConfirmedWorker.cs @@ -0,0 +1,51 @@ +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class CheckEvmTransactionConfirmedWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly IChainAppService _chainAppService; + + public CheckEvmTransactionConfirmedWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + ICrossChainTransferAppService crossChainTransferAppService, IChainAppService chainAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, + serviceScopeFactory) + { + Timer.Period = workerSyncPeriodOptions.Value.CheckEvmConfirmedTransactionPeriod; + _crossChainTransferAppService = crossChainTransferAppService; + _chainAppService = chainAppService; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + var chainList = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.Evm + }); + Log.Debug("Start to check evm confirmed transfer transaction."); + var tasks = + chainList.Items.Select(o => o.Id).Select(async chainId => + { + await _crossChainTransferAppService.CheckEvmTransferTransactionConfirmedAsync(chainId); + }); + + await Task.WhenAll(tasks); + Log.Debug("Start to check evm confirmed receive transaction."); + var tasksReceive = + chainList.Items.Select(o => o.Id).Select(async chainId => + { + await _crossChainTransferAppService.CheckEvmReceiveTransactionConfirmedAsync(chainId); + }); + + await Task.WhenAll(tasksReceive); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/CheckReceiveWorker.cs b/src/AElf.CrossChainServer.Worker/CheckReceiveWorker.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs b/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs new file mode 100644 index 0000000..6f5f16b --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs @@ -0,0 +1,26 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class CrossChainIndexingCleanWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + + public CrossChainIndexingCleanWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService,IOptionsSnapshot workerSyncPeriodOptions) : base(timer, serviceScopeFactory) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + Timer.Period = workerSyncPeriodOptions.Value.CrossChainIndexingCleanPeriod; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + await _crossChainIndexingInfoAppService.CleanAsync(DateTime.UtcNow.AddDays(-7)); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs b/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs new file mode 100644 index 0000000..0568fd6 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs @@ -0,0 +1,65 @@ +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.EvmIndexer; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Worker.EvmIndexerSync; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Limit; +using AElf.CrossChainServer.Worker.IndexerSync; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker +{ + [DependsOn( + typeof(AbpBackgroundWorkersModule), typeof(CrossChainServerEvmIndexerModule))] + public class CrossChainServerWorkerModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("BridgeContractSync")); + Configure(configuration.GetSection("TonIndexSync")); + Configure(configuration.GetSection("EvmContractSync")); + Configure(configuration.GetSection("TokenLimitSwapInfo")); + Configure(configuration.GetSection("WorkerSyncPeriod")); + + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var liquiditySyncOption = + context.ServiceProvider.GetRequiredService>(); + if (liquiditySyncOption.Value.IsSyncEnabled) + { + var service = context.ServiceProvider.GetRequiredService(); + AsyncHelper.RunSync(async () => await service.SyncPoolLiquidityInfoFromChainAsync()); + } + + var limitSyncOption = + context.ServiceProvider.GetRequiredService>(); + if (limitSyncOption.Value.IsSyncEnabled) + { + var service = context.ServiceProvider.GetRequiredService(); + AsyncHelper.RunSync(async () => await service.InitLimitAsync()); + } + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/ConfigChangedEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/ConfigChangedEvent.cs new file mode 100644 index 0000000..b945a44 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/ConfigChangedEvent.cs @@ -0,0 +1,23 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +[Event("ConfigChanged")] +// event ConfigChanged(bytes32 bucketId, bool isEnabled, uint128 tokenCapacity, uint128 rate,uint128 currentTokenAmount); +public class ConfigChangedEvent : IEventDTO +{ + [Parameter("bytes32", "bucketId", 1, false)] + public byte[] BucketId { get; set; } + + [Parameter("bool", "isEnabled", 2, false)] + public bool IsEnabled { get; set; } + + [Parameter("uint128", "tokenCapacity", 3, false)] + public BigInteger TokenCapacity { get; set; } + + [Parameter("uint128", "rate", 4, false)] + public BigInteger Rate { get; set; } + + [Parameter("uint128", "currentTokenAmount", 5, false)] + public BigInteger CurrentTokenAmount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/DailyLimitSetEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/DailyLimitSetEvent.cs new file mode 100644 index 0000000..7b6551b --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/DailyLimitSetEvent.cs @@ -0,0 +1,21 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; + +[Event("DailyLimitSet")] +// event DailyLimitSet(bytes32 dailyLimitId, uint32 refreshTime, uint256 dailyLimit, uint256 remainTokenAmount); +public class DailyLimitSetEvent : IEventDTO +{ + [Parameter("bytes32", "dailyLimitId", 1, false)] + public byte[] DailyLimitId { get; set; } + + [Parameter("uint32", "refreshTime", 2, false)] + public long RefreshTime { get; set; } + + [Parameter("uint256", "dailyLimit", 3, false)] + public BigInteger DailyLimit { get; set; } + + [Parameter("uint256", "remainTokenAmount", 4, false)] + public BigInteger RemainTokenAmount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenDailyLimitConsumedEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenDailyLimitConsumedEvent.cs new file mode 100644 index 0000000..7dbfd16 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenDailyLimitConsumedEvent.cs @@ -0,0 +1,16 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; + +[Event("TokenDailyLimitConsumed")] +// event TokenDailyLimitConsumed(bytes32 dailyLimitId, address tokenAddress, uint256 amount); +public class TokenDailyLimitConsumedEvent : IEventDTO +{ + [Parameter("bytes32", "dailyLimitId", 1, false)] + public byte[] DailyLimitId { get; set; } + [Parameter("address", "tokenAddress", 2, false)] + public string TokenAddress { get; set; } + [Parameter("uint256", "amount", 3, false)] + public BigInteger Amount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenRateLimitConsumedEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenRateLimitConsumedEvent.cs new file mode 100644 index 0000000..76175dc --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenRateLimitConsumedEvent.cs @@ -0,0 +1,15 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +// event TokenRateLimitConsumed(bytes32 bucketId, address tokenAddress, uint256 amount); +[Event("TokenRateLimitConsumed")] +public class TokenRateLimitConsumedEvent : IEventDTO +{ + [Parameter("bytes32", "bucketId", 1, false)] + public byte[] BucketId { get; set; } + [Parameter("address", "tokenAddress", 2, false)] + public string TokenAddress { get; set; } + [Parameter("uint256", "amount", 3, false)] + public BigInteger Amount { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/NewReceiptEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/NewReceiptEvent.cs new file mode 100644 index 0000000..9aef64f --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/NewReceiptEvent.cs @@ -0,0 +1,37 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos; +/* + *event NewReceipt( + * string receiptId, + * address asset, + * address owner, + * uint256 amount, + * string targetChainId, + * bytes32 targetAddress, + * uint256 blockTime + *); + */ +[Event("NewReceipt")] +public class NewReceiptEvent: IEventDTO +{ + [Parameter("string", "receiptId", 1, false)] + public string ReceiptId { get; set; } + [Parameter("address", "asset", 2, false)] + public string Asset { get; set; } + [Parameter("address", "owner", 3, false)] + public string Owner { get; set; } + + [Parameter("uint256", "amount", 4, false)] + public BigInteger Amount { get; set; } + + [Parameter("string", "targetChainId", 5, false)] + public string TargetChainId { get; set; } + + [Parameter("bytes32", "targetAddress", 6, false)] + public byte[] TargetAddress { get; set; } + [Parameter("uint256","blockTime",7,false)] + public BigInteger BlockTime { get; set; } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/TokenSwappedEvent.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/TokenSwappedEvent.cs new file mode 100644 index 0000000..4b7fbd5 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/TokenSwappedEvent.cs @@ -0,0 +1,35 @@ +using System.Numerics; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos; + +[Event("TokenSwapEvent")] +/* + * event TokenSwapEvent( + * address receiveAddress, + * address token, + * uint256 amount, + * string receiptId, + * string fromChainId, + * uint256 blockTime + * ); + */ +public class TokenSwappedEvent : IEventDTO +{ + [Parameter("address", "receiveAddress", 1, false)] + public string ReceiveAddress { get; set; } + + [Parameter("address", "token", 2, false)] + public string Token { get; set; } + + [Parameter("uint256", "amount", 3, false)] + public BigInteger Amount { get; set; } + + [Parameter("string", "receiptId", 4, false)] + public string ReceiptId { get; set; } + + [Parameter("string", "fromChainId", 5, false)] + public string FromChainId { get; set; } + [Parameter("uint256","blockTime",6,false)] + public BigInteger BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EventHelper.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EventHelper.cs new file mode 100644 index 0000000..5a9e77b --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EventHelper.cs @@ -0,0 +1,12 @@ +using Nethereum.Util; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public static class EventHelper +{ + public static string GetEventSignature(this string eventSig) + { + return new Sha3Keccack().CalculateHash(eventSig).ToString(); + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs new file mode 100644 index 0000000..9c31ed4 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using Nethereum.Contracts; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmContractSyncOptions +{ + public bool Enabled { get; set; } = true; + public Dictionary IndexerInfos { get; set; } + public int SyncPeriod { get; set; } = 3 * 1000; // 1min + +} + +public class IndexerInfo +{ + public string WsUrl { get; set; } + public string TokenPoolContract { get; set; } = ""; + public string BridgeInContract { get; set; } = ""; + public string BridgeOutContract { get; set; } = ""; + public string LimiterContract { get; set; } = ""; + public int PingDelay { get; set; } = 5000; + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncProviderBase.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncProviderBase.cs new file mode 100644 index 0000000..a1f683f --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncProviderBase.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Settings; +using Nethereum.ABI.FunctionEncoding.Attributes; +using Serilog; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public abstract class EvmIndexerSyncProviderBase(ISettingManager settingManager) + : IEvmSyncProvider, ITransientDependency +{ + protected readonly ISettingManager SettingManager = settingManager; + public IBlockchainAppService BlockchainAppService { get; set; } + protected const int MaxRequestCount = 1000; + + public async Task ExecuteAsync(string chainId) + { + var syncHeight = await GetSyncHeightAsync(chainId, null); + var currentIndexHeight = await GetConfirmedHeightAsync(chainId); + var endHeight = Math.Min(syncHeight + MaxRequestCount, currentIndexHeight); + if (endHeight <= syncHeight) + { + Log.ForContext("chainId", chainId).Debug( + "No need to sync chain {chainId} from {SyncHeight} to {EndHeight}, current index height {CurrentIndexHeight}", + chainId, syncHeight, endHeight, currentIndexHeight); + return; + } + + Log.ForContext("chainId", chainId).Debug("Start to sync chain {chainId} from {SyncHeight} to {EndHeight}", + chainId, syncHeight + 1, endHeight); + + var height = await HandleDataAsync(chainId, syncHeight + 1, + endHeight); + + await SetSyncHeightAsync(chainId, null, height); + } + + public async Task GetConfirmedHeightAsync(string chainId) + { + var chainStatus = await BlockchainAppService.GetChainStatusAsync(chainId); + return chainStatus.ConfirmedBlockHeight; + } + + private string GetSettingKey(string typePrefix) + { + return string.IsNullOrWhiteSpace(typePrefix) ? SyncType : $"{typePrefix}-{SyncType}"; + } + + private async Task GetSyncHeightAsync(string chainId, string typePrefix) + { + var settingKey = GetSettingKey(typePrefix); + var setting = await SettingManager.GetOrNullAsync(chainId, settingKey); + return setting == null ? 0 : long.Parse(setting); + } + + private async Task SetSyncHeightAsync(string chainId, string typePrefix, long height) + { + var settingKey = GetSettingKey(typePrefix); + await SettingManager.SetAsync(chainId, settingKey, height.ToString()); + } + + protected async Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, + long endHeight) + { + var logs = await BlockchainAppService.GetContractLogsAsync(chainId, contractAddress, startHeight, endHeight); + return logs; + } + + protected async Task> GetContractLogsAndParseAsync(string chainId, + string contractAddress, long startHeight, long endHeight, string logSignature) + where TEventDTO : IEventDTO, new() + { + var logs = await BlockchainAppService.GetContractLogsAndParseAsync(chainId, contractAddress, + startHeight, endHeight, logSignature); + return logs; + } + + protected abstract string SyncType { get; } + + protected abstract Task HandleDataAsync(string chainId, long startHeight, long endHeight); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs new file mode 100644 index 0000000..a4e899f --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmIndexerSyncWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly IChainAppService _chainAppService; + private readonly IEnumerable _evmSyncProviders; + private readonly EvmContractSyncOptions _evmContractSyncOptions; + + public EvmIndexerSyncWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + IEnumerable evmSyncProviders, IChainAppService chainAppService,IOptionsSnapshot evmContractSyncOptions) : base( + timer, + serviceScopeFactory) + { + _evmSyncProviders = evmSyncProviders.ToList(); + _chainAppService = chainAppService; + _evmContractSyncOptions = evmContractSyncOptions.Value; + Timer.Period = _evmContractSyncOptions.SyncPeriod; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + if(!_evmContractSyncOptions.Enabled) + { + Log.Debug("Evm sync is disabled."); + return; + } + var chains = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.Evm + }); + + Log.Debug("Start to sync evm chain."); + foreach (var chain in chains.Items) + { + foreach (var provider in _evmSyncProviders) + { + Log.Debug("Start to sync evm chain {ChainId} with {ProviderName}.", chain.Id, provider.GetType().Name); + await provider.ExecuteAsync(chain.Id); + } + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs new file mode 100644 index 0000000..d30f60b --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs @@ -0,0 +1,81 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos; +using AElf.Types; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmNewReceiptSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + + private const string NewReceiptEvent = "NewReceipt(string,address,address,uint256,string,bytes32,uint256)"; + private static string NewReceiptEventSignature => NewReceiptEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmNewReceiptIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync new receipt info {chainId} from {StartHeight} to {EndHeight}", + chainId, startHeight, endHeight); + var bridgeInContract = _evmContractSyncOptions.IndexerInfos[chainId].BridgeInContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, bridgeInContract, + startHeight, + endHeight, NewReceiptEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync new receipt log event, chainId: {chainId}", chainId); + + foreach (var newReceipt in filterLogsAndEventsDto.Events) + { + var log = newReceipt.Log; + var events = newReceipt.Event; + Log.Debug("Sync new receipt log event, chainId: {chainId}, log: {log}", chainId, + JsonSerializer.Serialize(events)); + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = events.Asset + }); + await crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TransferTransactionId = log.TransactionHash, + FromAddress = events.Owner, + ReceiptId = events.ReceiptId[2..], + ToAddress = Address.FromBytes(events.TargetAddress).ToBase58(), + TransferAmount = (decimal)((BigDecimal)events.Amount / BigInteger.Pow(10, token.Decimals)), + TransferTime = DateTimeHelper.FromUnixTimeMilliseconds((long)events.BlockTime * 1000), + FromChainId = chainId, + ToChainId = events.TargetChainId, + TransferBlockHeight = log.BlockNumber, + TransferTokenId = token.Id, + TransferStatus = ReceiptStatus.Confirmed + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs new file mode 100644 index 0000000..2aff2c1 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs @@ -0,0 +1,186 @@ +using System; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmTokenPoolIndexerSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + IPoolLiquidityInfoAppService poolLiquidityInfoAppService, + ITokenAppService tokenAppService, + IUserLiquidityInfoAppService userLiquidityInfoAppService) + : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + + private const string LockedEvent = "Locked(address,address,string,uint256)"; + private const string ReleasedEvent = "Released(address,address,string,uint256)"; + private const string LiquidityAddedEvent = "LiquidityAdded(address,address,uint256)"; + private const string LiquidityRemovedEvent = "LiquidityRemoved(address,address,uint256)"; + private static string LockedEventSignature => LockedEvent.GetEventSignature(); + private static string ReleasedEventSignature => ReleasedEvent.GetEventSignature(); + private static string LiquidityAddedEventSignature => LiquidityAddedEvent.GetEventSignature(); + private static string LiquidityRemovedEventSignature => LiquidityRemovedEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmPoolLiquidityIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync pool liquidity info {chainId} from {StartHeight} to {EndHeight}", + chainId, startHeight, endHeight); + var tokenPoolContractAddress = _evmContractSyncOptions.IndexerInfos[chainId].TokenPoolContract; + var logs = await GetContractLogsAsync(chainId, tokenPoolContractAddress, startHeight, endHeight); + if (logs == null || logs.Logs.Count == 0) + { + return endHeight; + } + foreach (var log in logs.Logs) + { + if (log.Removed) + { + continue; + } + + var logSignature = log.Topics[0]?.ToString()?.Substring(2); + if (string.IsNullOrEmpty(logSignature)) + { + continue; + } + await ProcessLogEventAsync(chainId, log, logSignature); + } + + return logs.Logs.Last().BlockNumber; + } + + private async Task ProcessLogEventAsync(string chainId, FilterLog log, string logSignature) + { + if (logSignature == LockedEventSignature) + { + await HandleLockedEventAsync(chainId, log); + } + else if (logSignature == ReleasedEventSignature) + { + await HandleReleasedEventAsync(chainId, log); + } + else if (logSignature == LiquidityAddedEventSignature) + { + await HandleLiquidityAddedEventAsync(chainId, log); + } + else if (logSignature == LiquidityRemovedEventSignature) + { + await HandleLiquidityRemovedEventAsync(chainId, log); + } + } + + private async Task HandleEventAsync( + string chainId, + FilterLog log, + string logType, + Func poolLiquidityAction, + Func userLiquidityAction = null) + { + // Parse common fields + var address = ParseAddress(log.Topics[1].ToString()); + var tokenAddress = ParseAddress(log.Topics[2].ToString()); + var amount = ParseAmount(log.Topics[3].ToString()); + + Log.ForContext("chainId", chainId).Debug( + "Handle {logType} event {chainId}, address1 {address1}, token {token}, amount {amount}", + logType, chainId, address, tokenAddress, amount); + + // Retrieve token details + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress + }); + + // Prepare liquidity input + var liquidityAmount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)); + var poolLiquidityInfo = new PoolLiquidityInfoInput + { + ChainId = chainId, + TokenId = token.Id, + Liquidity = liquidityAmount, + Provider = address + }; + + // Perform pool liquidity action + await poolLiquidityAction(poolLiquidityInfo); + + // Optionally handle user liquidity + if (userLiquidityAction != null) + { + var userLiquidityInfo = new UserLiquidityInfoInput + { + ChainId = chainId, + Provider = address, + TokenId = token.Id, + Liquidity = liquidityAmount + }; + await userLiquidityAction(userLiquidityInfo); + } + } + + private async Task HandleLockedEventAsync(string chainId, FilterLog log) + { + await HandleEventAsync( + chainId, + log, + "locked", + poolLiquidityInfoAppService.AddLiquidityAsync + ); + } + + private async Task HandleReleasedEventAsync(string chainId, FilterLog log) + { + await HandleEventAsync( + chainId, + log, + "released", + poolLiquidityInfoAppService.RemoveLiquidityAsync + ); + } + + private async Task HandleLiquidityAddedEventAsync(string chainId, FilterLog log) + { + await HandleEventAsync( + chainId, + log, + "liquidity added", + poolLiquidityInfoAppService.AddLiquidityAsync, + userLiquidityInfoAppService.AddUserLiquidityAsync + ); + } + + private async Task HandleLiquidityRemovedEventAsync(string chainId, FilterLog log) + { + await HandleEventAsync( + chainId, + log, + "liquidity removed", + poolLiquidityInfoAppService.RemoveLiquidityAsync, + userLiquidityInfoAppService.RemoveUserLiquidityAsync + ); + } + + public static string ParseAddress(string topic) + { + return "0x" + topic.Substring(topic.Length - 40); + } + + public static BigInteger ParseAmount(string topic) + { + return BigInteger.Parse(topic.Substring(2), System.Globalization.NumberStyles.HexNumber); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs new file mode 100644 index 0000000..340d0bb --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs @@ -0,0 +1,81 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class EvmTokenSwapSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + + private const string TokenSwappedEvent = "TokenSwapEvent(address,address,uint256,string,string,uint256)"; + private static string TokenSwappedEventSignature => TokenSwappedEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmTokenSwappedIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync token swap info {chainId} from {StartHeight} to {EndHeight}", + chainId, startHeight, endHeight); + var bridgeOutContract = _evmContractSyncOptions.IndexerInfos[chainId].BridgeOutContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, bridgeOutContract, + startHeight, + endHeight, TokenSwappedEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync token swap log event, chainId: {chainId}", chainId); + + foreach (var tokenSwapped in filterLogsAndEventsDto.Events) + { + var log = tokenSwapped.Log; + var events = tokenSwapped.Event; + Log.Debug("Sync token swap log event, chainId: {chainId}, log: {log}", chainId, + JsonSerializer.Serialize(events) + ); + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenSwapped.Event.Token + }); + await crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput + { + ReceiveTransactionId = log.TransactionHash, + ReceiptId = events.ReceiptId, + ToAddress = events.ReceiveAddress, + FromChainId = events.FromChainId, + ToChainId = chainId, + ReceiveAmount = (decimal)((BigDecimal)events.Amount / BigInteger.Pow(10, token.Decimals)), + ReceiveTime = DateTimeHelper.FromUnixTimeMilliseconds((long)events.BlockTime * 1000), + ReceiveTokenId = token.Id, + ReceiveStatus = ReceiptStatus.Confirmed, + ReceiveBlockHeight = log.BlockNumber + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/IEvmSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/IEvmSyncProvider.cs new file mode 100644 index 0000000..424ad65 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/IEvmSyncProvider.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public interface IEvmSyncProvider +{ + Task ExecuteAsync(string chainId); +} diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitConsumedSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitConsumedSyncProvider.cs new file mode 100644 index 0000000..101a749 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitConsumedSyncProvider.cs @@ -0,0 +1,89 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Limit; + +public class EvmDailyLimitConsumedSyncProvider +( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainLimitAppService crossChainLimitAppService, + ITokenAppService tokenAppService,IOptionsSnapshot tokenSwapInfoOptions) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly TokenLimitSwapInfoOptions _tokenLimitSwapInfoOptions = tokenSwapInfoOptions.Value; + + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + + private const string DailyLimitConsumedEvent = "TokenDailyLimitConsumed(bytes32,address,uint256)"; + + private static string DailyLimitConsumedEventSignature => DailyLimitConsumedEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmDailyLimitConsumedIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync daily limit consumed info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, + endHeight); + var limiterContract = _evmContractSyncOptions.IndexerInfos[chainId].LimiterContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, limiterContract, + startHeight, + endHeight, DailyLimitConsumedEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync daily limit consumed log event, chainId: {chainId}", chainId); + + foreach (var dailyLimitSet in filterLogsAndEventsDto.Events) + { + var log = dailyLimitSet.Log; + var events = dailyLimitSet.Event; + Log.Debug("Sync daily limit consumed log event, chainId: {chainId}, log: {log}", chainId, + JsonSerializer.Serialize(events) + ); + var swapInfo = _tokenLimitSwapInfoOptions.SwapTokenInfos[events.DailyLimitId.ToHex()]; + if (swapInfo == null) + { + Log.Error("TokenDailyLimitConsumedEventProcessor: SwapInfo not found for id: {Id}", events.DailyLimitId.ToHex()); + return; + } + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = swapInfo.TokenAddress + }); + var consumeAmount = (decimal)((BigDecimal)events.Amount / BigInteger.Pow(10, token.Decimals)); + await crossChainLimitAppService.ConsumeCrossChainDailyLimitAsync(new ConsumeCrossChainDailyLimitInput + { + ChainId = swapInfo.FromChainId, + Type = swapInfo.LimitType == 0 + ? CrossChainLimitType.Receipt + : CrossChainLimitType.Swap, + TargetChainId = swapInfo.ToChainId, + TokenId = token.Id, + Amount = consumeAmount + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitSetSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitSetSyncProvider.cs new file mode 100644 index 0000000..3a56fdd --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitSetSyncProvider.cs @@ -0,0 +1,92 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Limit; + +public class EvmDailyLimitSetSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainLimitAppService crossChainLimitAppService, + ITokenAppService tokenAppService, + IOptionsSnapshot tokenSwapInfoOptions) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly TokenLimitSwapInfoOptions _tokenLimitSwapInfoOptions = tokenSwapInfoOptions.Value; + + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + private const string DailyLimitSetEvent = "DailyLimitSet(bytes32,uint32,uint256,uint256)"; + private static string DailyLimitSetEventSignature => DailyLimitSetEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmDailyLimitSetIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync token limit info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, + endHeight); + var limiterContract = _evmContractSyncOptions.IndexerInfos[chainId].LimiterContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, limiterContract, + startHeight, + endHeight, DailyLimitSetEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync daily limit set log event, chainId: {chainId}", chainId); + + foreach (var dailyLimitSet in filterLogsAndEventsDto.Events) + { + var log = dailyLimitSet.Log; + var events = dailyLimitSet.Event; + Log.Debug("Sync daily limit set log event, chainId: {chainId}, log: {log}, dailyLimitId: {Id}", chainId, + JsonSerializer.Serialize(events),events.DailyLimitId.ToHex() + ); + var swapInfo = _tokenLimitSwapInfoOptions.SwapTokenInfos[events.DailyLimitId.ToHex()]; + if (swapInfo == null) + { + Log.Error("DailyLimitSetEventProcessor: SwapInfo not found for id: {Id}", events.DailyLimitId.ToHex()); + return; + } + + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = swapInfo.TokenAddress + }); + var dailyLimitAmount = (decimal)((BigDecimal)events.DailyLimit / BigInteger.Pow(10, token.Decimals)); + var remainTokenAmount = + (decimal)((BigDecimal)events.RemainTokenAmount / BigInteger.Pow(10, token.Decimals)); + + await crossChainLimitAppService.SetCrossChainDailyLimitAsync(new SetCrossChainDailyLimitInput + { + ChainId = swapInfo.FromChainId, + Type = swapInfo.LimitType == 0 + ? CrossChainLimitType.Receipt + : CrossChainLimitType.Swap, + DailyLimit = dailyLimitAmount, + RefreshTime = events.RefreshTime, + RemainAmount = remainTokenAmount, + TokenId = token.Id, + TargetChainId = swapInfo.ToChainId, + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitConsumedSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitConsumedSyncProvider.cs new file mode 100644 index 0000000..7848b56 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitConsumedSyncProvider.cs @@ -0,0 +1,87 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Limit; + +public class EvmRateLimitConsumedSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainLimitAppService crossChainLimitAppService, + ITokenAppService tokenAppService,IOptionsSnapshot tokenSwapInfoOptions) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly TokenLimitSwapInfoOptions _tokenLimitSwapInfoOptions = tokenSwapInfoOptions.Value; + + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + private const string RateLimitConsumedEvent = "TokenRateLimitConsumed(bytes32,address,uint256)"; + private static string RateLimitConsumedEventSignature => RateLimitConsumedEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmRateLimitConsumedIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync rate limit consumed info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, + endHeight); + var limiterContract = _evmContractSyncOptions.IndexerInfos[chainId].LimiterContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, limiterContract, + startHeight, + endHeight, RateLimitConsumedEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync rate limit consumed log event, chainId: {chainId}", chainId); + + foreach (var dailyLimitSet in filterLogsAndEventsDto.Events) + { + var log = dailyLimitSet.Log; + var events = dailyLimitSet.Event; + Log.Debug("Sync rate limit consumed log event, chainId: {chainId}, log: {log}", chainId, + JsonSerializer.Serialize(events) + ); + var swapInfo = _tokenLimitSwapInfoOptions.SwapTokenInfos[events.BucketId.ToHex()]; + if (swapInfo == null) + { + Log.Error("TokenDailyLimitConsumedEventProcessor: SwapInfo not found for id: {Id}", events.BucketId.ToHex()); + return; + } + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = swapInfo.TokenAddress + }); + var consumeAmount = (decimal)((BigDecimal)events.Amount / BigInteger.Pow(10, token.Decimals)); + await crossChainLimitAppService.ConsumeCrossChainRateLimitAsync(new ConsumeCrossChainRateLimitInput + { + ChainId = swapInfo.FromChainId, + Type = swapInfo.LimitType == 0 + ? CrossChainLimitType.Receipt + : CrossChainLimitType.Swap, + TargetChainId = swapInfo.ToChainId, + TokenId = token.Id, + Amount = consumeAmount + }); + } + } + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitSetSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitSetSyncProvider.cs new file mode 100644 index 0000000..3fa0b54 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitSetSyncProvider.cs @@ -0,0 +1,94 @@ +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync.Dtos.Limit; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync.Limit; + +public class EvmRateLimitSetSyncProvider( + ISettingManager settingManager, + IOptionsSnapshot evmContractSyncOptions, + ICrossChainLimitAppService crossChainLimitAppService, + ITokenAppService tokenAppService, + IOptionsSnapshot tokenSwapInfoOptions) : EvmIndexerSyncProviderBase(settingManager) +{ + private readonly TokenLimitSwapInfoOptions _tokenLimitSwapInfoOptions = tokenSwapInfoOptions.Value; + + private readonly EvmContractSyncOptions _evmContractSyncOptions = evmContractSyncOptions.Value; + private const string RateLimitSetEvent = "ConfigChanged(bytes32,bool,uint128,uint128,uint128)"; + + private static string RateLimitSetEventSignature => RateLimitSetEvent.GetEventSignature(); + + protected override string SyncType { get; } = CrossChainServerSettings.EvmRateLimitSetIndexerSync; + + protected override async Task HandleDataAsync(string chainId, long startHeight, long endHeight) + { + Log.ForContext("chainId", chainId).Debug( + "Start to sync token rate limit set info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, + endHeight); + var limiterContract = _evmContractSyncOptions.IndexerInfos[chainId].LimiterContract; + var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, limiterContract, + startHeight, + endHeight, RateLimitSetEventSignature); + if (filterLogsAndEventsDto?.Events == null || filterLogsAndEventsDto.Events?.Count == 0) + { + return endHeight; + } + + await ProcessLogEventAsync(chainId, filterLogsAndEventsDto); + + return filterLogsAndEventsDto.Events.Max(e => e.Log.BlockNumber); + } + + private async Task ProcessLogEventAsync(string chainId, + FilterLogsAndEventsDto filterLogsAndEventsDto) + { + Log.Debug("Sync rate limit set log event, chainId: {chainId}", chainId); + + foreach (var dailyLimitSet in filterLogsAndEventsDto.Events) + { + var log = dailyLimitSet.Log; + var events = dailyLimitSet.Event; + Log.Debug("Sync rate limit set log event, chainId: {chainId}, transaction:{tx}, log: {log}", chainId, + JsonSerializer.Serialize(log), JsonSerializer.Serialize(events) + ); + var swapInfo = _tokenLimitSwapInfoOptions.SwapTokenInfos[events.BucketId.ToHex()]; + if (swapInfo == null) + { + Log.Error("ConfigChangedEventProcessor: SwapInfo not found for id: {Id}", events.BucketId.ToHex()); + return; + } + var token = await tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = swapInfo.TokenAddress + }); + var capacityAmount = (decimal)((BigDecimal)events.TokenCapacity / BigInteger.Pow(10, token.Decimals)); + var remainTokenAmount = + (decimal)((BigDecimal)events.CurrentTokenAmount / BigInteger.Pow(10, token.Decimals)); + var rate = (decimal)((BigDecimal)events.Rate / BigInteger.Pow(10, token.Decimals)); + + await crossChainLimitAppService.SetCrossChainRateLimitAsync(new SetCrossChainRateLimitInput() + { + ChainId = swapInfo.FromChainId, + Type = swapInfo.LimitType == 0 + ? CrossChainLimitType.Receipt + : CrossChainLimitType.Swap, + TokenId = token.Id, + TargetChainId = swapInfo.ToChainId, + Rate = rate, + CurrentAmount = remainTokenAmount, + Capacity = capacityAmount, + IsEnable = events.IsEnabled + }); + } + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/TokenLimitSwapInfoOptions.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/TokenLimitSwapInfoOptions.cs new file mode 100644 index 0000000..d2d8529 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/TokenLimitSwapInfoOptions.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Worker.EvmIndexerSync; + +public class TokenLimitSwapInfoOptions +{ + public Dictionary SwapTokenInfos { get; set; } = new(); +} + +public class SwapTokenInfo +{ + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string TokenAddress { get; set; } + public int LimitType { get; set; } // Receipt:0,Swap:1 +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/BridgeContractSyncOptions.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/BridgeContractSyncOptions.cs new file mode 100644 index 0000000..0448167 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/BridgeContractSyncOptions.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using AElf.CrossChainServer.BridgeContract; + +namespace AElf.CrossChainServer.Worker; + +public class BridgeContractSyncOptions +{ + /// + /// ChainId -> Token Dic + /// + public int SyncDelayHeight { get; set; } = 10; + public string ConfirmedSyncKeyPrefix { get; set; } = "Confirmed"; + public int ConfirmedSyncDelayHeight { get; set; } = 20; + +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainIndexingInfoIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainIndexingInfoIndexerSyncProvider.cs new file mode 100644 index 0000000..75746c3 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainIndexingInfoIndexerSyncProvider.cs @@ -0,0 +1,111 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Settings; +using GraphQL; +using GraphQL.Client.Abstractions; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Serilog; +using Serilog.Core; +using Volo.Abp.Json; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class CrossChainIndexingInfoIndexerSyncProvider : IndexerSyncProviderBase +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + + + public CrossChainIndexingInfoIndexerSyncProvider(IGraphQLClientFactory graphQlClientFactory, + ISettingManager settingManager, + IChainAppService chainAppService, IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, + ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService) : base( + graphQlClientFactory, settingManager, jsonSerializer, indexerAppService, chainAppService) + { + _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; + } + + protected override string SyncType { get; } = CrossChainServerSettings.CrossChainIndexingIndexerSync; + + protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight,bool isConfirmed) + { + Log.ForContext("chainId", aelfChainId).Debug("Start to sync cross chain indexing info {ChainId} from {StartHeight} to {EndHeight}", + aelfChainId, startHeight, endHeight); + var data = await QueryDataAsync(GetRequest(aelfChainId, startHeight, + endHeight)); + if (data == null || data.CrossChainIndexingInfo.Count == 0) + { + return endHeight; + } + + foreach (var indexing in data.CrossChainIndexingInfo) + { + await HandleDataAsync(indexing); + } + + return endHeight; + } + + private async Task HandleDataAsync(CrossChainIndexingInfoDto data) + { + Log.ForContext("chainId", data.ChainId).Debug( + "Start to handler cross chain indexing info {ChainId},index chain id:{indexChainId},index height:{indexHeight}", + data.ChainId, data.IndexChainId, data.IndexBlockHeight); + var chain = await ChainAppService.GetByAElfChainIdAsync(ChainHelper.ConvertBase58ToChainId(data.ChainId)); + var indexChain = + await ChainAppService.GetByAElfChainIdAsync(ChainHelper.ConvertBase58ToChainId(data.IndexChainId)); + if (indexChain == null) + { + return; + } + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + BlockHeight = data.BlockHeight, + BlockTime = data.BlockTime, + ChainId = chain.Id, + IndexChainId = indexChain.Id, + IndexBlockHeight = data.IndexBlockHeight + }); + } + + private GraphQLRequest GetRequest(string chainId, long startHeight, long endHeight) + { + return new GraphQLRequest + { + Query = + @"query($chainId:String,$startBlockHeight:Long!,$endBlockHeight:Long!,$maxMaxResultCount:Int!){ + crossChainIndexingInfo(input: {chainId:$chainId,startBlockHeight:$startBlockHeight,endBlockHeight:$endBlockHeight,maxMaxResultCount:$maxMaxResultCount}){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + indexChainId, + indexBlockHeight + } + }", + Variables = new + { + chainId = chainId, + startBlockHeight = startHeight, + endBlockHeight = endHeight, + maxMaxResultCount = MaxRequestCount + } + }; + } +} + +public class CrossChainIndexingInfoResponse +{ + public List CrossChainIndexingInfo { get; set; } = new(); +} + +public class CrossChainIndexingInfoDto : GraphQLDto +{ + public string IndexChainId { get; set; } + public long IndexBlockHeight { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs new file mode 100644 index 0000000..2bdd8ff --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using GraphQL; +using GraphQL.Client.Abstractions; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Serilog; +using Volo.Abp.Json; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class CrossChainTransferIndexerSyncProvider : IndexerSyncProviderBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + + public CrossChainTransferIndexerSyncProvider(IGraphQLClientFactory graphQlClientFactory, + ISettingManager settingManager, + ICrossChainTransferAppService crossChainTransferAppService, IChainAppService chainAppService, + ITokenAppService tokenAppService, IJsonSerializer jsonSerializer, + IIndexerAppService indexerAppService) : base( + graphQlClientFactory, settingManager, jsonSerializer, indexerAppService, chainAppService) + { + _crossChainTransferAppService = crossChainTransferAppService; + _tokenAppService = tokenAppService; + } + + protected override string SyncType { get; } = CrossChainServerSettings.CrossChainTransferIndexerSync; + + protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight, + bool isConfirmed) + { + Log.ForContext("chainId", aelfChainId).Debug( + "Start to sync cross chain transfer info {chainId} from {StartHeight} to {EndHeight}, isConfirmed:{isConfirmed}", + aelfChainId, startHeight, endHeight, isConfirmed); + var data = await QueryDataAsync(GetRequest(aelfChainId, startHeight, endHeight)); + if (data == null || data.CrossChainTransferInfo.Count == 0) + { + return endHeight; + } + + foreach (var crossChainTransfer in data.CrossChainTransferInfo) + { + Log.ForContext("chainId", crossChainTransfer.ChainId).Debug( + "Start to handle cross chain transfer info {ChainId},token {symbol}, transfer type:{transferType},cross chain type:{crossChainType}", + crossChainTransfer.ChainId, crossChainTransfer.TransferTokenSymbol, + crossChainTransfer.TransferType == TransferType.Transfer ? "Transfer" : "Receive", + crossChainTransfer.CrossChainType == CrossChainType.Heterogeneous ? "Heterogeneous" : "Homogeneous"); + await HandleDataAsync(crossChainTransfer,isConfirmed); + } + + return endHeight; + } + + private async Task HandleDataAsync(CrossChainTransferInfo transfer,bool isConfirmed) + { + var chain = await ChainAppService.GetByAElfChainIdAsync(ChainHelper.ConvertBase58ToChainId(transfer.ChainId)); + + switch (transfer.TransferType) + { + case TransferType.Transfer: + var toChainId = await GetChainIdAsync(transfer.ToChainId, transfer.CrossChainType); + if (toChainId == null) + { + return; + } + + var toChain = await ChainAppService.GetAsync(toChainId); + var toAddress = transfer.ToAddress; + if (toChain.Type == BlockchainType.Tvm) + { + toAddress = TonAddressHelper.GetTonRawAddress(transfer.ToAddress); + } + + var transferToken = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = transfer.TransferTokenSymbol + }); + Log.ForContext("fromChainId", chain.Id).ForContext("toChainId", toChainId).Information( + "Start to transfer token {symbol}", transfer.TransferTokenSymbol); + await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TransferAmount = transfer.TransferAmount / (decimal)Math.Pow(10, transferToken.Decimals), + FromAddress = transfer.FromAddress, + ToAddress = toAddress, + TransferTokenId = transferToken.Id, + FromChainId = chain.Id, + ToChainId = toChainId, + TransferBlockHeight = transfer.BlockHeight, + TransferTime = transfer.TransferTime, + TransferTransactionId = transfer.TransferTransactionId, + ReceiptId = transfer.ReceiptId, + TransferStatus = isConfirmed + ? ReceiptStatus.Confirmed + : ReceiptStatus.Pending, + }); + break; + case TransferType.Receive: + var fromChainId = await GetChainIdAsync(transfer.FromChainId, transfer.CrossChainType); + if (fromChainId == null) + { + return; + } + + var receiveToken = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = transfer.ReceiveTokenSymbol + }); + + Log.ForContext("fromChainId", fromChainId).ForContext("toChainId", chain.Id).Information( + "Start to receive token {symbol} from {fromChainId} to {toChainId}", + transfer.ReceiveTokenSymbol, fromChainId, chain.Id); + + await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput() + { + ReceiveAmount = transfer.ReceiveAmount / (decimal)Math.Pow(10, receiveToken.Decimals), + ReceiveTime = transfer.ReceiveTime, + FromChainId = fromChainId, + ReceiveTransactionId = transfer.ReceiveTransactionId, + ToChainId = chain.Id, + TransferTransactionId = transfer.TransferTransactionId, + ReceiveTokenId = receiveToken.Id, + FromAddress = transfer.FromAddress, + ToAddress = transfer.ToAddress, + ReceiptId = transfer.ReceiptId, + ReceiveStatus = isConfirmed + ? ReceiptStatus.Confirmed + : ReceiptStatus.Pending, + ReceiveBlockHeight = transfer.ReceiveBlockHeight + }); + break; + } + } + + private async Task GetChainIdAsync(string originalChainId, CrossChainType crossChainType) + { + var chainId = originalChainId; + if (crossChainType == CrossChainType.Heterogeneous) + { + return chainId; + } + + Log.Debug("Start to get chain id by {originalChainId}", originalChainId); + var toChain = + await ChainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(originalChainId)); + if (toChain == null) + { + return null; + } + + chainId = toChain.Id; + return chainId; + } + + private GraphQLRequest GetRequest(string chainId, long startHeight, long endHeight) + { + return new GraphQLRequest + { + Query = + @"query($chainId:String,$startBlockHeight:Long!,$endBlockHeight:Long!,$maxMaxResultCount:Int!){ + crossChainTransferInfo(input: {chainId:$chainId,startBlockHeight:$startBlockHeight,endBlockHeight:$endBlockHeight,maxMaxResultCount:$maxMaxResultCount}){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + crossChainType, + transferType, + fromChainId, + toChainId, + transferTokenSymbol, + transferAmount, + transferTime, + transferTransactionId, + fromAddress, + toAddress, + receiveTokenSymbol, + receiveAmount, + receiveTime, + receiveTransactionId, + receiptId, + receiveBlockHeight + } + }", + Variables = new + { + chainId = chainId, + startBlockHeight = startHeight, + endBlockHeight = endHeight, + maxMaxResultCount = MaxRequestCount + } + }; + } +} + +public class CrossChainTransferInfoDto +{ + public List CrossChainTransferInfo { get; set; } +} + +public class CrossChainTransferInfo : GraphQLDto +{ + public string FromChainId { get; set; } + public string ToChainId { get; set; } + public string FromAddress { get; set; } + public string ToAddress { get; set; } + public string TransferTransactionId { get; set; } + public string ReceiveTransactionId { get; set; } + public DateTime TransferTime { get; set; } + public long TransferBlockHeight { get; set; } + public DateTime ReceiveTime { get; set; } + public long TransferAmount { get; set; } + public long ReceiveAmount { get; set; } + public string ReceiptId { get; set; } + public string TransferTokenSymbol { get; set; } + public string ReceiveTokenSymbol { get; set; } + public TransferType TransferType { get; set; } + public CrossChainType CrossChainType { get; set; } + public long ReceiveBlockHeight { get; set; } +} + +public enum TransferType +{ + Transfer, + Receive +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/GraphQLDto.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/GraphQLDto.cs new file mode 100644 index 0000000..075be26 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/GraphQLDto.cs @@ -0,0 +1,12 @@ +using System; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class GraphQLDto +{ + public string Id { get; set; } + public string ChainId { get; set; } + public string BlockHash { get; set; } + public long BlockHeight { get; set; } + public DateTime BlockTime { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs new file mode 100644 index 0000000..c4955de --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public interface IIndexerSyncProvider +{ + bool RequiresRealTime { get; } + + Task ExecuteAsync(string chainId, int syncDelayHeight = 0, string typePrefix = null,bool isConfirmed = false); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncProviderBase.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncProviderBase.cs new file mode 100644 index 0000000..b43923f --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncProviderBase.cs @@ -0,0 +1,118 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Settings; +using GraphQL; +using GraphQL.Client.Abstractions; +using Serilog; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Json; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public abstract class IndexerSyncProviderBase : IIndexerSyncProvider, ITransientDependency +{ + protected readonly IGraphQLClient GraphQlClient; + protected readonly ISettingManager SettingManager; + protected readonly IJsonSerializer JsonSerializer; + protected readonly IIndexerAppService IndexerAppService; + protected readonly IChainAppService ChainAppService; + + protected const int MaxRequestCount = 1000; + + protected IndexerSyncProviderBase(IGraphQLClientFactory graphQlClientFactory, ISettingManager settingManager, + IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, IChainAppService chainAppService) + { + GraphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); + SettingManager = settingManager; + JsonSerializer = jsonSerializer; + IndexerAppService = indexerAppService; + ChainAppService = chainAppService; + } + + public virtual bool RequiresRealTime { get; set; } = true; + + public async Task ExecuteAsync(string chainId, int syncDelayHeight = 0, string typePrefix = null, + bool isConfirmed = false) + { + Log.Debug("Start to sync indexer data for chain {chainId},{prefix}", chainId, typePrefix); + var syncHeight = await GetSyncHeightAsync(chainId, typePrefix); + long currentIndexHeight; + if (isConfirmed) + { + currentIndexHeight = await GetLatestIndexConfirmedHeightAsync(chainId); + } + else + { + currentIndexHeight = await GetLatestIndexBestHeightAsync(chainId); + } + + var endHeight = Math.Min(syncHeight + MaxRequestCount, currentIndexHeight - syncDelayHeight); + if (endHeight <= syncHeight) + { + return; + } + + var chain = await ChainAppService.GetAsync(chainId); + if (chain == null) + { + return; + } + + Log.ForContext("chainId", chainId).Debug("Start to sync chain {chainId} from {SyncHeight} to {EndHeight}", + chainId, syncHeight + 1, endHeight); + + var height = await HandleDataAsync(ChainHelper.ConvertChainIdToBase58(chain.AElfChainId), syncHeight + 1, + endHeight,isConfirmed); + + await SetSyncHeightAsync(chainId, typePrefix, height); + } + + protected async Task QueryDataAsync(GraphQLRequest request) + { + var data = await GraphQlClient.SendQueryAsync(request); + if (data.Errors == null || data.Errors.Length == 0) + { + return data.Data; + } + + Log.Error("Query indexer failed. errors: {Errors}", + string.Join(",", data.Errors.Select(e => e.Message).ToList())); + throw new Exception("Query indexer failed. "); + } + + private async Task GetLatestIndexBestHeightAsync(string chainId) + { + return await IndexerAppService.GetLatestIndexBestHeightAsync(chainId); + } + + private async Task GetLatestIndexConfirmedHeightAsync(string chainId) + { + return await IndexerAppService.GetLatestIndexHeightAsync(chainId); + } + + private async Task GetSyncHeightAsync(string chainId, string typePrefix) + { + var settingKey = GetSettingKey(typePrefix); + var setting = await SettingManager.GetOrNullAsync(chainId, settingKey); + return setting == null ? 0 : long.Parse(setting); + } + + private async Task SetSyncHeightAsync(string chainId, string typePrefix, long height) + { + var settingKey = GetSettingKey(typePrefix); + await SettingManager.SetAsync(chainId, settingKey, height.ToString()); + } + + private string GetSettingKey(string typePrefix) + { + return string.IsNullOrWhiteSpace(typePrefix) ? SyncType : $"{typePrefix}-{SyncType}"; + } + + protected abstract string SyncType { get; } + + protected abstract Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight, + bool isConfirmed); +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncWorker.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncWorker.cs new file mode 100644 index 0000000..a5734f3 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncWorker.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class IndexerSyncWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly IChainAppService _chainAppService; + private readonly IEnumerable _indexerSyncProviders; + private readonly BridgeContractSyncOptions _bridgeContractSyncOptions; + + public IndexerSyncWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + IEnumerable indexerSyncProviders, IChainAppService chainAppService, + IOptionsSnapshot bridgeContractSyncOptions) : base(timer, + serviceScopeFactory) + { + _bridgeContractSyncOptions = bridgeContractSyncOptions.Value; + _chainAppService = chainAppService; + _indexerSyncProviders = indexerSyncProviders.ToList(); + Timer.Period = 1000 * 1; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + var chains = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.AElf + }); + + Log.Debug("Start to sync chain."); + var tasks = + chains.Items.Select(o => o.Id).SelectMany(chainId => + _indexerSyncProviders + .Where(provider => provider.RequiresRealTime) + .Select(async provider => await provider.ExecuteAsync(chainId, _bridgeContractSyncOptions.SyncDelayHeight))); + + await Task.WhenAll(tasks); + + var confirmTasks = chains.Items.Select(o => o.Id).SelectMany(chainId => + _indexerSyncProviders + .Select(async provider => await provider.ExecuteAsync(chainId, + _bridgeContractSyncOptions.ConfirmedSyncDelayHeight, + _bridgeContractSyncOptions.ConfirmedSyncKeyPrefix,true))); + + await Task.WhenAll(confirmTasks); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs new file mode 100644 index 0000000..35d8454 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync; +using GraphQL; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.Json; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class PoolLiquidityIndexerSyncProvider : IndexerSyncProviderBase +{ + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly ITokenAppService _tokenAppService; + private readonly EvmContractSyncOptions _evmContractSyncOptions; + + public PoolLiquidityIndexerSyncProvider(IGraphQLClientFactory graphQlClientFactory, ISettingManager settingManager, + IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, IChainAppService chainAppService, + IPoolLiquidityInfoAppService poolLiquidityInfoAppService, ITokenAppService tokenAppService, + IOptionsSnapshot evmContractSyncOptions) : base( + graphQlClientFactory, settingManager, jsonSerializer, indexerAppService, chainAppService) + { + _poolLiquidityInfoAppService = poolLiquidityInfoAppService; + _tokenAppService = tokenAppService; + _evmContractSyncOptions = evmContractSyncOptions.Value; + } + + public override bool RequiresRealTime { get; set; } = false; + protected override string SyncType { get; } = CrossChainServerSettings.PoolLiquidityIndexerSync; + + protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight, + bool isConfirmed) + { + Log.Debug( + "Start to sync pool liquidity info {chainId} from {StartHeight} to {EndHeight}, isConfirmed:{isConfirmed}", + aelfChainId, startHeight, endHeight, isConfirmed); + if (!_evmContractSyncOptions.Enabled) + { + return 0; + } + + Log.ForContext("chainId", aelfChainId).Debug( + "Start to sync pool liquidity info {chainId} from {StartHeight} to {EndHeight}", + aelfChainId, startHeight, endHeight); + var data = await QueryDataAsync(GetRequest(aelfChainId, startHeight, endHeight)); + if (data == null || data.PoolLiquidityInfo.Count == 0) + { + return endHeight; + } + + foreach (var poolLiquidityRecord in data.PoolLiquidityInfo) + { + Log.ForContext("chainId", poolLiquidityRecord.ChainId).Debug( + "Start to handle pool liquidity record info {ChainId},token {symbol}, liquidity type:{liquidityType}", + poolLiquidityRecord.ChainId, poolLiquidityRecord.TokenSymbol, + poolLiquidityRecord.LiquidityType == LiquidityType.Add ? "Add" : "Remove"); + await HandleDataAsync(poolLiquidityRecord); + } + + return endHeight; + } + + private async Task HandleDataAsync(PoolLiquidityInfo poolLiquidityRecord) + { + var chain = await ChainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(poolLiquidityRecord.ChainId)); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = poolLiquidityRecord.TokenSymbol + }); + var input = new PoolLiquidityInfoInput + { + ChainId = chain.Id, + Liquidity = poolLiquidityRecord.Liquidity / (decimal)Math.Pow(10, token.Decimals), + TokenId = token.Id + }; + switch (poolLiquidityRecord.LiquidityType) + { + case LiquidityType.Add: + await _poolLiquidityInfoAppService.AddLiquidityAsync(input); + break; + case LiquidityType.Remove: + await _poolLiquidityInfoAppService.RemoveLiquidityAsync(input); + break; + default: + throw new ArgumentOutOfRangeException(nameof(poolLiquidityRecord.LiquidityType), + "Unsupported liquidity type."); + } + } + + private GraphQLRequest GetRequest(string chainId, long startHeight, long endHeight) + { + return new GraphQLRequest + { + Query = + @"query($chainId:String,$startBlockHeight:Long!,$endBlockHeight:Long!,$maxMaxResultCount:Int!){ + poolLiquidityInfo(input: {chainId:$chainId,startBlockHeight:$startBlockHeight,endBlockHeight:$endBlockHeight,maxMaxResultCount:$maxMaxResultCount}){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + tokenSymbol, + liquidity, + liquidityType + } + }", + Variables = new + { + chainId = chainId, + startBlockHeight = startHeight, + endBlockHeight = endHeight, + maxMaxResultCount = MaxRequestCount + } + }; + } +} + +public class PoolLiquidityRecordInfoDto +{ + public List PoolLiquidityInfo { get; set; } +} + +public class PoolLiquidityInfo : GraphQLDto +{ + public string TokenSymbol { get; set; } + public long Liquidity { get; set; } + public LiquidityType LiquidityType { get; set; } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs new file mode 100644 index 0000000..1916dea --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using AElf.CrossChainServer.Worker.EvmIndexerSync; +using GraphQL; +using Microsoft.Extensions.Options; +using Serilog; +using Volo.Abp.Json; + +namespace AElf.CrossChainServer.Worker.IndexerSync; + +public class UserLiquidityIndexerSyncProvider : IndexerSyncProviderBase +{ + private readonly IUserLiquidityInfoAppService _userLiquidityInfoAppService; + private readonly ITokenAppService _tokenAppService; + private readonly EvmContractSyncOptions _evmContractSyncOptions; + + public UserLiquidityIndexerSyncProvider(IGraphQLClientFactory graphQlClientFactory, ISettingManager settingManager, + IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, IChainAppService chainAppService, + IUserLiquidityInfoAppService userLiquidityInfoAppService, ITokenAppService tokenAppService,IOptionsSnapshot evmContractSyncOptions) : base( + graphQlClientFactory, settingManager, jsonSerializer, indexerAppService, chainAppService) + { + _userLiquidityInfoAppService = userLiquidityInfoAppService; + _tokenAppService = tokenAppService; + _evmContractSyncOptions = evmContractSyncOptions.Value; + } + + public override bool RequiresRealTime { get; set; } = false; + protected override string SyncType { get; } = CrossChainServerSettings.UserLiquidityIndexerSync; + + protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight,bool isConfirmed) + { + Log.Debug( + "Start to sync user liquidity info {chainId} from {StartHeight} to {EndHeight}, isConfirmed:{isConfirmed}", + aelfChainId, startHeight, endHeight, isConfirmed); + if (!_evmContractSyncOptions.Enabled) + { + return 0; + } + Log.ForContext("chainId", aelfChainId).Debug( + "Start to sync user liquidity info {chainId} from {StartHeight} to {EndHeight}", + aelfChainId, startHeight, endHeight); + var data = await QueryDataAsync(GetRequest(aelfChainId, startHeight, endHeight)); + if (data == null || data.UserLiquidityInfo.Count == 0) + { + return endHeight; + } + + foreach (var userLiquidityRecord in data.UserLiquidityInfo) + { + Log.ForContext("chainId", userLiquidityRecord.ChainId).Debug( + "Start to handle user liquidity record info {ChainId},token {symbol},provider {provider}, liquidity type:{liquidityType}", + userLiquidityRecord.ChainId, userLiquidityRecord.TokenSymbol, userLiquidityRecord.Provider, + userLiquidityRecord.LiquidityType == LiquidityType.Add ? "Add" : "Remove"); + await HandleDataAsync(userLiquidityRecord); + } + + return endHeight; + } + + private async Task HandleDataAsync(UserLiquidityInfo userLiquidity) + { + var chain = await ChainAppService.GetByAElfChainIdAsync( + ChainHelper.ConvertBase58ToChainId(userLiquidity.ChainId)); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chain.Id, + Symbol = userLiquidity.TokenSymbol + }); + var input = new UserLiquidityInfoInput + { + ChainId = chain.Id, + Provider = userLiquidity.Provider, + Liquidity = userLiquidity.Liquidity / (decimal)Math.Pow(10, token.Decimals), + TokenId = token.Id + }; + switch (userLiquidity.LiquidityType) + { + case LiquidityType.Add: + await _userLiquidityInfoAppService.AddUserLiquidityAsync(input); + break; + case LiquidityType.Remove: + await _userLiquidityInfoAppService.RemoveUserLiquidityAsync(input); + break; + default: + throw new ArgumentOutOfRangeException(nameof(userLiquidity.LiquidityType), + "Unsupported liquidity type."); + } + } + + private GraphQLRequest GetRequest(string chainId, long startHeight, long endHeight) + { + return new GraphQLRequest + { + Query = + @"query($chainId:String,$startBlockHeight:Long!,$endBlockHeight:Long!,$maxMaxResultCount:Int!){ + userLiquidityInfo(input: {chainId:$chainId,startBlockHeight:$startBlockHeight,endBlockHeight:$endBlockHeight,maxMaxResultCount:$maxMaxResultCount}){ + id, + chainId, + blockHash, + blockHeight, + blockTime, + provider, + tokenSymbol, + liquidity, + liquidityType + } + }", + Variables = new + { + chainId = chainId, + startBlockHeight = startHeight, + endBlockHeight = endHeight, + maxMaxResultCount = MaxRequestCount + } + }; + } +} + +public class UserLiquidityRecordInfoDto +{ + public List UserLiquidityInfo { get; set; } +} + +public class UserLiquidityInfo : GraphQLDto +{ + public string Provider { get; set; } + public string TokenSymbol { get; set; } + public long Liquidity { get; set; } + public LiquidityType LiquidityType { get; set; } +} + +public enum LiquidityType +{ + Add, + Remove +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs new file mode 100644 index 0000000..622ee89 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; + +namespace AElf.CrossChainServer.Worker; + +public class TonIndexSyncOptions +{ + public bool IsEnable { get; set; } = true; + public Dictionary ContractAddress { get; set; } = new(); + public int SyncPeriod { get; set; } = 10 * 1000; // 10s + public int QueryDelayTime { get; set; } = 1000; // 1s +} + +public class ContractInfo +{ + public string BridgeContract { get; set; } + public List BridgePoolContract { get; set; } +} + +public class BridgePoolContractInfo +{ + public string TokenAddress { get; set; } + public string PoolAddress { get; set; } +} diff --git a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs new file mode 100644 index 0000000..2bd6346 --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs @@ -0,0 +1,357 @@ +using System; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Settings; +using AElf.CrossChainServer.Tokens; +using JetBrains.Annotations; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Nethereum.Util; +using Serilog; +using TonSdk.Core; +using TonSdk.Core.Boc; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class TonIndexSyncWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly IBlockchainAppService _blockchainAppService; + private readonly ISettingManager _settingManager; + private readonly IChainAppService _chainAppService; + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly TonIndexSyncOptions _tonIndexSyncOptions; + private readonly ICrossChainLimitAppService _crossChainLimitAppService; + + public TonIndexSyncWorker([NotNull] AbpAsyncTimer timer, [NotNull] IServiceScopeFactory serviceScopeFactory, + IBlockchainAppService blockchainAppService, ISettingManager settingManager, + IChainAppService chainAppService, ICrossChainTransferAppService crossChainTransferAppService, + ITokenAppService tokenAppService, IOptionsSnapshot tonIndexSyncOptions, + ICrossChainLimitAppService crossChainLimitAppService) : base( + timer, serviceScopeFactory) + { + _blockchainAppService = blockchainAppService; + _settingManager = settingManager; + _chainAppService = chainAppService; + _crossChainTransferAppService = crossChainTransferAppService; + _tokenAppService = tokenAppService; + _crossChainLimitAppService = crossChainLimitAppService; + _tonIndexSyncOptions = tonIndexSyncOptions.Value; + timer.Period = _tonIndexSyncOptions.SyncPeriod; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + if (!_tonIndexSyncOptions.IsEnable) + { + return; + } + + var chains = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.Tvm + }); + + foreach (var chain in chains.Items) + { + if (!_tonIndexSyncOptions.ContractAddress.TryGetValue(chain.Id, out var contract)) + { + continue; + } + + Log.Debug("Sync ton chain bridge contract:{contract}", contract.BridgeContract); + await HandleTonTransactionAsync(chain.Id, contract.BridgeContract); + foreach (var pool in contract.BridgePoolContract) + { + Log.Debug("Sync ton chain bridge pool contract:{contract}", pool.PoolAddress); + await HandleTonTransactionAsync(chain.Id, pool.PoolAddress, pool.TokenAddress); + } + } + } + + private async Task HandleTonTransactionAsync(string chainId, string contractAddress, string tokenAddress = null) + { + var settingKey = GetSettingKey(contractAddress); + var lastSyncLt = + await _settingManager.GetOrNullAsync(chainId, settingKey); + var txs = await _blockchainAppService.GetTonTransactionAsync(new GetTonTransactionInput + { + ChainId = chainId, + ContractAddress = contractAddress, + LatestTransactionLt = lastSyncLt + }); + + while (true) + { + if (!txs.Any() || (txs.Count == 1 && txs[0].Lt == lastSyncLt)) + { + break; + } + + foreach (var tx in txs) + { + if (tx.Lt == lastSyncLt) + { + continue; + } + + var txId = tx.Hash; + var traceId = tx.TraceId; + + foreach (var outMsg in tx.OutMsgs) + { + switch (outMsg.Opcode) + { + case CrossChainServerConsts.TonReceivedOpCode: + await ReceiveAsync(chainId, tx.McBlockSeqno, DateTimeHelper.FromUnixTimeSeconds(tx.Now), + outMsg, txId); + break; + case CrossChainServerConsts.TonTransferredOpCode: + await TransferAsync(chainId, tx.McBlockSeqno, DateTimeHelper.FromUnixTimeSeconds(tx.Now), + outMsg, traceId, txId); + break; + case CrossChainServerConsts.TonDailyLimitChangedOpCode: + await SetDailyLimitAsync(chainId, tokenAddress, outMsg); + break; + case CrossChainServerConsts.TonRateLimitChangedOpCode: + await SetRateLimitAsync(chainId, tokenAddress, outMsg); + break; + case CrossChainServerConsts.TonLimitConsumedOpCode: + await ConsumeLimitAsync(chainId, tokenAddress, outMsg); + break; + default: + continue; + } + } + } + + lastSyncLt = txs.Last().Lt; + await _settingManager.SetAsync(chainId, settingKey, lastSyncLt); + + // Avoid exceeding the request limit + await Task.Delay(_tonIndexSyncOptions.QueryDelayTime); + txs = await _blockchainAppService.GetTonTransactionAsync(new GetTonTransactionInput + { + ChainId = chainId, + LatestTransactionLt = lastSyncLt + }); + } + } + + private string GetSettingKey(string contractAddress) + { + return $"{CrossChainServerSettings.TonIndexTransactionSync}-{contractAddress}"; + } + + private async Task TransferAsync(string chainId, long blockHeight, DateTime blockTime, TonMessageDto outMessage, + string traceId, string txId) + { + Log.ForContext("chainId", chainId).Debug( + "Sync ton transfer.txId:{txId}", txId); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toChainId = (int)bodySlice.LoadInt(32); + var amount = bodySlice.LoadCoins().ToBigInt(); + var addInfo = bodySlice.LoadRef().Parse(); + var fromAddress = addInfo.LoadAddress(); + var tokenAddress = addInfo.LoadAddress(); + var toAddress = addInfo.LoadBytes(32); + var receipt = bodySlice.LoadRef(); + var receiptSlice = receipt.Parse(); + var keyHash = receiptSlice.LoadBytes(32).ToHex(); + var index = receiptSlice.LoadInt(64); + var receiptId = $"{keyHash}.{index}"; + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress.ToString() + }); + + var toChain = await _chainAppService.GetByAElfChainIdAsync(toChainId); + var from = TonAddressHelper.GetTonRawAddress(fromAddress.ToString()); + await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput + { + TraceId = traceId, + TransferTransactionId = txId, + FromAddress = from, + ReceiptId = receiptId, + ToAddress = Types.Address.FromBytes(toAddress).ToBase58(), + TransferAmount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)), + TransferTime = blockTime, + FromChainId = chainId, + ToChainId = toChain.Id, + TransferBlockHeight = blockHeight, + TransferTokenId = token.Id, + TransferStatus = ReceiptStatus.Confirmed + }); + } + + private async Task ReceiveAsync(string chainId, long blockHeight, DateTime blockTime, TonMessageDto outMessage, + string txId) + { + Log.ForContext("chainId", chainId).Debug( + "Sync ton receive.txId:{txId}", txId); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toAddress = bodySlice.LoadAddress(); + var tokenAddress = bodySlice.LoadAddress(); + var amount = bodySlice.LoadCoins().ToBigInt(); + var fromChainId = (int)bodySlice.LoadInt(32); + var receipt = bodySlice.LoadRef(); + var receiptSlice = receipt.Parse(); + var keyHash = receiptSlice.LoadBytes(32).ToHex(); + var index = receiptSlice.LoadUInt(256); + var receiptId = $"{keyHash}.{index}"; + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress.ToString() + }); + var fromChain = await _chainAppService.GetByAElfChainIdAsync(fromChainId); + var to = TonAddressHelper.GetTonRawAddress(toAddress.ToString()); + await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput + { + ReceiveTransactionId = txId, + ReceiptId = receiptId, + ToAddress = to, + FromChainId = fromChain.Id, + ToChainId = chainId, + ReceiveAmount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)), + ReceiveTime = blockTime, + ReceiveTokenId = token.Id, + ReceiveStatus = ReceiptStatus.Confirmed, + ReceiveBlockHeight = blockHeight + }); + } + + private async Task SetDailyLimitAsync(string chainId, string tokenAddress, TonMessageDto outMessage) + { + Log.ForContext("chainId", chainId).Debug("Start to set daily limit:{tokenAddress}", tokenAddress); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toChainId = (int)bodySlice.LoadInt(32); + var type = (CrossChainLimitType)(int)bodySlice.LoadUInt(1); + var remainAmount = bodySlice.LoadInt(256); + var refreshTime = bodySlice.LoadInt(64); + var limit = bodySlice.LoadInt(256); + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress + }); + + await _crossChainLimitAppService.SetCrossChainDailyLimitAsync(new SetCrossChainDailyLimitInput() + { + ChainId = chainId, + Type = type, + DailyLimit = (decimal)((BigDecimal)limit / BigInteger.Pow(10, token.Decimals)), + RefreshTime = (long)refreshTime, + RemainAmount = (decimal)((BigDecimal)remainAmount / BigInteger.Pow(10, token.Decimals)), + TokenId = token.Id, + TargetChainId = ChainHelper.ConvertChainIdToBase58(toChainId) + }); + } + + private async Task ConsumeLimitAsync(string chainId, string tokenAddress, TonMessageDto outMessage) + { + Log.ForContext("chainId", chainId).Debug("Start to consume limit:{tokenAddress}", tokenAddress); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toChainId = (int)bodySlice.LoadInt(32); + var type = (CrossChainLimitType)(int)bodySlice.LoadUInt(1); + var amount = bodySlice.LoadInt(256); + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress + }); + + await _crossChainLimitAppService.ConsumeCrossChainDailyLimitAsync(new ConsumeCrossChainDailyLimitInput + { + ChainId = chainId, + Type = type, + TargetChainId = ChainHelper.ConvertChainIdToBase58(toChainId), + TokenId = token.Id, + Amount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)) + }); + await _crossChainLimitAppService.ConsumeCrossChainRateLimitAsync(new ConsumeCrossChainRateLimitInput + { + ChainId = chainId, + Type = type, + TargetChainId = ChainHelper.ConvertChainIdToBase58(toChainId), + TokenId = token.Id, + Amount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)) + }); + } + + private async Task SetRateLimitAsync(string chainId, string tokenAddress, TonMessageDto outMessage) + { + Log.ForContext("chainId", chainId).Debug("Start to set rate limit:{tokenAddress}", tokenAddress); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toChainId = (int)bodySlice.LoadInt(32); + var type = (CrossChainLimitType)(int)bodySlice.LoadUInt(1); + var limitInfo = bodySlice.LoadRef().Parse(); + var currentAmount = limitInfo.LoadInt(256); + var capacity = limitInfo.LoadInt(256); + var isEnable = limitInfo.LoadInt(1) == 0 ? false : true; + var rate = limitInfo.LoadInt(256); + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress + }); + + await _crossChainLimitAppService.SetCrossChainRateLimitAsync(new SetCrossChainRateLimitInput() + { + ChainId = chainId, + Type = type, + TargetChainId = ChainHelper.ConvertChainIdToBase58(toChainId), + TokenId = token.Id, + Capacity = (decimal)((BigDecimal)capacity / BigInteger.Pow(10, token.Decimals)), + IsEnable = isEnable, + Rate = (decimal)((BigDecimal)rate / BigInteger.Pow(10, token.Decimals)), + CurrentAmount = (decimal)((BigDecimal)currentAmount / BigInteger.Pow(10, token.Decimals)), + }); + } + + private async Task ConsumeRateLimitAsync(string chainId, string tokenAddress, TonMessageDto outMessage) + { + Log.ForContext("chainId", chainId).Debug("Start to consume rate limit:{tokenAddress}", tokenAddress); + var body = Cell.From(outMessage.MessageContent.Body); + var bodySlice = body.Parse(); + var eventId = bodySlice.LoadUInt(32); + var toChainId = (int)bodySlice.LoadInt(32); + var type = (CrossChainLimitType)(int)bodySlice.LoadUInt(1); + var amount = bodySlice.LoadInt(256); + + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = chainId, + Address = tokenAddress + }); + + await _crossChainLimitAppService.ConsumeCrossChainRateLimitAsync(new ConsumeCrossChainRateLimitInput + { + ChainId = chainId, + Type = type, + TargetChainId = ChainHelper.ConvertChainIdToBase58(toChainId), + TokenId = token.Id, + Amount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)) + }); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/TransferAutoReceiveWorker.cs b/src/AElf.CrossChainServer.Worker/TransferAutoReceiveWorker.cs new file mode 100644 index 0000000..7f7fb8f --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/TransferAutoReceiveWorker.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class TransferAutoReceiveWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + + public TransferAutoReceiveWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + ICrossChainTransferAppService crossChainTransferAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, + serviceScopeFactory) + { + Timer.Period = workerSyncPeriodOptions.Value.AutoReceiveSyncPeriod; + _crossChainTransferAppService = crossChainTransferAppService; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + await _crossChainTransferAppService.UpdateReceiveTransactionAsync(); + await _crossChainTransferAppService.AutoReceiveAsync(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs b/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs new file mode 100644 index 0000000..18abf9d --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer.Worker; + +public class TransferProgressUpdateWorker : AsyncPeriodicBackgroundWorkerBase +{ + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + + public TransferProgressUpdateWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, + ICrossChainTransferAppService crossChainTransferAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, serviceScopeFactory) + { + _crossChainTransferAppService = crossChainTransferAppService; + Timer.Period = workerSyncPeriodOptions.Value.ProgressUpdatePeriod; + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + await _crossChainTransferAppService.UpdateProgressAsync(); + } +} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/WorkerSyncPeriodOptions.cs b/src/AElf.CrossChainServer.Worker/WorkerSyncPeriodOptions.cs new file mode 100644 index 0000000..7d9e48a --- /dev/null +++ b/src/AElf.CrossChainServer.Worker/WorkerSyncPeriodOptions.cs @@ -0,0 +1,11 @@ +namespace AElf.CrossChainServer.Worker; + +public class WorkerSyncPeriodOptions +{ + public int AutoReceiveSyncPeriod { get; set; } = 60 * 1000; // 1min + public int ProgressUpdatePeriod { get; set; } = 1000 * 10; // 10s + + public int CrossChainIndexingCleanPeriod { get; set; } = 1000 * 60 * 60; // 1h + public int CheckAElfConfirmedTransactionPeriod { get; set; } = 1000 * 60; // 1min + public int CheckEvmConfirmedTransactionPeriod { get; set; } = 1000 * 60; // 1min +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/AElf.CrossChainServer.Application.Tests.csproj b/test/AElf.CrossChainServer.Application.Tests/AElf.CrossChainServer.Application.Tests.csproj new file mode 100644 index 0000000..57f6efb --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/AElf.CrossChainServer.Application.Tests.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/test/AElf.CrossChainServer.Application.Tests/AssemblyInfo.cs b/test/AElf.CrossChainServer.Application.Tests/AssemblyInfo.cs new file mode 100644 index 0000000..41a898e --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs new file mode 100644 index 0000000..7a1f542 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs @@ -0,0 +1,23 @@ +using AElf.Client.Service; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Chains; + +public class AElfClientFactoryTests : CrossChainServerApplicationTestBase +{ + private readonly IBlockchainClientFactory _aelfClientFactory; + + public AElfClientFactoryTests() + { + _aelfClientFactory = GetRequiredService>(); + } + + [Fact] + public void GetClientTest() + { + + var client = _aelfClientFactory.GetClient("MainChain_AELF"); + client.ShouldNotBeNull(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/BlockchainAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/BlockchainAppServiceTests.cs new file mode 100644 index 0000000..747b8bb --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/BlockchainAppServiceTests.cs @@ -0,0 +1,38 @@ +using System.Threading.Tasks; +using Xunit; +using Shouldly; + +namespace AElf.CrossChainServer.Chains; + +public class BlockchainAppServiceTests: CrossChainServerApplicationTestBase +{ + private readonly IBlockchainAppService _blockchainAppService; + + public BlockchainAppServiceTests() + { + _blockchainAppService = GetRequiredService(); + } + + [Fact] + public async Task GetChainStatus_Test() + { + var chainStatus = await _blockchainAppService.GetChainStatusAsync("MainChain_AELF"); + chainStatus.ChainId.ShouldBe("MainChain_AELF"); + chainStatus.BlockHeight.ShouldBe(100); + chainStatus.ConfirmedBlockHeight.ShouldBe(90); + } + + [Fact] + public async Task GetTransactionResult_Test() + { + var transactionResult = await _blockchainAppService.GetTransactionResultAsync("MainChain_AELF","txid"); + transactionResult.ChainId.ShouldBe("MainChain_AELF"); + } + + [Fact] + public async Task GetMerklePath_Test() + { + var merklePath = await _blockchainAppService.GetMerklePathAsync("MainChain_AELF", "txid"); + merklePath.ShouldNotBeNull(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/ChainAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/ChainAppServiceTests.cs new file mode 100644 index 0000000..03caa72 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/ChainAppServiceTests.cs @@ -0,0 +1,66 @@ +using System.Threading.Tasks; +using AElf.Indexing.Elasticsearch; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Chains; + +public class ChainAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly IChainAppService _chainAppService; + private readonly IChainRepository _chainRepository; + private readonly INESTRepository _chainIndexRepository; + + public ChainAppServiceTests() + { + _chainAppService = GetRequiredService(); + _chainRepository = GetRequiredService(); + _chainIndexRepository = GetRequiredService>(); + } + + [Fact] + public async Task GetTest() + { + var chain = await _chainAppService.GetAsync("MainChain_AELF"); + chain.Id.ShouldBe("MainChain_AELF"); + chain.Name.ShouldBe("Main Chain AELF"); + + chain = await _chainAppService.GetByNameAsync("Main Chain AELF"); + chain.Id.ShouldBe("MainChain_AELF"); + chain.Name.ShouldBe("Main Chain AELF"); + + chain = await _chainAppService.GetByAElfChainIdAsync(9992731); + chain.Id.ShouldBe("MainChain_AELF"); + chain.Name.ShouldBe("Main Chain AELF"); + + await _chainIndexRepository.AddOrUpdateAsync(new ChainIndex + { + Id = "MainChain_AELF", + Name = "Main Chain AELF", + Type = BlockchainType.AElf + }); + + await _chainIndexRepository.AddOrUpdateAsync(new ChainIndex + { + Id = "SideChain_tDVV", + Name = "Side Chain tDVV", + Type = BlockchainType.AElf + }); + + await _chainIndexRepository.AddOrUpdateAsync(new ChainIndex + { + Id = "Ethereum", + Name = "Ethereum", + Type = BlockchainType.Evm + }); + + var chains = await _chainAppService.GetListAsync(new GetChainsInput()); + chains.Items.Count.ShouldBe(3); + + chains = await _chainAppService.GetListAsync(new GetChainsInput + { + Type = BlockchainType.AElf + }); + chains.Items.Count.ShouldBe(2); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/EvmClientFactoryTests.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/EvmClientFactoryTests.cs new file mode 100644 index 0000000..aa96b74 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/EvmClientFactoryTests.cs @@ -0,0 +1,21 @@ +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Chains; + +public class EvmClientFactoryTests : CrossChainServerApplicationTestBase +{ + private readonly IBlockchainClientFactory _factory; + + public EvmClientFactoryTests() + { + _factory = GetRequiredService>(); + } + + [Fact] + public void GetClientTest() + { + var client = _factory.GetClient("Ethereum"); + client.ShouldNotBeNull(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/MockAElfClientProvider.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/MockAElfClientProvider.cs new file mode 100644 index 0000000..e66c4b3 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/MockAElfClientProvider.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Chains; + +public class MockAElfClientProvider : IBlockchainClientProvider +{ + public BlockchainType ChainType { get; } = BlockchainType.AElf; + + public async Task GetTokenAsync(string chainId, string address, string symbol) + { + return new TokenDto + { + ChainId = chainId, + Address = "MockTokenAddress", + Symbol = symbol + }; + } + + public async Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + return new BlockDto + { + BlockHash = "BlockHash", + Header = new BlockHeaderDto + { + Height = height, + Time = DateTime.UtcNow.AddMinutes(-3).AddSeconds(height), + ChainId = chainId, + PreviousBlockHash = "PreviousBlockHash" + } + }; + } + + public Task GetChainHeightAsync(string chainId) + { + throw new System.NotImplementedException(); + } + + public Task GetChainStatusAsync(string chainId) + { + return Task.FromResult(new ChainStatusDto + { + ChainId = chainId, + BlockHeight = 100, + ConfirmedBlockHeight = 90 + }); + } + + public Task GetTransactionResultAsync(string chainId, string transactionId) + { + return Task.FromResult(new TransactionResultDto + { + ChainId = chainId, + BlockHeight = 100, + Transaction = new TransactionDto(), + BlockHash = "BlockHash", + IsFailed = false, + IsMined = true + }); + } + + public Task GetMerklePathAsync(string chainId, string txId) + { + return Task.FromResult(new MerklePathDto + { + MerklePathNodes = new List + { + new MerklePathNodeDto + { + Hash = "Hash", + IsLeftChildNode = true + } + } + }); + } + + public Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight) + { + throw new NotImplementedException(); + } + + public Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, long startHeight, long endHeight, + string logSignature) where TEventDTO : IEventDTO, new() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/MockEvmClientProvider.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/MockEvmClientProvider.cs new file mode 100644 index 0000000..cfd027f --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/MockEvmClientProvider.cs @@ -0,0 +1,70 @@ +using System.Threading.Tasks; +using AElf.Client.Dto; +using AElf.CrossChainServer.Tokens; +using Nethereum.ABI.FunctionEncoding.Attributes; + +namespace AElf.CrossChainServer.Chains; + +public class MockEvmClientProvider : IBlockchainClientProvider +{ + public BlockchainType ChainType { get; } = BlockchainType.Evm; + + public async Task GetTokenAsync(string chainId, string address, string symbol) + { + return new TokenDto + { + ChainId = chainId, + Address = address, + Symbol = "MockSymbol" + }; + } + + public Task GetBlockByHeightAsync(string chainId, long height, bool includeTransactions = false) + { + throw new System.NotImplementedException(); + } + + public Task GetChainHeightAsync(string chainId) + { + throw new System.NotImplementedException(); + } + + public async Task GetChainStatusAsync(string chainId) + { + return new ChainStatusDto + { + ChainId = chainId, + BlockHeight = 105, + ConfirmedBlockHeight = 100 + }; + } + + public Task GetTransactionResultAsync(string chainId, string transactionId) + { + return Task.FromResult(new TransactionResultDto + { + ChainId = chainId, + BlockHeight = 100, + Transaction = new TransactionDto(), + BlockHash = "BlockHash", + IsFailed = false, + IsMined = true + }); + } + + public Task GetMerklePathAsync(string chainId, string txId) + { + throw new System.NotImplementedException(); + } + + public Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, long endHeight) + { + throw new System.NotImplementedException(); + } + + public Task> GetContractLogsAndParseAsync(string chainId, string contractAddress, long startHeight, long endHeight, + string logSignature) where TEventDTO : IEventDTO, new() + { + throw new System.NotImplementedException(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainIndexingInfoAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainIndexingInfoAppServiceTests.cs new file mode 100644 index 0000000..c7d40b6 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainIndexingInfoAppServiceTests.cs @@ -0,0 +1,348 @@ +using System; +using System.Threading.Tasks; +using AElf.Indexing.Elasticsearch; +using Shouldly; +using Volo.Abp; +using Xunit; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainIndexingInfoAppServiceTests: CrossChainServerApplicationTestBase +{ + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly INESTRepository _nestRepository; + private readonly ICrossChainIndexingInfoRepository _crossChainIndexingInfoRepository; + + public CrossChainIndexingInfoAppServiceTests() + { + _crossChainIndexingInfoAppService = GetRequiredService(); + _nestRepository = GetRequiredService>(); + _crossChainIndexingInfoRepository = GetRequiredService(); + } + + [Fact] + public async Task CalculateCrossChainProgressTest() + { + var progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", + 100); + progress.ShouldBe(0); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "MainChain_AELF", + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 80, + IndexChainId = "MainChain_AELF", + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", + 100); + progress.ShouldBe(50); + } + + [Fact] + public async Task Calculate_IndexNotExist_Test() + { + var progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", + 100); + progress.ShouldBe(0); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 80, + IndexChainId = "MainChain_AELF", + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", + 100); + progress.ShouldBe(100); + } + + [Fact] + public async Task Calculate_IsAELF_Test() + { + var exception = await Assert.ThrowsAsync(async () => await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("Ethereum", "SideChain_tDVV", 100)); + exception.Message.ShouldContain("parameter chainId is not valid"); + } + + [Fact] + public async Task Homogeneous_MainToSide_Test() + { + var progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", 100, DateTime.UtcNow); + progress.ShouldBe(0); + + // 9992731->1866392 + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "MainChain_AELF", + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 80, + IndexChainId = "MainChain_AELF", + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(50); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 100, + IndexChainId = "MainChain_AELF", + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF", "SideChain_tDVV", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(100); + } + + [Fact] + public async Task Homogeneous_SideToMain_Test() + { + var progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "MainChain_AELF", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(0); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 100, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 20, + IndexChainId = "SideChain_tDVV" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 200, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 60, + IndexChainId = "SideChain_tDVV" + }); + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "MainChain_AELF", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(25); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 300, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 110, + IndexChainId = "SideChain_tDVV" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 120, + BlockTime = DateTime.UtcNow.AddSeconds(-15), + IndexBlockHeight = 200, + IndexChainId = "MainChain_AELF" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 120, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 250, + IndexChainId = "MainChain_AELF" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "MainChain_AELF", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(75); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 150, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 300, + IndexChainId = "MainChain_AELF" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "MainChain_AELF", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(100); + } + + [Fact] + public async Task Homogeneous_SideToSide_Test() + { + // 1866392->1931928 + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "SideChain_tDVV" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 80, + IndexChainId = "SideChain_tDVV" + }); + + var progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "SideChain_tDVW", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(25); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 100, + IndexChainId = "SideChain_tDVV" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "SideChain_tDVW", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(50); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVW", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow.AddSeconds(-5), + IndexBlockHeight = 90000, + IndexChainId = "MainChain_AELF" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVW", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 95000, + IndexChainId = "MainChain_AELF" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "SideChain_tDVW", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(50); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 100000, + IndexChainId = "MainChain_AELF" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "SideChain_tDVW", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(75); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVW", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 100000, + IndexChainId = "MainChain_AELF" + }); + + progress = + await _crossChainIndexingInfoAppService.CalculateCrossChainProgressAsync("SideChain_tDVV", "SideChain_tDVW", 100, DateTime.UtcNow.AddSeconds(-10)); + progress.ShouldBe(100); + } + + [Fact] + public async Task CleanTest() + { + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "SideChain_tDVV" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 99001, + BlockTime = DateTime.UtcNow.AddMinutes(-4), + IndexBlockHeight = 61, + IndexChainId = "SideChain_tDVV" + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 99002, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 62, + IndexChainId = "SideChain_tDVV" + }); + + var list = await _crossChainIndexingInfoRepository.GetListAsync(); + list.Count.ShouldBe(3); + + await _crossChainIndexingInfoAppService.CleanAsync(DateTime.UtcNow.AddMinutes(-1)); + + list = await _crossChainIndexingInfoRepository.GetListAsync(); + list.Count.ShouldBe(1); + list[0].IndexBlockHeight.ShouldBe(62); + } + + [Fact] + public async Task Create_Repeat_Test() + { + var input = new CreateCrossChainIndexingInfoInput + { + ChainId = "MainChain_AELF", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "SideChain_tDVV" + }; + + await _crossChainIndexingInfoAppService.CreateAsync(input); + await _crossChainIndexingInfoAppService.CreateAsync(input); + + var list = await _crossChainIndexingInfoRepository.GetListAsync(); + list.Count.ShouldBe(1); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitAppServiceTest.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitAppServiceTest.cs new file mode 100644 index 0000000..f47cceb --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitAppServiceTest.cs @@ -0,0 +1,168 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.Tokens; +using AElf.Indexing.Elasticsearch; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainLimitAppServiceTest: CrossChainServerApplicationTestBase +{ + private readonly ICrossChainLimitAppService _crossChainLimitAppService; + private readonly ITokenAppService _tokenAppService; + private readonly INESTRepository _crossChainRateLimitIndexRepository; + private readonly INESTRepository _crossChainDailyLimitIndexRepository; + + public CrossChainLimitAppServiceTest() + { + _crossChainRateLimitIndexRepository = GetRequiredService>(); + _crossChainDailyLimitIndexRepository = GetRequiredService>(); + _crossChainLimitAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task RateLimitTest() + { + var token = await _tokenAppService.CreateAsync(new TokenCreateInput + { + ChainId = "Ton", + Decimals = 6, + Symbol = "USDT", + Address = "USDTAddress" + }); + + var setInput = new SetCrossChainRateLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + Capacity = 100, + IsEnable = true, + Rate = 20, + CurrentAmount = 20, + TokenId = token.Id + }; + + await _crossChainLimitAppService.SetCrossChainRateLimitAsync(setInput); + + var limit = await _crossChainRateLimitIndexRepository.GetListAsync(); + limit.Item2.Count.ShouldBe(1); + limit.Item2[0].ChainId.ShouldBe(setInput.ChainId); + limit.Item2[0].Type.ShouldBe(setInput.Type); + limit.Item2[0].TargetChainId.ShouldBe(setInput.TargetChainId); + limit.Item2[0].Capacity.ShouldBe(setInput.Capacity); + limit.Item2[0].IsEnable.ShouldBe(setInput.IsEnable); + limit.Item2[0].Rate.ShouldBe(setInput.Rate); + limit.Item2[0].CurrentAmount.ShouldBe(setInput.CurrentAmount); + limit.Item2[0].Token.Id.ShouldBe(token.Id); + + setInput = new SetCrossChainRateLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + Capacity = 200, + IsEnable = true, + Rate = 20, + CurrentAmount = 50, + TokenId = token.Id + }; + + await _crossChainLimitAppService.SetCrossChainRateLimitAsync(setInput); + + limit = await _crossChainRateLimitIndexRepository.GetListAsync(); + limit.Item2.Count.ShouldBe(1); + limit.Item2[0].ChainId.ShouldBe(setInput.ChainId); + limit.Item2[0].Type.ShouldBe(setInput.Type); + limit.Item2[0].TargetChainId.ShouldBe(setInput.TargetChainId); + limit.Item2[0].Capacity.ShouldBe(setInput.Capacity); + limit.Item2[0].IsEnable.ShouldBe(setInput.IsEnable); + limit.Item2[0].Rate.ShouldBe(setInput.Rate); + limit.Item2[0].CurrentAmount.ShouldBe(setInput.CurrentAmount); + limit.Item2[0].Token.Id.ShouldBe(token.Id); + + await _crossChainLimitAppService.ConsumeCrossChainRateLimitAsync(new ConsumeCrossChainRateLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + TokenId = token.Id, + Amount = 10 + }); + + limit = await _crossChainRateLimitIndexRepository.GetListAsync(); + limit.Item2[0].CurrentAmount.ShouldBe(40); + } + + [Fact] + public async Task DailyLimitTest() + { + var token = await _tokenAppService.CreateAsync(new TokenCreateInput + { + ChainId = "Ton", + Decimals = 6, + Symbol = "USDT", + Address = "USDTAddress" + }); + + var setInput = new SetCrossChainDailyLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + TokenId = token.Id, + RefreshTime = 100, + DailyLimit = 100, + RemainAmount = 20 + }; + + await _crossChainLimitAppService.SetCrossChainDailyLimitAsync(setInput); + + var limit = await _crossChainDailyLimitIndexRepository.GetListAsync(); + limit.Item2.Count.ShouldBe(1); + limit.Item2[0].ChainId.ShouldBe(setInput.ChainId); + limit.Item2[0].Type.ShouldBe(setInput.Type); + limit.Item2[0].TargetChainId.ShouldBe(setInput.TargetChainId); + limit.Item2[0].RefreshTime.ShouldBe(setInput.RefreshTime); + limit.Item2[0].DailyLimit.ShouldBe(setInput.DailyLimit); + limit.Item2[0].RemainAmount.ShouldBe(setInput.RemainAmount); + limit.Item2[0].Token.Id.ShouldBe(token.Id); + + setInput = new SetCrossChainDailyLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + RefreshTime = 200, + DailyLimit = 200, + RemainAmount = 50, + TokenId = token.Id + }; + + await _crossChainLimitAppService.SetCrossChainDailyLimitAsync(setInput); + + limit = await _crossChainDailyLimitIndexRepository.GetListAsync(); + limit.Item2.Count.ShouldBe(1); + limit.Item2[0].ChainId.ShouldBe(setInput.ChainId); + limit.Item2[0].Type.ShouldBe(setInput.Type); + limit.Item2[0].TargetChainId.ShouldBe(setInput.TargetChainId); + limit.Item2[0].RefreshTime.ShouldBe(setInput.RefreshTime); + limit.Item2[0].DailyLimit.ShouldBe(setInput.DailyLimit); + limit.Item2[0].RemainAmount.ShouldBe(setInput.RemainAmount); + limit.Item2[0].Token.Id.ShouldBe(token.Id); + + await _crossChainLimitAppService.ConsumeCrossChainDailyLimitAsync(new ConsumeCrossChainDailyLimitInput + { + ChainId = "Ton", + Type = CrossChainLimitType.Receipt, + TargetChainId = "AELF", + TokenId = token.Id, + Amount = 10 + }); + + limit = await _crossChainDailyLimitIndexRepository.GetListAsync(); + limit.Item2[0].RemainAmount.ShouldBe(40); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs new file mode 100644 index 0000000..f734a44 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs @@ -0,0 +1,440 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using AElf.Client.Proto; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using NSubstitute; +using Volo.Abp.ObjectMapping; +using Xunit; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainLimitInfoAppServiceTest +{ + private readonly ILogger _mockLogger; + private readonly CrossChainLimitInfoAppService _service; + private readonly IObjectMapper _mockObjectMapper; + private readonly IIndexerCrossChainLimitInfoService _mockIndexerCrossChainLimitInfoService; + private readonly IBridgeContractAppService _mockBridgeContractAppService; + private readonly ITokenAppService _mockTokenAppService; + private readonly IChainAppService _mockChainAppService; + private readonly IOptionsMonitor _mockCrossChainLimitsOptions; + private readonly ITokenSymbolMappingProvider _mockTokenSymbolMappingProvider; + private readonly ICrossChainLimitAppService _mockCrossChainLimitAppService; + + public CrossChainLimitInfoAppServiceTest() + { + _mockObjectMapper = Substitute.For(); + _mockIndexerCrossChainLimitInfoService = Substitute.For(); + _mockBridgeContractAppService = Substitute.For(); + _mockTokenAppService = Substitute.For(); + _mockChainAppService = Substitute.For(); + _mockCrossChainLimitsOptions = Substitute.For>(); + _mockTokenSymbolMappingProvider = Substitute.For(); + _mockCrossChainLimitAppService = Substitute.For(); + + _service = new CrossChainLimitInfoAppService( + _mockIndexerCrossChainLimitInfoService, + _mockTokenAppService, + _mockChainAppService, + _mockCrossChainLimitsOptions, + _mockTokenSymbolMappingProvider, + _mockCrossChainLimitAppService + ); + } + + [Fact] + public async void GetCrossChainDailyLimitsAsyncTest() + { + // Arrange + var expectedDtoList = MockIndexerCrossChainLimitInfos(); + + _mockIndexerCrossChainLimitInfoService.GetAllCrossChainLimitInfoIndexAsync() + .Returns(expectedDtoList); + + _mockCrossChainLimitsOptions.CurrentValue.Returns(MockEthChainIdsOptions()); + + MockChainAppService(); + + MockTokenAppService(); + + // Act + var result = await _service.GetCrossChainDailyLimitsAsync(); + + var elfToken = result.Items.Where(r => r.Token.Equals("ELF")).Select(r => r.Allowance).FirstOrDefault(); + + Assert.Equal(new decimal(0.2010), elfToken); + + var firstToken = result.Items.Select(r => r.Token).FirstOrDefault(); + + //sort of ELF is first + Assert.Equal("ELF", firstToken); + } + + + [Fact] + public async void GetCrossChainRateLimitsAsyncTest() + { + // Arrange + var crossChainLimitInfos = MockIndexerCrossChainLimitInfos(); + _mockIndexerCrossChainLimitInfoService.GetAllCrossChainLimitInfoIndexAsync() + .Returns(crossChainLimitInfos); + + _mockCrossChainLimitsOptions.CurrentValue.Returns(MockEthChainIdsOptions()); + + + MockChainAppService(); + + MockTokenAppService(); + + MockBridgeContractAppService(); + + MockTokenSymbolMappingProvider(); + + MockCrossChainLimitAppService(); + + // Act + var result = await _service.GetCrossChainRateLimitsAsync(); + + // Assert + Assert.Equal(6, result.Items.Count); + } + + + private CrossChainLimitsOptions MockEthChainIdsOptions() + { + var evmTokensOptions = new CrossChainLimitsOptions + { + ChainIdInfo = new ChainIdInfo + { + TokenFirstChainId = "Sepolia", + ToChainIds = new List + { + "AELF","tDVV" + } + }, + + TokenSortRules = new Dictionary() + { + {"BTC", 0}, + {"ELF", 1}, + {"USDT", 2}, + {"USDC", 3} + }, + + ChainSortRules = new Dictionary() + { + {"Sepolia-AELF", 1}, + {"Sepolia-tDVV", 2}, + {"AELF-Sepolia", 3}, + {"tDVW-Sepolia", 4}, + {"BSC-AELF", 5}, + {"BSC-tDVV", 6}, + {"AELF-BSC", 7}, + {"tDVV-BSC", 8} + } + }; + return evmTokensOptions; + } + + private List MockIndexerCrossChainLimitInfos() + { + var fromToChainJsonArray = @"[ + { + ""FromChainId"": ""BSCTest"", + ""ToChainId"": ""AELF"" + }, + { + ""FromChainId"": ""AELF"", + ""ToChainId"": ""BSCTest"" + }, + { + ""FromChainId"": ""AELF"", + ""ToChainId"": ""Sepolia"" + }, + { + ""FromChainId"": ""Sepolia"", + ""ToChainId"": ""AELF"" + }, + { + ""FromChainId"": ""tDVV"", + ""ToChainId"": ""BSCTest"" + }, + { + ""FromChainId"": ""BSCTest"", + ""ToChainId"": ""tDVV"" + }, + { + ""FromChainId"": ""tDVV"", + ""ToChainId"": ""Sepolia"" + }, + { + ""FromChainId"": ""Sepolia"", + ""ToChainId"": ""tDVV"" + }, + { + ""FromChainId"": ""AELF"", + ""ToChainId"": ""Ton"" + }, + { + ""FromChainId"": ""tDVV"", + ""ToChainId"": ""Ton"" + }, + { + ""FromChainId"": ""Ton"", + ""ToChainId"": ""AELF"" + }, + { + ""FromChainId"": ""Ton"", + ""ToChainId"": ""tDVV"" + } + ]"; + var fromToChainList = JsonSerializer.Deserialize>(fromToChainJsonArray); + var aelfChains = new HashSet { "AELF", "tDVV" }; + var tokenList = new List(new [] { "ELF", "USDT"}); + var crossChainLimitInfos = new List(); + for (var i = 0; i < tokenList.Count; i++) + { + for (var j = 0; j < fromToChainList.Count; j++) + { + var limit = fromToChainList[j]; + var t = (i + j) * 10000; + var info = new IndexerCrossChainLimitInfo(); + info.FromChainId = limit.FromChainId; + info.ToChainId = limit.ToChainId; + info.LimitType = aelfChains.Contains(info.ToChainId) ? CrossChainLimitType.Swap : CrossChainLimitType.Receipt; + info.Symbol = tokenList[i]; + info.DefaultDailyLimit = 10000000 + t; + info.RefreshTime = DateTime.UtcNow; + info.CurrentDailyLimit = 8000000 + t; + info.Capacity = 5000000 + t; + info.RefillRate = 100000 + t; + info.IsEnable = true; + info.CurrentBucketTokenAmount = 2500000 + t; + info.BucketUpdateTime = DateTime.UtcNow; + info.Id = info.FromChainId + "-" + info.ToChainId + "-" + info.Symbol; + crossChainLimitInfos.Add(info); + } + } + return crossChainLimitInfos; + } + + private void MockChainAppService() + { + var aelfChain = new ChainDto + { + Id = "MainChain_AELF", + IsMainChain = true, + Type = BlockchainType.AElf, + BlockChain = "AElf", + AElfChainId = 9992731 + }; + + var tDVVChain = new ChainDto + { + Id = "SideChain_tDVV", + IsMainChain = false, + Type = BlockchainType.AElf, + BlockChain = "AElf", + AElfChainId = 1866392 + + }; + _mockChainAppService.GetAsync(Arg.Is(s => "MainChain_AELF".Contains(s))) + .Returns(aelfChain); + _mockChainAppService.GetAsync(Arg.Is(s => "SideChain_tDVV".Contains(s))) + .Returns(tDVVChain); + _mockChainAppService.GetAsync(Arg.Is(s => "Sepolia".Contains(s))) + .Returns(new ChainDto + { + Id = "Sepolia", + IsMainChain = true, + Type = BlockchainType.Evm, + BlockChain = "ETH" + }); + + _mockChainAppService.GetAsync(Arg.Is(s => "BSCTest".Contains(s))) + .Returns(new ChainDto + { + Id = "BSCTest", + IsMainChain = true, + Type = BlockchainType.Evm, + BlockChain = "BSC" + }); + + _mockChainAppService.GetAsync(Arg.Is(s => "Ton".Contains(s))) + .Returns(new ChainDto + { + Id = "Ton", + IsMainChain = true, + Type = BlockchainType.Tvm, + BlockChain = "Ton" + }); + + _mockChainAppService.GetByAElfChainIdAsync(Arg.Is(s => s == 9992731)) + .Returns(aelfChain); + _mockChainAppService.GetByAElfChainIdAsync(Arg.Is(s => s == 1866392)) + .Returns(aelfChain); + } + + private void MockTokenAppService() + { + + var tokenDict = new Dictionary + { + { "ELF", 8 }, + { "USDT", 6 } + }; + + var chainIds = new HashSet { "MainChain_AELF", "SideChain_tDVV", "Sepolia" ,"BSCTest", "Ton"}; + + foreach (var token in tokenDict) + { + + foreach (var chainId in chainIds) + { + _mockTokenAppService + .GetAsync(Arg.Is(input => chainId.Contains(input.ChainId) + && (input.Symbol == token.Key || input.Address.Contains(chainId)))) + .Returns(new TokenDto + { + Symbol = token.Key, Id = new Guid(), Decimals = token.Value + }); + } + + } + } + + private void MockTokenSymbolMappingProvider() + { + + var symbols = new HashSet { "ELF", "USDT", "BTC" ,"USDC"}; + + foreach (var symbol in symbols) + { + _mockTokenSymbolMappingProvider + .GetMappingSymbol(Arg.Any(), Arg.Any(), symbol) + .Returns(symbol); + } + } + + private void MockBridgeContractAppService() + { + _mockBridgeContractAppService + .GetCurrentReceiptTokenBucketStatesAsync(Arg.Is("Sepolia"), Arg.Any>(), Arg.Any>()) + .Returns(new List() + { + new() + { + Capacity = 121, + RefillRate = 102, + MaximumTimeConsumed = 3 + } + }); + + _mockBridgeContractAppService + .GetCurrentSwapTokenBucketStatesAsync(Arg.Is("Sepolia"), Arg.Any>(), Arg.Any>()) + .Returns(new List() + { + new() + { + Capacity = 122, + RefillRate = 103, + MaximumTimeConsumed = 4 + } + }); + + + _mockBridgeContractAppService + .GetCurrentReceiptTokenBucketStatesAsync(Arg.Is("BSCTest"), Arg.Any>(), Arg.Any>()) + .Returns(new List() + { + new() + { + Capacity = 121, + RefillRate = 102, + MaximumTimeConsumed = 3 + } + }); + + _mockBridgeContractAppService + .GetCurrentSwapTokenBucketStatesAsync(Arg.Is("BSCTest"), Arg.Any>(), Arg.Any>()) + .Returns(new List() + { + new() + { + Capacity = 122, + RefillRate = 103, + MaximumTimeConsumed = 4 + } + }); + } + + private void MockCrossChainLimitAppService() + { + _mockCrossChainLimitAppService.GetCrossChainRateLimitsAsync().Returns(new List + { + new() + { + TargetChainId = "AELF", + Capacity = 7000, + CurrentAmount = 700, + Type = CrossChainLimitType.Receipt, + Token = new TokenDto + { + Symbol = "USDT" + }, + ChainId = "Ton", + IsEnable = true, + Rate = 70 + }, + new() + { + TargetChainId = "tDVV", + Capacity = 7100, + CurrentAmount = 710, + Type = CrossChainLimitType.Receipt, + Token = new TokenDto + { + Symbol = "USDT" + }, + ChainId = "Ton", + IsEnable = true, + Rate = 71 + }, + new() + { + TargetChainId = "AELF", + Capacity = 7200, + CurrentAmount = 720, + Type = CrossChainLimitType.Swap, + Token = new TokenDto + { + Symbol = "USDT" + }, + ChainId = "Ton", + IsEnable = true, + Rate = 72 + }, + new() + { + TargetChainId = "tDVV", + Capacity = 7300, + CurrentAmount = 730, + Type = CrossChainLimitType.Swap, + Token = new TokenDto + { + Symbol = "USDT" + }, + ChainId = "Ton", + IsEnable = true, + Rate = 73 + } + }); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs new file mode 100644 index 0000000..b85be69 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs @@ -0,0 +1,1051 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.Tokens; +using Shouldly; +using Volo.Abp.Validation; +using Xunit; + +namespace AElf.CrossChainServer.CrossChain; + +public class CrossChainTransferAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly ICrossChainTransferRepository _crossChainTransferRepository; + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; + private readonly IAetherLinkProvider _aetherLinkProvider; + private readonly IIndexerAppService _indexerAppService; + + public CrossChainTransferAppServiceTests() + { + _crossChainTransferRepository = GetRequiredService(); + _crossChainTransferAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + _crossChainIndexingInfoAppService = GetRequiredService(); + _aetherLinkProvider = GetRequiredService(); + _indexerAppService = GetRequiredService(); + } + + [Fact] + public async Task HomogeneousTransferTest() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "SideChain_tDVV", + Symbol = "ELF" + }); + + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Homogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Pending); + + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Homogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(0); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 99000, + BlockTime = DateTime.UtcNow.AddMinutes(-5), + IndexBlockHeight = 60, + IndexChainId = "MainChain_AELF", + }); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 80, + IndexChainId = "MainChain_AELF", + }); + + await _crossChainTransferAppService.UpdateProgressAsync(); + + var exception = await Assert.ThrowsAsync(async () => await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + FromChainId = "FromChainId_FromChainId", + ToChainId = "ToChainId_ToChainId_ToChainId", + FromAddress = "FromAddress_FromAddress_FromAddress_FromAddress_FromAddress_FromAddress_FromAddress_FromAddress", + ToAddress = "ToAddress_ToAddress_ToAddress_ToAddress_ToAddress_ToAddress_ToAddress_ToAddress_ToAddress" + })); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("FromChainId"))); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("ToChainId"))); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("FromAddress"))); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("ToAddress"))); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(50); + + var guidList = new List(); + for (int i = 0; i < 11; i++) + { + guidList.Add(new Guid()); + } + exception = await Assert.ThrowsAsync(async () => await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = guidList + })); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("Ids"))); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(50); + + await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexingInfoInput + { + ChainId = "SideChain_tDVV", + BlockHeight = 100000, + BlockTime = DateTime.UtcNow, + IndexBlockHeight = 120, + IndexChainId = "MainChain_AELF", + }); + + await Task.Delay(1000); + await _crossChainTransferAppService.UpdateProgressAsync(); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + ReceiveTransactionId = "ReceiveTransactionId", + TransferTransactionId = "TransferTransactionId", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 110, + ReceiveStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Pending); + + await _crossChainTransferAppService.CheckReceiveTransactionConfirmedAsync("SideChain_tDVV"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Confirmed); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + [Fact] + public async Task HeterogeneousTransfer_ETH_To_AELF_Test() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ethereum", + Symbol = "ELF" + }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "ELF" + }); + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + ReceiptId = "ReceiptId", + FromChainId = "Ethereum", + ToChainId = "MainChain_AELF", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Pending); + + await _crossChainTransferAppService.CheckEvmTransferTransactionConfirmedAsync("Ethereum"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(0); + + await _crossChainTransferAppService.UpdateProgressAsync(); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(50); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "Ethereum", + ToChainId = "MainChain_AELF", + ReceiveTransactionId = "ReceiveTransactionId", + TransferTransactionId = "TransferTransactionId", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 110, + ReceiveStatus = ReceiptStatus.Pending, + ReceiptId = "ReceiptId" + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Pending); + + await _crossChainTransferAppService.CheckReceiveTransactionConfirmedAsync("MainChain_AELF"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Confirmed); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + [Fact] + public async Task HeterogeneousTransfer_AELF_To_ETH_Test() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "ELF" + }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ethereum", + Symbol = "ELF" + }); + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + ReceiptId = "ReceiptId", + ToChainId = "Ethereum", + FromChainId = "MainChain_AELF", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Pending); + list.Items[0].ReceiptId.ShouldBe(input.ReceiptId); + + + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(0); + + await _crossChainTransferAppService.UpdateProgressAsync(); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(50); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "MainChain_AELF", + ToChainId = "Ethereum", + ReceiveTransactionId = "ReceiveTransactionId", + TransferTransactionId = "TransferTransactionId", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 100, + ReceiveStatus = ReceiptStatus.Pending, + ReceiptId = "ReceiptId" + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Pending); + + await _crossChainTransferAppService.CheckEvmReceiveTransactionConfirmedAsync("Ethereum"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Confirmed); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + + [Fact] + public async Task HeterogeneousTransfer_AELF_To_TON_Test() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "ELF" + }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ton", + Symbol = "ELF" + }); + + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + FromChainId = "MainChain_AELF", + ToChainId = "Ton", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiptId = "ReceiptId", + TransferTransactionId = "txID", + TraceId = "TraceId", + TransferStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].ReceiptId.ShouldBe(input.ReceiptId); + list.Items[0].TraceId.ShouldBe(input.TraceId); + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(0); + + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); + + await _crossChainTransferAppService.UpdateProgressAsync(); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(50); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "MainChain_AELF", + ToChainId = "Ton", + ReceiveTransactionId = "ReceiveTransactionId", + TransferTransactionId = "txID", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 110, + ReceiptId = "ReceiptId", + ReceiveStatus = ReceiptStatus.Confirmed + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + [Fact] + public async Task HeterogeneousTransfer_TON_To_AELF_Test() + { + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="SideChain_tDVV", + Symbol = "ELF" + }); + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ton", + Symbol = "ELF" + }); + + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + FromChainId = "Ton", + ToChainId = "SideChain_tDVV", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiptId = "ReceiptId", + TransferTransactionId = "txID", + TraceId = "TraceId", + TransferStatus = ReceiptStatus.Confirmed + }; + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(0); + list.Items[0].Progress.ShouldBe(0); + list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].ReceiveToken.ShouldBeNull(); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].ReceiptId.ShouldBe(input.ReceiptId); + list.Items[0].TraceId.ShouldBe(input.TraceId); + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(0); + + await _crossChainTransferAppService.UpdateProgressAsync(); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(50); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "Ton", + ToChainId = "SideChain_tDVV", + ReceiveTransactionId = "ReceiveTransactionId", + TransferTransactionId = "txID", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + ReceiptId = "ReceiptId", + ReceiveStatus = ReceiptStatus.Pending, + ReceiveBlockHeight = 110 + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Pending); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + + await _crossChainTransferAppService.CheckReceiveTransactionConfirmedAsync("SideChain_tDVV"); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].ReceiveStatus.ShouldBe(ReceiptStatus.Confirmed); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + [Fact] + public async Task ReceiveFirstTest() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "ELF" + }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ethereum", + Symbol = "ELF" + }); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "MainChain_AELF", + ToChainId = "Ethereum", + ReceiveTransactionId = "ReceiveTransactionId", + ReceiptId = "ReceiptId", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + ReceiveBlockHeight = 100, + ReceiveStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveAmount.ShouldBe(receiveInput.ReceiveAmount); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + list.Items[0].FromAddress.ShouldBe(receiveInput.FromAddress); + list.Items[0].ToAddress.ShouldBe(receiveInput.ToAddress); + list.Items[0].FromChainId.ShouldBe(receiveInput.FromChainId); + list.Items[0].ToChainId.ShouldBe(receiveInput.ToChainId); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + + var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + FromChainId = "MainChain_AELF", + ToChainId = "Ethereum", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiptId = "ReceiptId", + TransferStatus = ReceiptStatus.Pending + }; + await _crossChainTransferAppService.TransferAsync(input); + await _crossChainTransferAppService.CheckEvmReceiveTransactionConfirmedAsync("Ethereum"); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + list.Items.Count.ShouldBe(1); + list.Items[0].TransferAmount.ShouldBe(input.TransferAmount); + list.Items[0].ReceiveAmount.ShouldBe(100); + list.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + list.Items[0].FromAddress.ShouldBe(input.FromAddress); + list.Items[0].ToAddress.ShouldBe(input.ToAddress); + list.Items[0].FromChainId.ShouldBe(input.FromChainId); + list.Items[0].ToChainId.ShouldBe(input.ToChainId); + list.Items[0].TransferBlockHeight.ShouldBe(input.TransferBlockHeight); + list.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(input.TransferTime)); + list.Items[0].ReceiptId.ShouldBe(input.ReceiptId); + list.Items[0].Progress.ShouldBe(100); + list.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(receiveInput.ReceiveTime)); + list.Items[0].ReceiveTransactionId.ShouldBe(receiveInput.ReceiveTransactionId); + list.Items[0].Status.ShouldBe(CrossChainStatus.Received); + list.Items[0].ReceiveToken.Id.ShouldBe(tokenReceived.Id); + + status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + { + Ids = { list.Items[0].Id } + }); + status.Items.Count.ShouldBe(1); + status.Items[0].Progress.ShouldBe(100); + } + + [Fact] + public async Task GetListTest() + { + var transfers = new List(); + transfers.Add(new CrossChainTransfer + { + FromAddress = "FromAddress1", + ToAddress = "ToAddress1", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "FromAddress2", + ToAddress = "ToAddress2", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVW", + Status = CrossChainStatus.Received, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "FromAddress3", + ToAddress = "ToAddress3", + FromChainId = "SideChain_tDVW", + ToChainId = "Ethereum", + Status = CrossChainStatus.Transferred, + Type = CrossChainType.Heterogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "ToAddress3", + ToAddress = "FromAddress1", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "ToAddress1", + ToAddress = "FromAddress2", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "ToAddress1", + ToAddress = "FromAddress3", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "FromAddress2", + ToAddress = "ToAddress3", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "FromAddress1", + ToAddress = "ToAddress3", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + transfers.Add(new CrossChainTransfer + { + FromAddress = "ToAddress1", + ToAddress = "FromAddress1", + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + Status = CrossChainStatus.Indexed, + Type = CrossChainType.Homogeneous, + }); + await _crossChainTransferRepository.InsertManyAsync(transfers); + + var list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(9); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + FromAddress = "FromAddress1", + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(2); + list.Items[0].FromAddress.ShouldBe("FromAddress1"); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + ToAddress = "ToAddress1", + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(1); + list.Items[0].ToAddress.ShouldBe("ToAddress1"); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + FromChainId = "SideChain_tDVW", + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(1); + list.Items[0].FromChainId.ShouldBe("SideChain_tDVW"); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + ToChainId = "Ethereum", + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(1); + list.Items[0].ToChainId.ShouldBe("Ethereum"); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + Status = CrossChainStatus.Indexed, + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(7); + list.Items[0].Status.ShouldBe(CrossChainStatus.Indexed); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + Type = CrossChainType.Heterogeneous, + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(1); + list.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + Addresses = "FromAddress1,ToAddress1,FromAddress2,ToAddress2", + MaxResultCount = 10 + }); + list.TotalCount.ShouldBe(8); + + } + + [Fact] + public async Task Transfer_Repeat_Test() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "ELF" + }); + + var input = new CrossChainTransferInput + { + TransferAmount = 100, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTokenId = tokenTransfer.Id, + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + TransferTransactionId = "TransferTransactionId" + }; + await _crossChainTransferAppService.TransferAsync(input); + await _crossChainTransferAppService.TransferAsync(input); + + var list = await _crossChainTransferRepository.GetListAsync(); + list.Count.ShouldBe(1); + } + + [Fact] + public async Task Receive_Repeat_Test() + { + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ethereum", + Symbol = "ELF" + }); + + var receiveInput = new CrossChainReceiveInput + { + ReceiveTime = DateTime.UtcNow, + FromChainId = "MainChain_AELF", + ToChainId = "Ethereum", + ReceiveTransactionId = "ReceiveTransactionId", + ReceiptId = "ReceiptId", + ReceiveAmount = 100, + ReceiveTokenId = tokenReceived.Id, + FromAddress = "FromAddress", + ToAddress = "ToAddress", + }; + await _crossChainTransferAppService.ReceiveAsync(receiveInput); + + var list = await _crossChainTransferRepository.GetListAsync(); + list.Count.ShouldBe(1); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockAetherLinkProvider.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockAetherLinkProvider.cs new file mode 100644 index 0000000..872c7c3 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockAetherLinkProvider.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.CrossChain; + +public class MockAetherLinkProvider : IAetherLinkProvider +{ + public async Task CalculateCrossChainProgressAsync(AetherLinkCrossChainStatusInput input) + { + return 50; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockCheckTransferProvider.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockCheckTransferProvider.cs new file mode 100644 index 0000000..9840a68 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/MockCheckTransferProvider.cs @@ -0,0 +1,17 @@ +using System; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.CrossChain; + +public class MockCheckTransferProvider : ICheckTransferProvider +{ + public async Task CheckTransferAsync(string fromChainId, string toChainId, Guid tokenId, decimal transferAmount) + { + return true; + } + + public async Task CheckTokenExistAsync(string fromChainId, string toChainId, Guid tokenId) + { + return true; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestBase.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestBase.cs new file mode 100644 index 0000000..7cdd255 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestBase.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer; + +public abstract class CrossChainServerApplicationTestBase : CrossChainServerTestBase +{ + +} diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs new file mode 100644 index 0000000..5ad591b --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs @@ -0,0 +1,87 @@ +using System.Collections.Generic; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Chains.Ton; +using AElf.CrossChainServer.Contracts.Bridge; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.EntityHandler.Core; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.TokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerApplicationModule), + typeof(CrossChainServerDomainTestModule), + typeof(CrossChainServerEntityHandlerCoreModule) +)] +public class CrossChainServerApplicationTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.RemoveAll(); + context.Services.RemoveAll(); + + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + context.Services.AddTransient(); + + Configure(o => + { + o.ChainNodeApis = new Dictionary + { + { "Ethereum", "https://ethereum-sepolia-rpc.publicnode.com" }, + { "MainChain_AELF", "https://aelf.io" }, + { "Ton", "https://toncenter.com/api/v3/" } + }; + }); + + Configure(o => + { + o.ContractAddresses = new Dictionary + { + { + "Ethereum", new BridgeContractAddress + { + BridgeInContract = "0x164322657FC57EA95CAc4bF6623E53CA0f952E11", + BridgeOutContract = "0x26a44A0383F15f7f83D84eb95c4b7762d8de995A" + } + } + }; + }); + + Configure(o => + { + o.Mapping = new Dictionary>>(); + o.Mapping["Ethereum"] = new Dictionary>(); + o.Mapping["Ethereum"]["MainChain_AELF"] = new Dictionary + { + { "WETH", "ETH" } + }; + }); + + Configure(o => + { + o.Mapping = new Dictionary + { + { "CrossChainServerClient", "http://192.168.67.84:8083/AElfIndexer_DApp/CrossChainServerIndexerCASchema/graphql" }, + { "CrossChainClient", "http://192.168.67.84:8083/AElfIndexer_DApp/CrossChainIndexerCASchema/graphql" }, + { "ScanClient", "http://localhost:8080/graphql" } + }; + }); + } +} diff --git a/test/AElf.CrossChainServer.Application.Tests/DateTimeHelperTests.cs b/test/AElf.CrossChainServer.Application.Tests/DateTimeHelperTests.cs new file mode 100644 index 0000000..1249a20 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/DateTimeHelperTests.cs @@ -0,0 +1,22 @@ +using System; +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer; + +public class DateTimeHelperTests +{ + [Fact] + public async Task Test() + { + var date = DateTime.MinValue; + var timestamp = DateTimeHelper.ToUnixTimeMilliseconds(date); + timestamp.ShouldBe(0); + + timestamp = DateTimeHelper.ToUnixTimeMilliseconds(DateTime.UtcNow); + var newDate = DateTimeHelper.FromUnixTimeMilliseconds(timestamp); + var newTimestamp = DateTimeHelper.ToUnixTimeMilliseconds(newDate); + newTimestamp.ShouldBe(timestamp); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs b/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs new file mode 100644 index 0000000..fde2b9c --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs @@ -0,0 +1,21 @@ +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Indexer; + +public class GraphQLClientFactoryTest : CrossChainServerApplicationTestBase +{ + private readonly IGraphQLClientFactory _graphQlClientFactory; + + public GraphQLClientFactoryTest() + { + _graphQlClientFactory = GetRequiredService(); + } + + [Fact] + public void GetClientTest() + { + var client = _graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); + client.ShouldNotBeNull(); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Indexer/IndexerCrossChainLimitInfoServiceTest.cs b/test/AElf.CrossChainServer.Application.Tests/Indexer/IndexerCrossChainLimitInfoServiceTest.cs new file mode 100644 index 0000000..98e8790 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Indexer/IndexerCrossChainLimitInfoServiceTest.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using GraphQL; +using GraphQL.Client.Abstractions; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Xunit; + +namespace AElf.CrossChainServer.Indexer; + +public class IndexerCrossChainLimitInfoServiceTest +{ + private readonly IndexerCrossChainLimitInfoService _service; + private readonly IGraphQLClientFactory _mockGraphQlClientFactory; + private readonly ILogger _mockLogger; + + public IndexerCrossChainLimitInfoServiceTest() + { + _mockGraphQlClientFactory = Substitute.For(); + _mockLogger = Substitute.For>(); + } + + [Fact] + public async Task GetAllCrossChainLimitInfoIndexAsyncTest() + { + // Arrange + int size = 1000; + var expectedInfos = new List(); + for (int i = 0; i < 1001; i++) + { + expectedInfos.Add(new IndexerCrossChainLimitInfo()); + } + + var mockGraphQLClient = Substitute.For(); + _mockGraphQlClientFactory.GetClient(Arg.Any()).Returns(mockGraphQLClient); + + // mock page query + int callCount = 0; + mockGraphQLClient + .SendQueryAsync(Arg.Any()) + .Returns(info => + { + int pageSize = size; + int skip = callCount * pageSize; + callCount++; + + var pagedData = expectedInfos.Skip(skip).Take(pageSize).ToList(); + return Task.FromResult(new GraphQLResponse + { + Data = new IndexerCrossChainLimitInfos + { + Data = new IndexerCrossChainLimitInfos + { + DataList = pagedData + } + } + }); + }); + + //IGraphQLClientFactory crest _service + var _service = new IndexerCrossChainLimitInfoService(_mockGraphQlClientFactory); + + // Act + var result = await _service.GetAllCrossChainLimitInfoIndexAsync(); + + // Assert + Assert.Equal(expectedInfos.Count, result.Count); + + // check SendQueryAsync request times + var expectedCalls = (int)Math.Ceiling((expectedInfos.Count / 1000m)); + mockGraphQLClient.Received(expectedCalls). + SendQueryAsync(Arg.Any()); + } + + + [Fact] + public async Task GetCrossChainLimitInfoIndexAsyncTest() + { + // Arrange + int size = 1000; + var expectedInfos = new List(); + for (int i = 0; i < 3001; i++) + { + expectedInfos.Add(new IndexerCrossChainLimitInfo()); + } + + var mockGraphQLClient = Substitute.For(); + _mockGraphQlClientFactory.GetClient(Arg.Any()).Returns(mockGraphQLClient); + + // mock page query + int callCount = 0; + mockGraphQLClient + .SendQueryAsync(Arg.Any()) + .Returns(info => + { + int pageSize = size; + int skip = callCount * pageSize; + callCount++; + + var pagedData = expectedInfos.Skip(skip).Take(pageSize).ToList(); + return Task.FromResult(new GraphQLResponse + { + Data = new IndexerCrossChainLimitInfos + { + Data = new IndexerCrossChainLimitInfos + { + DataList = pagedData + } + } + }); + }); + + //IGraphQLClientFactory crest _service + var _service = new IndexerCrossChainLimitInfoService(_mockGraphQlClientFactory); + + // Act + var result = await _service.GetAllCrossChainLimitInfoIndexAsync(); + + // Assert + Assert.Equal(expectedInfos.Count, result.Count); + + // check SendQueryAsync request times + var expectedCalls = (int)Math.Ceiling((expectedInfos.Count / 1000m)); + mockGraphQLClient.Received(expectedCalls). + SendQueryAsync(Arg.Any()); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs b/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs new file mode 100644 index 0000000..2b27e6e --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs @@ -0,0 +1,121 @@ +using System; +using System.Threading.Tasks; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Indexer; +using AElf.CrossChainServer.TokenPool; + +namespace AElf.CrossChainServer; + +public class MockIndexerAppService : CrossChainServerAppService, IIndexerAppService +{ + public async Task GetLatestIndexHeightAsync(string chainId) + { + return 110; + } + + public Task GetLatestIndexBestHeightAsync(string chainId) + { + throw new System.NotImplementedException(); + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingTransactionAsync(string chainId, + string transferTransactionId) + { + var dto = new CrossChainTransferInfoDto() + { + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTransactionId = "TransferTransactionId", + TransferBlockHeight = 100, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + TransferAmount = 100, + }; + return (true, dto); + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiveTransactionAsync(string chainId, + string transferTransactionId) + { + var dto = new CrossChainTransferInfoDto + { + FromChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTransactionId = "TransferTransactionId", + ReceiveTransactionId = "ReceiveTransactionId", + TransferBlockHeight = 100, + ReceiveBlockHeight = 110, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiveTime = DateTime.UtcNow, + ReceiveAmount = 100 + }; + return (true, dto); + } + + public async Task<(bool, CrossChainTransferInfoDto)> GetPendingReceiptAsync(string chainId, string receiptId) + { + var dto = new CrossChainTransferInfoDto(); + if (chainId == "Ethereum") + { + dto = new CrossChainTransferInfoDto + { + FromChainId = chainId, + ToChainId = "MainChain_AELF", + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTransactionId = "TransferTransactionId", + ReceiveTransactionId = "ReceiveTransactionId", + TransferBlockHeight = 100, + ReceiveBlockHeight = 110, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiveTime = DateTime.UtcNow, + ReceiveAmount = 100, + ReceiptId = "ReceiptId", + TransferAmount = 100 + }; + } + else if ((chainId == "MainChain_AELF")) + { + dto = new CrossChainTransferInfoDto + { + FromChainId = chainId, + ToChainId = "Ethereum", + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTransactionId = "TransferTransactionId", + ReceiveTransactionId = "ReceiveTransactionId", + TransferBlockHeight = 100, + ReceiveBlockHeight = 110, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiveTime = DateTime.UtcNow, + ReceiveAmount = 100, + ReceiptId = "ReceiptId", + TransferAmount = 100 + }; + } + else + { + dto = new CrossChainTransferInfoDto + { + FromChainId = "Ton", + ToChainId = "MainChain_AELF", + FromAddress = "FromAddress", + ToAddress = "ToAddress", + TransferTransactionId = "txId", + ReceiveTransactionId = "ReceiveTransactionId", + TransferBlockHeight = 100, + ReceiveBlockHeight = 110, + TransferTime = DateTime.UtcNow.AddMinutes(-1), + ReceiveTime = DateTime.UtcNow, + ReceiveAmount = 100, + ReceiptId = "ReceiptId", + TransferAmount = 100 + }; + } + + return (true, dto); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAggregatePriceProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAggregatePriceProvider.cs new file mode 100644 index 0000000..143cc1c --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAggregatePriceProvider.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockAggregatePriceProvider : IAggregatePriceProvider +{ + private readonly Dictionary _tokenPriceMap = new Dictionary(); + + public void SetupTokenPrice(string symbol, decimal priceInUsd) + { + _tokenPriceMap[symbol] = priceInUsd; + } + + public Task GetPriceAsync(string symbol) + { + if (_tokenPriceMap.TryGetValue(symbol, out var price)) + { + return Task.FromResult(price); + } + + return Task.FromResult(1m); // Default price + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAwakenProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAwakenProvider.cs new file mode 100644 index 0000000..b895f81 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAwakenProvider.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockAwakenProvider : IAwakenProvider +{ + private readonly Dictionary _tokenLiquidityMap = new Dictionary(); + private readonly Dictionary _tokenPriceMap = new Dictionary(); + + public void SetupTokenLiquidityInUsd(string symbol, string liquidityInUsd) + { + _tokenLiquidityMap[symbol] = liquidityInUsd; + } + + public void SetupTokenPrice(string symbol, decimal priceInUsd) + { + _tokenPriceMap[symbol] = priceInUsd; + } + + public Task GetTokenLiquidityInUsdAsync(string symbol) + { + if (_tokenLiquidityMap.TryGetValue(symbol, out var liquidity)) + { + return Task.FromResult(liquidity); + } + + return Task.FromResult("0"); + } + + public Task GetTokenPriceInUsdAsync(string symbol) + { + if (_tokenPriceMap.TryGetValue(symbol, out var price)) + { + return Task.FromResult(price); + } + + return Task.FromResult(1.5m); // Default price + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockLarkProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockLarkProvider.cs new file mode 100644 index 0000000..4363f84 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockLarkProvider.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Notify; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockLarkProvider : ILarkRobotNotifyProvider +{ + public async Task SendMessageAsync(NotifyRequest notifyRequest) + { + return true; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockScanProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockScanProvider.cs new file mode 100644 index 0000000..b5d8aa8 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockScanProvider.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockScanProvider : IScanProvider +{ + private readonly Dictionary _tokenDetailMap = new Dictionary(); + private readonly Dictionary _tokenHolderMap = + new Dictionary(); + + public void SetupTokenDetail(string symbol, TokenDetailDto tokenDetail) + { + _tokenDetailMap[symbol] = tokenDetail; + } + + public void SetupTokenHolderList(string address, IndexerTokenHolderInfoListDto tokenHolders) + { + _tokenHolderMap[address] = tokenHolders; + } + + public Task GetTokenHolderListAsync(string address, int skipCount, int maxResultCount, string symbol = "") + { + if (_tokenHolderMap.TryGetValue(address, out var holders)) + { + // Filter by symbol if provided + if (!string.IsNullOrEmpty(symbol)) + { + var filteredItems = holders.Items.FindAll(h => h.Token?.Symbol == symbol); + return Task.FromResult(new IndexerTokenHolderInfoListDto + { + TotalCount = filteredItems.Count, + Items = filteredItems + }); + } + + return Task.FromResult(holders); + } + + // Return empty result if not found + return Task.FromResult(new IndexerTokenHolderInfoListDto + { + TotalCount = 0, + Items = new List() + }); + } + + public Task GetTokenDetailAsync(string symbol) + { + if (_tokenDetailMap.TryGetValue(symbol, out var tokenDetail)) + { + return Task.FromResult(tokenDetail); + } + + // Return a default token detail if not found + return Task.FromResult(new TokenDetailDto + { + Token = new TokenBaseInfo + { + Symbol = symbol, + Name = $"{symbol} Token", + ImageUrl = $"https://example.com/{symbol}.png", + Decimals = 8 + }, + TotalSupply = 1000000, + MergeHolders = 10000, + ChainIds = new List { "AELF" } + }); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenImageProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenImageProvider.cs new file mode 100644 index 0000000..140d801 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenImageProvider.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockTokenImageProvider : ITokenImageProvider +{ + public async Task GetTokenImageAsync(string symbol) + { + return "https://example.com/image.png"; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenInvokeProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenInvokeProvider.cs new file mode 100644 index 0000000..1a96863 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenInvokeProvider.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; + +namespace AElf.CrossChainServer.TokenAccess; + +public class MockTokenInvokeProvider : ITokenInvokeProvider +{ + public async Task GetThirdTokenListAndUpdateAsync(string symbol) + { + // Mock implementation that always returns success + return true; + } + + public async Task PrepareBindingAsync(ThirdUserTokenIssueInfoDto input) + { + return new UserTokenBindingDto + { + BindingId = "binding_id", + ThirdTokenId = "third_token_id", + MintToAddress = input.WalletAddress + }; + } + + public async Task BindingAsync(UserTokenBindingDto input) + { + return true; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessAppServiceTests.cs new file mode 100644 index 0000000..6629ddc --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessAppServiceTests.cs @@ -0,0 +1,309 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.Contracts; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Notify; +using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; +using AElf.CrossChainServer.TokenAccess.UserTokenAccess; +using AElf.CrossChainServer.TokenPool; +using AElf.CrossChainServer.Tokens; +using Shouldly; +using Volo.Abp.Validation; +using Xunit; + +namespace AElf.CrossChainServer.TokenAccess; + +public class TokenAccessAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly ITokenAccessAppService _tokenAccessAppService; + private readonly ITokenAppService _tokenAppService; + private readonly IUserAccessTokenInfoRepository _userAccessTokenInfoRepository; + private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; + private readonly ITokenApplyOrderRepository _tokenApplyOrderRepository; + private readonly ICrossChainUserRepository _crossChainUserRepository; + private readonly ITokenInfoCacheProvider _tokenInfoCacheProvider; + private readonly IScanProvider _scanProvider; + private readonly IAwakenProvider _awakenProvider; + + public TokenAccessAppServiceTests() + { + _tokenAccessAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + _userAccessTokenInfoRepository = GetRequiredService(); + _thirdUserTokenIssueRepository = GetRequiredService(); + _tokenApplyOrderRepository = GetRequiredService(); + _crossChainUserRepository = GetRequiredService(); + _tokenInfoCacheProvider = GetRequiredService(); + _scanProvider = GetRequiredService(); + _awakenProvider = GetRequiredService(); + } + + [Fact] + public async Task GetTokenConfigAsync_Should_Return_Config() + { + // Act + var result = await _tokenAccessAppService.GetTokenConfigAsync(new GetTokenConfigInput { Symbol = "ELF" }); + + // Assert + result.ShouldNotBeNull(); + // LiquidityInUsd is a string type, only check it's not null + result.LiquidityInUsd.ShouldNotBeNull(); + result.Holders.ShouldBeGreaterThanOrEqualTo(0); + } + + [Fact] + public async Task GetTokenWhitelistAsync_Should_Return_Whitelist() + { + // Act + var result = await _tokenAccessAppService.GetTokenWhitelistAsync(); + + // Assert + result.ShouldNotBeNull(); + // Whitelist may be empty, but should return a non-null object + } + + [Fact] + public async Task GetTokenPriceAsync_Should_Return_Price() + { + // Arrange + var input = new GetTokenPriceInput + { + Symbol = "ELF", + Amount = 100 + }; + + // Act + var result = await _tokenAccessAppService.GetTokenPriceAsync(input); + + // Assert + result.ShouldNotBeNull(); + result.Symbol.ShouldBe("ELF"); + (result.TokenAmountInUsd >= 0).ShouldBeTrue(); + } + + [Fact] + public async Task GetAvailableTokensAsync_Empty_When_Not_Authenticated() + { + // Assume current user is not authenticated + + // Act + var result = await _tokenAccessAppService.GetAvailableTokensAsync(new GetAvailableTokensInput()); + + // Assert + result.ShouldNotBeNull(); + result.TokenList.ShouldBeEmpty(); + } + + [Fact] + public async Task CommitTokenAccessInfoAsync_Should_Throw_When_Not_Authenticated() + { + // Arrange + var input = new UserTokenAccessInfoInput + { + Symbol = "ELF", + Email = "test@example.com", + OfficialWebsite = "https://example.com", + PersonName = "Test Person", + Title = "Test Title" + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.CommitTokenAccessInfoAsync(input)); + } + + [Fact] + public async Task CheckChainAccessStatusAsync_Should_Throw_When_Not_Authenticated() + { + // Arrange + var input = new CheckChainAccessStatusInput + { + Symbol = "ELF" + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.CheckChainAccessStatusAsync(input)); + } + + [Fact] + public async Task AddChainAsync_Should_Throw_When_Not_Authenticated() + { + // Arrange + var input = new AddChainInput + { + Symbol = "ELF", + ChainIds = new List { "Ethereum" } + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.AddChainAsync(input)); + } + + [Fact] + public async Task PrepareBindingIssueAsync_Should_Throw_For_Invalid_Address() + { + // Arrange + var input = new PrepareBindIssueInput + { + Symbol = "ELF", + ChainId = "Ethereum", + Address = "invalid_address" // Invalid address + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.PrepareBindingIssueAsync(input)); + } + + [Fact] + public async Task GetBindingIssueAsync_Should_Throw_When_Not_Authenticated() + { + // Arrange + var input = new UserTokenBindingDto + { + BindingId = "binding_id", + ThirdTokenId = "token_id", + MintToAddress = "address" + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.GetBindingIssueAsync(input)); + } + + [Fact] + public async Task GetTokenApplyOrderListAsync_Empty_When_Not_Authenticated() + { + // Act + var result = await _tokenAccessAppService.GetTokenApplyOrderListAsync(new GetTokenApplyOrderListInput()); + + // Assert + result.ShouldNotBeNull(); + result.TotalCount.ShouldBe(0); + result.Items.ShouldBeEmpty(); + } + + [Fact] + public async Task GetTokenApplyOrderDetailAsync_Empty_When_Not_Authenticated() + { + // Arrange + var input = new GetTokenApplyOrderInput + { + Symbol = "ELF" + }; + + // Act + var result = await _tokenAccessAppService.GetTokenApplyOrderDetailAsync(input); + + // Assert + result.ShouldNotBeNull(); + result.ShouldBeEmpty(); + } + + [Fact] + public async Task TriggerOrderStatusChangeAsync_Should_Throw_For_Invalid_Order() + { + // Arrange + var input = new TriggerOrderStatusChangeInput + { + OrderId = Guid.NewGuid().ToString(), + ChainIdTokenInfo = new ChainTokenDto + { + TokenContractAddress = "contract_address", + TokenDecimals = 8 + } + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.TriggerOrderStatusChangeAsync(input)); + } + + // Index-related tests + [Fact] + public async Task AddUserTokenAccessInfoIndexAsync_Should_Work() + { + // Arrange + var input = new AddUserTokenAccessInfoIndexInput + { + Symbol = "TEST_TOKEN2", + Address = "test_address2", + Email = "test2@example.com" + }; + + // Act & Assert - If no exception is thrown, consider it successful + await _tokenAccessAppService.AddUserTokenAccessInfoIndexAsync(input); + } + + [Fact] + public async Task AddThirdUserTokenIssueInfoIndexAsync_Should_Work() + { + // Arrange + var input = new AddThirdUserTokenIssueInfoIndexInput + { + Id = Guid.NewGuid(), + Symbol = "TEST_TOKEN", + Address = "test_address", + ChainId = "MainChain_AELF", + OtherChainId = "Ethereum" + }; + + // Act & Assert - If no exception is thrown, consider it successful + await _tokenAccessAppService.AddThirdUserTokenIssueInfoIndexAsync(input); + } + + [Fact] + public async Task AddTokenApplyOrderIndexAsync_Should_Work() + { + // Arrange + var input = new AddTokenApplyOrderIndexInput + { + Id = Guid.NewGuid(), + Symbol = "TEST_TOKEN", + UserAddress = "test_address", + ChainId = "Ethereum", + ChainName = "Ethereum", + TokenName = "Test Token", + Status = "Pending", + StatusChangedRecords = new List + { + new StatusChangedRecordDto + { + Id = Guid.NewGuid(), + Status = "Pending", + Time = DateTime.UtcNow + } + } + }; + + // Act & Assert - If no exception is thrown, consider it successful + await _tokenAccessAppService.AddTokenApplyOrderIndexAsync(input); + } + + [Fact] + public async Task GetAvailableTokenDetailAsync_Should_Throw_When_Not_Authenticated() + { + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.GetAvailableTokenDetailAsync("ELF")); + } + + [Fact] + public async Task GetUserTokenAccessInfoAsync_Should_Throw_When_Not_Authenticated() + { + // Arrange + var input = new UserTokenAccessInfoBaseInput + { + Symbol = "ELF" + }; + + // Act & Assert + await Should.ThrowAsync(async () => + await _tokenAccessAppService.GetUserTokenAccessInfoAsync(input)); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenPool/LiquidityAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/TokenPool/LiquidityAppServiceTests.cs new file mode 100644 index 0000000..feb7f8c --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenPool/LiquidityAppServiceTests.cs @@ -0,0 +1,57 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.TokenPool; + +public class LiquidityAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly ILiquidityAppService _liquidityAppService; + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly IUserLiquidityInfoAppService _userLiquidityInfoAppService; + + public LiquidityAppServiceTests() + { + _liquidityAppService = GetRequiredService(); + _poolLiquidityInfoAppService = GetRequiredService(); + _userLiquidityInfoAppService = GetRequiredService(); + } + + [Fact] + public async Task GetPoolOverviewAsync_Should_Return_Overview() + { + // Act + var overview = await _liquidityAppService.GetPoolOverviewAsync(null); + + // Assert + overview.ShouldNotBeNull(); + } + + [Fact] + public async Task GetPoolListAsync_Should_Return_Pool_List() + { + // Act + var pools = await _liquidityAppService.GetPoolListAsync(new GetPoolListInput + { + MaxResultCount = 10, + SkipCount = 0 + }); + + // Assert + pools.ShouldNotBeNull(); + pools.Items.ShouldNotBeNull(); + } + + [Fact] + public async Task GetPoolDetailAsync_Should_Return_Pool_Detail() + { + // Act - Note: This may return null if the pool doesn't exist + var detail = await _liquidityAppService.GetPoolDetailAsync(new GetPoolDetailInput + { + Token = "ELF", + ChainId = "MainChain_AELF" + }); + + // No assertion necessary as the result depends on existing data + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenPool/MockTokenLiquidityMonitorProvider.cs b/test/AElf.CrossChainServer.Application.Tests/TokenPool/MockTokenLiquidityMonitorProvider.cs new file mode 100644 index 0000000..71d382c --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenPool/MockTokenLiquidityMonitorProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Threading.Tasks; + +namespace AElf.CrossChainServer.TokenPool; + +public class MockTokenLiquidityMonitorProvider : ITokenLiquidityMonitorProvider +{ + public Task MonitorTokenLiquidityAsync(string chainId, Guid tokenId, decimal poolLiquidity) + { + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenPool/PoolLiquidityInfoAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/TokenPool/PoolLiquidityInfoAppServiceTests.cs new file mode 100644 index 0000000..838a3fc --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenPool/PoolLiquidityInfoAppServiceTests.cs @@ -0,0 +1,113 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Tokens; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.TokenPool; + +public class PoolLiquidityInfoAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly IPoolLiquidityInfoAppService _poolLiquidityInfoAppService; + private readonly ITokenAppService _tokenAppService; + + public PoolLiquidityInfoAppServiceTests() + { + _poolLiquidityInfoAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task GetPoolLiquidityInfosAsync_With_Different_Parameters_Test() + { + // Setup test data + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + + var input = new PoolLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 5, + Provider = "Provider1" + }; + await _poolLiquidityInfoAppService.AddLiquidityAsync(input); + + // Test with chain filter + var resultWithChainFilter = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync(new GetPoolLiquidityInfosInput + { + ChainId = "MainChain_AELF" + }); + resultWithChainFilter.Items.Count.ShouldBeGreaterThan(0); + resultWithChainFilter.Items.ShouldAllBe(item => item.ChainId == "MainChain_AELF"); + + // Test with token filter + var resultWithTokenFilter = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync(new GetPoolLiquidityInfosInput + { + Token = token.Address + }); + resultWithTokenFilter.Items.Count.ShouldBeGreaterThanOrEqualTo(0); + } + + [Fact] + public async Task AddLiquidityAsync_Test() + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + var input = new PoolLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 1, + Provider = "Provider" + }; + await _poolLiquidityInfoAppService.AddLiquidityAsync(input); + var liq = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync(new GetPoolLiquidityInfosInput{ + ChainId = "MainChain_AELF" + }); + liq.TotalCount.ShouldBe(1); + liq.Items.Count.ShouldBe(1); + liq.Items[0].ChainId.ShouldBe("MainChain_AELF"); + liq.Items[0].TokenInfo.Symbol.ShouldBe(token.Symbol); + liq.Items[0].Liquidity.ShouldBe(1); + } + + [Fact] + public async Task RemoveLiquidityAsync_Test() + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + var input = new PoolLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 2, + Provider = "Provider" + }; + await _poolLiquidityInfoAppService.AddLiquidityAsync(input); + input = new PoolLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 1, + Provider = "Provider" + }; + await _poolLiquidityInfoAppService.RemoveLiquidityAsync(input); + var liq = await _poolLiquidityInfoAppService.GetPoolLiquidityInfosAsync(new GetPoolLiquidityInfosInput{ + ChainId = "MainChain_AELF" + }); + liq.TotalCount.ShouldBe(1); + liq.Items.Count.ShouldBe(1); + liq.Items[0].ChainId.ShouldBe("MainChain_AELF"); + liq.Items[0].TokenInfo.Symbol.ShouldBe(token.Symbol); + liq.Items[0].Liquidity.ShouldBe(1); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/TokenPool/UserLiquidityInfoAppServicesTest.cs b/test/AElf.CrossChainServer.Application.Tests/TokenPool/UserLiquidityInfoAppServicesTest.cs new file mode 100644 index 0000000..a708a57 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/TokenPool/UserLiquidityInfoAppServicesTest.cs @@ -0,0 +1,79 @@ +using System.Threading.Tasks; +using AElf.CrossChainServer.Tokens; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.TokenPool; + +public class UserLiquidityInfoAppServiceTests : CrossChainServerApplicationTestBase +{ + private readonly IUserLiquidityInfoAppService _userLiquidityInfoAppService; + private readonly ITokenAppService _tokenAppService; + + public UserLiquidityInfoAppServiceTests() + { + _userLiquidityInfoAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task AddLiquidityAsync_Test() + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + var input = new UserLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 1, + Provider = "Provider" + }; + await _userLiquidityInfoAppService.AddUserLiquidityAsync(input); + var liq = await _userLiquidityInfoAppService.GetUserLiquidityInfosAsync(new GetUserLiquidityInput(){ + ChainId = "MainChain_AELF", + Providers = ["Provider"] + }); + liq.Count.ShouldBe(1); + liq[0].ChainId.ShouldBe("MainChain_AELF"); + liq[0].TokenInfo.Symbol.ShouldBe(token.Symbol); + liq[0].Liquidity.ShouldBe(1); + liq[0].Provider.ShouldBe("Provider"); + } + + [Fact] + public async Task RemoveLiquidityAsync_Test() + { + var token = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "ELF" + }); + var input = new UserLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 2, + Provider = "Provider" + }; + await _userLiquidityInfoAppService.AddUserLiquidityAsync(input); + input = new UserLiquidityInfoInput + { + ChainId = "MainChain_AELF", + TokenId = token.Id, + Liquidity = 1, + Provider = "Provider" + }; + await _userLiquidityInfoAppService.RemoveUserLiquidityAsync(input); + var liq = await _userLiquidityInfoAppService.GetUserLiquidityInfosAsync(new GetUserLiquidityInput(){ + ChainId = "MainChain_AELF", + Providers = ["Provider"] + }); + liq.Count.ShouldBe(1); + liq[0].ChainId.ShouldBe("MainChain_AELF"); + liq[0].TokenInfo.Symbol.ShouldBe(token.Symbol); + liq[0].Liquidity.ShouldBe(1); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenAppServiceTests.cs new file mode 100644 index 0000000..65d11fa --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenAppServiceTests.cs @@ -0,0 +1,49 @@ +using System.Linq; +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Validation; +using Xunit; + +namespace AElf.CrossChainServer.Tokens; + +public class TokenAppServiceTests: CrossChainServerApplicationTestBase +{ + private readonly ITokenAppService _tokenAppService; + + public TokenAppServiceTests() + { + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task CreateTest() + { + var getTokenInput = new GetTokenInput + { + Address = "Address_Address_Address_Address_Address_Address_Address_Address_Address_Address_Address_Address", + Symbol = "SymbolSymbol_SymbolSymbol_SymbolSymbol", + ChainId = "MainChain_AELF_AELF_AELF" + }; + + var exception = await Assert.ThrowsAsync(async () => await _tokenAppService.GetAsync(getTokenInput)); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("Address"))); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("Symbol"))); + exception.ValidationErrors.ShouldContain(err => err.MemberNames.Any(mem => mem.Contains("ChainId"))); + + var tokenInput = new TokenCreateInput + { + Address = "Address", + Decimals = 8, + Symbol = "Symbol", + ChainId = "MainChain_AELF" + }; + + var result = await _tokenAppService.CreateAsync(tokenInput); + + var token = await _tokenAppService.GetAsync(result.Id); + token.Address.ShouldBe(tokenInput.Address); + token.Decimals.ShouldBe(tokenInput.Decimals); + token.Symbol.ShouldBe(tokenInput.Symbol); + token.ChainId.ShouldBe(tokenInput.ChainId); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenSymbolMappingProviderTests.cs b/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenSymbolMappingProviderTests.cs new file mode 100644 index 0000000..1d5ac38 --- /dev/null +++ b/test/AElf.CrossChainServer.Application.Tests/Tokens/TokenSymbolMappingProviderTests.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Tokens; + +public class TokenSymbolMappingProviderTests: CrossChainServerApplicationTestBase +{ + private readonly ITokenSymbolMappingProvider _tokenSymbolMappingProvider; + + public TokenSymbolMappingProviderTests() + { + _tokenSymbolMappingProvider = GetRequiredService(); + } + + [Fact] + public async Task Test() + { + var symbol = _tokenSymbolMappingProvider.GetMappingSymbol("Ethereum", "MainChain_AELF", "WETH"); + symbol.ShouldBe("ETH"); + + symbol = _tokenSymbolMappingProvider.GetMappingSymbol("Ethereum", "MainChain_AELF", "USDT"); + symbol.ShouldBe("USDT"); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AElf.CrossChainServer.ContractEventHandler.Core.Tests.csproj b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AElf.CrossChainServer.ContractEventHandler.Core.Tests.csproj new file mode 100644 index 0000000..b571f98 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AElf.CrossChainServer.ContractEventHandler.Core.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + AElf.CrossChainServer.ContractEventHandler + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AssemblyInfo.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AssemblyInfo.cs new file mode 100644 index 0000000..41a898e --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestBase.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestBase.cs new file mode 100644 index 0000000..03c34f7 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestBase.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.ContractEventHandler +{ + public class ContractEventHandlerCoreTestBase : CrossChainServerTestBase + { + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestModule.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestModule.cs new file mode 100644 index 0000000..decff21 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/ContractEventHandlerCoreTestModule.cs @@ -0,0 +1,15 @@ +using AElf.AElfNode.EventHandler.TestBase; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + [DependsOn( + typeof(CrossChainServerApplicationTestModule), + typeof(CrossChainServerContractEventHandlerCoreModule), + typeof(AElfEventHandlerTestBaseModule) + )] + public class ContractEventHandlerCoreTestModule : AbpModule + { + + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/EventContextHelper.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/EventContextHelper.cs new file mode 100644 index 0000000..de7d59e --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/EventContextHelper.cs @@ -0,0 +1,33 @@ +using System; +using AElf.AElfNode.EventHandler.BackgroundJob; + +namespace AElf.CrossChainServer.ContractEventHandler +{ + public class EventContextHelper + { + public static EventContext Create(string methodName, int chainId =9992731) + { + var txId = "20ab8470f71572fa553b6fd7cd8274c382d0d13695b9444ac65321955bc638ff"; + var returnValue = string.Empty; + var blockNumber = 1000; + var blockTime = DateTime.UtcNow; + var fromAddress = "0xUser"; + var toAddress = "0xFactoryA"; + var blockHash = "0x0834ca06d6211906c1a2eb64a04fc1"; + + return new EventContext + { + TransactionId = txId, + Status = "MINED", + ReturnValue = returnValue, + ChainId = chainId, + BlockNumber = blockNumber, + MethodName = methodName, + BlockTime = blockTime, + FromAddress = fromAddress, + ToAddress = toAddress, + BlockHash = blockHash + }; + } + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/CrossChainTransferProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/CrossChainTransferProcessorTests.cs new file mode 100644 index 0000000..c2dfd17 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/CrossChainTransferProcessorTests.cs @@ -0,0 +1,145 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.MultiToken; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; +using AElf.Types; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class CrossChainTransferProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _crossChainTransferredTestProcessor; + private readonly IEventHandlerTestProcessor _crossChainReceivedTestProcessor; + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + + public CrossChainTransferProcessorTests() + { + _crossChainTransferredTestProcessor = GetRequiredService>(); + _crossChainReceivedTestProcessor = GetRequiredService>(); + _crossChainTransferAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "Symbol" + }); + var tokenReceive = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="SideChain_tDVV", + Symbol = "Symbol" + }); + var transferEvent = new CrossChainTransferred + { + Symbol = "Symbol", + Amount = 100, + From = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + To = Address.FromBase58("Lmemfcp2nB8kAvQDLxsLtQuHWgpH5gUWVmmcEkpJ2kRY9Jv25"), + Memo = "Memo", + IssueChainId = 9992731, + ToChainId = 1866392 + }; + var contractEvent = EventContextHelper.Create("CrossChainTransferred",9992731); + var transferTxId = contractEvent.TransactionId; + + await _crossChainTransferredTestProcessor.HandleEventAsync(transferEvent, contractEvent); + + var transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.TotalCount.ShouldBe(1); + transfers.Items[0].TransferAmount.ShouldBe(transferEvent.Amount); + transfers.Items[0].ReceiveAmount.ShouldBe(0); + transfers.Items[0].Progress.ShouldBe(0); + transfers.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + transfers.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + transfers.Items[0].ReceiveToken.ShouldBeNull(); + transfers.Items[0].Type.ShouldBe(CrossChainType.Homogeneous); + transfers.Items[0].FromAddress.ShouldBe(transferEvent.From.ToBase58()); + transfers.Items[0].ToAddress.ShouldBe(transferEvent.To.ToBase58()); + transfers.Items[0].FromChainId.ShouldBe("MainChain_AELF"); + transfers.Items[0].ToChainId.ShouldBe("SideChain_tDVV"); + transfers.Items[0].TransferBlockHeight.ShouldBe(contractEvent.BlockNumber); + transfers.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(contractEvent.BlockTime)); + transfers.Items[0].TransferTransactionId.ShouldBe(transferTxId); + + var receivedEvent = new CrossChainReceived + { + Symbol = "Symbol", + Amount = 100, + From = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + To = Address.FromBase58("Lmemfcp2nB8kAvQDLxsLtQuHWgpH5gUWVmmcEkpJ2kRY9Jv25"), + Memo = "Memo", + FromChainId = 9992731, + TransferTransactionId = Hash.LoadFromHex(transferTxId), + IssueChainId = 9992731, + ParentChainHeight = 10000 + }; + contractEvent = EventContextHelper.Create("CrossChainReceived",1866392); + await _crossChainReceivedTestProcessor.HandleEventAsync(receivedEvent, contractEvent); + + transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.Items[0].Progress.ShouldBe(100); + transfers.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(contractEvent.BlockTime)); + transfers.Items[0].ReceiveTransactionId.ShouldBe(contractEvent.TransactionId); + transfers.Items[0].Status.ShouldBe(CrossChainStatus.Received); + transfers.Items[0].ReceiveToken.Id.ShouldBe(tokenReceive.Id); + } + + [Fact] + public async Task HandleEvent_ChainNotExist_Test() + { + var transferEvent = new CrossChainTransferred + { + Symbol = "Symbol", + Amount = 100, + From = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + To = Address.FromBase58("Lmemfcp2nB8kAvQDLxsLtQuHWgpH5gUWVmmcEkpJ2kRY9Jv25"), + Memo = "Memo", + IssueChainId = 9992731, + ToChainId = 100 + }; + var contractEvent = EventContextHelper.Create("CrossChainTransferred", 9992731); + + await _crossChainTransferredTestProcessor.HandleEventAsync(transferEvent, contractEvent); + + var transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.TotalCount.ShouldBe(0); + + var receivedEvent = new CrossChainReceived + { + Symbol = "Symbol", + Amount = 100, + From = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + To = Address.FromBase58("Lmemfcp2nB8kAvQDLxsLtQuHWgpH5gUWVmmcEkpJ2kRY9Jv25"), + Memo = "Memo", + FromChainId = 100, + TransferTransactionId = Hash.LoadFromHex(contractEvent.TransactionId), + IssueChainId = 9992731, + ParentChainHeight = 10000 + }; + contractEvent = EventContextHelper.Create("CrossChainReceived",1866392); + await _crossChainReceivedTestProcessor.HandleEventAsync(receivedEvent, contractEvent); + + transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.TotalCount.ShouldBe(0); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/OracleProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/OracleProcessorTests.cs new file mode 100644 index 0000000..d27147a --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/OracleProcessorTests.cs @@ -0,0 +1,185 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.Oracle; +using AElf.CrossChainServer.CrossChain; +using AElf.Types; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class OracleProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _queryCreatedTestProcessor; + private readonly IEventHandlerTestProcessor _committedTestProcessor; + private readonly IEventHandlerTestProcessor _sufficientCommitmentsCollectedTestProcessor; + private readonly IEventHandlerTestProcessor _commitmentRevealedTestProcessor; + private readonly IEventHandlerTestProcessor _queryCompletedWithAggregationTestProcessor; + private readonly IEventHandlerTestProcessor _queryCompletedWithoutAggregationTestProcessor; + private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; + + public OracleProcessorTests() + { + _queryCreatedTestProcessor = GetRequiredService>(); + _committedTestProcessor = GetRequiredService>(); + _sufficientCommitmentsCollectedTestProcessor = GetRequiredService>(); + _commitmentRevealedTestProcessor = GetRequiredService>(); + _queryCompletedWithAggregationTestProcessor = GetRequiredService>(); + _queryCompletedWithoutAggregationTestProcessor = GetRequiredService>(); + _oracleQueryInfoAppService = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var receiptHash = "ReceiptHash"; + var receiptId = $"{receiptHash}.1"; + var queryId = Hash.LoadFromHex("18a7d0f51ac07c3ec033e8bcc48e60a7723b1372f4bf584987d60884098cb14d"); + var queryEvent = new QueryCreated + { + QueryId = queryId, + QueryInfo = new QueryInfo + { + Title = "record_price_elf", + Options = { receiptHash } + } + }; + var contractEvent = EventContextHelper.Create("QueryCreated",9992731); + await _queryCreatedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + var progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(0); + + queryEvent = new QueryCreated + { + QueryId = queryId, + QueryInfo = new QueryInfo + { + Title = "record_receipts_elf", + Options = { receiptId,receiptId } + } + }; + contractEvent = EventContextHelper.Create("QueryCreated",9992731); + await _queryCreatedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(20); + + var committedEvent = new Committed + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("Committed",9992731); + await _committedTestProcessor.HandleEventAsync(committedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(40); + + var sufficientCommitmentsCollectedEvent = new SufficientCommitmentsCollected + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("SufficientCommitmentsCollected",9992731); + await _sufficientCommitmentsCollectedTestProcessor.HandleEventAsync(sufficientCommitmentsCollectedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(60); + + var commitmentRevealedEvent = new CommitmentRevealed + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("CommitmentRevealed",9992731); + await _commitmentRevealedTestProcessor.HandleEventAsync(commitmentRevealedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(80); + + var queryCompletedWithAggregationEvent = new QueryCompletedWithAggregation + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("QueryCompletedWithAggregation",9992731); + await _queryCompletedWithAggregationTestProcessor.HandleEventAsync(queryCompletedWithAggregationEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(100); + } + + [Fact] + public async Task HandleEventWithoutAggregationTest() + { + var receiptHash = "ReceiptHash"; + var receiptId = $"{receiptHash}.1"; + var queryId = Hash.LoadFromHex("18a7d0f51ac07c3ec033e8bcc48e60a7723b1372f4bf584987d60884098cb14d"); + var queryEvent = new QueryCreated + { + QueryId = queryId, + QueryInfo = new QueryInfo + { + Title = "record_price_elf", + Options = { receiptId } + } + }; + var contractEvent = EventContextHelper.Create("QueryCreated",9992731); + await _queryCreatedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + var progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(0); + + queryEvent = new QueryCreated + { + QueryId = queryId, + QueryInfo = new QueryInfo + { + Title = "record_receipts_elf", + Options = { receiptId,receiptId } + } + }; + contractEvent = EventContextHelper.Create("QueryCreated",9992731); + await _queryCreatedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(20); + + var committedEvent = new Committed + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("Committed",9992731); + await _committedTestProcessor.HandleEventAsync(committedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(40); + + var sufficientCommitmentsCollectedEvent = new SufficientCommitmentsCollected + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("SufficientCommitmentsCollected",9992731); + await _sufficientCommitmentsCollectedTestProcessor.HandleEventAsync(sufficientCommitmentsCollectedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(60); + + var commitmentRevealedEvent = new CommitmentRevealed + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("CommitmentRevealed",9992731); + await _commitmentRevealedTestProcessor.HandleEventAsync(commitmentRevealedEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(80); + + var queryCompletedWithAggregationEvent = new QueryCompletedWithoutAggregation + { + QueryId = queryId, + }; + contractEvent = EventContextHelper.Create("QueryCompletedWithoutAggregation",9992731); + await _queryCompletedWithoutAggregationTestProcessor.HandleEventAsync(queryCompletedWithAggregationEvent, contractEvent); + + progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(100); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ParentChainIndexedProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ParentChainIndexedProcessorTests.cs new file mode 100644 index 0000000..14b34d7 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ParentChainIndexedProcessorTests.cs @@ -0,0 +1,54 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.CrossChain; +using AElf.CrossChainServer.CrossChain; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ParentChainIndexedProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _parentChainIndexedTestProcessor; + private readonly ICrossChainIndexingInfoRepository _crossChainIndexingInfoRepository; + + public ParentChainIndexedProcessorTests() + { + _parentChainIndexedTestProcessor = GetRequiredService>(); + _crossChainIndexingInfoRepository = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var @event = new ParentChainIndexed + { + ChainId = 9992731, + IndexedHeight = 100 + }; + var contractEvent = EventContextHelper.Create("ParentChainIndexed",1866392); + + await _parentChainIndexedTestProcessor.HandleEventAsync(@event, contractEvent); + + var indexes = await _crossChainIndexingInfoRepository.GetListAsync(); + indexes[0].IndexChainId.ShouldBe("MainChain_AELF"); + indexes[0].IndexBlockHeight.ShouldBe(@event.IndexedHeight); + indexes[0].BlockHeight.ShouldBe(contractEvent.BlockNumber); + indexes[0].BlockTime.ShouldBe(contractEvent.BlockTime); + + var @event2 = new ParentChainIndexed + { + ChainId = 1, + IndexedHeight = 200 + }; + var contractEvent2 = EventContextHelper.Create("ParentChainIndexed",1866392); + + await _parentChainIndexedTestProcessor.HandleEventAsync(@event2, contractEvent2); + + indexes = await _crossChainIndexingInfoRepository.GetListAsync(); + indexes[0].IndexChainId.ShouldBe("MainChain_AELF"); + indexes[0].IndexBlockHeight.ShouldBe(@event.IndexedHeight); + indexes[0].BlockHeight.ShouldBe(contractEvent.BlockNumber); + indexes[0].BlockTime.ShouldBe(contractEvent.BlockTime); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReceiptCreatedProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReceiptCreatedProcessorTests.cs new file mode 100644 index 0000000..aa9a55c --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReceiptCreatedProcessorTests.cs @@ -0,0 +1,70 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.Bridge; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; +using AElf.Types; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ReceiptCreatedProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _receiptCreatedTestProcessor; + private readonly IEventHandlerTestProcessor _tokenSwappedTestProcessor; + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + + public ReceiptCreatedProcessorTests() + { + _receiptCreatedTestProcessor = GetRequiredService>(); + _tokenSwappedTestProcessor = GetRequiredService>(); + _crossChainTransferAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var tokenTransfer = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="MainChain_AELF", + Symbol = "Symbol" + }); + + var transferEvent = new ReceiptCreated + { + Symbol = "Symbol", + Amount = 100, + Owner = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + ReceiptId = "ReceiptId", + TargetAddress = "Lmemfcp2nB8kAvQDLxsLtQuHWgpH5gUWVmmcEkpJ2kRY9Jv25", + TargetChainId = "Ethereum", + }; + var contractEvent = EventContextHelper.Create("ReceiptCreated",9992731); + var transferTxId = contractEvent.TransactionId; + + await _receiptCreatedTestProcessor.HandleEventAsync(transferEvent, contractEvent); + + var transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.TotalCount.ShouldBe(1); + transfers.Items[0].TransferAmount.ShouldBe(transferEvent.Amount); + transfers.Items[0].ReceiveAmount.ShouldBe(0); + transfers.Items[0].Progress.ShouldBe(0); + transfers.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); + transfers.Items[0].TransferToken.Id.ShouldBe(tokenTransfer.Id); + transfers.Items[0].ReceiveToken.ShouldBeNull(); + transfers.Items[0].Type.ShouldBe(CrossChainType.Heterogeneous); + transfers.Items[0].FromAddress.ShouldBe(transferEvent.Owner.ToBase58()); + transfers.Items[0].ToAddress.ShouldBe(transferEvent.TargetAddress); + transfers.Items[0].FromChainId.ShouldBe("MainChain_AELF"); + transfers.Items[0].ToChainId.ShouldBe(transferEvent.TargetChainId); + transfers.Items[0].TransferBlockHeight.ShouldBe(contractEvent.BlockNumber); + transfers.Items[0].TransferTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(contractEvent.BlockTime)); + transfers.Items[0].TransferTransactionId.ShouldBe(transferTxId); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReportProcessorTest.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReportProcessorTest.cs new file mode 100644 index 0000000..a370a3b --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/ReportProcessorTest.cs @@ -0,0 +1,85 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.Report; +using AElf.CrossChainServer.CrossChain; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class ReportProcessorTest : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _reportProposedTestProcessor; + private readonly IEventHandlerTestProcessor _reportConfirmedTestProcessor; + private readonly IReportInfoAppService _reportInfoAppService; + + public ReportProcessorTest() + { + _reportProposedTestProcessor = GetRequiredService>(); + _reportConfirmedTestProcessor = GetRequiredService>(); + _reportInfoAppService = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var receiptId = "ReceiptId"; + var queryEvent = new ReportProposed + { + QueryInfo = new OffChainQueryInfo + { + Title = "record_price_", + Options = { receiptId } + }, + Token = "token_address", + RoundId = 1 + }; + var contractEvent = EventContextHelper.Create("ReportProposed",9992731); + await _reportProposedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + var progress = await _reportInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(0); + + queryEvent = new ReportProposed + { + QueryInfo = new OffChainQueryInfo + { + Title = "lock_token_"+receiptId, + Options = { receiptId } + }, + Token = "token_address", + RoundId = 1, + TargetChainId = "Ethereum" + }; + contractEvent = EventContextHelper.Create("ReportProposed",9992731); + await _reportProposedTestProcessor.HandleEventAsync(queryEvent, contractEvent); + + progress = await _reportInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(100/3); + + var reportConfirmedEvent = new ReportConfirmed + { + RoundId = 1, + Token = "token_address", + TargetChainId = "Ethereum", + }; + contractEvent = EventContextHelper.Create("ReportConfirmed",9992731); + await _reportConfirmedTestProcessor.HandleEventAsync(reportConfirmedEvent, contractEvent); + + progress = await _reportInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(100/3); + + reportConfirmedEvent = new ReportConfirmed + { + RoundId = 1, + Token = "token_address", + TargetChainId = "Ethereum", + IsAllNodeConfirmed = true + }; + contractEvent = EventContextHelper.Create("ReportConfirmed",9992731); + await _reportConfirmedTestProcessor.HandleEventAsync(reportConfirmedEvent, contractEvent); + + progress = await _reportInfoAppService.CalculateCrossChainProgressAsync("MainChain_AELF",receiptId); + progress.ShouldBe(200/3); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/SideChainIndexedProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/SideChainIndexedProcessorTests.cs new file mode 100644 index 0000000..bab1e44 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/SideChainIndexedProcessorTests.cs @@ -0,0 +1,55 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.CrossChain; +using AElf.CrossChainServer.CrossChain; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class SideChainIndexedProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _sideChainIndexedTestProcessor; + private readonly ICrossChainIndexingInfoRepository _crossChainIndexingInfoRepository; + + public SideChainIndexedProcessorTests() + { + _sideChainIndexedTestProcessor = GetRequiredService>(); + _crossChainIndexingInfoRepository = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var @event = new SideChainIndexed + { + ChainId = 1866392, + IndexedHeight = 100 + }; + var contractEvent = EventContextHelper.Create("SideChainIndexed",9992731); + + await _sideChainIndexedTestProcessor.HandleEventAsync(@event, contractEvent); + + var indexes = await _crossChainIndexingInfoRepository.GetListAsync(); + indexes[0].IndexChainId.ShouldBe("SideChain_tDVV"); + indexes[0].IndexBlockHeight.ShouldBe(@event.IndexedHeight); + indexes[0].BlockHeight.ShouldBe(contractEvent.BlockNumber); + indexes[0].BlockTime.ShouldBe(contractEvent.BlockTime); + + var @event2 = new SideChainIndexed + { + ChainId = 1, + IndexedHeight = 200 + }; + var contractEvent2 = EventContextHelper.Create("SideChainIndexed",9992731); + + await _sideChainIndexedTestProcessor.HandleEventAsync(@event2, contractEvent2); + + indexes = await _crossChainIndexingInfoRepository.GetListAsync(); + indexes.Count.ShouldBe(1); + indexes[0].IndexChainId.ShouldBe("SideChain_tDVV"); + indexes[0].IndexBlockHeight.ShouldBe(@event.IndexedHeight); + indexes[0].BlockHeight.ShouldBe(contractEvent.BlockNumber); + indexes[0].BlockTime.ShouldBe(contractEvent.BlockTime); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/TokenSwappedProcessorTests.cs b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/TokenSwappedProcessorTests.cs new file mode 100644 index 0000000..d4a5f95 --- /dev/null +++ b/test/AElf.CrossChainServer.ContractEventHandler.Core.Tests/Processors/TokenSwappedProcessorTests.cs @@ -0,0 +1,55 @@ +using System.Threading.Tasks; +using AElf.AElfNode.EventHandler.TestBase; +using AElf.Contracts.Bridge; +using AElf.CrossChainServer.CrossChain; +using AElf.CrossChainServer.Tokens; +using AElf.Types; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.ContractEventHandler.Processors; + +public class TokenSwappedProcessorTests : ContractEventHandlerCoreTestBase +{ + private readonly IEventHandlerTestProcessor _tokenSwappedTestProcessor; + private readonly ICrossChainTransferAppService _crossChainTransferAppService; + private readonly ITokenAppService _tokenAppService; + + public TokenSwappedProcessorTests() + { + _tokenSwappedTestProcessor = GetRequiredService>(); + _crossChainTransferAppService = GetRequiredService(); + _tokenAppService = GetRequiredService(); + } + + [Fact] + public async Task HandleEventTest() + { + var tokenReceive = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId = "MainChain_AELF", + Symbol = "Symbol" + }); + + var receivedEvent = new TokenSwapped + { + Symbol = "Symbol", + Amount = 100, + Address = Address.FromBase58("2Pvmz2c57roQAJEtQ11fqavofdDtyD1Vehjxd7QRpQ7hwSqcF7"), + ReceiptId = "ReceiptId", + FromChainId = "Ethereum" + }; + var contractEvent = EventContextHelper.Create("TokenSwapped",9992731); + await _tokenSwappedTestProcessor.HandleEventAsync(receivedEvent, contractEvent); + + var transfers = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput + { + MaxResultCount = 100 + }); + transfers.Items[0].Progress.ShouldBe(100); + transfers.Items[0].ReceiveTime.ShouldBe(DateTimeHelper.ToUnixTimeMilliseconds(contractEvent.BlockTime)); + transfers.Items[0].ReceiveTransactionId.ShouldBe(contractEvent.TransactionId); + transfers.Items[0].Status.ShouldBe(CrossChainStatus.Received); + transfers.Items[0].ReceiveToken.Id.ShouldBe(tokenReceive.Id); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Domain.Tests/AElf.CrossChainServer.Domain.Tests.csproj b/test/AElf.CrossChainServer.Domain.Tests/AElf.CrossChainServer.Domain.Tests.csproj new file mode 100644 index 0000000..2a37f8a --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/AElf.CrossChainServer.Domain.Tests.csproj @@ -0,0 +1,26 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + diff --git a/test/AElf.CrossChainServer.Domain.Tests/AssemblyInfo.cs b/test/AElf.CrossChainServer.Domain.Tests/AssemblyInfo.cs new file mode 100644 index 0000000..41a898e --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs b/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs new file mode 100644 index 0000000..d0a548f --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs @@ -0,0 +1,38 @@ +// using System; +// using System.Threading.Tasks; +// using Shouldly; +// using Xunit; +// +// namespace AElf.CrossChainServer.BridgeContract; +// +// public class BridgeContractSyncInfoRepositoryTests: CrossChainServerDomainTestBase +// { +// private readonly IBridgeContractSyncInfoRepository _bridgeContractSyncInfoRepository; +// +// public BridgeContractSyncInfoRepositoryTests() +// { +// _bridgeContractSyncInfoRepository = GetRequiredService(); +// } +// +// [Fact] +// public async Task Get_Set_Test() +// { +// var bridgeContractSyncInfo = new BridgeContractSyncInfo +// { +// Type = TransferType.Receive, +// ChainId = "MainChain_AELF", +// SyncIndex = 100, +// TargetChainId = "SideChain_AELF", +// TokenId = Guid.NewGuid() +// }; +// +// await _bridgeContractSyncInfoRepository.InsertAsync(bridgeContractSyncInfo); +// var syncInfos = await _bridgeContractSyncInfoRepository.GetListAsync(); +// syncInfos.Count.ShouldBe(1); +// syncInfos[0].Type.ShouldBe(bridgeContractSyncInfo.Type); +// syncInfos[0].ChainId.ShouldBe(bridgeContractSyncInfo.ChainId); +// syncInfos[0].SyncIndex.ShouldBe(bridgeContractSyncInfo.SyncIndex); +// syncInfos[0].TargetChainId.ShouldBe(bridgeContractSyncInfo.TargetChainId); +// syncInfos[0].TokenId.ShouldBe(bridgeContractSyncInfo.TokenId); +// } +// } \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestBase.cs b/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestBase.cs new file mode 100644 index 0000000..68db975 --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestBase.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer; + +public abstract class CrossChainServerDomainTestBase : CrossChainServerTestBase +{ + +} diff --git a/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestModule.cs b/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestModule.cs new file mode 100644 index 0000000..2d3ee22 --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/CrossChainServerDomainTestModule.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using AElf.CrossChainServer.EntityFrameworkCore; +using AElf.Indexing.Elasticsearch; +using AElf.Indexing.Elasticsearch.Options; +using AElf.Indexing.Elasticsearch.Services; +using Elasticsearch.Net; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(CrossChainServerEntityFrameworkCoreTestModule) + )] +public class CrossChainServerDomainTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Do not modify this!!! + context.Services.Configure(options => + { + options.Uris = new List { "http://127.0.0.1:9200"}; + }); + + context.Services.Configure(options => + { + options.NumberOfReplicas = 1; + options.NumberOfShards = 1; + options.Refresh = Refresh.True; + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + var elasticIndexService = context.ServiceProvider.GetRequiredService(); + var modules = context.ServiceProvider.GetRequiredService>().Value.Modules; + + modules.ForEach(m => + { + var types = GetTypesAssignableFrom(m.Assembly); + foreach (var t in types) + { + AsyncHelper.RunSync(async () => + await elasticIndexService.DeleteIndexAsync(t.Name.ToLower())); + } + }); + } + + private List GetTypesAssignableFrom(Assembly assembly) + { + var compareType = typeof(T); + return assembly.DefinedTypes + .Where(type => compareType.IsAssignableFrom(type) && !compareType.IsAssignableFrom(type.BaseType) && + !type.IsAbstract && type.IsClass && compareType != type) + .Cast().ToList(); + } +} diff --git a/test/AElf.CrossChainServer.Domain.Tests/Samples/SampleDomainTests.cs b/test/AElf.CrossChainServer.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..6e282de --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,44 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Xunit; + +namespace AElf.CrossChainServer.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public class SampleDomainTests : CrossChainServerDomainTestBase +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + public SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/test/AElf.CrossChainServer.Domain.Tests/Settings/SettingManagerTests.cs b/test/AElf.CrossChainServer.Domain.Tests/Settings/SettingManagerTests.cs new file mode 100644 index 0000000..b413b4f --- /dev/null +++ b/test/AElf.CrossChainServer.Domain.Tests/Settings/SettingManagerTests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace AElf.CrossChainServer.Settings; + +public class SettingManagerTests: CrossChainServerDomainTestBase +{ + private readonly ISettingManager _settingManager; + + public SettingManagerTests() + { + _settingManager = GetRequiredService(); + } + + [Fact] + public async Task SettingTest() + { + var chainId = "AELF"; + var key = "key"; + var value = "value"; + var getValue = await _settingManager.GetOrNullAsync(chainId, key); + getValue.ShouldBeNull(); + + await _settingManager.SetAsync(chainId, key, value); + getValue = await _settingManager.GetOrNullAsync(chainId, key); + getValue.ShouldBe(value); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AElf.CrossChainServer.EntityFrameworkCore.Tests.csproj b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AElf.CrossChainServer.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..d0576f7 --- /dev/null +++ b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AElf.CrossChainServer.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,27 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + diff --git a/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AssemblyInfo.cs b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AssemblyInfo.cs new file mode 100644 index 0000000..41a898e --- /dev/null +++ b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestBase.cs b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..1328c3b --- /dev/null +++ b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestBase.cs @@ -0,0 +1,6 @@ +namespace AElf.CrossChainServer.EntityFrameworkCore; + +public abstract class CrossChainServerEntityFrameworkCoreTestBase : CrossChainServerTestBase +{ + +} diff --git a/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestModule.cs b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..821191c --- /dev/null +++ b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/CrossChainServerEntityFrameworkCoreTestModule.cs @@ -0,0 +1,74 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; + +namespace AElf.CrossChainServer.EntityFrameworkCore; + +[DependsOn( + typeof(CrossChainServerEntityFrameworkCoreModule), + typeof(CrossChainServerTestBaseModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class CrossChainServerEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new CrossChainServerDbContext(options)) + { + context.GetService().CreateTables(); + context.Database.AutoTransactionBehavior = AutoTransactionBehavior.WhenNeeded; + } + + return connection; + } +} diff --git a/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..9d464b5 --- /dev/null +++ b/test/AElf.CrossChainServer.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,43 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace AElf.CrossChainServer.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +public class SampleRepositoryTests : CrossChainServerEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp.csproj b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..064ad04 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,32 @@ + + + + Exe + net8.0 + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..3e842f2 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..46daf69 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/CrossChainServerConsoleApiClientModule.cs b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/CrossChainServerConsoleApiClientModule.cs new file mode 100644 index 0000000..cd5589b --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/CrossChainServerConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(CrossChainServerHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class CrossChainServerConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/Program.cs b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..d80ab99 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.json b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..6517837 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,18 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44320" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "CrossChainServer_App", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44316", + "Scope": "CrossChainServer" + } + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/test/AElf.CrossChainServer.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.TestBase/AElf.CrossChainServer.TestBase.csproj b/test/AElf.CrossChainServer.TestBase/AElf.CrossChainServer.TestBase.csproj new file mode 100644 index 0000000..5b0d02b --- /dev/null +++ b/test/AElf.CrossChainServer.TestBase/AElf.CrossChainServer.TestBase.csproj @@ -0,0 +1,33 @@ + + + + + + net8.0 + AElf.CrossChainServer + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBase.cs b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBase.cs new file mode 100644 index 0000000..499f0c3 --- /dev/null +++ b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace AElf.CrossChainServer; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class CrossChainServerTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBaseModule.cs b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBaseModule.cs new file mode 100644 index 0000000..d3bc05b --- /dev/null +++ b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestBaseModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; +using Volo.Abp.Uow; + +namespace AElf.CrossChainServer; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(CrossChainServerDomainModule) + )] +public class CrossChainServerTestBaseModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // PreConfigure(options => + // { + // options.AddDeveloperSigningCredential = false; + // }); + // + // PreConfigure(identityServerBuilder => + // { + // identityServerBuilder.AddDeveloperSigningCredential(false, System.Guid.NewGuid().ToString()); + // }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + var dataSeeder = scope.ServiceProvider.GetRequiredService(); + + using (var uow = scope.ServiceProvider.GetRequiredService().Begin(new AbpUnitOfWorkOptions + { + IsTransactional = false + })) + { + await dataSeeder.SeedAsync(); + await uow.CompleteAsync(); + } + } + }); + } +} diff --git a/test/AElf.CrossChainServer.TestBase/CrossChainServerTestDataSeedContributor.cs b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestDataSeedContributor.cs new file mode 100644 index 0000000..b90404d --- /dev/null +++ b/test/AElf.CrossChainServer.TestBase/CrossChainServerTestDataSeedContributor.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AElf.CrossChainServer.Chains; +using AElf.CrossChainServer.CrossChain; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Users; + +namespace AElf.CrossChainServer; + +public class CrossChainServerTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + protected ICurrentUser _currentUser; + private readonly IChainRepository _chainRepository; + private readonly ICrossChainUserRepository _crossChainUserRepository; + + public CrossChainServerTestDataSeedContributor(IChainRepository chainRepository, + ICrossChainUserRepository crossChainUserRepository) + { + _chainRepository = chainRepository; + _crossChainUserRepository = crossChainUserRepository; + } + + public async Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + await _chainRepository.InsertAsync(new Chain + { + Id = "Ethereum", + Type = BlockchainType.Evm, + Name = "Ethereum", + IsMainChain = true, + AElfChainId = 0 + }); + + await _chainRepository.InsertAsync(new Chain() + { + Id = "MainChain_AELF", + Type = BlockchainType.AElf, + Name = "Main Chain AELF", + IsMainChain = true, + AElfChainId = 9992731 + }); + + await _chainRepository.InsertAsync(new Chain() + { + Id = "SideChain_tDVV", + Type = BlockchainType.AElf, + Name = "Side Chain tDVV", + IsMainChain = false, + AElfChainId = 1866392 + }); + + await _chainRepository.InsertAsync(new Chain() + { + Id = "SideChain_tDVW", + Type = BlockchainType.AElf, + Name = "Side Chain tDVW", + IsMainChain = false, + AElfChainId = 1931928 + }); + + await _chainRepository.InsertAsync(new Chain() + { + Id = "Ton", + Type = BlockchainType.Tvm, + Name = "Ton", + IsMainChain = true, + AElfChainId = 0 + }); + + await _crossChainUserRepository.InsertAsync(new() + { + Id = new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b"), + AppId = "test_app_id", + CaHash = "test_ca_hash", + AddressInfos = new List + { + new() + { + ChainId = "AELF", + Address = "test_user_address", + Id = Guid.NewGuid() + }, + new() + { + ChainId = "tDVW", + Address = "side_test_user_address", + Id = Guid.NewGuid() + } + }, + CreateTime = 0, + ModificationTime = 0 + }); + } +} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/test/AElf.CrossChainServer.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..40a00d1 --- /dev/null +++ b/test/AElf.CrossChainServer.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace AElf.CrossChainServer.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } +}