From ba849fe905df5ebfef43015c065139b95a79d088 Mon Sep 17 00:00:00 2001 From: sherry Date: Tue, 20 May 2025 12:46:16 +0900 Subject: [PATCH] feat:for optimize transaction record. --- AElf.CrossChainServer.sln | 7 + CodeCoverage.runsettings | 31 +- .../Contracts/BridgeContractSyncInfoDto.cs | 12 - .../Contracts/IBridgeContractAppService.cs | 14 +- .../Contracts/IReportContractAppService.cs | 8 - .../Contracts/OracleContract.c.cs | 231 - .../Contracts/OracleContract.g.cs | 8762 --------------- .../Contracts/ReceiptIndexDto.cs | 10 - .../Contracts/ReceiptInfoDto.cs | 22 - .../Contracts/ReceivedReceiptInfoDto.cs | 22 - .../Contracts/ReportContract.c.cs | 110 - .../Contracts/ReportContract.g.cs | 9416 ----------------- .../Contracts/TokenBucketDto.cs | 3 + .../AddCrossChainTransferIndexInput.cs | 3 + .../AddOracleQueryInfoIndexInput.cs | 13 - .../CrossChain/AddReportInfoIndexInput.cs | 19 - .../CrossChain/CreateOracleQueryInfoInput.cs | 12 - .../CrossChain/CreateReportInfoInput.cs | 16 - .../CrossChain/CrossChainReceiveInput.cs | 2 + .../CrossChain/CrossChainTransferIndexDto.cs | 3 + .../CrossChain/CrossChainTransferInfoDto.cs | 1 + .../CrossChain/CrossChainTransferInput.cs | 1 + .../CrossChain/ICrossChainLimitAppService.cs | 1 + .../ICrossChainTransferAppService.cs | 7 +- .../CrossChain/IOracleQueryInfoAppService.cs | 12 - .../CrossChain/IReportInfoAppService.cs | 18 - .../CrossChain/LimitSyncOptions.cs | 16 + .../UpdateCrossChainTransferIndexInput.cs | 3 + .../UpdateOracleQueryInfoIndexInput.cs | 13 - .../CrossChain/UpdateOracleQueryInfoInput.cs | 11 - .../CrossChain/UpdateReportInfoIndexInput.cs | 20 - .../Indexer/GraphQLClientEnum.cs | 1 - .../Indexer/IEvmIndexerAppService.cs | 8 - .../Indexer/IIndexerAppService.cs | 7 +- .../Indexer/SyncStateDto.cs | 12 - .../TokenPool/PoolLiquiditySyncOptions.cs | 2 +- .../AElf.CrossChainServer.Application.csproj | 8 +- .../Chains/EvmClientProvider.cs | 25 +- .../Bridge/AElfBridgeContractProvider.cs | 84 +- .../Bridge/BridgeContractAppService.cs | 161 +- .../Bridge/EvmBridgeContractProvider.cs | 211 +- .../Bridge/GetReceiptInfosFunctionMessage.cs | 50 - .../GetReceiveReceiptIndexFunctionMessage.cs | 23 - .../GetReceivedReceiptInfosFunctionMessage.cs | 48 - .../GetSendReceiptIndexFunctionMessage.cs | 23 - .../GetSwapDailyLimitFunctionMessage.cs | 22 + .../Bridge/IBridgeContractProvider.cs | 19 +- .../IsReceiptRecordedFunctionMessage.cs | 18 - .../Report/AElfReportContractProvider.cs | 44 - .../Report/IReportContractProvider.cs | 9 - .../Report/ReportContractAppService.cs | 30 - .../Contracts/Report/ReportContractOptions.cs | 8 - .../CrossChain/CrossChainLimitAppService.cs | 152 +- .../CrossChainLimitInfoAppService.cs | 168 +- .../CrossChain/CrossChainOptions.cs | 7 - .../CrossChainTransferAppService.cs | 480 +- .../CrossChain/EvmTokensOptions.cs | 19 - ...HeterogeneousCrossChainTransferProvider.cs | 19 +- .../CrossChain/ICheckTransferProvider.cs | 65 - .../CrossChain/OracleQueryInfoAppService.cs | 100 - .../CrossChain/ReportInfoAppService.cs | 266 - .../CrossChain/ReportJobCategoryOptions.cs | 8 - ...ChainServerApplicationAutoMapperProfile.cs | 15 +- .../CrossChainServerApplicationModule.cs | 8 +- .../HttpClient/JsonSettingsBuilder.cs | 93 - .../Indexer/EvmIndexerAppService.cs | 11 - .../Indexer/IndexerAppService.cs | 183 +- .../ReportQueryTimesOptions.cs | 6 - .../appsettings.json | 28 +- .../CrossChain/CrossChainTransferEto.cs | 5 +- .../CrossChain/OracleQueryInfoEto.cs | 13 - .../CrossChain/OracleStep.cs | 10 - .../CrossChain/ReceiptStatus.cs | 8 + .../CrossChain/ReportInfoEto.cs | 20 - .../CrossChain/ReportStep.cs | 10 - .../BridgeContract/BridgeContractSyncInfo.cs | 12 - .../IBridgeContractSyncInfoRepository.cs | 10 - .../CrossChain/CrossChainTransferBase.cs | 5 +- .../CrossChain/IOracleQueryInfoRepository.cs | 10 - .../CrossChain/IReportInfoRepository.cs | 10 - .../CrossChain/OracleQueryInfo.cs | 15 - .../CrossChain/OracleQueryInfoIndex.cs | 7 - .../CrossChain/ReportInfo.cs | 25 - .../CrossChain/ReportInfoIndex.cs | 8 - .../CrossChainServerConsts.cs | 3 - .../CrossChainServerDomainModule.cs | 6 - .../DomainAutoMapperProfile.cs | 2 - .../Settings/CrossChainServerSettings.cs | 5 +- .../EfCoreBridgeContractSyncInfoRepository.cs | 15 - .../EfCoreOracleQueryInfoRepository.cs | 16 - .../CrossChain/EfCoreReportInfoRepository.cs | 15 - .../CrossChainServerDbContext.cs | 24 - ...or_Check_Transaction_Confirmed.Designer.cs | 2652 +++++ ...2164715_For_Check_Transaction_Confirmed.cs | 62 + ...74042_For_Remove_Unused_Tables.Designer.cs | 2549 +++++ ...20250519074042_For_Remove_Unused_Tables.cs | 109 + .../CrossChainServerDbContextModelSnapshot.cs | 113 +- .../CrossChainTransferEntityHandler.cs | 9 +- .../OracleQueryInfoEntityHandler.cs | 35 - .../ReportInfoEntityHandler.cs | 35 - .../AElf.CrossChainServer.EvmIndexer.csproj | 22 + .../ContractEventSubscriptionInfo.cs | 10 + .../CrossChainServerEvmIndexerModule.cs | 32 + .../Dtos/Event/Bridge/NewReceiptEvent.cs | 37 + .../Dtos/Event/Bridge/TokenSwappedEvent.cs | 35 + .../NewReceiptReceivedMessageDto.cs | 24 + .../Dtos/MessageDto/TokenSwappedMessageDto.cs | 20 + .../EvmContractSyncOptions.cs | 23 + .../EvmIndexerHandlerWorker.cs | 110 + .../IEventSubscriber.cs | 59 + .../IEvmEventProcessor.cs | 10 + .../IEvmEventSubscriptionManager.cs | 64 + .../Bridge/NewReceiptEventProcessor.cs | 64 + .../Bridge/TokenSwappedEventProcessor.cs | 60 + .../AElf.CrossChainServer.Worker.csproj | 1 + .../BridgeContractSyncOptions.cs | 23 - .../CheckAElfTransactionConfirmedWorker.cs | 51 + .../CheckEvmTransactionConfirmedWorker.cs | 51 + .../CheckReceiveWorker.cs | 24 - .../CrossChainIndexingCleanWorker.cs | 5 +- .../CrossChainServerWorkerModule.cs | 29 +- .../Dtos/Limit/ConfigChangedEvent.cs | 23 + .../Dtos/Limit/DailyLimitSetEvent.cs | 21 + .../Limit/TokenDailyLimitConsumedEvent.cs | 16 + .../Dtos/Limit/TokenRateLimitConsumedEvent.cs | 15 + .../EvmIndexerSync/EvmContractSyncOptions.cs | 12 +- .../EvmIndexerSyncProviderBase.cs | 13 +- .../EvmIndexerSync/EvmIndexerSyncWorker.cs | 1 + .../EvmNewReceiptSyncProvider.cs | 5 +- .../EvmTokenPoolIndexerSyncProvider.cs | 2 +- .../EvmTokenSwapSyncProvider.cs | 4 +- .../EvmDailyLimitConsumedSyncProvider.cs | 89 + .../Limit/EvmDailyLimitSetSyncProvider.cs | 92 + .../Limit/EvmRateLimitConsumedSyncProvider.cs | 87 + .../Limit/EvmRateLimitSetSyncProvider.cs | 94 + .../TokenLimitSwapInfoOptions.cs | 16 + .../IndexerSync/BridgeContractSyncOptions.cs | 15 + ...ossChainIndexingInfoIndexerSyncProvider.cs | 2 +- .../CrossChainTransferIndexerSyncProvider.cs | 40 +- .../IndexerSync/IIndexerSyncProvider.cs | 4 +- .../IndexerSync/IndexerSyncProviderBase.cs | 43 +- .../IndexerSync/IndexerSyncWorker.cs | 7 +- .../PoolLiquidityIndexerSyncProvider.cs | 13 +- .../UserLiquidityIndexerSyncProvider.cs | 7 +- .../TonIndexerSync/TonIndexSyncOptions.cs | 2 - .../TonIndexerSync/TonIndexSyncWorker.cs | 12 +- .../TransferAutoReceiveWorker.cs | 9 +- .../TransferProgressUpdateWorker.cs | 6 +- .../WorkerSyncPeriodOptions.cs | 11 + ....CrossChainServer.Application.Tests.csproj | 4 + .../Chains/AElfClientFactoryTests.cs | 4 +- .../Chains/MockEvmClientProvider.cs | 19 +- .../CrossChainLimitInfoAppServiceTest.cs | 30 - .../CrossChainTransferAppServiceTests.cs | 401 +- .../OracleQueryInfoAppServiceTests.cs | 145 - .../CrossChain/ReportInfoAppServiceTests.cs | 122 - .../CrossChainServerApplicationTestModule.cs | 26 +- .../Indexer/GraphQLClientFactoryTest.cs | 5 +- .../MockIndexerAppService.cs | 108 +- .../TokenAccess/MockAggregatePriceProvider.cs | 24 + .../TokenAccess/MockAwakenProvider.cs | 40 + .../TokenAccess/MockLarkProvider.cs | 12 + .../TokenAccess/MockScanProvider.cs | 72 + .../TokenAccess/MockTokenImageProvider.cs | 11 + .../TokenAccess/MockTokenInvokeProvider.cs | 29 + .../TokenAccess/TokenAccessAppServiceTests.cs | 439 +- .../TokenAccess/TokenAccessMockTest.cs | 93 - .../TokenPool/LiquidityAppServiceTests.cs | 57 + .../MockTokenLiquidityMonitorProvider.cs | 12 + .../PoolLiquidityInfoAppServiceTests.cs | 113 + .../UserLiquidityInfoAppServicesTest.cs | 79 + .../BridgeContractSyncInfoRepositoryTests.cs | 76 +- 172 files changed, 8859 insertions(+), 21555 deletions(-) delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContractSyncInfoDto.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/IReportContractAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.c.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.g.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptIndexDto.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptInfoDto.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceivedReceiptInfoDto.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.c.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.g.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddOracleQueryInfoIndexInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddReportInfoIndexInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateOracleQueryInfoInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateReportInfoInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/IOracleQueryInfoAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/IReportInfoAppService.cs create mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/LimitSyncOptions.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoIndexInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateReportInfoIndexInput.cs delete mode 100644 src/AElf.CrossChainServer.Application.Contracts/Indexer/IEvmIndexerAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiptInfosFunctionMessage.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiveReceiptIndexFunctionMessage.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceivedReceiptInfosFunctionMessage.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSendReceiptIndexFunctionMessage.cs create mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSwapDailyLimitFunctionMessage.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Bridge/IsReceiptRecordedFunctionMessage.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Report/AElfReportContractProvider.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Report/IReportContractProvider.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractOptions.cs delete mode 100644 src/AElf.CrossChainServer.Application/CrossChain/CrossChainOptions.cs delete mode 100644 src/AElf.CrossChainServer.Application/CrossChain/EvmTokensOptions.cs delete mode 100644 src/AElf.CrossChainServer.Application/CrossChain/OracleQueryInfoAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application/CrossChain/ReportInfoAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application/CrossChain/ReportJobCategoryOptions.cs delete mode 100644 src/AElf.CrossChainServer.Application/Indexer/EvmIndexerAppService.cs delete mode 100644 src/AElf.CrossChainServer.Application/ReportQueryTimesOptions.cs delete mode 100644 src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleQueryInfoEto.cs delete mode 100644 src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleStep.cs create mode 100644 src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReceiptStatus.cs delete mode 100644 src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportInfoEto.cs delete mode 100644 src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportStep.cs delete mode 100644 src/AElf.CrossChainServer.Domain/BridgeContract/BridgeContractSyncInfo.cs delete mode 100644 src/AElf.CrossChainServer.Domain/BridgeContract/IBridgeContractSyncInfoRepository.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/IOracleQueryInfoRepository.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/IReportInfoRepository.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfo.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfoIndex.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/ReportInfo.cs delete mode 100644 src/AElf.CrossChainServer.Domain/CrossChain/ReportInfoIndex.cs delete mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/BridgeContract/EfCoreBridgeContractSyncInfoRepository.cs delete mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreOracleQueryInfoRepository.cs delete mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreReportInfoRepository.cs create mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.Designer.cs create mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250422164715_For_Check_Transaction_Confirmed.cs create mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.Designer.cs create mode 100644 src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/20250519074042_For_Remove_Unused_Tables.cs delete mode 100644 src/AElf.CrossChainServer.EntityHandler.Core/OracleQueryInfoEntityHandler.cs delete mode 100644 src/AElf.CrossChainServer.EntityHandler.Core/ReportInfoEntityHandler.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/AElf.CrossChainServer.EvmIndexer.csproj create mode 100644 src/AElf.CrossChainServer.EvmIndexer/ContractEventSubscriptionInfo.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/CrossChainServerEvmIndexerModule.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/NewReceiptEvent.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Dtos/Event/Bridge/TokenSwappedEvent.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/NewReceiptReceivedMessageDto.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Dtos/MessageDto/TokenSwappedMessageDto.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/EvmContractSyncOptions.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/EvmIndexerHandlerWorker.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/IEventSubscriber.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/IEvmEventProcessor.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/IEvmEventSubscriptionManager.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/NewReceiptEventProcessor.cs create mode 100644 src/AElf.CrossChainServer.EvmIndexer/Processor/Bridge/TokenSwappedEventProcessor.cs delete mode 100644 src/AElf.CrossChainServer.Worker/BridgeContractSyncOptions.cs create mode 100644 src/AElf.CrossChainServer.Worker/CheckAElfTransactionConfirmedWorker.cs create mode 100644 src/AElf.CrossChainServer.Worker/CheckEvmTransactionConfirmedWorker.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/ConfigChangedEvent.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/DailyLimitSetEvent.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenDailyLimitConsumedEvent.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Dtos/Limit/TokenRateLimitConsumedEvent.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitConsumedSyncProvider.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmDailyLimitSetSyncProvider.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitConsumedSyncProvider.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/Limit/EvmRateLimitSetSyncProvider.cs create mode 100644 src/AElf.CrossChainServer.Worker/EvmIndexerSync/TokenLimitSwapInfoOptions.cs create mode 100644 src/AElf.CrossChainServer.Worker/IndexerSync/BridgeContractSyncOptions.cs create mode 100644 src/AElf.CrossChainServer.Worker/WorkerSyncPeriodOptions.cs delete mode 100644 test/AElf.CrossChainServer.Application.Tests/CrossChain/OracleQueryInfoAppServiceTests.cs delete mode 100644 test/AElf.CrossChainServer.Application.Tests/CrossChain/ReportInfoAppServiceTests.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAggregatePriceProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockAwakenProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockLarkProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockScanProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenImageProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/MockTokenInvokeProvider.cs delete mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessMockTest.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenPool/LiquidityAppServiceTests.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenPool/MockTokenLiquidityMonitorProvider.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenPool/PoolLiquidityInfoAppServiceTests.cs create mode 100644 test/AElf.CrossChainServer.Application.Tests/TokenPool/UserLiquidityInfoAppServicesTest.cs diff --git a/AElf.CrossChainServer.sln b/AElf.CrossChainServer.sln index 88b3a3a..2047560 100644 --- a/AElf.CrossChainServer.sln +++ b/AElf.CrossChainServer.sln @@ -45,6 +45,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CrossChainServer.Aethe 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 @@ -127,6 +129,10 @@ Global {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 @@ -151,6 +157,7 @@ Global {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} diff --git a/CodeCoverage.runsettings b/CodeCoverage.runsettings index 0d25f73..290c399 100755 --- a/CodeCoverage.runsettings +++ b/CodeCoverage.runsettings @@ -7,7 +7,36 @@ cobertura [xunit.*]*,[*Tests]* - **/test/**/*.cs,**/src/AElf.CrossChainServer.IdentityServer/**/*.cs,**/src/AElf.CrossChainServer.DbMigrator/**/*.cs,**/src/AElf.CrossChainServer.EntityHandler/**/*.cs,**/src/AElf.CrossChainServer.ContractEventHandler/**/*.cs,**/src/AElf.CrossChainServer.HttpApi.Host/**/*.cs,**/src/AElf.CrossChainServer.HttpApi.Client/**/*.cs,**/src/AElf.CrossChainServer.Application.Contracts/Contracts/**/*.cs,**/src/AElf.CrossChainServer.Application.Contracts/Permissions/**/*.cs,**/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/*.cs,**/src/AElf.CrossChainServer.Application/Contracts/**/*.cs,**/src/AElf.CrossChainServer.Application/Chains/AElfClientProvider.cs,**/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs,**/src/AElf.CrossChainServer.Application/Indexer/**/*.cs,**/src/AElf.CrossChainServer.Domain/Data/**/*.cs,**/src/AElf.CrossChainServer.Domain/IdentityServer/**/*.cs,**/src/AElf.CrossChainServer.Domain/Chains/ChainDataSeedContributor.cs,**/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContextFactory.cs,**/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCrossChainServerDbSchemaMigrator.cs,**/src/AElf.CrossChainServer.Application/Contracts/CrossChain/ICheckTransferProvider.cs,**/src/AElf.CrossChainServer.Application/HttpClient/*.cs + + **/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 diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContractSyncInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContractSyncInfoDto.cs deleted file mode 100644 index 31d028e..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/BridgeContractSyncInfoDto.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AElf.CrossChainServer.BridgeContract; - -namespace AElf.CrossChainServer.Contracts; - -public class BridgeContractSyncInfoDto -{ - public string ChainId { get; set; } - public Guid TokenId { get; set; } - public TransferType Type { get; set; } - public long SyncIndex { 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 index 84fddf9..423251c 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/IBridgeContractAppService.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/IBridgeContractAppService.cs @@ -8,20 +8,8 @@ namespace AElf.CrossChainServer.Contracts; public interface IBridgeContractAppService { - Task> GetTransferReceiptInfosAsync(string chainId, string targetChainId, Guid tokenId, - long fromIndex, long endIndex); - Task> GetReceivedReceiptInfosAsync(string chainId, string targetChainId, Guid tokenId, - long fromIndex, long endIndex); - Task GetSyncInfoAsync(string chainId, TransferType type, string targetChainId, Guid tokenId); - Task UpdateSyncInfoAsync(string chainId, TransferType type, string targetChainId, Guid tokenId, long syncIndex); - Task> GetTransferReceiptIndexAsync(string chainId, List tokenIds, List targetChainIds); - Task> GetReceiveReceiptIndexAsync(string chainId, List tokenIds, List targetChainIds); - Task CheckTransmitAsync(string chainId, string receiptHash); - Task GetSwapIdByTokenAsync(string chainId, string fromChainId, string symbol); - Task SwapTokenAsync(string chainId, string swapId, string receiptId, string originAmount, - string receiverAddress); - 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); diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/IReportContractAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/IReportContractAppService.cs deleted file mode 100644 index 816a686..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/IReportContractAppService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.Contracts; - -public interface IReportContractAppService -{ - Task QueryOracleAsync(string chainId, string targetChainId, string receiptId, string receiptHash,string receiptInfo); -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.c.cs deleted file mode 100644 index 3eccca8..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.c.cs +++ /dev/null @@ -1,231 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: oracle_contract.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using System.Collections.Generic; -using aelf = global::AElf.CSharp.Core; - -namespace AElf.Contracts.Oracle { - - #region Events - public partial class QueryCreated : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public QueryCreated GetNonIndexed() - { - return new QueryCreated - { - Payment = Payment, - CallbackInfo = CallbackInfo, - AggregatorContractAddress = AggregatorContractAddress, - DesignatedNodeList = DesignatedNodeList, - QueryInfo = QueryInfo, - AggregateThreshold = AggregateThreshold, - QuerySender = QuerySender, - QueryId = QueryId, - Token = Token, - MaximumPermissibleDeviation = MaximumPermissibleDeviation, - AggregateOption = AggregateOption, - TaskId = TaskId, - }; - } - } - - public partial class QueryTaskCreated : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public QueryTaskCreated GetNonIndexed() - { - return new QueryTaskCreated - { - EachPayment = EachPayment, - SupposedQueryTimes = SupposedQueryTimes, - QueryInfo = QueryInfo, - EndTime = EndTime, - DesignatedNodeList = DesignatedNodeList, - AggregatorContractAddress = AggregatorContractAddress, - CallbackInfo = CallbackInfo, - Creator = Creator, - AggregateThreshold = AggregateThreshold, - AggregateOption = AggregateOption, - }; - } - } - - public partial class QueryCancelled : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public QueryCancelled GetNonIndexed() - { - return new QueryCancelled - { - QueryId = QueryId, - }; - } - } - - public partial class SufficientCommitmentsCollected : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public SufficientCommitmentsCollected GetNonIndexed() - { - return new SufficientCommitmentsCollected - { - QueryId = QueryId, - }; - } - } - - public partial class Committed : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public Committed GetNonIndexed() - { - return new Committed - { - QueryId = QueryId, - OracleNodeAddress = OracleNodeAddress, - Commitment = Commitment, - }; - } - } - - public partial class CommitmentRevealed : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public CommitmentRevealed GetNonIndexed() - { - return new CommitmentRevealed - { - QueryId = QueryId, - OracleNodeAddress = OracleNodeAddress, - Commitment = Commitment, - RevealData = RevealData, - Salt = Salt, - }; - } - } - - public partial class CommitmentRevealFailed : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public CommitmentRevealFailed GetNonIndexed() - { - return new CommitmentRevealFailed - { - QueryId = QueryId, - OracleNodeAddress = OracleNodeAddress, - Commitment = Commitment, - RevealData = RevealData, - Salt = Salt, - }; - } - } - - public partial class QueryCompletedWithAggregation : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public QueryCompletedWithAggregation GetNonIndexed() - { - return new QueryCompletedWithAggregation - { - QueryId = QueryId, - Result = Result, - }; - } - } - - public partial class QueryCompletedWithoutAggregation : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public QueryCompletedWithoutAggregation GetNonIndexed() - { - return new QueryCompletedWithoutAggregation - { - QueryId = QueryId, - Result = Result, - }; - } - } - - public partial class TokenLocked : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public TokenLocked GetNonIndexed() - { - return new TokenLocked - { - OracleNodeAddress = OracleNodeAddress, - FromAddress = FromAddress, - LockedAmount = LockedAmount, - }; - } - } - - #endregion -} -#endregion - diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.g.cs deleted file mode 100644 index 06e4e2b..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/OracleContract.g.cs +++ /dev/null @@ -1,8762 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: oracle_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.Oracle { - - /// Holder for reflection information generated from oracle_contract.proto - public static partial class OracleContractReflection { - - #region Descriptor - /// File descriptor for oracle_contract.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static OracleContractReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChVvcmFjbGVfY29udHJhY3QucHJvdG8aD2FlbGYvY29yZS5wcm90bxoSYWVs", - "Zi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8a", - "H2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8aHmdvb2dsZS9wcm90", - "b2J1Zi93cmFwcGVycy5wcm90byLpAQoPSW5pdGlhbGl6ZUlucHV0EiIKGm1p", - "bmltdW1fb3JhY2xlX25vZGVzX2NvdW50GAEgASgFEiAKGGRlZmF1bHRfcmV2", - "ZWFsX3RocmVzaG9sZBgCIAEoBRIjChtkZWZhdWx0X2FnZ3JlZ2F0ZV90aHJl", - "c2hvbGQYAyABKAUSIgoaZGVmYXVsdF9leHBpcmF0aW9uX3NlY29uZHMYBCAB", - "KAUSFQoNaXNfY2hhcmdlX2ZlZRgFIAEoCBIwChlyZWdpbWVudF9jb250cmFj", - "dF9hZGRyZXNzGAYgASgLMg0uYWVsZi5BZGRyZXNzIqYCCgpRdWVyeUlucHV0", - "Eg8KB3BheW1lbnQYASABKAMSJAoNY2FsbGJhY2tfaW5mbxgCIAEoCzINLkNh", - "bGxiYWNrSW5mbxIyChthZ2dyZWdhdG9yX2NvbnRyYWN0X2FkZHJlc3MYAyAB", - "KAsyDS5hZWxmLkFkZHJlc3MSKgoUZGVzaWduYXRlZF9ub2RlX2xpc3QYBCAB", - "KAsyDC5BZGRyZXNzTGlzdBIeCgpxdWVyeV9pbmZvGAUgASgLMgouUXVlcnlJ", - "bmZvEhsKE2FnZ3JlZ2F0ZV90aHJlc2hvbGQYBiABKAUSDQoFdG9rZW4YByAB", - "KAkSGAoQYWdncmVnYXRlX29wdGlvbhgIIAEoBRIbCgd0YXNrX2lkGAkgASgL", - "MgouYWVsZi5IYXNoIqkCChRDcmVhdGVRdWVyeVRhc2tJbnB1dBIUCgxlYWNo", - "X3BheW1lbnQYASABKAMSHAoUc3VwcG9zZWRfcXVlcnlfdGltZXMYAiABKAUS", - "HgoKcXVlcnlfaW5mbxgDIAEoCzIKLlF1ZXJ5SW5mbxIsCghlbmRfdGltZRgE", - "IAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASJAoNY2FsbGJhY2tf", - "aW5mbxgFIAEoCzINLkNhbGxiYWNrSW5mbxIyChthZ2dyZWdhdG9yX2NvbnRy", - "YWN0X2FkZHJlc3MYBiABKAsyDS5hZWxmLkFkZHJlc3MSGAoQYWdncmVnYXRl", - "X29wdGlvbhgHIAEoBRIbChNhZ2dyZWdhdGVfdGhyZXNob2xkGAggASgFIi0K", - "DlRhc2tRdWVyeUlucHV0EhsKB3Rhc2tfaWQYASABKAsyCi5hZWxmLkhhc2gi", - "fgoWQ29tcGxldGVRdWVyeVRhc2tJbnB1dBIbCgd0YXNrX2lkGAEgASgLMgou", - "YWVsZi5IYXNoEioKFGRlc2lnbmF0ZWRfbm9kZV9saXN0GAIgASgLMgwuQWRk", - "cmVzc0xpc3QSGwoTYWdncmVnYXRlX3RocmVzaG9sZBgDIAEoBSJMCgxDYWxs", - "YmFja0luZm8SJwoQY29udHJhY3RfYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRk", - "cmVzcxITCgttZXRob2RfbmFtZRgCIAEoCSIrCgtBZGRyZXNzTGlzdBIcCgV2", - "YWx1ZRgBIAMoCzINLmFlbGYuQWRkcmVzcyKoBQoLUXVlcnlSZWNvcmQSKgoU", - "ZGVzaWduYXRlZF9ub2RlX2xpc3QYASABKAsyDC5BZGRyZXNzTGlzdBIyChth", - "Z2dyZWdhdG9yX2NvbnRyYWN0X2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJl", - "c3MSOAoUZXhwaXJhdGlvbl90aW1lc3RhbXAYAyABKAsyGi5nb29nbGUucHJv", - "dG9idWYuVGltZXN0YW1wEisKI2lzX3N1ZmZpY2llbnRfY29tbWl0bWVudHNf", - "Y29sbGVjdGVkGAQgASgIEiQKHGlzX3N1ZmZpY2llbnRfZGF0YV9jb2xsZWN0", - "ZWQYBSABKAgSFAoMZmluYWxfcmVzdWx0GAYgASgJEg8KB3BheW1lbnQYByAB", - "KAMSJAoNY2FsbGJhY2tfaW5mbxgIIAEoCzINLkNhbGxiYWNrSW5mbxIcCghx", - "dWVyeV9pZBgJIAEoCzIKLmFlbGYuSGFzaBIbChNhZ2dyZWdhdGVfdGhyZXNo", - "b2xkGAogASgFEiMKDHF1ZXJ5X3NlbmRlchgLIAEoCzINLmFlbGYuQWRkcmVz", - "cxIgChhpc19jb21taXRfc3RhZ2VfZmluaXNoZWQYDCABKAgSGQoRY29tbWl0", - "bWVudHNfY291bnQYDSABKAUSFAoMaXNfY2FuY2VsbGVkGA4gASgIEh4KCnF1", - "ZXJ5X2luZm8YDyABKAsyCi5RdWVyeUluZm8SDQoFdG9rZW4YECABKAkSIgoM", - "ZGF0YV9yZWNvcmRzGBEgASgLMgwuRGF0YVJlY29yZHMSGAoQYWdncmVnYXRl", - "X29wdGlvbhgSIAEoBRIbCgd0YXNrX2lkGBMgASgLMgouYWVsZi5IYXNoEiIK", - "GmlzX3BhaWRfdG9fb3JhY2xlX2NvbnRyYWN0GBQgASgIIn0KE0NyZWF0ZVJl", - "Z2ltZW50SW5wdXQSHgoHbWFuYWdlchgBIAEoCzINLmFlbGYuQWRkcmVzcxIq", - "ChNpbml0aWFsX21lbWJlcl9saXN0GAIgAygLMg0uYWVsZi5BZGRyZXNzEhoK", - "EmlzX2FwcHJvdmVfdG9fam9pbhgDIAEoCCJnChFKb2luUmVnaW1lbnRJbnB1", - "dBInChByZWdpbWVudF9hZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEikK", - "Em5ld19tZW1iZXJfYWRkcmVzcxgCIAEoCzINLmFlbGYuQWRkcmVzcyJqChJM", - "ZWF2ZVJlZ2ltZW50SW5wdXQSJwoQcmVnaW1lbnRfYWRkcmVzcxgBIAEoCzIN", - "LmFlbGYuQWRkcmVzcxIrChRsZWF2ZV9tZW1iZXJfYWRkcmVzcxgCIAEoCzIN", - "LmFlbGYuQWRkcmVzcyJsChZBZGRSZWdpbWVudE1lbWJlcklucHV0EicKEHJl", - "Z2ltZW50X2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSKQoSbmV3X21l", - "bWJlcl9hZGRyZXNzGAIgASgLMg0uYWVsZi5BZGRyZXNzInIKGURlbGV0ZVJl", - "Z2ltZW50TWVtYmVySW5wdXQSJwoQcmVnaW1lbnRfYWRkcmVzcxgBIAEoCzIN", - "LmFlbGYuQWRkcmVzcxIsChVkZWxldGVfbWVtYmVyX2FkZHJlc3MYAiABKAsy", - "DS5hZWxmLkFkZHJlc3MiowEKHlRyYW5zZmVyUmVnaW1lbnRPd25lcnNoaXBJ", - "bnB1dBInChByZWdpbWVudF9hZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNz", - "EioKE25ld19tYW5hZ2VyX2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MS", - "LAoVb3JpZ2luX3NlbmRlcl9hZGRyZXNzGAMgASgLMg0uYWVsZi5BZGRyZXNz", - "IooBCg5BZGRBZG1pbnNJbnB1dBInChByZWdpbWVudF9hZGRyZXNzGAEgASgL", - "Mg0uYWVsZi5BZGRyZXNzEiEKCm5ld19hZG1pbnMYAiADKAsyDS5hZWxmLkFk", - "ZHJlc3MSLAoVb3JpZ2luX3NlbmRlcl9hZGRyZXNzGAMgASgLMg0uYWVsZi5B", - "ZGRyZXNzIpABChFEZWxldGVBZG1pbnNJbnB1dBInChByZWdpbWVudF9hZGRy", - "ZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEiQKDWRlbGV0ZV9hZG1pbnMYAiAD", - "KAsyDS5hZWxmLkFkZHJlc3MSLAoVb3JpZ2luX3NlbmRlcl9hZGRyZXNzGAMg", - "ASgLMg0uYWVsZi5BZGRyZXNzIpoDCglRdWVyeVRhc2sSFAoMZWFjaF9wYXlt", - "ZW50GAEgASgDEhwKFHN1cHBvc2VkX3F1ZXJ5X3RpbWVzGAIgASgFEh4KCnF1", - "ZXJ5X2luZm8YAyABKAsyCi5RdWVyeUluZm8SLAoIZW5kX3RpbWUYBCABKAsy", - "Gi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEioKFGRlc2lnbmF0ZWRfbm9k", - "ZV9saXN0GAUgASgLMgwuQWRkcmVzc0xpc3QSMgobYWdncmVnYXRvcl9jb250", - "cmFjdF9hZGRyZXNzGAYgASgLMg0uYWVsZi5BZGRyZXNzEhwKFGFjdHVhbF9x", - "dWVyaWVkX3RpbWVzGAcgASgFEiQKDWNhbGxiYWNrX2luZm8YCCABKAsyDS5D", - "YWxsYmFja0luZm8SHgoHY3JlYXRvchgJIAEoCzINLmFlbGYuQWRkcmVzcxIb", - "ChNhZ2dyZWdhdGVfdGhyZXNob2xkGAogASgFEhgKEGFnZ3JlZ2F0ZV9vcHRp", - "b24YCyABKAUSEAoIb25fZ29pbmcYDCABKAgiSwoLQ29tbWl0SW5wdXQSHAoI", - "cXVlcnlfaWQYASABKAsyCi5hZWxmLkhhc2gSHgoKY29tbWl0bWVudBgCIAEo", - "CzIKLmFlbGYuSGFzaCJTCgtSZXZlYWxJbnB1dBIcCghxdWVyeV9pZBgBIAEo", - "CzIKLmFlbGYuSGFzaBIMCgRkYXRhGAIgASgJEhgKBHNhbHQYAyABKAsyCi5h", - "ZWxmLkhhc2gicwoNQ29tbWl0bWVudE1hcBIoCgV2YWx1ZRgBIAMoCzIZLkNv", - "bW1pdG1lbnRNYXAuVmFsdWVFbnRyeRo4CgpWYWx1ZUVudHJ5EgsKA2tleRgB", - "IAEoCRIZCgV2YWx1ZRgCIAEoCzIKLmFlbGYuSGFzaDoCOAEigAEKE09yYWNs", - "ZU5vZGVUaHJlc2hvbGQSIgoabWluaW11bV9vcmFjbGVfbm9kZXNfY291bnQY", - "ASABKAUSIAoYZGVmYXVsdF9yZXZlYWxfdGhyZXNob2xkGAIgASgFEiMKG2Rl", - "ZmF1bHRfYWdncmVnYXRlX3RocmVzaG9sZBgDIAEoBSIyCgpSZXN1bHRMaXN0", - "Eg8KB3Jlc3VsdHMYASADKAkSEwoLZnJlcXVlbmNpZXMYAiADKAUiOgoKRGF0", - "YVJlY29yZBIeCgdhZGRyZXNzGAEgASgLMg0uYWVsZi5BZGRyZXNzEgwKBGRh", - "dGEYAiABKAkiKQoLRGF0YVJlY29yZHMSGgoFdmFsdWUYASADKAsyCy5EYXRh", - "UmVjb3JkIokBCgtQbGFpblJlc3VsdBIiCgxkYXRhX3JlY29yZHMYASABKAsy", - "DC5EYXRhUmVjb3JkcxInChByZWdpbWVudF9hZGRyZXNzGAIgASgLMg0uYWVs", - "Zi5BZGRyZXNzEh4KCnF1ZXJ5X2luZm8YAyABKAsyCi5RdWVyeUluZm8SDQoF", - "dG9rZW4YBCABKAkiUgoPTG9ja1Rva2Vuc0lucHV0EioKE29yYWNsZV9ub2Rl", - "X2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSEwoLbG9ja19hbW91bnQY", - "AiABKAMiWAoRVW5sb2NrVG9rZW5zSW5wdXQSKgoTb3JhY2xlX25vZGVfYWRk", - "cmVzcxgBIAEoCzINLmFlbGYuQWRkcmVzcxIXCg93aXRoZHJhd19hbW91bnQY", - "AiABKAMiKwoJUXVlcnlJbmZvEg0KBXRpdGxlGAEgASgJEg8KB29wdGlvbnMY", - "AiADKAkimAMKDFF1ZXJ5Q3JlYXRlZBIPCgdwYXltZW50GAEgASgDEiQKDWNh", - "bGxiYWNrX2luZm8YAiABKAsyDS5DYWxsYmFja0luZm8SMgobYWdncmVnYXRv", - "cl9jb250cmFjdF9hZGRyZXNzGAMgASgLMg0uYWVsZi5BZGRyZXNzEioKFGRl", - "c2lnbmF0ZWRfbm9kZV9saXN0GAQgASgLMgwuQWRkcmVzc0xpc3QSHgoKcXVl", - "cnlfaW5mbxgFIAEoCzIKLlF1ZXJ5SW5mbxIbChNhZ2dyZWdhdGVfdGhyZXNo", - "b2xkGAYgASgFEiMKDHF1ZXJ5X3NlbmRlchgHIAEoCzINLmFlbGYuQWRkcmVz", - "cxIcCghxdWVyeV9pZBgIIAEoCzIKLmFlbGYuSGFzaBINCgV0b2tlbhgJIAEo", - "CRIlCh1tYXhpbXVtX3Blcm1pc3NpYmxlX2RldmlhdGlvbhgKIAEoBRIYChBh", - "Z2dyZWdhdGVfb3B0aW9uGAsgASgFEhsKB3Rhc2tfaWQYDCABKAsyCi5hZWxm", - "Lkhhc2g6BKC7GAEi9wIKEFF1ZXJ5VGFza0NyZWF0ZWQSFAoMZWFjaF9wYXlt", - "ZW50GAEgASgDEhwKFHN1cHBvc2VkX3F1ZXJ5X3RpbWVzGAIgASgFEh4KCnF1", - "ZXJ5X2luZm8YAyABKAsyCi5RdWVyeUluZm8SLAoIZW5kX3RpbWUYBCABKAsy", - "Gi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEioKFGRlc2lnbmF0ZWRfbm9k", - "ZV9saXN0GAUgASgLMgwuQWRkcmVzc0xpc3QSMgobYWdncmVnYXRvcl9jb250", - "cmFjdF9hZGRyZXNzGAYgASgLMg0uYWVsZi5BZGRyZXNzEiQKDWNhbGxiYWNr", - "X2luZm8YByABKAsyDS5DYWxsYmFja0luZm8SHgoHY3JlYXRvchgIIAEoCzIN", - "LmFlbGYuQWRkcmVzcxIbChNhZ2dyZWdhdGVfdGhyZXNob2xkGAkgASgFEhgK", - "EGFnZ3JlZ2F0ZV9vcHRpb24YCiABKAU6BKC7GAEiNAoOUXVlcnlDYW5jZWxs", - "ZWQSHAoIcXVlcnlfaWQYASABKAsyCi5hZWxmLkhhc2g6BKC7GAEiRAoeU3Vm", - "ZmljaWVudENvbW1pdG1lbnRzQ29sbGVjdGVkEhwKCHF1ZXJ5X2lkGAEgASgL", - "MgouYWVsZi5IYXNoOgSguxgBInsKCUNvbW1pdHRlZBIcCghxdWVyeV9pZBgB", - "IAEoCzIKLmFlbGYuSGFzaBIqChNvcmFjbGVfbm9kZV9hZGRyZXNzGAIgASgL", - "Mg0uYWVsZi5BZGRyZXNzEh4KCmNvbW1pdG1lbnQYAyABKAsyCi5hZWxmLkhh", - "c2g6BKC7GAEiswEKEkNvbW1pdG1lbnRSZXZlYWxlZBIcCghxdWVyeV9pZBgB", - "IAEoCzIKLmFlbGYuSGFzaBIqChNvcmFjbGVfbm9kZV9hZGRyZXNzGAIgASgL", - "Mg0uYWVsZi5BZGRyZXNzEh4KCmNvbW1pdG1lbnQYAyABKAsyCi5hZWxmLkhh", - "c2gSEwoLcmV2ZWFsX2RhdGEYBCABKAkSGAoEc2FsdBgFIAEoCzIKLmFlbGYu", - "SGFzaDoEoLsYASK3AQoWQ29tbWl0bWVudFJldmVhbEZhaWxlZBIcCghxdWVy", - "eV9pZBgBIAEoCzIKLmFlbGYuSGFzaBIqChNvcmFjbGVfbm9kZV9hZGRyZXNz", - "GAIgASgLMg0uYWVsZi5BZGRyZXNzEh4KCmNvbW1pdG1lbnQYAyABKAsyCi5h", - "ZWxmLkhhc2gSEwoLcmV2ZWFsX2RhdGEYBCABKAkSGAoEc2FsdBgFIAEoCzIK", - "LmFlbGYuSGFzaDoEoLsYASJTCh1RdWVyeUNvbXBsZXRlZFdpdGhBZ2dyZWdh", - "dGlvbhIcCghxdWVyeV9pZBgBIAEoCzIKLmFlbGYuSGFzaBIOCgZyZXN1bHQY", - "AiABKAk6BKC7GAEiZAogUXVlcnlDb21wbGV0ZWRXaXRob3V0QWdncmVnYXRp", - "b24SHAoIcXVlcnlfaWQYASABKAsyCi5hZWxmLkhhc2gSHAoGcmVzdWx0GAIg", - "ASgLMgwuUGxhaW5SZXN1bHQ6BKC7GAEiewoLVG9rZW5Mb2NrZWQSKgoTb3Jh", - "Y2xlX25vZGVfYWRkcmVzcxgBIAEoCzINLmFlbGYuQWRkcmVzcxIjCgxmcm9t", - "X2FkZHJlc3MYAiABKAsyDS5hZWxmLkFkZHJlc3MSFQoNbG9ja2VkX2Ftb3Vu", - "dBgDIAEoAzoEoLsYATLuEQoOT3JhY2xlQ29udHJhY3QSOAoKSW5pdGlhbGl6", - "ZRIQLkluaXRpYWxpemVJbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIA", - "EkYKGEluaXRpYWxpemVBbmRDcmVhdGVUb2tlbhIQLkluaXRpYWxpemVJbnB1", - "dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEiIKBVF1ZXJ5EgsuUXVlcnlJ", - "bnB1dBoKLmFlbGYuSGFzaCIAEjAKBkNvbW1pdBIMLkNvbW1pdElucHV0GhYu", - "Z29vZ2xlLnByb3RvYnVmLkVtcHR5IgASMAoGUmV2ZWFsEgwuUmV2ZWFsSW5w", - "dXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABIzCgtDYW5jZWxRdWVyeRIK", - "LmFlbGYuSGFzaBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjYKD0NyZWF0", - "ZVF1ZXJ5VGFzaxIVLkNyZWF0ZVF1ZXJ5VGFza0lucHV0GgouYWVsZi5IYXNo", - "IgASKgoJVGFza1F1ZXJ5Eg8uVGFza1F1ZXJ5SW5wdXQaCi5hZWxmLkhhc2gi", - "ABJGChFDb21wbGV0ZVF1ZXJ5VGFzaxIXLkNvbXBsZXRlUXVlcnlUYXNrSW5w", - "dXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI7ChBDaGFuZ2VDb250cm9s", - "bGVyEg0uYWVsZi5BZGRyZXNzGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS", - "QAoOQ3JlYXRlUmVnaW1lbnQSFC5DcmVhdGVSZWdpbWVudElucHV0GhYuZ29v", - "Z2xlLnByb3RvYnVmLkVtcHR5IgASPAoMSm9pblJlZ2ltZW50EhIuSm9pblJl", - "Z2ltZW50SW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI+Cg1MZWF2", - "ZVJlZ2ltZW50EhMuTGVhdmVSZWdpbWVudElucHV0GhYuZ29vZ2xlLnByb3Rv", - "YnVmLkVtcHR5IgASRgoRQWRkUmVnaW1lbnRNZW1iZXISFy5BZGRSZWdpbWVu", - "dE1lbWJlcklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASTAoURGVs", - "ZXRlUmVnaW1lbnRNZW1iZXISGi5EZWxldGVSZWdpbWVudE1lbWJlcklucHV0", - "GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASVgoZVHJhbnNmZXJSZWdpbWVu", - "dE93bmVyc2hpcBIfLlRyYW5zZmVyUmVnaW1lbnRPd25lcnNoaXBJbnB1dBoW", - "Lmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEjYKCUFkZEFkbWlucxIPLkFkZEFk", - "bWluc0lucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASPAoMRGVsZXRl", - "QWRtaW5zEhIuRGVsZXRlQWRtaW5zSW5wdXQaFi5nb29nbGUucHJvdG9idWYu", - "RW1wdHkiABI4CgpMb2NrVG9rZW5zEhAuTG9ja1Rva2Vuc0lucHV0GhYuZ29v", - "Z2xlLnByb3RvYnVmLkVtcHR5IgASPAoMVW5sb2NrVG9rZW5zEhIuVW5sb2Nr", - "VG9rZW5zSW5wdXQaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI+CgxTZXRU", - "aHJlc2hvbGQSFC5PcmFjbGVOb2RlVGhyZXNob2xkGhYuZ29vZ2xlLnByb3Rv", - "YnVmLkVtcHR5IgASVwoeQ2hhbmdlRGVmYXVsdEV4cGlyYXRpb25TZWNvbmRz", - "EhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUaFi5nb29nbGUucHJvdG9i", - "dWYuRW1wdHkiABJDCg9FbmFibGVDaGFyZ2VGZWUSFi5nb29nbGUucHJvdG9i", - "dWYuRW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI8ChFBZGRQb3N0", - "UGF5QWRkcmVzcxINLmFlbGYuQWRkcmVzcxoWLmdvb2dsZS5wcm90b2J1Zi5F", - "bXB0eSIAEj8KFFJlbW92ZVBvc3RQYXlBZGRyZXNzEg0uYWVsZi5BZGRyZXNz", - "GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASPQoNR2V0Q29udHJvbGxlchIW", - "Lmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoNLmFlbGYuQWRkcmVzcyIFiIn3AQES", - "MQoOR2V0UXVlcnlSZWNvcmQSCi5hZWxmLkhhc2gaDC5RdWVyeVJlY29yZCIF", - "iIn3AQESNQoQR2V0Q29tbWl0bWVudE1hcBIKLmFlbGYuSGFzaBoOLkNvbW1p", - "dG1lbnRNYXAiBYiJ9wEBElMKFEdldE9yYWNsZVRva2VuU3ltYm9sEhYuZ29v", - "Z2xlLnByb3RvYnVmLkVtcHR5GhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1Zh", - "bHVlIgWIifcBARJKChVHZXRMb2NrZWRUb2tlbnNBbW91bnQSDS5hZWxmLkFk", - "ZHJlc3MaGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZSIFiIn3AQESQwoM", - "R2V0VGhyZXNob2xkEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhQuT3JhY2xl", - "Tm9kZVRocmVzaG9sZCIFiIn3AQESWQobR2V0RGVmYXVsdEV4cGlyYXRpb25T", - "ZWNvbmRzEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhsuZ29vZ2xlLnByb3Rv", - "YnVmLkludDMyVmFsdWUiBYiJ9wEBEjUKEkdldEhlbHBmdWxOb2RlTGlzdBIK", - "LmFlbGYuSGFzaBoMLkFkZHJlc3NMaXN0IgWIifcBARItCgxHZXRRdWVyeVRh", - "c2sSCi5hZWxmLkhhc2gaCi5RdWVyeVRhc2siBYiJ9wEBEjsKFUdldFJlZ2lt", - "ZW50TWVtYmVyTGlzdBINLmFlbGYuQWRkcmVzcxoMLkFkZHJlc3NMaXN0IgWI", - "ifcBARoussz2ASlBRWxmLkNvbnRyYWN0cy5PcmFjbGUuT3JhY2xlQ29udHJh", - "Y3RTdGF0ZUIYqgIVQUVsZi5Db250cmFjdHMuT3JhY2xlYgZwcm90bzM=")); - 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.Oracle.InitializeInput), global::AElf.Contracts.Oracle.InitializeInput.Parser, new[]{ "MinimumOracleNodesCount", "DefaultRevealThreshold", "DefaultAggregateThreshold", "DefaultExpirationSeconds", "IsChargeFee", "RegimentContractAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryInput), global::AElf.Contracts.Oracle.QueryInput.Parser, new[]{ "Payment", "CallbackInfo", "AggregatorContractAddress", "DesignatedNodeList", "QueryInfo", "AggregateThreshold", "Token", "AggregateOption", "TaskId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CreateQueryTaskInput), global::AElf.Contracts.Oracle.CreateQueryTaskInput.Parser, new[]{ "EachPayment", "SupposedQueryTimes", "QueryInfo", "EndTime", "CallbackInfo", "AggregatorContractAddress", "AggregateOption", "AggregateThreshold" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.TaskQueryInput), global::AElf.Contracts.Oracle.TaskQueryInput.Parser, new[]{ "TaskId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CompleteQueryTaskInput), global::AElf.Contracts.Oracle.CompleteQueryTaskInput.Parser, new[]{ "TaskId", "DesignatedNodeList", "AggregateThreshold" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CallbackInfo), global::AElf.Contracts.Oracle.CallbackInfo.Parser, new[]{ "ContractAddress", "MethodName" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.AddressList), global::AElf.Contracts.Oracle.AddressList.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryRecord), global::AElf.Contracts.Oracle.QueryRecord.Parser, new[]{ "DesignatedNodeList", "AggregatorContractAddress", "ExpirationTimestamp", "IsSufficientCommitmentsCollected", "IsSufficientDataCollected", "FinalResult", "Payment", "CallbackInfo", "QueryId", "AggregateThreshold", "QuerySender", "IsCommitStageFinished", "CommitmentsCount", "IsCancelled", "QueryInfo", "Token", "DataRecords", "AggregateOption", "TaskId", "IsPaidToOracleContract" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CreateRegimentInput), global::AElf.Contracts.Oracle.CreateRegimentInput.Parser, new[]{ "Manager", "InitialMemberList", "IsApproveToJoin" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.JoinRegimentInput), global::AElf.Contracts.Oracle.JoinRegimentInput.Parser, new[]{ "RegimentAddress", "NewMemberAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.LeaveRegimentInput), global::AElf.Contracts.Oracle.LeaveRegimentInput.Parser, new[]{ "RegimentAddress", "LeaveMemberAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.AddRegimentMemberInput), global::AElf.Contracts.Oracle.AddRegimentMemberInput.Parser, new[]{ "RegimentAddress", "NewMemberAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.DeleteRegimentMemberInput), global::AElf.Contracts.Oracle.DeleteRegimentMemberInput.Parser, new[]{ "RegimentAddress", "DeleteMemberAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.TransferRegimentOwnershipInput), global::AElf.Contracts.Oracle.TransferRegimentOwnershipInput.Parser, new[]{ "RegimentAddress", "NewManagerAddress", "OriginSenderAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.AddAdminsInput), global::AElf.Contracts.Oracle.AddAdminsInput.Parser, new[]{ "RegimentAddress", "NewAdmins", "OriginSenderAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.DeleteAdminsInput), global::AElf.Contracts.Oracle.DeleteAdminsInput.Parser, new[]{ "RegimentAddress", "DeleteAdmins", "OriginSenderAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryTask), global::AElf.Contracts.Oracle.QueryTask.Parser, new[]{ "EachPayment", "SupposedQueryTimes", "QueryInfo", "EndTime", "DesignatedNodeList", "AggregatorContractAddress", "ActualQueriedTimes", "CallbackInfo", "Creator", "AggregateThreshold", "AggregateOption", "OnGoing" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CommitInput), global::AElf.Contracts.Oracle.CommitInput.Parser, new[]{ "QueryId", "Commitment" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.RevealInput), global::AElf.Contracts.Oracle.RevealInput.Parser, new[]{ "QueryId", "Data", "Salt" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CommitmentMap), global::AElf.Contracts.Oracle.CommitmentMap.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.OracleNodeThreshold), global::AElf.Contracts.Oracle.OracleNodeThreshold.Parser, new[]{ "MinimumOracleNodesCount", "DefaultRevealThreshold", "DefaultAggregateThreshold" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.ResultList), global::AElf.Contracts.Oracle.ResultList.Parser, new[]{ "Results", "Frequencies" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.DataRecord), global::AElf.Contracts.Oracle.DataRecord.Parser, new[]{ "Address", "Data" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.DataRecords), global::AElf.Contracts.Oracle.DataRecords.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.PlainResult), global::AElf.Contracts.Oracle.PlainResult.Parser, new[]{ "DataRecords", "RegimentAddress", "QueryInfo", "Token" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.LockTokensInput), global::AElf.Contracts.Oracle.LockTokensInput.Parser, new[]{ "OracleNodeAddress", "LockAmount" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.UnlockTokensInput), global::AElf.Contracts.Oracle.UnlockTokensInput.Parser, new[]{ "OracleNodeAddress", "WithdrawAmount" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryInfo), global::AElf.Contracts.Oracle.QueryInfo.Parser, new[]{ "Title", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryCreated), global::AElf.Contracts.Oracle.QueryCreated.Parser, new[]{ "Payment", "CallbackInfo", "AggregatorContractAddress", "DesignatedNodeList", "QueryInfo", "AggregateThreshold", "QuerySender", "QueryId", "Token", "MaximumPermissibleDeviation", "AggregateOption", "TaskId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryTaskCreated), global::AElf.Contracts.Oracle.QueryTaskCreated.Parser, new[]{ "EachPayment", "SupposedQueryTimes", "QueryInfo", "EndTime", "DesignatedNodeList", "AggregatorContractAddress", "CallbackInfo", "Creator", "AggregateThreshold", "AggregateOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryCancelled), global::AElf.Contracts.Oracle.QueryCancelled.Parser, new[]{ "QueryId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.SufficientCommitmentsCollected), global::AElf.Contracts.Oracle.SufficientCommitmentsCollected.Parser, new[]{ "QueryId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.Committed), global::AElf.Contracts.Oracle.Committed.Parser, new[]{ "QueryId", "OracleNodeAddress", "Commitment" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CommitmentRevealed), global::AElf.Contracts.Oracle.CommitmentRevealed.Parser, new[]{ "QueryId", "OracleNodeAddress", "Commitment", "RevealData", "Salt" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.CommitmentRevealFailed), global::AElf.Contracts.Oracle.CommitmentRevealFailed.Parser, new[]{ "QueryId", "OracleNodeAddress", "Commitment", "RevealData", "Salt" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryCompletedWithAggregation), global::AElf.Contracts.Oracle.QueryCompletedWithAggregation.Parser, new[]{ "QueryId", "Result" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.QueryCompletedWithoutAggregation), global::AElf.Contracts.Oracle.QueryCompletedWithoutAggregation.Parser, new[]{ "QueryId", "Result" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Oracle.TokenLocked), global::AElf.Contracts.Oracle.TokenLocked.Parser, new[]{ "OracleNodeAddress", "FromAddress", "LockedAmount" }, null, null, null, null) - })); - } - #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.Oracle.OracleContractReflection.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() { - minimumOracleNodesCount_ = other.minimumOracleNodesCount_; - defaultRevealThreshold_ = other.defaultRevealThreshold_; - defaultAggregateThreshold_ = other.defaultAggregateThreshold_; - defaultExpirationSeconds_ = other.defaultExpirationSeconds_; - isChargeFee_ = other.isChargeFee_; - regimentContractAddress_ = other.regimentContractAddress_ != null ? other.regimentContractAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitializeInput Clone() { - return new InitializeInput(this); - } - - /// Field number for the "minimum_oracle_nodes_count" field. - public const int MinimumOracleNodesCountFieldNumber = 1; - private int minimumOracleNodesCount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinimumOracleNodesCount { - get { return minimumOracleNodesCount_; } - set { - minimumOracleNodesCount_ = value; - } - } - - /// Field number for the "default_reveal_threshold" field. - public const int DefaultRevealThresholdFieldNumber = 2; - private int defaultRevealThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int DefaultRevealThreshold { - get { return defaultRevealThreshold_; } - set { - defaultRevealThreshold_ = value; - } - } - - /// Field number for the "default_aggregate_threshold" field. - public const int DefaultAggregateThresholdFieldNumber = 3; - private int defaultAggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int DefaultAggregateThreshold { - get { return defaultAggregateThreshold_; } - set { - defaultAggregateThreshold_ = value; - } - } - - /// Field number for the "default_expiration_seconds" field. - public const int DefaultExpirationSecondsFieldNumber = 4; - private int defaultExpirationSeconds_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int DefaultExpirationSeconds { - get { return defaultExpirationSeconds_; } - set { - defaultExpirationSeconds_ = value; - } - } - - /// Field number for the "is_charge_fee" field. - public const int IsChargeFeeFieldNumber = 5; - private bool isChargeFee_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsChargeFee { - get { return isChargeFee_; } - set { - isChargeFee_ = value; - } - } - - /// Field number for the "regiment_contract_address" field. - public const int RegimentContractAddressFieldNumber = 6; - private global::AElf.Types.Address regimentContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentContractAddress { - get { return regimentContractAddress_; } - set { - regimentContractAddress_ = 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 (MinimumOracleNodesCount != other.MinimumOracleNodesCount) return false; - if (DefaultRevealThreshold != other.DefaultRevealThreshold) return false; - if (DefaultAggregateThreshold != other.DefaultAggregateThreshold) return false; - if (DefaultExpirationSeconds != other.DefaultExpirationSeconds) return false; - if (IsChargeFee != other.IsChargeFee) return false; - if (!object.Equals(RegimentContractAddress, other.RegimentContractAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinimumOracleNodesCount != 0) hash ^= MinimumOracleNodesCount.GetHashCode(); - if (DefaultRevealThreshold != 0) hash ^= DefaultRevealThreshold.GetHashCode(); - if (DefaultAggregateThreshold != 0) hash ^= DefaultAggregateThreshold.GetHashCode(); - if (DefaultExpirationSeconds != 0) hash ^= DefaultExpirationSeconds.GetHashCode(); - if (IsChargeFee != false) hash ^= IsChargeFee.GetHashCode(); - if (regimentContractAddress_ != null) hash ^= RegimentContractAddress.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 (MinimumOracleNodesCount != 0) { - output.WriteRawTag(8); - output.WriteInt32(MinimumOracleNodesCount); - } - if (DefaultRevealThreshold != 0) { - output.WriteRawTag(16); - output.WriteInt32(DefaultRevealThreshold); - } - if (DefaultAggregateThreshold != 0) { - output.WriteRawTag(24); - output.WriteInt32(DefaultAggregateThreshold); - } - if (DefaultExpirationSeconds != 0) { - output.WriteRawTag(32); - output.WriteInt32(DefaultExpirationSeconds); - } - if (IsChargeFee != false) { - output.WriteRawTag(40); - output.WriteBool(IsChargeFee); - } - if (regimentContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(RegimentContractAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinimumOracleNodesCount != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinimumOracleNodesCount); - } - if (DefaultRevealThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DefaultRevealThreshold); - } - if (DefaultAggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DefaultAggregateThreshold); - } - if (DefaultExpirationSeconds != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DefaultExpirationSeconds); - } - if (IsChargeFee != false) { - size += 1 + 1; - } - if (regimentContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentContractAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(InitializeInput other) { - if (other == null) { - return; - } - if (other.MinimumOracleNodesCount != 0) { - MinimumOracleNodesCount = other.MinimumOracleNodesCount; - } - if (other.DefaultRevealThreshold != 0) { - DefaultRevealThreshold = other.DefaultRevealThreshold; - } - if (other.DefaultAggregateThreshold != 0) { - DefaultAggregateThreshold = other.DefaultAggregateThreshold; - } - if (other.DefaultExpirationSeconds != 0) { - DefaultExpirationSeconds = other.DefaultExpirationSeconds; - } - if (other.IsChargeFee != false) { - IsChargeFee = other.IsChargeFee; - } - if (other.regimentContractAddress_ != null) { - if (regimentContractAddress_ == null) { - RegimentContractAddress = new global::AElf.Types.Address(); - } - RegimentContractAddress.MergeFrom(other.RegimentContractAddress); - } - _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: { - MinimumOracleNodesCount = input.ReadInt32(); - break; - } - case 16: { - DefaultRevealThreshold = input.ReadInt32(); - break; - } - case 24: { - DefaultAggregateThreshold = input.ReadInt32(); - break; - } - case 32: { - DefaultExpirationSeconds = input.ReadInt32(); - break; - } - case 40: { - IsChargeFee = input.ReadBool(); - break; - } - case 50: { - if (regimentContractAddress_ == null) { - RegimentContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentContractAddress); - break; - } - } - } - } - - } - - public sealed partial class QueryInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInput(QueryInput other) : this() { - payment_ = other.payment_; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - token_ = other.token_; - aggregateOption_ = other.aggregateOption_; - taskId_ = other.taskId_ != null ? other.taskId_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInput Clone() { - return new QueryInput(this); - } - - /// Field number for the "payment" field. - public const int PaymentFieldNumber = 1; - private long payment_; - /// - /// Maximum for this query option. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Payment { - get { return payment_; } - set { - payment_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 2; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 3; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 4; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - /// - /// Will be regiment address if count is 1. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 5; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 6; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 7; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 8; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - /// Field number for the "task_id" field. - public const int TaskIdFieldNumber = 9; - private global::AElf.Types.Hash taskId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash TaskId { - get { return taskId_; } - set { - taskId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Payment != other.Payment) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (Token != other.Token) return false; - if (AggregateOption != other.AggregateOption) return false; - if (!object.Equals(TaskId, other.TaskId)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Payment != 0L) hash ^= Payment.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.GetHashCode(); - if (taskId_ != null) hash ^= TaskId.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 (Payment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Payment); - } - if (callbackInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(26); - output.WriteMessage(AggregatorContractAddress); - } - if (designatedNodeList_ != null) { - output.WriteRawTag(34); - output.WriteMessage(DesignatedNodeList); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(48); - output.WriteInt32(AggregateThreshold); - } - if (Token.Length != 0) { - output.WriteRawTag(58); - output.WriteString(Token); - } - if (AggregateOption != 0) { - output.WriteRawTag(64); - output.WriteInt32(AggregateOption); - } - if (taskId_ != null) { - output.WriteRawTag(74); - output.WriteMessage(TaskId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Payment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Payment); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (taskId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TaskId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryInput other) { - if (other == null) { - return; - } - if (other.Payment != 0L) { - Payment = other.Payment; - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - if (other.taskId_ != null) { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - TaskId.MergeFrom(other.TaskId); - } - _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: { - Payment = input.ReadInt64(); - break; - } - case 18: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 26: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 34: { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 48: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 58: { - Token = input.ReadString(); - break; - } - case 64: { - AggregateOption = input.ReadInt32(); - break; - } - case 74: { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - input.ReadMessage(TaskId); - break; - } - } - } - } - - } - - public sealed partial class CreateQueryTaskInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateQueryTaskInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateQueryTaskInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateQueryTaskInput(CreateQueryTaskInput other) : this() { - eachPayment_ = other.eachPayment_; - supposedQueryTimes_ = other.supposedQueryTimes_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - endTime_ = other.endTime_ != null ? other.endTime_.Clone() : null; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - aggregateOption_ = other.aggregateOption_; - aggregateThreshold_ = other.aggregateThreshold_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateQueryTaskInput Clone() { - return new CreateQueryTaskInput(this); - } - - /// Field number for the "each_payment" field. - public const int EachPaymentFieldNumber = 1; - private long eachPayment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long EachPayment { - get { return eachPayment_; } - set { - eachPayment_ = value; - } - } - - /// Field number for the "supposed_query_times" field. - public const int SupposedQueryTimesFieldNumber = 2; - private int supposedQueryTimes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int SupposedQueryTimes { - get { return supposedQueryTimes_; } - set { - supposedQueryTimes_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 3; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "end_time" field. - public const int EndTimeFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Timestamp endTime_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp EndTime { - get { return endTime_; } - set { - endTime_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 5; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 7; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 8; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CreateQueryTaskInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CreateQueryTaskInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (EachPayment != other.EachPayment) return false; - if (SupposedQueryTimes != other.SupposedQueryTimes) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (!object.Equals(EndTime, other.EndTime)) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (AggregateOption != other.AggregateOption) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (EachPayment != 0L) hash ^= EachPayment.GetHashCode(); - if (SupposedQueryTimes != 0) hash ^= SupposedQueryTimes.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (endTime_ != null) hash ^= EndTime.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.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 (EachPayment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(EachPayment); - } - if (SupposedQueryTimes != 0) { - output.WriteRawTag(16); - output.WriteInt32(SupposedQueryTimes); - } - if (queryInfo_ != null) { - output.WriteRawTag(26); - output.WriteMessage(QueryInfo); - } - if (endTime_ != null) { - output.WriteRawTag(34); - output.WriteMessage(EndTime); - } - if (callbackInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (AggregateOption != 0) { - output.WriteRawTag(56); - output.WriteInt32(AggregateOption); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(64); - output.WriteInt32(AggregateThreshold); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (EachPayment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(EachPayment); - } - if (SupposedQueryTimes != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(SupposedQueryTimes); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (endTime_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(EndTime); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CreateQueryTaskInput other) { - if (other == null) { - return; - } - if (other.EachPayment != 0L) { - EachPayment = other.EachPayment; - } - if (other.SupposedQueryTimes != 0) { - SupposedQueryTimes = other.SupposedQueryTimes; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.endTime_ != null) { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - EndTime.MergeFrom(other.EndTime); - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - _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: { - EachPayment = input.ReadInt64(); - break; - } - case 16: { - SupposedQueryTimes = input.ReadInt32(); - break; - } - case 26: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 34: { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(EndTime); - break; - } - case 42: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 56: { - AggregateOption = input.ReadInt32(); - break; - } - case 64: { - AggregateThreshold = input.ReadInt32(); - break; - } - } - } - } - - } - - public sealed partial class TaskQueryInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TaskQueryInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TaskQueryInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TaskQueryInput(TaskQueryInput other) : this() { - taskId_ = other.taskId_ != null ? other.taskId_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TaskQueryInput Clone() { - return new TaskQueryInput(this); - } - - /// Field number for the "task_id" field. - public const int TaskIdFieldNumber = 1; - private global::AElf.Types.Hash taskId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash TaskId { - get { return taskId_; } - set { - taskId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TaskQueryInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TaskQueryInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(TaskId, other.TaskId)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (taskId_ != null) hash ^= TaskId.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 (taskId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(TaskId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (taskId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TaskId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TaskQueryInput other) { - if (other == null) { - return; - } - if (other.taskId_ != null) { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - TaskId.MergeFrom(other.TaskId); - } - _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 (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - input.ReadMessage(TaskId); - break; - } - } - } - } - - } - - public sealed partial class CompleteQueryTaskInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CompleteQueryTaskInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CompleteQueryTaskInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CompleteQueryTaskInput(CompleteQueryTaskInput other) : this() { - taskId_ = other.taskId_ != null ? other.taskId_.Clone() : null; - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CompleteQueryTaskInput Clone() { - return new CompleteQueryTaskInput(this); - } - - /// Field number for the "task_id" field. - public const int TaskIdFieldNumber = 1; - private global::AElf.Types.Hash taskId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash TaskId { - get { return taskId_; } - set { - taskId_ = value; - } - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 2; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 3; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CompleteQueryTaskInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CompleteQueryTaskInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(TaskId, other.TaskId)) return false; - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (taskId_ != null) hash ^= TaskId.GetHashCode(); - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.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 (taskId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(TaskId); - } - if (designatedNodeList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(DesignatedNodeList); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(24); - output.WriteInt32(AggregateThreshold); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (taskId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TaskId); - } - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CompleteQueryTaskInput other) { - if (other == null) { - return; - } - if (other.taskId_ != null) { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - TaskId.MergeFrom(other.TaskId); - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - _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 (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - input.ReadMessage(TaskId); - break; - } - case 18: { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 24: { - AggregateThreshold = input.ReadInt32(); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[5]; } - } - - [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 AddressList : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressList()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddressList() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddressList(AddressList other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddressList Clone() { - return new AddressList(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.Address.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 AddressList); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AddressList 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(AddressList 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 QueryRecord : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryRecord()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryRecord() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryRecord(QueryRecord other) : this() { - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - expirationTimestamp_ = other.expirationTimestamp_ != null ? other.expirationTimestamp_.Clone() : null; - isSufficientCommitmentsCollected_ = other.isSufficientCommitmentsCollected_; - isSufficientDataCollected_ = other.isSufficientDataCollected_; - finalResult_ = other.finalResult_; - payment_ = other.payment_; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - querySender_ = other.querySender_ != null ? other.querySender_.Clone() : null; - isCommitStageFinished_ = other.isCommitStageFinished_; - commitmentsCount_ = other.commitmentsCount_; - isCancelled_ = other.isCancelled_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - token_ = other.token_; - dataRecords_ = other.dataRecords_ != null ? other.dataRecords_.Clone() : null; - aggregateOption_ = other.aggregateOption_; - taskId_ = other.taskId_ != null ? other.taskId_.Clone() : null; - isPaidToOracleContract_ = other.isPaidToOracleContract_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryRecord Clone() { - return new QueryRecord(this); - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 1; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 2; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "expiration_timestamp" field. - public const int ExpirationTimestampFieldNumber = 3; - private global::Google.Protobuf.WellKnownTypes.Timestamp expirationTimestamp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp ExpirationTimestamp { - get { return expirationTimestamp_; } - set { - expirationTimestamp_ = value; - } - } - - /// Field number for the "is_sufficient_commitments_collected" field. - public const int IsSufficientCommitmentsCollectedFieldNumber = 4; - private bool isSufficientCommitmentsCollected_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsSufficientCommitmentsCollected { - get { return isSufficientCommitmentsCollected_; } - set { - isSufficientCommitmentsCollected_ = value; - } - } - - /// Field number for the "is_sufficient_data_collected" field. - public const int IsSufficientDataCollectedFieldNumber = 5; - private bool isSufficientDataCollected_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsSufficientDataCollected { - get { return isSufficientDataCollected_; } - set { - isSufficientDataCollected_ = value; - } - } - - /// Field number for the "final_result" field. - public const int FinalResultFieldNumber = 6; - private string finalResult_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string FinalResult { - get { return finalResult_; } - set { - finalResult_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "payment" field. - public const int PaymentFieldNumber = 7; - private long payment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Payment { - get { return payment_; } - set { - payment_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 8; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 9; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 10; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "query_sender" field. - public const int QuerySenderFieldNumber = 11; - private global::AElf.Types.Address querySender_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address QuerySender { - get { return querySender_; } - set { - querySender_ = value; - } - } - - /// Field number for the "is_commit_stage_finished" field. - public const int IsCommitStageFinishedFieldNumber = 12; - private bool isCommitStageFinished_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsCommitStageFinished { - get { return isCommitStageFinished_; } - set { - isCommitStageFinished_ = value; - } - } - - /// Field number for the "commitments_count" field. - public const int CommitmentsCountFieldNumber = 13; - private int commitmentsCount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CommitmentsCount { - get { return commitmentsCount_; } - set { - commitmentsCount_ = value; - } - } - - /// Field number for the "is_cancelled" field. - public const int IsCancelledFieldNumber = 14; - private bool isCancelled_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsCancelled { - get { return isCancelled_; } - set { - isCancelled_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 15; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 16; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "data_records" field. - public const int DataRecordsFieldNumber = 17; - private global::AElf.Contracts.Oracle.DataRecords dataRecords_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.DataRecords DataRecords { - get { return dataRecords_; } - set { - dataRecords_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 18; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - /// Field number for the "task_id" field. - public const int TaskIdFieldNumber = 19; - private global::AElf.Types.Hash taskId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash TaskId { - get { return taskId_; } - set { - taskId_ = value; - } - } - - /// Field number for the "is_paid_to_oracle_contract" field. - public const int IsPaidToOracleContractFieldNumber = 20; - private bool isPaidToOracleContract_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsPaidToOracleContract { - get { return isPaidToOracleContract_; } - set { - isPaidToOracleContract_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryRecord); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryRecord other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (!object.Equals(ExpirationTimestamp, other.ExpirationTimestamp)) return false; - if (IsSufficientCommitmentsCollected != other.IsSufficientCommitmentsCollected) return false; - if (IsSufficientDataCollected != other.IsSufficientDataCollected) return false; - if (FinalResult != other.FinalResult) return false; - if (Payment != other.Payment) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(QueryId, other.QueryId)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (!object.Equals(QuerySender, other.QuerySender)) return false; - if (IsCommitStageFinished != other.IsCommitStageFinished) return false; - if (CommitmentsCount != other.CommitmentsCount) return false; - if (IsCancelled != other.IsCancelled) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (Token != other.Token) return false; - if (!object.Equals(DataRecords, other.DataRecords)) return false; - if (AggregateOption != other.AggregateOption) return false; - if (!object.Equals(TaskId, other.TaskId)) return false; - if (IsPaidToOracleContract != other.IsPaidToOracleContract) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (expirationTimestamp_ != null) hash ^= ExpirationTimestamp.GetHashCode(); - if (IsSufficientCommitmentsCollected != false) hash ^= IsSufficientCommitmentsCollected.GetHashCode(); - if (IsSufficientDataCollected != false) hash ^= IsSufficientDataCollected.GetHashCode(); - if (FinalResult.Length != 0) hash ^= FinalResult.GetHashCode(); - if (Payment != 0L) hash ^= Payment.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (querySender_ != null) hash ^= QuerySender.GetHashCode(); - if (IsCommitStageFinished != false) hash ^= IsCommitStageFinished.GetHashCode(); - if (CommitmentsCount != 0) hash ^= CommitmentsCount.GetHashCode(); - if (IsCancelled != false) hash ^= IsCancelled.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (dataRecords_ != null) hash ^= DataRecords.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.GetHashCode(); - if (taskId_ != null) hash ^= TaskId.GetHashCode(); - if (IsPaidToOracleContract != false) hash ^= IsPaidToOracleContract.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 (designatedNodeList_ != null) { - output.WriteRawTag(10); - output.WriteMessage(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(AggregatorContractAddress); - } - if (expirationTimestamp_ != null) { - output.WriteRawTag(26); - output.WriteMessage(ExpirationTimestamp); - } - if (IsSufficientCommitmentsCollected != false) { - output.WriteRawTag(32); - output.WriteBool(IsSufficientCommitmentsCollected); - } - if (IsSufficientDataCollected != false) { - output.WriteRawTag(40); - output.WriteBool(IsSufficientDataCollected); - } - if (FinalResult.Length != 0) { - output.WriteRawTag(50); - output.WriteString(FinalResult); - } - if (Payment != 0L) { - output.WriteRawTag(56); - output.WriteInt64(Payment); - } - if (callbackInfo_ != null) { - output.WriteRawTag(66); - output.WriteMessage(CallbackInfo); - } - if (queryId_ != null) { - output.WriteRawTag(74); - output.WriteMessage(QueryId); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(80); - output.WriteInt32(AggregateThreshold); - } - if (querySender_ != null) { - output.WriteRawTag(90); - output.WriteMessage(QuerySender); - } - if (IsCommitStageFinished != false) { - output.WriteRawTag(96); - output.WriteBool(IsCommitStageFinished); - } - if (CommitmentsCount != 0) { - output.WriteRawTag(104); - output.WriteInt32(CommitmentsCount); - } - if (IsCancelled != false) { - output.WriteRawTag(112); - output.WriteBool(IsCancelled); - } - if (queryInfo_ != null) { - output.WriteRawTag(122); - output.WriteMessage(QueryInfo); - } - if (Token.Length != 0) { - output.WriteRawTag(130, 1); - output.WriteString(Token); - } - if (dataRecords_ != null) { - output.WriteRawTag(138, 1); - output.WriteMessage(DataRecords); - } - if (AggregateOption != 0) { - output.WriteRawTag(144, 1); - output.WriteInt32(AggregateOption); - } - if (taskId_ != null) { - output.WriteRawTag(154, 1); - output.WriteMessage(TaskId); - } - if (IsPaidToOracleContract != false) { - output.WriteRawTag(160, 1); - output.WriteBool(IsPaidToOracleContract); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (expirationTimestamp_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpirationTimestamp); - } - if (IsSufficientCommitmentsCollected != false) { - size += 1 + 1; - } - if (IsSufficientDataCollected != false) { - size += 1 + 1; - } - if (FinalResult.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FinalResult); - } - if (Payment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Payment); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (querySender_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QuerySender); - } - if (IsCommitStageFinished != false) { - size += 1 + 1; - } - if (CommitmentsCount != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(CommitmentsCount); - } - if (IsCancelled != false) { - size += 1 + 1; - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (Token.Length != 0) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (dataRecords_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(DataRecords); - } - if (AggregateOption != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (taskId_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(TaskId); - } - if (IsPaidToOracleContract != false) { - size += 2 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryRecord other) { - if (other == null) { - return; - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.expirationTimestamp_ != null) { - if (expirationTimestamp_ == null) { - ExpirationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - ExpirationTimestamp.MergeFrom(other.ExpirationTimestamp); - } - if (other.IsSufficientCommitmentsCollected != false) { - IsSufficientCommitmentsCollected = other.IsSufficientCommitmentsCollected; - } - if (other.IsSufficientDataCollected != false) { - IsSufficientDataCollected = other.IsSufficientDataCollected; - } - if (other.FinalResult.Length != 0) { - FinalResult = other.FinalResult; - } - if (other.Payment != 0L) { - Payment = other.Payment; - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.querySender_ != null) { - if (querySender_ == null) { - QuerySender = new global::AElf.Types.Address(); - } - QuerySender.MergeFrom(other.QuerySender); - } - if (other.IsCommitStageFinished != false) { - IsCommitStageFinished = other.IsCommitStageFinished; - } - if (other.CommitmentsCount != 0) { - CommitmentsCount = other.CommitmentsCount; - } - if (other.IsCancelled != false) { - IsCancelled = other.IsCancelled; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.dataRecords_ != null) { - if (dataRecords_ == null) { - DataRecords = new global::AElf.Contracts.Oracle.DataRecords(); - } - DataRecords.MergeFrom(other.DataRecords); - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - if (other.taskId_ != null) { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - TaskId.MergeFrom(other.TaskId); - } - if (other.IsPaidToOracleContract != false) { - IsPaidToOracleContract = other.IsPaidToOracleContract; - } - _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 (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 18: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 26: { - if (expirationTimestamp_ == null) { - ExpirationTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(ExpirationTimestamp); - break; - } - case 32: { - IsSufficientCommitmentsCollected = input.ReadBool(); - break; - } - case 40: { - IsSufficientDataCollected = input.ReadBool(); - break; - } - case 50: { - FinalResult = input.ReadString(); - break; - } - case 56: { - Payment = input.ReadInt64(); - break; - } - case 66: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 74: { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 80: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 90: { - if (querySender_ == null) { - QuerySender = new global::AElf.Types.Address(); - } - input.ReadMessage(QuerySender); - break; - } - case 96: { - IsCommitStageFinished = input.ReadBool(); - break; - } - case 104: { - CommitmentsCount = input.ReadInt32(); - break; - } - case 112: { - IsCancelled = input.ReadBool(); - break; - } - case 122: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 130: { - Token = input.ReadString(); - break; - } - case 138: { - if (dataRecords_ == null) { - DataRecords = new global::AElf.Contracts.Oracle.DataRecords(); - } - input.ReadMessage(DataRecords); - break; - } - case 144: { - AggregateOption = input.ReadInt32(); - break; - } - case 154: { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - input.ReadMessage(TaskId); - break; - } - case 160: { - IsPaidToOracleContract = input.ReadBool(); - break; - } - } - } - } - - } - - public sealed partial class CreateRegimentInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateRegimentInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateRegimentInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateRegimentInput(CreateRegimentInput other) : this() { - manager_ = other.manager_ != null ? other.manager_.Clone() : null; - initialMemberList_ = other.initialMemberList_.Clone(); - isApproveToJoin_ = other.isApproveToJoin_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CreateRegimentInput Clone() { - return new CreateRegimentInput(this); - } - - /// Field number for the "manager" field. - public const int ManagerFieldNumber = 1; - private global::AElf.Types.Address manager_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address Manager { - get { return manager_; } - set { - manager_ = value; - } - } - - /// Field number for the "initial_member_list" field. - public const int InitialMemberListFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_initialMemberList_codec - = pb::FieldCodec.ForMessage(18, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField initialMemberList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField InitialMemberList { - get { return initialMemberList_; } - } - - /// Field number for the "is_approve_to_join" field. - public const int IsApproveToJoinFieldNumber = 3; - private bool isApproveToJoin_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IsApproveToJoin { - get { return isApproveToJoin_; } - set { - isApproveToJoin_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CreateRegimentInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CreateRegimentInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Manager, other.Manager)) return false; - if(!initialMemberList_.Equals(other.initialMemberList_)) return false; - if (IsApproveToJoin != other.IsApproveToJoin) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (manager_ != null) hash ^= Manager.GetHashCode(); - hash ^= initialMemberList_.GetHashCode(); - if (IsApproveToJoin != false) hash ^= IsApproveToJoin.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 (manager_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Manager); - } - initialMemberList_.WriteTo(output, _repeated_initialMemberList_codec); - if (IsApproveToJoin != false) { - output.WriteRawTag(24); - output.WriteBool(IsApproveToJoin); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (manager_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Manager); - } - size += initialMemberList_.CalculateSize(_repeated_initialMemberList_codec); - if (IsApproveToJoin != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CreateRegimentInput other) { - if (other == null) { - return; - } - if (other.manager_ != null) { - if (manager_ == null) { - Manager = new global::AElf.Types.Address(); - } - Manager.MergeFrom(other.Manager); - } - initialMemberList_.Add(other.initialMemberList_); - if (other.IsApproveToJoin != false) { - IsApproveToJoin = other.IsApproveToJoin; - } - _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 (manager_ == null) { - Manager = new global::AElf.Types.Address(); - } - input.ReadMessage(Manager); - break; - } - case 18: { - initialMemberList_.AddEntriesFrom(input, _repeated_initialMemberList_codec); - break; - } - case 24: { - IsApproveToJoin = input.ReadBool(); - break; - } - } - } - } - - } - - public sealed partial class JoinRegimentInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JoinRegimentInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public JoinRegimentInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public JoinRegimentInput(JoinRegimentInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - newMemberAddress_ = other.newMemberAddress_ != null ? other.newMemberAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public JoinRegimentInput Clone() { - return new JoinRegimentInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "new_member_address" field. - public const int NewMemberAddressFieldNumber = 2; - private global::AElf.Types.Address newMemberAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address NewMemberAddress { - get { return newMemberAddress_; } - set { - newMemberAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as JoinRegimentInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(JoinRegimentInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(NewMemberAddress, other.NewMemberAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (newMemberAddress_ != null) hash ^= NewMemberAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (newMemberAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(NewMemberAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (newMemberAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewMemberAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(JoinRegimentInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.newMemberAddress_ != null) { - if (newMemberAddress_ == null) { - NewMemberAddress = new global::AElf.Types.Address(); - } - NewMemberAddress.MergeFrom(other.NewMemberAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (newMemberAddress_ == null) { - NewMemberAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(NewMemberAddress); - break; - } - } - } - } - - } - - public sealed partial class LeaveRegimentInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LeaveRegimentInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LeaveRegimentInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LeaveRegimentInput(LeaveRegimentInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - leaveMemberAddress_ = other.leaveMemberAddress_ != null ? other.leaveMemberAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LeaveRegimentInput Clone() { - return new LeaveRegimentInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "leave_member_address" field. - public const int LeaveMemberAddressFieldNumber = 2; - private global::AElf.Types.Address leaveMemberAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address LeaveMemberAddress { - get { return leaveMemberAddress_; } - set { - leaveMemberAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as LeaveRegimentInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(LeaveRegimentInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(LeaveMemberAddress, other.LeaveMemberAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (leaveMemberAddress_ != null) hash ^= LeaveMemberAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (leaveMemberAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(LeaveMemberAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (leaveMemberAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(LeaveMemberAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(LeaveRegimentInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.leaveMemberAddress_ != null) { - if (leaveMemberAddress_ == null) { - LeaveMemberAddress = new global::AElf.Types.Address(); - } - LeaveMemberAddress.MergeFrom(other.LeaveMemberAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (leaveMemberAddress_ == null) { - LeaveMemberAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(LeaveMemberAddress); - break; - } - } - } - } - - } - - public sealed partial class AddRegimentMemberInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddRegimentMemberInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddRegimentMemberInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddRegimentMemberInput(AddRegimentMemberInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - newMemberAddress_ = other.newMemberAddress_ != null ? other.newMemberAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddRegimentMemberInput Clone() { - return new AddRegimentMemberInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "new_member_address" field. - public const int NewMemberAddressFieldNumber = 2; - private global::AElf.Types.Address newMemberAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address NewMemberAddress { - get { return newMemberAddress_; } - set { - newMemberAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as AddRegimentMemberInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AddRegimentMemberInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(NewMemberAddress, other.NewMemberAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (newMemberAddress_ != null) hash ^= NewMemberAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (newMemberAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(NewMemberAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (newMemberAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewMemberAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(AddRegimentMemberInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.newMemberAddress_ != null) { - if (newMemberAddress_ == null) { - NewMemberAddress = new global::AElf.Types.Address(); - } - NewMemberAddress.MergeFrom(other.NewMemberAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (newMemberAddress_ == null) { - NewMemberAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(NewMemberAddress); - break; - } - } - } - } - - } - - public sealed partial class DeleteRegimentMemberInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeleteRegimentMemberInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteRegimentMemberInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteRegimentMemberInput(DeleteRegimentMemberInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - deleteMemberAddress_ = other.deleteMemberAddress_ != null ? other.deleteMemberAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteRegimentMemberInput Clone() { - return new DeleteRegimentMemberInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "delete_member_address" field. - public const int DeleteMemberAddressFieldNumber = 2; - private global::AElf.Types.Address deleteMemberAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address DeleteMemberAddress { - get { return deleteMemberAddress_; } - set { - deleteMemberAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DeleteRegimentMemberInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeleteRegimentMemberInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(DeleteMemberAddress, other.DeleteMemberAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (deleteMemberAddress_ != null) hash ^= DeleteMemberAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (deleteMemberAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(DeleteMemberAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (deleteMemberAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DeleteMemberAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeleteRegimentMemberInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.deleteMemberAddress_ != null) { - if (deleteMemberAddress_ == null) { - DeleteMemberAddress = new global::AElf.Types.Address(); - } - DeleteMemberAddress.MergeFrom(other.DeleteMemberAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (deleteMemberAddress_ == null) { - DeleteMemberAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(DeleteMemberAddress); - break; - } - } - } - } - - } - - public sealed partial class TransferRegimentOwnershipInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransferRegimentOwnershipInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransferRegimentOwnershipInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransferRegimentOwnershipInput(TransferRegimentOwnershipInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - newManagerAddress_ = other.newManagerAddress_ != null ? other.newManagerAddress_.Clone() : null; - originSenderAddress_ = other.originSenderAddress_ != null ? other.originSenderAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransferRegimentOwnershipInput Clone() { - return new TransferRegimentOwnershipInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "new_manager_address" field. - public const int NewManagerAddressFieldNumber = 2; - private global::AElf.Types.Address newManagerAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address NewManagerAddress { - get { return newManagerAddress_; } - set { - newManagerAddress_ = value; - } - } - - /// Field number for the "origin_sender_address" field. - public const int OriginSenderAddressFieldNumber = 3; - private global::AElf.Types.Address originSenderAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OriginSenderAddress { - get { return originSenderAddress_; } - set { - originSenderAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TransferRegimentOwnershipInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TransferRegimentOwnershipInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(NewManagerAddress, other.NewManagerAddress)) return false; - if (!object.Equals(OriginSenderAddress, other.OriginSenderAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (newManagerAddress_ != null) hash ^= NewManagerAddress.GetHashCode(); - if (originSenderAddress_ != null) hash ^= OriginSenderAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (newManagerAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(NewManagerAddress); - } - if (originSenderAddress_ != null) { - output.WriteRawTag(26); - output.WriteMessage(OriginSenderAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (newManagerAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewManagerAddress); - } - if (originSenderAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OriginSenderAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TransferRegimentOwnershipInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.newManagerAddress_ != null) { - if (newManagerAddress_ == null) { - NewManagerAddress = new global::AElf.Types.Address(); - } - NewManagerAddress.MergeFrom(other.NewManagerAddress); - } - if (other.originSenderAddress_ != null) { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - OriginSenderAddress.MergeFrom(other.OriginSenderAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (newManagerAddress_ == null) { - NewManagerAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(NewManagerAddress); - break; - } - case 26: { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OriginSenderAddress); - break; - } - } - } - } - - } - - public sealed partial class AddAdminsInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddAdminsInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddAdminsInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddAdminsInput(AddAdminsInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - newAdmins_ = other.newAdmins_.Clone(); - originSenderAddress_ = other.originSenderAddress_ != null ? other.originSenderAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AddAdminsInput Clone() { - return new AddAdminsInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "new_admins" field. - public const int NewAdminsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_newAdmins_codec - = pb::FieldCodec.ForMessage(18, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField newAdmins_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NewAdmins { - get { return newAdmins_; } - } - - /// Field number for the "origin_sender_address" field. - public const int OriginSenderAddressFieldNumber = 3; - private global::AElf.Types.Address originSenderAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OriginSenderAddress { - get { return originSenderAddress_; } - set { - originSenderAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as AddAdminsInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AddAdminsInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if(!newAdmins_.Equals(other.newAdmins_)) return false; - if (!object.Equals(OriginSenderAddress, other.OriginSenderAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - hash ^= newAdmins_.GetHashCode(); - if (originSenderAddress_ != null) hash ^= OriginSenderAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - newAdmins_.WriteTo(output, _repeated_newAdmins_codec); - if (originSenderAddress_ != null) { - output.WriteRawTag(26); - output.WriteMessage(OriginSenderAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - size += newAdmins_.CalculateSize(_repeated_newAdmins_codec); - if (originSenderAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OriginSenderAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(AddAdminsInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - newAdmins_.Add(other.newAdmins_); - if (other.originSenderAddress_ != null) { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - OriginSenderAddress.MergeFrom(other.OriginSenderAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - newAdmins_.AddEntriesFrom(input, _repeated_newAdmins_codec); - break; - } - case 26: { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OriginSenderAddress); - break; - } - } - } - } - - } - - public sealed partial class DeleteAdminsInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeleteAdminsInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteAdminsInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteAdminsInput(DeleteAdminsInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - deleteAdmins_ = other.deleteAdmins_.Clone(); - originSenderAddress_ = other.originSenderAddress_ != null ? other.originSenderAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeleteAdminsInput Clone() { - return new DeleteAdminsInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "delete_admins" field. - public const int DeleteAdminsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_deleteAdmins_codec - = pb::FieldCodec.ForMessage(18, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField deleteAdmins_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField DeleteAdmins { - get { return deleteAdmins_; } - } - - /// Field number for the "origin_sender_address" field. - public const int OriginSenderAddressFieldNumber = 3; - private global::AElf.Types.Address originSenderAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OriginSenderAddress { - get { return originSenderAddress_; } - set { - originSenderAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DeleteAdminsInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeleteAdminsInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if(!deleteAdmins_.Equals(other.deleteAdmins_)) return false; - if (!object.Equals(OriginSenderAddress, other.OriginSenderAddress)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - hash ^= deleteAdmins_.GetHashCode(); - if (originSenderAddress_ != null) hash ^= OriginSenderAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - deleteAdmins_.WriteTo(output, _repeated_deleteAdmins_codec); - if (originSenderAddress_ != null) { - output.WriteRawTag(26); - output.WriteMessage(OriginSenderAddress); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - size += deleteAdmins_.CalculateSize(_repeated_deleteAdmins_codec); - if (originSenderAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OriginSenderAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeleteAdminsInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - deleteAdmins_.Add(other.deleteAdmins_); - if (other.originSenderAddress_ != null) { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - OriginSenderAddress.MergeFrom(other.OriginSenderAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - deleteAdmins_.AddEntriesFrom(input, _repeated_deleteAdmins_codec); - break; - } - case 26: { - if (originSenderAddress_ == null) { - OriginSenderAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OriginSenderAddress); - break; - } - } - } - } - - } - - public sealed partial class QueryTask : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryTask()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[16]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTask() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTask(QueryTask other) : this() { - eachPayment_ = other.eachPayment_; - supposedQueryTimes_ = other.supposedQueryTimes_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - endTime_ = other.endTime_ != null ? other.endTime_.Clone() : null; - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - actualQueriedTimes_ = other.actualQueriedTimes_; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - creator_ = other.creator_ != null ? other.creator_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - aggregateOption_ = other.aggregateOption_; - onGoing_ = other.onGoing_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTask Clone() { - return new QueryTask(this); - } - - /// Field number for the "each_payment" field. - public const int EachPaymentFieldNumber = 1; - private long eachPayment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long EachPayment { - get { return eachPayment_; } - set { - eachPayment_ = value; - } - } - - /// Field number for the "supposed_query_times" field. - public const int SupposedQueryTimesFieldNumber = 2; - private int supposedQueryTimes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int SupposedQueryTimes { - get { return supposedQueryTimes_; } - set { - supposedQueryTimes_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 3; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "end_time" field. - public const int EndTimeFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Timestamp endTime_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp EndTime { - get { return endTime_; } - set { - endTime_ = value; - } - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 5; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "actual_queried_times" field. - public const int ActualQueriedTimesFieldNumber = 7; - private int actualQueriedTimes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int ActualQueriedTimes { - get { return actualQueriedTimes_; } - set { - actualQueriedTimes_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 8; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "creator" field. - public const int CreatorFieldNumber = 9; - private global::AElf.Types.Address creator_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address Creator { - get { return creator_; } - set { - creator_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 10; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 11; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - /// Field number for the "on_going" field. - public const int OnGoingFieldNumber = 12; - private bool onGoing_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool OnGoing { - get { return onGoing_; } - set { - onGoing_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryTask); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryTask other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (EachPayment != other.EachPayment) return false; - if (SupposedQueryTimes != other.SupposedQueryTimes) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (!object.Equals(EndTime, other.EndTime)) return false; - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (ActualQueriedTimes != other.ActualQueriedTimes) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(Creator, other.Creator)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (AggregateOption != other.AggregateOption) return false; - if (OnGoing != other.OnGoing) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (EachPayment != 0L) hash ^= EachPayment.GetHashCode(); - if (SupposedQueryTimes != 0) hash ^= SupposedQueryTimes.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (endTime_ != null) hash ^= EndTime.GetHashCode(); - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (ActualQueriedTimes != 0) hash ^= ActualQueriedTimes.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (creator_ != null) hash ^= Creator.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.GetHashCode(); - if (OnGoing != false) hash ^= OnGoing.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 (EachPayment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(EachPayment); - } - if (SupposedQueryTimes != 0) { - output.WriteRawTag(16); - output.WriteInt32(SupposedQueryTimes); - } - if (queryInfo_ != null) { - output.WriteRawTag(26); - output.WriteMessage(QueryInfo); - } - if (endTime_ != null) { - output.WriteRawTag(34); - output.WriteMessage(EndTime); - } - if (designatedNodeList_ != null) { - output.WriteRawTag(42); - output.WriteMessage(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (ActualQueriedTimes != 0) { - output.WriteRawTag(56); - output.WriteInt32(ActualQueriedTimes); - } - if (callbackInfo_ != null) { - output.WriteRawTag(66); - output.WriteMessage(CallbackInfo); - } - if (creator_ != null) { - output.WriteRawTag(74); - output.WriteMessage(Creator); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(80); - output.WriteInt32(AggregateThreshold); - } - if (AggregateOption != 0) { - output.WriteRawTag(88); - output.WriteInt32(AggregateOption); - } - if (OnGoing != false) { - output.WriteRawTag(96); - output.WriteBool(OnGoing); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (EachPayment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(EachPayment); - } - if (SupposedQueryTimes != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(SupposedQueryTimes); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (endTime_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(EndTime); - } - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (ActualQueriedTimes != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(ActualQueriedTimes); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (creator_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (OnGoing != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryTask other) { - if (other == null) { - return; - } - if (other.EachPayment != 0L) { - EachPayment = other.EachPayment; - } - if (other.SupposedQueryTimes != 0) { - SupposedQueryTimes = other.SupposedQueryTimes; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.endTime_ != null) { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - EndTime.MergeFrom(other.EndTime); - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.ActualQueriedTimes != 0) { - ActualQueriedTimes = other.ActualQueriedTimes; - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.creator_ != null) { - if (creator_ == null) { - Creator = new global::AElf.Types.Address(); - } - Creator.MergeFrom(other.Creator); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - if (other.OnGoing != false) { - OnGoing = other.OnGoing; - } - _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: { - EachPayment = input.ReadInt64(); - break; - } - case 16: { - SupposedQueryTimes = input.ReadInt32(); - break; - } - case 26: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 34: { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(EndTime); - break; - } - case 42: { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 56: { - ActualQueriedTimes = input.ReadInt32(); - break; - } - case 66: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 74: { - if (creator_ == null) { - Creator = new global::AElf.Types.Address(); - } - input.ReadMessage(Creator); - break; - } - case 80: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 88: { - AggregateOption = input.ReadInt32(); - break; - } - case 96: { - OnGoing = input.ReadBool(); - break; - } - } - } - } - - } - - public sealed partial class CommitInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommitInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[17]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitInput(CommitInput other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - commitment_ = other.commitment_ != null ? other.commitment_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitInput Clone() { - return new CommitInput(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "commitment" field. - public const int CommitmentFieldNumber = 2; - private global::AElf.Types.Hash commitment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Commitment { - get { return commitment_; } - set { - commitment_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CommitInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CommitInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (!object.Equals(Commitment, other.Commitment)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (commitment_ != null) hash ^= Commitment.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (commitment_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Commitment); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (commitment_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Commitment); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CommitInput other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.commitment_ != null) { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - Commitment.MergeFrom(other.Commitment); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - input.ReadMessage(Commitment); - break; - } - } - } - } - - } - - public sealed partial class RevealInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RevealInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[18]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RevealInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RevealInput(RevealInput other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - data_ = other.data_; - salt_ = other.salt_ != null ? other.salt_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RevealInput Clone() { - return new RevealInput(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 2; - private string data_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "salt" field. - public const int SaltFieldNumber = 3; - private global::AElf.Types.Hash salt_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Salt { - get { return salt_; } - set { - salt_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RevealInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RevealInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (Data != other.Data) return false; - if (!object.Equals(Salt, other.Salt)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (salt_ != null) hash ^= Salt.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (Data.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Data); - } - if (salt_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Salt); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Data); - } - if (salt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Salt); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RevealInput other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.Data.Length != 0) { - Data = other.Data; - } - if (other.salt_ != null) { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - Salt.MergeFrom(other.Salt); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - Data = input.ReadString(); - break; - } - case 26: { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - input.ReadMessage(Salt); - break; - } - } - } - } - - } - - public sealed partial class CommitmentMap : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommitmentMap()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[19]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentMap(CommitmentMap other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentMap Clone() { - return new CommitmentMap(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.ForMessage(18, global::AElf.Types.Hash.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 CommitmentMap); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CommitmentMap 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(CommitmentMap 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 OracleNodeThreshold : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OracleNodeThreshold()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[20]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public OracleNodeThreshold() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public OracleNodeThreshold(OracleNodeThreshold other) : this() { - minimumOracleNodesCount_ = other.minimumOracleNodesCount_; - defaultRevealThreshold_ = other.defaultRevealThreshold_; - defaultAggregateThreshold_ = other.defaultAggregateThreshold_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public OracleNodeThreshold Clone() { - return new OracleNodeThreshold(this); - } - - /// Field number for the "minimum_oracle_nodes_count" field. - public const int MinimumOracleNodesCountFieldNumber = 1; - private int minimumOracleNodesCount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinimumOracleNodesCount { - get { return minimumOracleNodesCount_; } - set { - minimumOracleNodesCount_ = value; - } - } - - /// Field number for the "default_reveal_threshold" field. - public const int DefaultRevealThresholdFieldNumber = 2; - private int defaultRevealThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int DefaultRevealThreshold { - get { return defaultRevealThreshold_; } - set { - defaultRevealThreshold_ = value; - } - } - - /// Field number for the "default_aggregate_threshold" field. - public const int DefaultAggregateThresholdFieldNumber = 3; - private int defaultAggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int DefaultAggregateThreshold { - get { return defaultAggregateThreshold_; } - set { - defaultAggregateThreshold_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as OracleNodeThreshold); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(OracleNodeThreshold other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinimumOracleNodesCount != other.MinimumOracleNodesCount) return false; - if (DefaultRevealThreshold != other.DefaultRevealThreshold) return false; - if (DefaultAggregateThreshold != other.DefaultAggregateThreshold) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinimumOracleNodesCount != 0) hash ^= MinimumOracleNodesCount.GetHashCode(); - if (DefaultRevealThreshold != 0) hash ^= DefaultRevealThreshold.GetHashCode(); - if (DefaultAggregateThreshold != 0) hash ^= DefaultAggregateThreshold.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 (MinimumOracleNodesCount != 0) { - output.WriteRawTag(8); - output.WriteInt32(MinimumOracleNodesCount); - } - if (DefaultRevealThreshold != 0) { - output.WriteRawTag(16); - output.WriteInt32(DefaultRevealThreshold); - } - if (DefaultAggregateThreshold != 0) { - output.WriteRawTag(24); - output.WriteInt32(DefaultAggregateThreshold); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinimumOracleNodesCount != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinimumOracleNodesCount); - } - if (DefaultRevealThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DefaultRevealThreshold); - } - if (DefaultAggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DefaultAggregateThreshold); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(OracleNodeThreshold other) { - if (other == null) { - return; - } - if (other.MinimumOracleNodesCount != 0) { - MinimumOracleNodesCount = other.MinimumOracleNodesCount; - } - if (other.DefaultRevealThreshold != 0) { - DefaultRevealThreshold = other.DefaultRevealThreshold; - } - if (other.DefaultAggregateThreshold != 0) { - DefaultAggregateThreshold = other.DefaultAggregateThreshold; - } - _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: { - MinimumOracleNodesCount = input.ReadInt32(); - break; - } - case 16: { - DefaultRevealThreshold = input.ReadInt32(); - break; - } - case 24: { - DefaultAggregateThreshold = input.ReadInt32(); - break; - } - } - } - } - - } - - public sealed partial class ResultList : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResultList()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[21]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResultList() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResultList(ResultList other) : this() { - results_ = other.results_.Clone(); - frequencies_ = other.frequencies_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResultList Clone() { - return new ResultList(this); - } - - /// Field number for the "results" field. - public const int ResultsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_results_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField results_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Results { - get { return results_; } - } - - /// Field number for the "frequencies" field. - public const int FrequenciesFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_frequencies_codec - = pb::FieldCodec.ForInt32(18); - private readonly pbc::RepeatedField frequencies_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Frequencies { - get { return frequencies_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ResultList); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ResultList other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!results_.Equals(other.results_)) return false; - if(!frequencies_.Equals(other.frequencies_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= results_.GetHashCode(); - hash ^= frequencies_.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) { - results_.WriteTo(output, _repeated_results_codec); - frequencies_.WriteTo(output, _repeated_frequencies_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += results_.CalculateSize(_repeated_results_codec); - size += frequencies_.CalculateSize(_repeated_frequencies_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ResultList other) { - if (other == null) { - return; - } - results_.Add(other.results_); - frequencies_.Add(other.frequencies_); - _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: { - results_.AddEntriesFrom(input, _repeated_results_codec); - break; - } - case 18: - case 16: { - frequencies_.AddEntriesFrom(input, _repeated_frequencies_codec); - break; - } - } - } - } - - } - - public sealed partial class DataRecord : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataRecord()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[22]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecord() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecord(DataRecord other) : this() { - address_ = other.address_ != null ? other.address_.Clone() : null; - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecord Clone() { - return new DataRecord(this); - } - - /// Field number for the "address" field. - public const int AddressFieldNumber = 1; - private global::AElf.Types.Address address_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address Address { - get { return address_; } - set { - address_ = value; - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 2; - private string data_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DataRecord); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DataRecord other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Address, other.Address)) return false; - if (Data != other.Data) 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 (Data.Length != 0) hash ^= Data.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 (Data.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Data); - } - 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 (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DataRecord other) { - if (other == null) { - return; - } - if (other.address_ != null) { - if (address_ == null) { - Address = new global::AElf.Types.Address(); - } - Address.MergeFrom(other.Address); - } - if (other.Data.Length != 0) { - Data = other.Data; - } - _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: { - Data = input.ReadString(); - break; - } - } - } - } - - } - - public sealed partial class DataRecords : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataRecords()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[23]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecords() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecords(DataRecords other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DataRecords Clone() { - return new DataRecords(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.Oracle.DataRecord.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 DataRecords); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DataRecords 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(DataRecords 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 PlainResult : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlainResult()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[24]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PlainResult() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PlainResult(PlainResult other) : this() { - dataRecords_ = other.dataRecords_ != null ? other.dataRecords_.Clone() : null; - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - token_ = other.token_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PlainResult Clone() { - return new PlainResult(this); - } - - /// Field number for the "data_records" field. - public const int DataRecordsFieldNumber = 1; - private global::AElf.Contracts.Oracle.DataRecords dataRecords_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.DataRecords DataRecords { - get { return dataRecords_; } - set { - dataRecords_ = value; - } - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 2; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 3; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 4; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as PlainResult); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(PlainResult other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(DataRecords, other.DataRecords)) return false; - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (Token != other.Token) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (dataRecords_ != null) hash ^= DataRecords.GetHashCode(); - if (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (Token.Length != 0) 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 (dataRecords_ != null) { - output.WriteRawTag(10); - output.WriteMessage(DataRecords); - } - if (regimentAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(RegimentAddress); - } - if (queryInfo_ != null) { - output.WriteRawTag(26); - output.WriteMessage(QueryInfo); - } - if (Token.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Token); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (dataRecords_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DataRecords); - } - if (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(PlainResult other) { - if (other == null) { - return; - } - if (other.dataRecords_ != null) { - if (dataRecords_ == null) { - DataRecords = new global::AElf.Contracts.Oracle.DataRecords(); - } - DataRecords.MergeFrom(other.DataRecords); - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.Token.Length != 0) { - Token = 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: { - if (dataRecords_ == null) { - DataRecords = new global::AElf.Contracts.Oracle.DataRecords(); - } - input.ReadMessage(DataRecords); - break; - } - case 18: { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 26: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 34: { - Token = input.ReadString(); - break; - } - } - } - } - - } - - public sealed partial class LockTokensInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LockTokensInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[25]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LockTokensInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LockTokensInput(LockTokensInput other) : this() { - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - lockAmount_ = other.lockAmount_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LockTokensInput Clone() { - return new LockTokensInput(this); - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 1; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "lock_amount" field. - public const int LockAmountFieldNumber = 2; - private long lockAmount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long LockAmount { - get { return lockAmount_; } - set { - lockAmount_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as LockTokensInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(LockTokensInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (LockAmount != other.LockAmount) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (LockAmount != 0L) hash ^= LockAmount.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 (oracleNodeAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(OracleNodeAddress); - } - if (LockAmount != 0L) { - output.WriteRawTag(16); - output.WriteInt64(LockAmount); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (LockAmount != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(LockAmount); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(LockTokensInput other) { - if (other == null) { - return; - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.LockAmount != 0L) { - LockAmount = other.LockAmount; - } - _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 (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 16: { - LockAmount = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class UnlockTokensInput : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnlockTokensInput()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[26]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UnlockTokensInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UnlockTokensInput(UnlockTokensInput other) : this() { - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - withdrawAmount_ = other.withdrawAmount_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UnlockTokensInput Clone() { - return new UnlockTokensInput(this); - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 1; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "withdraw_amount" field. - public const int WithdrawAmountFieldNumber = 2; - private long withdrawAmount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long WithdrawAmount { - get { return withdrawAmount_; } - set { - withdrawAmount_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as UnlockTokensInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(UnlockTokensInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (WithdrawAmount != other.WithdrawAmount) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (WithdrawAmount != 0L) hash ^= WithdrawAmount.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 (oracleNodeAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(OracleNodeAddress); - } - if (WithdrawAmount != 0L) { - output.WriteRawTag(16); - output.WriteInt64(WithdrawAmount); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (WithdrawAmount != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(WithdrawAmount); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(UnlockTokensInput other) { - if (other == null) { - return; - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.WithdrawAmount != 0L) { - WithdrawAmount = other.WithdrawAmount; - } - _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 (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 16: { - WithdrawAmount = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class QueryInfo : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryInfo()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[27]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInfo(QueryInfo other) : this() { - title_ = other.title_; - options_ = other.options_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryInfo Clone() { - return new QueryInfo(this); - } - - /// Field number for the "title" field. - public const int TitleFieldNumber = 1; - private string title_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Title { - get { return title_; } - set { - title_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForString(18); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Options { - get { return options_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Title != other.Title) return false; - if(!options_.Equals(other.options_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Title.Length != 0) hash ^= Title.GetHashCode(); - hash ^= options_.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 (Title.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Title); - } - options_.WriteTo(output, _repeated_options_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Title.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Title); - } - size += options_.CalculateSize(_repeated_options_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryInfo other) { - if (other == null) { - return; - } - if (other.Title.Length != 0) { - Title = other.Title; - } - options_.Add(other.options_); - _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: { - Title = input.ReadString(); - break; - } - case 18: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - } - } - } - - } - - /// - /// Events - /// - public sealed partial class QueryCreated : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryCreated()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[28]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCreated() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCreated(QueryCreated other) : this() { - payment_ = other.payment_; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - querySender_ = other.querySender_ != null ? other.querySender_.Clone() : null; - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - token_ = other.token_; - maximumPermissibleDeviation_ = other.maximumPermissibleDeviation_; - aggregateOption_ = other.aggregateOption_; - taskId_ = other.taskId_ != null ? other.taskId_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCreated Clone() { - return new QueryCreated(this); - } - - /// Field number for the "payment" field. - public const int PaymentFieldNumber = 1; - private long payment_; - /// - /// Maximum for this query option. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Payment { - get { return payment_; } - set { - payment_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 2; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 3; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 4; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - /// - /// Will be regiment address if count is 1. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 5; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 6; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "query_sender" field. - public const int QuerySenderFieldNumber = 7; - private global::AElf.Types.Address querySender_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address QuerySender { - get { return querySender_; } - set { - querySender_ = value; - } - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 8; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 9; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "maximum_permissible_deviation" field. - public const int MaximumPermissibleDeviationFieldNumber = 10; - private int maximumPermissibleDeviation_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaximumPermissibleDeviation { - get { return maximumPermissibleDeviation_; } - set { - maximumPermissibleDeviation_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 11; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - /// Field number for the "task_id" field. - public const int TaskIdFieldNumber = 12; - private global::AElf.Types.Hash taskId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash TaskId { - get { return taskId_; } - set { - taskId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryCreated); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryCreated other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Payment != other.Payment) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (!object.Equals(QuerySender, other.QuerySender)) return false; - if (!object.Equals(QueryId, other.QueryId)) return false; - if (Token != other.Token) return false; - if (MaximumPermissibleDeviation != other.MaximumPermissibleDeviation) return false; - if (AggregateOption != other.AggregateOption) return false; - if (!object.Equals(TaskId, other.TaskId)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Payment != 0L) hash ^= Payment.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (querySender_ != null) hash ^= QuerySender.GetHashCode(); - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (MaximumPermissibleDeviation != 0) hash ^= MaximumPermissibleDeviation.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.GetHashCode(); - if (taskId_ != null) hash ^= TaskId.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 (Payment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Payment); - } - if (callbackInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(26); - output.WriteMessage(AggregatorContractAddress); - } - if (designatedNodeList_ != null) { - output.WriteRawTag(34); - output.WriteMessage(DesignatedNodeList); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(48); - output.WriteInt32(AggregateThreshold); - } - if (querySender_ != null) { - output.WriteRawTag(58); - output.WriteMessage(QuerySender); - } - if (queryId_ != null) { - output.WriteRawTag(66); - output.WriteMessage(QueryId); - } - if (Token.Length != 0) { - output.WriteRawTag(74); - output.WriteString(Token); - } - if (MaximumPermissibleDeviation != 0) { - output.WriteRawTag(80); - output.WriteInt32(MaximumPermissibleDeviation); - } - if (AggregateOption != 0) { - output.WriteRawTag(88); - output.WriteInt32(AggregateOption); - } - if (taskId_ != null) { - output.WriteRawTag(98); - output.WriteMessage(TaskId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Payment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Payment); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (querySender_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QuerySender); - } - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (MaximumPermissibleDeviation != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaximumPermissibleDeviation); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (taskId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TaskId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryCreated other) { - if (other == null) { - return; - } - if (other.Payment != 0L) { - Payment = other.Payment; - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.querySender_ != null) { - if (querySender_ == null) { - QuerySender = new global::AElf.Types.Address(); - } - QuerySender.MergeFrom(other.QuerySender); - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.MaximumPermissibleDeviation != 0) { - MaximumPermissibleDeviation = other.MaximumPermissibleDeviation; - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - if (other.taskId_ != null) { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - TaskId.MergeFrom(other.TaskId); - } - _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: { - Payment = input.ReadInt64(); - break; - } - case 18: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 26: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 34: { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 48: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 58: { - if (querySender_ == null) { - QuerySender = new global::AElf.Types.Address(); - } - input.ReadMessage(QuerySender); - break; - } - case 66: { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 74: { - Token = input.ReadString(); - break; - } - case 80: { - MaximumPermissibleDeviation = input.ReadInt32(); - break; - } - case 88: { - AggregateOption = input.ReadInt32(); - break; - } - case 98: { - if (taskId_ == null) { - TaskId = new global::AElf.Types.Hash(); - } - input.ReadMessage(TaskId); - break; - } - } - } - } - - } - - public sealed partial class QueryTaskCreated : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryTaskCreated()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[29]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTaskCreated() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTaskCreated(QueryTaskCreated other) : this() { - eachPayment_ = other.eachPayment_; - supposedQueryTimes_ = other.supposedQueryTimes_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - endTime_ = other.endTime_ != null ? other.endTime_.Clone() : null; - designatedNodeList_ = other.designatedNodeList_ != null ? other.designatedNodeList_.Clone() : null; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - callbackInfo_ = other.callbackInfo_ != null ? other.callbackInfo_.Clone() : null; - creator_ = other.creator_ != null ? other.creator_.Clone() : null; - aggregateThreshold_ = other.aggregateThreshold_; - aggregateOption_ = other.aggregateOption_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryTaskCreated Clone() { - return new QueryTaskCreated(this); - } - - /// Field number for the "each_payment" field. - public const int EachPaymentFieldNumber = 1; - private long eachPayment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long EachPayment { - get { return eachPayment_; } - set { - eachPayment_ = value; - } - } - - /// Field number for the "supposed_query_times" field. - public const int SupposedQueryTimesFieldNumber = 2; - private int supposedQueryTimes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int SupposedQueryTimes { - get { return supposedQueryTimes_; } - set { - supposedQueryTimes_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 3; - private global::AElf.Contracts.Oracle.QueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.QueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "end_time" field. - public const int EndTimeFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Timestamp endTime_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp EndTime { - get { return endTime_; } - set { - endTime_ = value; - } - } - - /// Field number for the "designated_node_list" field. - public const int DesignatedNodeListFieldNumber = 5; - private global::AElf.Contracts.Oracle.AddressList designatedNodeList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.AddressList DesignatedNodeList { - get { return designatedNodeList_; } - set { - designatedNodeList_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "callback_info" field. - public const int CallbackInfoFieldNumber = 7; - private global::AElf.Contracts.Oracle.CallbackInfo callbackInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.CallbackInfo CallbackInfo { - get { return callbackInfo_; } - set { - callbackInfo_ = value; - } - } - - /// Field number for the "creator" field. - public const int CreatorFieldNumber = 8; - private global::AElf.Types.Address creator_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address Creator { - get { return creator_; } - set { - creator_ = value; - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 9; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 10; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryTaskCreated); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryTaskCreated other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (EachPayment != other.EachPayment) return false; - if (SupposedQueryTimes != other.SupposedQueryTimes) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) return false; - if (!object.Equals(EndTime, other.EndTime)) return false; - if (!object.Equals(DesignatedNodeList, other.DesignatedNodeList)) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (!object.Equals(CallbackInfo, other.CallbackInfo)) return false; - if (!object.Equals(Creator, other.Creator)) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (AggregateOption != other.AggregateOption) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (EachPayment != 0L) hash ^= EachPayment.GetHashCode(); - if (SupposedQueryTimes != 0) hash ^= SupposedQueryTimes.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (endTime_ != null) hash ^= EndTime.GetHashCode(); - if (designatedNodeList_ != null) hash ^= DesignatedNodeList.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (callbackInfo_ != null) hash ^= CallbackInfo.GetHashCode(); - if (creator_ != null) hash ^= Creator.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.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 (EachPayment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(EachPayment); - } - if (SupposedQueryTimes != 0) { - output.WriteRawTag(16); - output.WriteInt32(SupposedQueryTimes); - } - if (queryInfo_ != null) { - output.WriteRawTag(26); - output.WriteMessage(QueryInfo); - } - if (endTime_ != null) { - output.WriteRawTag(34); - output.WriteMessage(EndTime); - } - if (designatedNodeList_ != null) { - output.WriteRawTag(42); - output.WriteMessage(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (callbackInfo_ != null) { - output.WriteRawTag(58); - output.WriteMessage(CallbackInfo); - } - if (creator_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Creator); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(72); - output.WriteInt32(AggregateThreshold); - } - if (AggregateOption != 0) { - output.WriteRawTag(80); - output.WriteInt32(AggregateOption); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (EachPayment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(EachPayment); - } - if (SupposedQueryTimes != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(SupposedQueryTimes); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (endTime_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(EndTime); - } - if (designatedNodeList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignatedNodeList); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (callbackInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CallbackInfo); - } - if (creator_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Creator); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryTaskCreated other) { - if (other == null) { - return; - } - if (other.EachPayment != 0L) { - EachPayment = other.EachPayment; - } - if (other.SupposedQueryTimes != 0) { - SupposedQueryTimes = other.SupposedQueryTimes; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.endTime_ != null) { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - EndTime.MergeFrom(other.EndTime); - } - if (other.designatedNodeList_ != null) { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - DesignatedNodeList.MergeFrom(other.DesignatedNodeList); - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.callbackInfo_ != null) { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - CallbackInfo.MergeFrom(other.CallbackInfo); - } - if (other.creator_ != null) { - if (creator_ == null) { - Creator = new global::AElf.Types.Address(); - } - Creator.MergeFrom(other.Creator); - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - _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: { - EachPayment = input.ReadInt64(); - break; - } - case 16: { - SupposedQueryTimes = input.ReadInt32(); - break; - } - case 26: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Oracle.QueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 34: { - if (endTime_ == null) { - EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(EndTime); - break; - } - case 42: { - if (designatedNodeList_ == null) { - DesignatedNodeList = new global::AElf.Contracts.Oracle.AddressList(); - } - input.ReadMessage(DesignatedNodeList); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: { - if (callbackInfo_ == null) { - CallbackInfo = new global::AElf.Contracts.Oracle.CallbackInfo(); - } - input.ReadMessage(CallbackInfo); - break; - } - case 66: { - if (creator_ == null) { - Creator = new global::AElf.Types.Address(); - } - input.ReadMessage(Creator); - break; - } - case 72: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 80: { - AggregateOption = input.ReadInt32(); - break; - } - } - } - } - - } - - public sealed partial class QueryCancelled : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryCancelled()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[30]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCancelled() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCancelled(QueryCancelled other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCancelled Clone() { - return new QueryCancelled(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryCancelled); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryCancelled other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryCancelled other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - } - } - } - - } - - public sealed partial class SufficientCommitmentsCollected : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SufficientCommitmentsCollected()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[31]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SufficientCommitmentsCollected() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SufficientCommitmentsCollected(SufficientCommitmentsCollected other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SufficientCommitmentsCollected Clone() { - return new SufficientCommitmentsCollected(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SufficientCommitmentsCollected); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SufficientCommitmentsCollected other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SufficientCommitmentsCollected other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - } - } - } - - } - - public sealed partial class Committed : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Committed()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[32]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Committed() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Committed(Committed other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - commitment_ = other.commitment_ != null ? other.commitment_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Committed Clone() { - return new Committed(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 2; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "commitment" field. - public const int CommitmentFieldNumber = 3; - private global::AElf.Types.Hash commitment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Commitment { - get { return commitment_; } - set { - commitment_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Committed); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Committed other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (!object.Equals(Commitment, other.Commitment)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (commitment_ != null) hash ^= Commitment.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (oracleNodeAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OracleNodeAddress); - } - if (commitment_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Commitment); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (commitment_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Commitment); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Committed other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.commitment_ != null) { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - Commitment.MergeFrom(other.Commitment); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 26: { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - input.ReadMessage(Commitment); - break; - } - } - } - } - - } - - public sealed partial class CommitmentRevealed : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommitmentRevealed()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[33]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealed() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealed(CommitmentRevealed other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - commitment_ = other.commitment_ != null ? other.commitment_.Clone() : null; - revealData_ = other.revealData_; - salt_ = other.salt_ != null ? other.salt_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealed Clone() { - return new CommitmentRevealed(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 2; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "commitment" field. - public const int CommitmentFieldNumber = 3; - private global::AElf.Types.Hash commitment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Commitment { - get { return commitment_; } - set { - commitment_ = value; - } - } - - /// Field number for the "reveal_data" field. - public const int RevealDataFieldNumber = 4; - private string revealData_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string RevealData { - get { return revealData_; } - set { - revealData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "salt" field. - public const int SaltFieldNumber = 5; - private global::AElf.Types.Hash salt_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Salt { - get { return salt_; } - set { - salt_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CommitmentRevealed); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CommitmentRevealed other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (!object.Equals(Commitment, other.Commitment)) return false; - if (RevealData != other.RevealData) return false; - if (!object.Equals(Salt, other.Salt)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (commitment_ != null) hash ^= Commitment.GetHashCode(); - if (RevealData.Length != 0) hash ^= RevealData.GetHashCode(); - if (salt_ != null) hash ^= Salt.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (oracleNodeAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OracleNodeAddress); - } - if (commitment_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Commitment); - } - if (RevealData.Length != 0) { - output.WriteRawTag(34); - output.WriteString(RevealData); - } - if (salt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Salt); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (commitment_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Commitment); - } - if (RevealData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RevealData); - } - if (salt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Salt); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CommitmentRevealed other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.commitment_ != null) { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - Commitment.MergeFrom(other.Commitment); - } - if (other.RevealData.Length != 0) { - RevealData = other.RevealData; - } - if (other.salt_ != null) { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - Salt.MergeFrom(other.Salt); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 26: { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - input.ReadMessage(Commitment); - break; - } - case 34: { - RevealData = input.ReadString(); - break; - } - case 42: { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - input.ReadMessage(Salt); - break; - } - } - } - } - - } - - public sealed partial class CommitmentRevealFailed : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommitmentRevealFailed()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[34]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealFailed() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealFailed(CommitmentRevealFailed other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - commitment_ = other.commitment_ != null ? other.commitment_.Clone() : null; - revealData_ = other.revealData_; - salt_ = other.salt_ != null ? other.salt_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CommitmentRevealFailed Clone() { - return new CommitmentRevealFailed(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 2; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "commitment" field. - public const int CommitmentFieldNumber = 3; - private global::AElf.Types.Hash commitment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Commitment { - get { return commitment_; } - set { - commitment_ = value; - } - } - - /// Field number for the "reveal_data" field. - public const int RevealDataFieldNumber = 4; - private string revealData_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string RevealData { - get { return revealData_; } - set { - revealData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "salt" field. - public const int SaltFieldNumber = 5; - private global::AElf.Types.Hash salt_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash Salt { - get { return salt_; } - set { - salt_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CommitmentRevealFailed); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CommitmentRevealFailed other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (!object.Equals(Commitment, other.Commitment)) return false; - if (RevealData != other.RevealData) return false; - if (!object.Equals(Salt, other.Salt)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (commitment_ != null) hash ^= Commitment.GetHashCode(); - if (RevealData.Length != 0) hash ^= RevealData.GetHashCode(); - if (salt_ != null) hash ^= Salt.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (oracleNodeAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OracleNodeAddress); - } - if (commitment_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Commitment); - } - if (RevealData.Length != 0) { - output.WriteRawTag(34); - output.WriteString(RevealData); - } - if (salt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Salt); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (commitment_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Commitment); - } - if (RevealData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RevealData); - } - if (salt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Salt); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CommitmentRevealFailed other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.commitment_ != null) { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - Commitment.MergeFrom(other.Commitment); - } - if (other.RevealData.Length != 0) { - RevealData = other.RevealData; - } - if (other.salt_ != null) { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - Salt.MergeFrom(other.Salt); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 26: { - if (commitment_ == null) { - Commitment = new global::AElf.Types.Hash(); - } - input.ReadMessage(Commitment); - break; - } - case 34: { - RevealData = input.ReadString(); - break; - } - case 42: { - if (salt_ == null) { - Salt = new global::AElf.Types.Hash(); - } - input.ReadMessage(Salt); - break; - } - } - } - } - - } - - public sealed partial class QueryCompletedWithAggregation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryCompletedWithAggregation()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[35]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithAggregation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithAggregation(QueryCompletedWithAggregation other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - result_ = other.result_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithAggregation Clone() { - return new QueryCompletedWithAggregation(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "result" field. - public const int ResultFieldNumber = 2; - private string result_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Result { - get { return result_; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryCompletedWithAggregation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryCompletedWithAggregation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (Result != other.Result) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (Result.Length != 0) hash ^= Result.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (Result.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Result); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (Result.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryCompletedWithAggregation other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.Result.Length != 0) { - Result = other.Result; - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - Result = input.ReadString(); - break; - } - } - } - } - - } - - public sealed partial class QueryCompletedWithoutAggregation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryCompletedWithoutAggregation()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[36]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithoutAggregation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithoutAggregation(QueryCompletedWithoutAggregation other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - result_ = other.result_ != null ? other.result_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryCompletedWithoutAggregation Clone() { - return new QueryCompletedWithoutAggregation(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "result" field. - public const int ResultFieldNumber = 2; - private global::AElf.Contracts.Oracle.PlainResult result_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Contracts.Oracle.PlainResult Result { - get { return result_; } - set { - result_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryCompletedWithoutAggregation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryCompletedWithoutAggregation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (!object.Equals(Result, other.Result)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (result_ != null) hash ^= Result.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (result_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Result); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (result_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryCompletedWithoutAggregation other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.result_ != null) { - if (result_ == null) { - Result = new global::AElf.Contracts.Oracle.PlainResult(); - } - Result.MergeFrom(other.Result); - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 18: { - if (result_ == null) { - Result = new global::AElf.Contracts.Oracle.PlainResult(); - } - input.ReadMessage(Result); - break; - } - } - } - } - - } - - public sealed partial class TokenLocked : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TokenLocked()); - 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.Oracle.OracleContractReflection.Descriptor.MessageTypes[37]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TokenLocked() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TokenLocked(TokenLocked other) : this() { - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - fromAddress_ = other.fromAddress_ != null ? other.fromAddress_.Clone() : null; - lockedAmount_ = other.lockedAmount_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TokenLocked Clone() { - return new TokenLocked(this); - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 1; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - /// Field number for the "from_address" field. - public const int FromAddressFieldNumber = 2; - private global::AElf.Types.Address fromAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::AElf.Types.Address FromAddress { - get { return fromAddress_; } - set { - fromAddress_ = value; - } - } - - /// Field number for the "locked_amount" field. - public const int LockedAmountFieldNumber = 3; - private long lockedAmount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long LockedAmount { - get { return lockedAmount_; } - set { - lockedAmount_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TokenLocked); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TokenLocked other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) return false; - if (!object.Equals(FromAddress, other.FromAddress)) return false; - if (LockedAmount != other.LockedAmount) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.GetHashCode(); - if (fromAddress_ != null) hash ^= FromAddress.GetHashCode(); - if (LockedAmount != 0L) hash ^= LockedAmount.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 (oracleNodeAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(OracleNodeAddress); - } - if (fromAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(FromAddress); - } - if (LockedAmount != 0L) { - output.WriteRawTag(24); - output.WriteInt64(LockedAmount); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (fromAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(FromAddress); - } - if (LockedAmount != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(LockedAmount); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TokenLocked other) { - if (other == null) { - return; - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - if (other.fromAddress_ != null) { - if (fromAddress_ == null) { - FromAddress = new global::AElf.Types.Address(); - } - FromAddress.MergeFrom(other.FromAddress); - } - if (other.LockedAmount != 0L) { - LockedAmount = other.LockedAmount; - } - _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 (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - case 18: { - if (fromAddress_ == null) { - FromAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(FromAddress); - break; - } - case 24: { - LockedAmount = input.ReadInt64(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptIndexDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptIndexDto.cs deleted file mode 100644 index 23a5da0..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptIndexDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.Contracts; - -public class ReceiptIndexDto -{ - public string TargetChainId { get; set; } - public Guid TokenId { get; set; } - public long Index { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptInfoDto.cs deleted file mode 100644 index 96419f3..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceiptInfoDto.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.Contracts; - -public class ReceiptInfoDto -{ - public string ReceiptId { get; set; } - - public Guid TokenId { get; set; } - - public string FromAddress { get; set; } - - public string ToChainId { get; set; } - - public string ToAddress { get; set; } - - public decimal Amount { 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/Contracts/ReceivedReceiptInfoDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceivedReceiptInfoDto.cs deleted file mode 100644 index 99e1d09..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReceivedReceiptInfoDto.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.Contracts; - -public class ReceivedReceiptInfoDto -{ - public string ReceiptId { get; set; } - - public Guid TokenId { get; set; } - - public string FromAddress { get; set; } - - public string FromChainId { get; set; } - - public string ToAddress { get; set; } - - public decimal Amount { 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/Contracts/ReportContract.c.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.c.cs deleted file mode 100644 index 09a4bcc..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.c.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: report_contract.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using System.Collections.Generic; -using aelf = global::AElf.CSharp.Core; - -namespace AElf.Contracts.Report { - - #region Events - public partial class ReportProposed : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public ReportProposed GetNonIndexed() - { - return new ReportProposed - { - RawReport = RawReport, - RegimentId = RegimentId, - Token = Token, - RoundId = RoundId, - QueryInfo = QueryInfo, - TargetChainId = TargetChainId, - }; - } - } - - public partial class ReportConfirmed : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public ReportConfirmed GetNonIndexed() - { - return new ReportConfirmed - { - RoundId = RoundId, - Signature = Signature, - RegimentId = RegimentId, - Token = Token, - IsAllNodeConfirmed = IsAllNodeConfirmed, - TargetChainId = TargetChainId, - }; - } - } - - public partial class OffChainAggregationRegistered : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public OffChainAggregationRegistered GetNonIndexed() - { - return new OffChainAggregationRegistered - { - Token = Token, - OffChainQueryInfoList = OffChainQueryInfoList, - RegimentId = RegimentId, - ConfigDigest = ConfigDigest, - AggregateThreshold = AggregateThreshold, - AggregatorContractAddress = AggregatorContractAddress, - ChainName = ChainName, - Register = Register, - AggregateOption = AggregateOption, - }; - } - } - - public partial class MerkleReportNodeAdded : aelf::IEvent - { - public global::System.Collections.Generic.IEnumerable GetIndexed() - { - return new List - { - }; - } - - public MerkleReportNodeAdded GetNonIndexed() - { - return new MerkleReportNodeAdded - { - Token = Token, - NodeIndex = NodeIndex, - NodeRoundId = NodeRoundId, - AggregatedData = AggregatedData, - }; - } - } - - #endregion -} -#endregion - diff --git a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.g.cs b/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.g.cs deleted file mode 100644 index 41c2ba6..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/ReportContract.g.cs +++ /dev/null @@ -1,9416 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: report_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.Report { - - /// Holder for reflection information generated from report_contract.proto - public static partial class ReportContractReflection { - - #region Descriptor - /// File descriptor for report_contract.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ReportContractReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChVyZXBvcnRfY29udHJhY3QucHJvdG8aD2FlbGYvY29yZS5wcm90bxoSYWVs", - "Zi9vcHRpb25zLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8a", - "H2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8aHmdvb2dsZS9wcm90", - "b2J1Zi93cmFwcGVycy5wcm90bxoUY2FsbGJhY2tfaW5wdXQucHJvdG8i1wEK", - "D0luaXRpYWxpemVJbnB1dBIuChdvcmFjbGVfY29udHJhY3RfYWRkcmVzcxgB", - "IAEoCzINLmFlbGYuQWRkcmVzcxISCgpyZXBvcnRfZmVlGAIgASgDEhoKEmFw", - "cGx5X29ic2VydmVyX2ZlZRgDIAEoAxIyChtpbml0aWFsX3JlZ2lzdGVyX3do", - "aXRlX2xpc3QYBCADKAsyDS5hZWxmLkFkZHJlc3MSMAoZcmVnaW1lbnRfY29u", - "dHJhY3RfYWRkcmVzcxgFIAEoCzINLmFlbGYuQWRkcmVzcyKdAQoQUXVlcnlP", - "cmFjbGVJbnB1dBIPCgdwYXltZW50GAEgASgDEg0KBXRva2VuGAIgASgJEhsK", - "E2FnZ3JlZ2F0ZV90aHJlc2hvbGQYAyABKAUSEgoKbm9kZV9pbmRleBgEIAEo", - "BRImCgpxdWVyeV9pbmZvGAUgASgLMhIuT2ZmQ2hhaW5RdWVyeUluZm8SEAoI", - "Y2hhaW5faWQYBiABKAkiSAoSQ29uZmlybVJlcG9ydElucHV0Eg0KBXRva2Vu", - "GAEgASgJEhAKCHJvdW5kX2lkGAIgASgDEhEKCXNpZ25hdHVyZRgDIAEoCSJb", - "ChFSZWplY3RSZXBvcnRJbnB1dBINCgV0b2tlbhgBIAEoCRIQCghyb3VuZF9p", - "ZBgCIAEoAxIlCg5hY2N1c2luZ19ub2RlcxgDIAMoCzINLmFlbGYuQWRkcmVz", - "cyJ2CgZSZXBvcnQSHAoIcXVlcnlfaWQYASABKAsyCi5hZWxmLkhhc2gSEAoI", - "cm91bmRfaWQYAiABKAMSIwoMb2JzZXJ2YXRpb25zGAMgASgLMg0uT2JzZXJ2", - "YXRpb25zEhcKD2FnZ3JlZ2F0ZWRfZGF0YRgEIAEoDCLJAQoRUmVwb3J0UXVl", - "cnlSZWNvcmQSKgoTb3JpZ2luX3F1ZXJ5X3NlbmRlchgBIAEoCzINLmFlbGYu", - "QWRkcmVzcxIXCg9wYWlkX3JlcG9ydF9mZWUYAiABKAMSEwoLaXNfcmVqZWN0", - "ZWQYAyABKAgSHQoVaXNfYWxsX25vZGVfY29uZmlybWVkGAQgASgIEioKE2Nv", - "bmZpcm1lZF9ub2RlX2xpc3QYBSADKAsyDS5hZWxmLkFkZHJlc3MSDwoHcGF5", - "bWVudBgGIAEoAyIsCgxPYnNlcnZlckxpc3QSHAoFdmFsdWUYASADKAsyDS5h", - "ZWxmLkFkZHJlc3MiKwoMT2JzZXJ2YXRpb25zEhsKBXZhbHVlGAEgAygLMgwu", - "T2JzZXJ2YXRpb24iKAoLT2JzZXJ2YXRpb24SCwoDa2V5GAEgASgJEgwKBGRh", - "dGEYAiABKAkiVAoRR2V0U2lnbmF0dXJlSW5wdXQSDQoFdG9rZW4YASABKAkS", - "EAoIcm91bmRfaWQYAiABKAMSHgoHYWRkcmVzcxgDIAEoCzINLmFlbGYuQWRk", - "cmVzcyI3ChRHZXRTaWduYXR1cmVNYXBJbnB1dBINCgV0b2tlbhgBIAEoCRIQ", - "Cghyb3VuZF9pZBgCIAEoAyJlCgxTaWduYXR1cmVNYXASJwoFdmFsdWUYASAD", - "KAsyGC5TaWduYXR1cmVNYXAuVmFsdWVFbnRyeRosCgpWYWx1ZUVudHJ5EgsK", - "A2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiKgoKTWVtYmVyTGlzdBIc", - "CgV2YWx1ZRgBIAMoCzINLmFlbGYuQWRkcmVzcyLOAgoXT2ZmQ2hhaW5BZ2dy", - "ZWdhdGlvbkluZm8SDQoFdG9rZW4YASABKAkSOQoZb2ZmX2NoYWluX3F1ZXJ5", - "X2luZm9fbGlzdBgCIAEoCzIWLk9mZkNoYWluUXVlcnlJbmZvTGlzdBIfCgty", - "ZWdpbWVudF9pZBgDIAEoCzIKLmFlbGYuSGFzaBIVCg1jb25maWdfZGlnZXN0", - "GAQgASgMEhsKE2FnZ3JlZ2F0ZV90aHJlc2hvbGQYBSABKAUSMgobYWdncmVn", - "YXRvcl9jb250cmFjdF9hZGRyZXNzGAYgASgLMg0uYWVsZi5BZGRyZXNzEhEK", - "CXJvdW5kX2lkcxgHIAMoAxISCgpjaGFpbl9uYW1lGAggASgJEh8KCHJlZ2lz", - "dGVyGAkgASgLMg0uYWVsZi5BZGRyZXNzEhgKEGFnZ3JlZ2F0ZV9vcHRpb24Y", - "CiABKAUioQIKIFJlZ2lzdGVyT2ZmQ2hhaW5BZ2dyZWdhdGlvbklucHV0Eh8K", - "C3JlZ2ltZW50X2lkGAEgASgLMgouYWVsZi5IYXNoEjkKGW9mZl9jaGFpbl9x", - "dWVyeV9pbmZvX2xpc3QYAiABKAsyFi5PZmZDaGFpblF1ZXJ5SW5mb0xpc3QS", - "DQoFdG9rZW4YAyABKAkSFQoNY29uZmlnX2RpZ2VzdBgEIAEoDBIbChNhZ2dy", - "ZWdhdGVfdGhyZXNob2xkGAUgASgFEjIKG2FnZ3JlZ2F0b3JfY29udHJhY3Rf", - "YWRkcmVzcxgGIAEoCzINLmFlbGYuQWRkcmVzcxIQCghjaGFpbl9pZBgHIAEo", - "CRIYChBhZ2dyZWdhdGVfb3B0aW9uGAggASgFInoKHEJpbmRPZmZDaGFpbkFn", - "Z3JlZ2F0aW9uSW5wdXQSIAoMdGFza19pZF9saXN0GAEgAygLMgouYWVsZi5I", - "YXNoEhIKCmNoYWluX25hbWUYAiABKAkSDQoFdG9rZW4YAyABKAkSFQoNY29u", - "ZmlnX2RpZ2VzdBgEIAEoDCIzChFPZmZDaGFpblF1ZXJ5SW5mbxINCgV0aXRs", - "ZRgBIAEoCRIPCgdvcHRpb25zGAIgAygJIjEKDkdldFJlcG9ydElucHV0Eg0K", - "BXRva2VuGAEgASgJEhAKCHJvdW5kX2lkGAIgASgDIkkKEkdldE1lcmtsZVBh", - "dGhJbnB1dBINCgV0b2tlbhgBIAEoCRIQCghyb3VuZF9pZBgCIAEoAxISCgpu", - "b2RlX2luZGV4GAMgASgFIjQKEUdldFJhd1JlcG9ydElucHV0Eg0KBXRva2Vu", - "GAEgASgJEhAKCHJvdW5kX2lkGAIgASgDIm0KFkdlbmVyYXRlUmF3UmVwb3J0", - "SW5wdXQSFwoGcmVwb3J0GAEgASgLMgcuUmVwb3J0EhUKDWNvbmZpZ19kaWdl", - "c3QYAiABKAwSIwoMb3JnYW5pemF0aW9uGAMgASgLMg0uYWVsZi5BZGRyZXNz", - "IjoKFU9mZkNoYWluUXVlcnlJbmZvTGlzdBIhCgV2YWx1ZRgBIAMoCzISLk9m", - "ZkNoYWluUXVlcnlJbmZvIlwKGUFkZE9mZkNoYWluUXVlcnlJbmZvSW5wdXQS", - "DQoFdG9rZW4YASABKAkSMAoUb2ZmX2NoYWluX3F1ZXJ5X2luZm8YAiABKAsy", - "Ei5PZmZDaGFpblF1ZXJ5SW5mbyJIChxSZW1vdmVPZmZDaGFpblF1ZXJ5SW5m", - "b0lucHV0Eg0KBXRva2VuGAEgASgJEhkKEXJlbW92ZV9ub2RlX2luZGV4GAIg", - "ASgFImMKHENoYW5nZU9mZkNoYWluUXVlcnlJbmZvSW5wdXQSDQoFdG9rZW4Y", - "ASABKAkSNAoYbmV3X29mZl9jaGFpbl9xdWVyeV9pbmZvGAIgASgLMhIuT2Zm", - "Q2hhaW5RdWVyeUluZm8iQgoSQXBwbHlPYnNlcnZlcklucHV0EiwKFXJlZ2lt", - "ZW50X2FkZHJlc3NfbGlzdBgBIAMoCzINLmFlbGYuQWRkcmVzcyJBChFRdWl0", - "T2JzZXJ2ZXJJbnB1dBIsChVyZWdpbWVudF9hZGRyZXNzX2xpc3QYASADKAsy", - "DS5hZWxmLkFkZHJlc3MiZgoPSXNPYnNlcnZlcklucHV0EicKEHJlZ2ltZW50", - "X2FkZHJlc3MYASABKAsyDS5hZWxmLkFkZHJlc3MSKgoTb3JhY2xlX25vZGVf", - "YWRkcmVzcxgCIAEoCzINLmFlbGYuQWRkcmVzcyJDChZTZXRTa2lwTWVtYmVy", - "TGlzdElucHV0Eg0KBXRva2VuGAEgASgJEhoKBXZhbHVlGAIgASgLMgsuTWVt", - "YmVyTGlzdCKtAQoOUmVwb3J0UHJvcG9zZWQSEgoKcmF3X3JlcG9ydBgBIAEo", - "CRIfCgtyZWdpbWVudF9pZBgCIAEoCzIKLmFlbGYuSGFzaBINCgV0b2tlbhgD", - "IAEoCRIQCghyb3VuZF9pZBgEIAEoAxImCgpxdWVyeV9pbmZvGAUgASgLMhIu", - "T2ZmQ2hhaW5RdWVyeUluZm8SFwoPdGFyZ2V0X2NoYWluX2lkGAYgASgJOgSg", - "uxgBIqQBCg9SZXBvcnRDb25maXJtZWQSEAoIcm91bmRfaWQYASABKAMSEQoJ", - "c2lnbmF0dXJlGAIgASgJEh8KC3JlZ2ltZW50X2lkGAMgASgLMgouYWVsZi5I", - "YXNoEg0KBXRva2VuGAQgASgJEh0KFWlzX2FsbF9ub2RlX2NvbmZpcm1lZBgF", - "IAEoCBIXCg90YXJnZXRfY2hhaW5faWQYBiABKAk6BKC7GAEixwIKHU9mZkNo", - "YWluQWdncmVnYXRpb25SZWdpc3RlcmVkEg0KBXRva2VuGAEgASgJEjkKGW9m", - "Zl9jaGFpbl9xdWVyeV9pbmZvX2xpc3QYAiABKAsyFi5PZmZDaGFpblF1ZXJ5", - "SW5mb0xpc3QSHwoLcmVnaW1lbnRfaWQYAyABKAsyCi5hZWxmLkhhc2gSFQoN", - "Y29uZmlnX2RpZ2VzdBgEIAEoDBIbChNhZ2dyZWdhdGVfdGhyZXNob2xkGAUg", - "ASgFEjIKG2FnZ3JlZ2F0b3JfY29udHJhY3RfYWRkcmVzcxgGIAEoCzINLmFl", - "bGYuQWRkcmVzcxISCgpjaGFpbl9uYW1lGAcgASgJEh8KCHJlZ2lzdGVyGAgg", - "ASgLMg0uYWVsZi5BZGRyZXNzEhgKEGFnZ3JlZ2F0ZV9vcHRpb24YCSABKAU6", - "BKC7GAEicAoVTWVya2xlUmVwb3J0Tm9kZUFkZGVkEg0KBXRva2VuGAEgASgJ", - "EhIKCm5vZGVfaW5kZXgYAiABKAUSFQoNbm9kZV9yb3VuZF9pZBgDIAEoAxIX", - "Cg9hZ2dyZWdhdGVkX2RhdGEYBCABKAk6BKC7GAEy3RMKDlJlcG9ydENvbnRy", - "YWN0EjgKCkluaXRpYWxpemUSEC5Jbml0aWFsaXplSW5wdXQaFi5nb29nbGUu", - "cHJvdG9idWYuRW1wdHkiABIuCgtRdWVyeU9yYWNsZRIRLlF1ZXJ5T3JhY2xl", - "SW5wdXQaCi5hZWxmLkhhc2giABI5ChFDYW5jZWxRdWVyeU9yYWNsZRIKLmFl", - "bGYuSGFzaBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEj4KDUNvbmZpcm1S", - "ZXBvcnQSEy5Db25maXJtUmVwb3J0SW5wdXQaFi5nb29nbGUucHJvdG9idWYu", - "RW1wdHkiABI8CgxSZWplY3RSZXBvcnQSEi5SZWplY3RSZXBvcnRJbnB1dBoW", - "Lmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEioKDVByb3Bvc2VSZXBvcnQSDi5D", - "YWxsYmFja0lucHV0GgcuUmVwb3J0IgASRwoOTW9ydGdhZ2VUb2tlbnMSGy5n", - "b29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRoWLmdvb2dsZS5wcm90b2J1Zi5F", - "bXB0eSIAEkcKDldpdGhkcmF3VG9rZW5zEhsuZ29vZ2xlLnByb3RvYnVmLklu", - "dDY0VmFsdWUaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJGChFTZXRTa2lw", - "TWVtYmVyTGlzdBIXLlNldFNraXBNZW1iZXJMaXN0SW5wdXQaFi5nb29nbGUu", - "cHJvdG9idWYuRW1wdHkiABI+Cg1BcHBseU9ic2VydmVyEhMuQXBwbHlPYnNl", - "cnZlcklucHV0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASPAoMUXVpdE9i", - "c2VydmVyEhIuUXVpdE9ic2VydmVySW5wdXQaFi5nb29nbGUucHJvdG9idWYu", - "RW1wdHkiABJPChZBZGp1c3RBcHBseU9ic2VydmVyRmVlEhsuZ29vZ2xlLnBy", - "b3RvYnVmLkludDY0VmFsdWUaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJI", - "Cg9BZGp1c3RSZXBvcnRGZWUSGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1", - "ZRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElwKG1JlZ2lzdGVyT2ZmQ2hh", - "aW5BZ2dyZWdhdGlvbhIhLlJlZ2lzdGVyT2ZmQ2hhaW5BZ2dyZWdhdGlvbklu", - "cHV0GhguT2ZmQ2hhaW5BZ2dyZWdhdGlvbkluZm8iABJUChdCaW5kT2ZmQ2hh", - "aW5BZ2dyZWdhdGlvbhIdLkJpbmRPZmZDaGFpbkFnZ3JlZ2F0aW9uSW5wdXQa", - "GC5PZmZDaGFpbkFnZ3JlZ2F0aW9uSW5mbyIAEkwKFEFkZE9mZkNoYWluUXVl", - "cnlJbmZvEhouQWRkT2ZmQ2hhaW5RdWVyeUluZm9JbnB1dBoWLmdvb2dsZS5w", - "cm90b2J1Zi5FbXB0eSIAElIKF1JlbW92ZU9mZkNoYWluUXVlcnlJbmZvEh0u", - "UmVtb3ZlT2ZmQ2hhaW5RdWVyeUluZm9JbnB1dBoWLmdvb2dsZS5wcm90b2J1", - "Zi5FbXB0eSIAElIKF0NoYW5nZU9mZkNoYWluUXVlcnlJbmZvEh0uQ2hhbmdl", - "T2ZmQ2hhaW5RdWVyeUluZm9JbnB1dBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0", - "eSIAEj8KFEFkZFJlZ2lzdGVyV2hpdGVMaXN0Eg0uYWVsZi5BZGRyZXNzGhYu", - "Z29vZ2xlLnByb3RvYnVmLkVtcHR5IgASRgobUmVtb3ZlRnJvbVJlZ2lzdGVy", - "V2hpdGVMaXN0Eg0uYWVsZi5BZGRyZXNzGhYuZ29vZ2xlLnByb3RvYnVmLkVt", - "cHR5IgASRgobQ2hhbmdlT3JhY2xlQ29udHJhY3RBZGRyZXNzEg0uYWVsZi5B", - "ZGRyZXNzGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASPQoNR2V0TWVya2xl", - "UGF0aBITLkdldE1lcmtsZVBhdGhJbnB1dBoQLmFlbGYuTWVya2xlUGF0aCIF", - "iIn3AQESLAoJR2V0UmVwb3J0Eg8uR2V0UmVwb3J0SW5wdXQaBy5SZXBvcnQi", - "BYiJ9wEBEkcKDEdldFNpZ25hdHVyZRISLkdldFNpZ25hdHVyZUlucHV0Ghwu", - "Z29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlIgWIifcBARJbChpHZXRPZmZD", - "aGFpbkFnZ3JlZ2F0aW9uSW5mbxIcLmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdW", - "YWx1ZRoYLk9mZkNoYWluQWdncmVnYXRpb25JbmZvIgWIifcBARI9ChRHZXRS", - "ZXBvcnRRdWVyeVJlY29yZBIKLmFlbGYuSGFzaBoSLlJlcG9ydFF1ZXJ5UmVj", - "b3JkIgWIifcBARJVChFHZXRDdXJyZW50Um91bmRJZBIcLmdvb2dsZS5wcm90", - "b2J1Zi5TdHJpbmdWYWx1ZRobLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVl", - "IgWIifcBARJHCgxHZXRSYXdSZXBvcnQSEi5HZXRSYXdSZXBvcnRJbnB1dBoc", - "Lmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdWYWx1ZSIFiIn3AQESUQoRR2VuZXJh", - "dGVSYXdSZXBvcnQSFy5HZW5lcmF0ZVJhd1JlcG9ydElucHV0GhwuZ29vZ2xl", - "LnByb3RvYnVmLlN0cmluZ1ZhbHVlIgWIifcBARI+Cg9HZXRTaWduYXR1cmVN", - "YXASFS5HZXRTaWduYXR1cmVNYXBJbnB1dBoNLlNpZ25hdHVyZU1hcCIFiIn3", - "AQESSQoVSXNJblJlZ2lzdGVyV2hpdGVMaXN0Eg0uYWVsZi5BZGRyZXNzGhou", - "Z29vZ2xlLnByb3RvYnVmLkJvb2xWYWx1ZSIFiIn3AQESQQoKSXNPYnNlcnZl", - "chIQLklzT2JzZXJ2ZXJJbnB1dBoaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFs", - "dWUiBYiJ9wEBEkwKF0dldE1vcnRnYWdlZFRva2VuQW1vdW50Eg0uYWVsZi5B", - "ZGRyZXNzGhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUiBYiJ9wEBEjYK", - "D0dldE9ic2VydmVyTGlzdBINLmFlbGYuQWRkcmVzcxoNLk9ic2VydmVyTGlz", - "dCIFiIn3AQESRQoRR2V0U2tpcE1lbWJlckxpc3QSHC5nb29nbGUucHJvdG9i", - "dWYuU3RyaW5nVmFsdWUaCy5NZW1iZXJMaXN0IgWIifcBARoussz2ASlBRWxm", - "LkNvbnRyYWN0cy5SZXBvcnQuUmVwb3J0Q29udHJhY3RTdGF0ZUIYqgIVQUVs", - "Zi5Db250cmFjdHMuUmVwb3J0YgZwcm90bzM=")); - 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.Report.InitializeInput), global::AElf.Contracts.Report.InitializeInput.Parser, new[]{ "OracleContractAddress", "ReportFee", "ApplyObserverFee", "InitialRegisterWhiteList", "RegimentContractAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.QueryOracleInput), global::AElf.Contracts.Report.QueryOracleInput.Parser, new[]{ "Payment", "Token", "AggregateThreshold", "NodeIndex", "QueryInfo", "ChainId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ConfirmReportInput), global::AElf.Contracts.Report.ConfirmReportInput.Parser, new[]{ "Token", "RoundId", "Signature" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.RejectReportInput), global::AElf.Contracts.Report.RejectReportInput.Parser, new[]{ "Token", "RoundId", "AccusingNodes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.Report), global::AElf.Contracts.Report.Report.Parser, new[]{ "QueryId", "RoundId", "Observations", "AggregatedData" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ReportQueryRecord), global::AElf.Contracts.Report.ReportQueryRecord.Parser, new[]{ "OriginQuerySender", "PaidReportFee", "IsRejected", "IsAllNodeConfirmed", "ConfirmedNodeList", "Payment" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ObserverList), global::AElf.Contracts.Report.ObserverList.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.Observations), global::AElf.Contracts.Report.Observations.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.Observation), global::AElf.Contracts.Report.Observation.Parser, new[]{ "Key", "Data" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GetSignatureInput), global::AElf.Contracts.Report.GetSignatureInput.Parser, new[]{ "Token", "RoundId", "Address" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GetSignatureMapInput), global::AElf.Contracts.Report.GetSignatureMapInput.Parser, new[]{ "Token", "RoundId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.SignatureMap), global::AElf.Contracts.Report.SignatureMap.Parser, new[]{ "Value" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.MemberList), global::AElf.Contracts.Report.MemberList.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.OffChainAggregationInfo), global::AElf.Contracts.Report.OffChainAggregationInfo.Parser, new[]{ "Token", "OffChainQueryInfoList", "RegimentId", "ConfigDigest", "AggregateThreshold", "AggregatorContractAddress", "RoundIds", "ChainName", "Register", "AggregateOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.RegisterOffChainAggregationInput), global::AElf.Contracts.Report.RegisterOffChainAggregationInput.Parser, new[]{ "RegimentId", "OffChainQueryInfoList", "Token", "ConfigDigest", "AggregateThreshold", "AggregatorContractAddress", "ChainId", "AggregateOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.BindOffChainAggregationInput), global::AElf.Contracts.Report.BindOffChainAggregationInput.Parser, new[]{ "TaskIdList", "ChainName", "Token", "ConfigDigest" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.OffChainQueryInfo), global::AElf.Contracts.Report.OffChainQueryInfo.Parser, new[]{ "Title", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GetReportInput), global::AElf.Contracts.Report.GetReportInput.Parser, new[]{ "Token", "RoundId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GetMerklePathInput), global::AElf.Contracts.Report.GetMerklePathInput.Parser, new[]{ "Token", "RoundId", "NodeIndex" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GetRawReportInput), global::AElf.Contracts.Report.GetRawReportInput.Parser, new[]{ "Token", "RoundId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.GenerateRawReportInput), global::AElf.Contracts.Report.GenerateRawReportInput.Parser, new[]{ "Report", "ConfigDigest", "Organization" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.OffChainQueryInfoList), global::AElf.Contracts.Report.OffChainQueryInfoList.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.AddOffChainQueryInfoInput), global::AElf.Contracts.Report.AddOffChainQueryInfoInput.Parser, new[]{ "Token", "OffChainQueryInfo" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.RemoveOffChainQueryInfoInput), global::AElf.Contracts.Report.RemoveOffChainQueryInfoInput.Parser, new[]{ "Token", "RemoveNodeIndex" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ChangeOffChainQueryInfoInput), global::AElf.Contracts.Report.ChangeOffChainQueryInfoInput.Parser, new[]{ "Token", "NewOffChainQueryInfo" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ApplyObserverInput), global::AElf.Contracts.Report.ApplyObserverInput.Parser, new[]{ "RegimentAddressList" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.QuitObserverInput), global::AElf.Contracts.Report.QuitObserverInput.Parser, new[]{ "RegimentAddressList" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.IsObserverInput), global::AElf.Contracts.Report.IsObserverInput.Parser, new[]{ "RegimentAddress", "OracleNodeAddress" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.SetSkipMemberListInput), global::AElf.Contracts.Report.SetSkipMemberListInput.Parser, new[]{ "Token", "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ReportProposed), global::AElf.Contracts.Report.ReportProposed.Parser, new[]{ "RawReport", "RegimentId", "Token", "RoundId", "QueryInfo", "TargetChainId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.ReportConfirmed), global::AElf.Contracts.Report.ReportConfirmed.Parser, new[]{ "RoundId", "Signature", "RegimentId", "Token", "IsAllNodeConfirmed", "TargetChainId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.OffChainAggregationRegistered), global::AElf.Contracts.Report.OffChainAggregationRegistered.Parser, new[]{ "Token", "OffChainQueryInfoList", "RegimentId", "ConfigDigest", "AggregateThreshold", "AggregatorContractAddress", "ChainName", "Register", "AggregateOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Contracts.Report.MerkleReportNodeAdded), global::AElf.Contracts.Report.MerkleReportNodeAdded.Parser, new[]{ "Token", "NodeIndex", "NodeRoundId", "AggregatedData" }, 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.Report.ReportContractReflection.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; - reportFee_ = other.reportFee_; - applyObserverFee_ = other.applyObserverFee_; - initialRegisterWhiteList_ = other.initialRegisterWhiteList_.Clone(); - regimentContractAddress_ = other.regimentContractAddress_ != null ? other.regimentContractAddress_.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 "report_fee" field. - public const int ReportFeeFieldNumber = 2; - private long reportFee_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long ReportFee { - get { return reportFee_; } - set { - reportFee_ = value; - } - } - - /// Field number for the "apply_observer_fee" field. - public const int ApplyObserverFeeFieldNumber = 3; - private long applyObserverFee_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long ApplyObserverFee { - get { return applyObserverFee_; } - set { - applyObserverFee_ = value; - } - } - - /// Field number for the "initial_register_white_list" field. - public const int InitialRegisterWhiteListFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_initialRegisterWhiteList_codec - = pb::FieldCodec.ForMessage(34, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField initialRegisterWhiteList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField InitialRegisterWhiteList { - get { return initialRegisterWhiteList_; } - } - - /// Field number for the "regiment_contract_address" field. - public const int RegimentContractAddressFieldNumber = 5; - 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; - } - } - - [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 (ReportFee != other.ReportFee) return false; - if (ApplyObserverFee != other.ApplyObserverFee) return false; - if(!initialRegisterWhiteList_.Equals(other.initialRegisterWhiteList_)) return false; - if (!object.Equals(RegimentContractAddress, other.RegimentContractAddress)) 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 (ReportFee != 0L) hash ^= ReportFee.GetHashCode(); - if (ApplyObserverFee != 0L) hash ^= ApplyObserverFee.GetHashCode(); - hash ^= initialRegisterWhiteList_.GetHashCode(); - if (regimentContractAddress_ != null) hash ^= RegimentContractAddress.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 (ReportFee != 0L) { - output.WriteRawTag(16); - output.WriteInt64(ReportFee); - } - if (ApplyObserverFee != 0L) { - output.WriteRawTag(24); - output.WriteInt64(ApplyObserverFee); - } - initialRegisterWhiteList_.WriteTo(output, _repeated_initialRegisterWhiteList_codec); - if (regimentContractAddress_ != null) { - output.WriteRawTag(42); - output.WriteMessage(RegimentContractAddress); - } - 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 (ReportFee != 0L) { - output.WriteRawTag(16); - output.WriteInt64(ReportFee); - } - if (ApplyObserverFee != 0L) { - output.WriteRawTag(24); - output.WriteInt64(ApplyObserverFee); - } - initialRegisterWhiteList_.WriteTo(ref output, _repeated_initialRegisterWhiteList_codec); - if (regimentContractAddress_ != null) { - output.WriteRawTag(42); - output.WriteMessage(RegimentContractAddress); - } - 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 (ReportFee != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(ReportFee); - } - if (ApplyObserverFee != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(ApplyObserverFee); - } - size += initialRegisterWhiteList_.CalculateSize(_repeated_initialRegisterWhiteList_codec); - if (regimentContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentContractAddress); - } - 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.ReportFee != 0L) { - ReportFee = other.ReportFee; - } - if (other.ApplyObserverFee != 0L) { - ApplyObserverFee = other.ApplyObserverFee; - } - initialRegisterWhiteList_.Add(other.initialRegisterWhiteList_); - if (other.regimentContractAddress_ != null) { - if (regimentContractAddress_ == null) { - RegimentContractAddress = new global::AElf.Types.Address(); - } - RegimentContractAddress.MergeFrom(other.RegimentContractAddress); - } - _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 16: { - ReportFee = input.ReadInt64(); - break; - } - case 24: { - ApplyObserverFee = input.ReadInt64(); - break; - } - case 34: { - initialRegisterWhiteList_.AddEntriesFrom(input, _repeated_initialRegisterWhiteList_codec); - break; - } - case 42: { - if (regimentContractAddress_ == null) { - RegimentContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentContractAddress); - 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 16: { - ReportFee = input.ReadInt64(); - break; - } - case 24: { - ApplyObserverFee = input.ReadInt64(); - break; - } - case 34: { - initialRegisterWhiteList_.AddEntriesFrom(ref input, _repeated_initialRegisterWhiteList_codec); - break; - } - case 42: { - if (regimentContractAddress_ == null) { - RegimentContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentContractAddress); - break; - } - } - } - } - #endif - - } - - public sealed partial class QueryOracleInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryOracleInput()); - 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.Report.ReportContractReflection.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 QueryOracleInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public QueryOracleInput(QueryOracleInput other) : this() { - payment_ = other.payment_; - token_ = other.token_; - aggregateThreshold_ = other.aggregateThreshold_; - nodeIndex_ = other.nodeIndex_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - chainId_ = other.chainId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public QueryOracleInput Clone() { - return new QueryOracleInput(this); - } - - /// Field number for the "payment" field. - public const int PaymentFieldNumber = 1; - private long payment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Payment { - get { return payment_; } - set { - payment_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 2; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 3; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "node_index" field. - public const int NodeIndexFieldNumber = 4; - private int nodeIndex_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int NodeIndex { - get { return nodeIndex_; } - set { - nodeIndex_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 5; - private global::AElf.Contracts.Report.OffChainQueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = value; - } - } - - /// Field number for the "chain_id" field. - public const int ChainIdFieldNumber = 6; - 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"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as QueryOracleInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(QueryOracleInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Payment != other.Payment) return false; - if (Token != other.Token) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (NodeIndex != other.NodeIndex) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) 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 (Payment != 0L) hash ^= Payment.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (NodeIndex != 0) hash ^= NodeIndex.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.GetHashCode(); - if (ChainId.Length != 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 (Payment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Payment); - } - if (Token.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Token); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(24); - output.WriteInt32(AggregateThreshold); - } - if (NodeIndex != 0) { - output.WriteRawTag(32); - output.WriteInt32(NodeIndex); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - if (ChainId.Length != 0) { - output.WriteRawTag(50); - output.WriteString(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 (Payment != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Payment); - } - if (Token.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Token); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(24); - output.WriteInt32(AggregateThreshold); - } - if (NodeIndex != 0) { - output.WriteRawTag(32); - output.WriteInt32(NodeIndex); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - if (ChainId.Length != 0) { - output.WriteRawTag(50); - output.WriteString(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 (Payment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Payment); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (NodeIndex != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeIndex); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - if (ChainId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(QueryOracleInput other) { - if (other == null) { - return; - } - if (other.Payment != 0L) { - Payment = other.Payment; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.NodeIndex != 0) { - NodeIndex = other.NodeIndex; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - if (other.ChainId.Length != 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 8: { - Payment = input.ReadInt64(); - break; - } - case 18: { - Token = input.ReadString(); - break; - } - case 24: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 32: { - NodeIndex = input.ReadInt32(); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 50: { - ChainId = 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: { - Payment = input.ReadInt64(); - break; - } - case 18: { - Token = input.ReadString(); - break; - } - case 24: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 32: { - NodeIndex = input.ReadInt32(); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 50: { - ChainId = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ConfirmReportInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConfirmReportInput()); - 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.Report.ReportContractReflection.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 ConfirmReportInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConfirmReportInput(ConfirmReportInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - signature_ = other.signature_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConfirmReportInput Clone() { - return new ConfirmReportInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "signature" field. - public const int SignatureFieldNumber = 3; - private string signature_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Signature { - get { return signature_; } - set { - signature_ = 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 ConfirmReportInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ConfirmReportInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) return false; - if (Signature != other.Signature) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - if (Signature.Length != 0) hash ^= Signature.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (Signature.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Signature); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (Signature.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Signature); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (Signature.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Signature); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ConfirmReportInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - if (other.Signature.Length != 0) { - Signature = other.Signature; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - Signature = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - Signature = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class RejectReportInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RejectReportInput()); - 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.Report.ReportContractReflection.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 RejectReportInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RejectReportInput(RejectReportInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - accusingNodes_ = other.accusingNodes_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RejectReportInput Clone() { - return new RejectReportInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "accusing_nodes" field. - public const int AccusingNodesFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_accusingNodes_codec - = pb::FieldCodec.ForMessage(26, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField accusingNodes_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField AccusingNodes { - get { return accusingNodes_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as RejectReportInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(RejectReportInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) return false; - if(!accusingNodes_.Equals(other.accusingNodes_)) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - hash ^= accusingNodes_.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - accusingNodes_.WriteTo(output, _repeated_accusingNodes_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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - accusingNodes_.WriteTo(ref output, _repeated_accusingNodes_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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - size += accusingNodes_.CalculateSize(_repeated_accusingNodes_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(RejectReportInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - accusingNodes_.Add(other.accusingNodes_); - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - accusingNodes_.AddEntriesFrom(input, _repeated_accusingNodes_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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - accusingNodes_.AddEntriesFrom(ref input, _repeated_accusingNodes_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class Report : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Report()); - 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.Report.ReportContractReflection.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 Report() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Report(Report other) : this() { - queryId_ = other.queryId_ != null ? other.queryId_.Clone() : null; - roundId_ = other.roundId_; - observations_ = other.observations_ != null ? other.observations_.Clone() : null; - aggregatedData_ = other.aggregatedData_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Report Clone() { - return new Report(this); - } - - /// Field number for the "query_id" field. - public const int QueryIdFieldNumber = 1; - private global::AElf.Types.Hash queryId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Hash QueryId { - get { return queryId_; } - set { - queryId_ = value; - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "observations" field. - public const int ObservationsFieldNumber = 3; - private global::AElf.Contracts.Report.Observations observations_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.Observations Observations { - get { return observations_; } - set { - observations_ = value; - } - } - - /// Field number for the "aggregated_data" field. - public const int AggregatedDataFieldNumber = 4; - private pb::ByteString aggregatedData_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString AggregatedData { - get { return aggregatedData_; } - set { - aggregatedData_ = 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 Report); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Report other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(QueryId, other.QueryId)) return false; - if (RoundId != other.RoundId) return false; - if (!object.Equals(Observations, other.Observations)) return false; - if (AggregatedData != other.AggregatedData) 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 (queryId_ != null) hash ^= QueryId.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - if (observations_ != null) hash ^= Observations.GetHashCode(); - if (AggregatedData.Length != 0) hash ^= AggregatedData.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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (observations_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Observations); - } - if (AggregatedData.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(AggregatedData); - } - 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 (queryId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(QueryId); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (observations_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Observations); - } - if (AggregatedData.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(AggregatedData); - } - 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 (queryId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryId); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (observations_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Observations); - } - if (AggregatedData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(AggregatedData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Report other) { - if (other == null) { - return; - } - if (other.queryId_ != null) { - if (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - QueryId.MergeFrom(other.QueryId); - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - if (other.observations_ != null) { - if (observations_ == null) { - Observations = new global::AElf.Contracts.Report.Observations(); - } - Observations.MergeFrom(other.Observations); - } - if (other.AggregatedData.Length != 0) { - AggregatedData = other.AggregatedData; - } - _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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - if (observations_ == null) { - Observations = new global::AElf.Contracts.Report.Observations(); - } - input.ReadMessage(Observations); - break; - } - case 34: { - AggregatedData = 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 (queryId_ == null) { - QueryId = new global::AElf.Types.Hash(); - } - input.ReadMessage(QueryId); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - if (observations_ == null) { - Observations = new global::AElf.Contracts.Report.Observations(); - } - input.ReadMessage(Observations); - break; - } - case 34: { - AggregatedData = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ReportQueryRecord : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReportQueryRecord()); - 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.Report.ReportContractReflection.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 ReportQueryRecord() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportQueryRecord(ReportQueryRecord other) : this() { - originQuerySender_ = other.originQuerySender_ != null ? other.originQuerySender_.Clone() : null; - paidReportFee_ = other.paidReportFee_; - isRejected_ = other.isRejected_; - isAllNodeConfirmed_ = other.isAllNodeConfirmed_; - confirmedNodeList_ = other.confirmedNodeList_.Clone(); - payment_ = other.payment_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportQueryRecord Clone() { - return new ReportQueryRecord(this); - } - - /// Field number for the "origin_query_sender" field. - public const int OriginQuerySenderFieldNumber = 1; - private global::AElf.Types.Address originQuerySender_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address OriginQuerySender { - get { return originQuerySender_; } - set { - originQuerySender_ = value; - } - } - - /// Field number for the "paid_report_fee" field. - public const int PaidReportFeeFieldNumber = 2; - private long paidReportFee_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long PaidReportFee { - get { return paidReportFee_; } - set { - paidReportFee_ = value; - } - } - - /// Field number for the "is_rejected" field. - public const int IsRejectedFieldNumber = 3; - private bool isRejected_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsRejected { - get { return isRejected_; } - set { - isRejected_ = value; - } - } - - /// Field number for the "is_all_node_confirmed" field. - public const int IsAllNodeConfirmedFieldNumber = 4; - private bool isAllNodeConfirmed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsAllNodeConfirmed { - get { return isAllNodeConfirmed_; } - set { - isAllNodeConfirmed_ = value; - } - } - - /// Field number for the "confirmed_node_list" field. - public const int ConfirmedNodeListFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_confirmedNodeList_codec - = pb::FieldCodec.ForMessage(42, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField confirmedNodeList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ConfirmedNodeList { - get { return confirmedNodeList_; } - } - - /// Field number for the "payment" field. - public const int PaymentFieldNumber = 6; - private long payment_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Payment { - get { return payment_; } - set { - payment_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ReportQueryRecord); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ReportQueryRecord other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(OriginQuerySender, other.OriginQuerySender)) return false; - if (PaidReportFee != other.PaidReportFee) return false; - if (IsRejected != other.IsRejected) return false; - if (IsAllNodeConfirmed != other.IsAllNodeConfirmed) return false; - if(!confirmedNodeList_.Equals(other.confirmedNodeList_)) return false; - if (Payment != other.Payment) 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 (originQuerySender_ != null) hash ^= OriginQuerySender.GetHashCode(); - if (PaidReportFee != 0L) hash ^= PaidReportFee.GetHashCode(); - if (IsRejected != false) hash ^= IsRejected.GetHashCode(); - if (IsAllNodeConfirmed != false) hash ^= IsAllNodeConfirmed.GetHashCode(); - hash ^= confirmedNodeList_.GetHashCode(); - if (Payment != 0L) hash ^= Payment.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 (originQuerySender_ != null) { - output.WriteRawTag(10); - output.WriteMessage(OriginQuerySender); - } - if (PaidReportFee != 0L) { - output.WriteRawTag(16); - output.WriteInt64(PaidReportFee); - } - if (IsRejected != false) { - output.WriteRawTag(24); - output.WriteBool(IsRejected); - } - if (IsAllNodeConfirmed != false) { - output.WriteRawTag(32); - output.WriteBool(IsAllNodeConfirmed); - } - confirmedNodeList_.WriteTo(output, _repeated_confirmedNodeList_codec); - if (Payment != 0L) { - output.WriteRawTag(48); - output.WriteInt64(Payment); - } - 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 (originQuerySender_ != null) { - output.WriteRawTag(10); - output.WriteMessage(OriginQuerySender); - } - if (PaidReportFee != 0L) { - output.WriteRawTag(16); - output.WriteInt64(PaidReportFee); - } - if (IsRejected != false) { - output.WriteRawTag(24); - output.WriteBool(IsRejected); - } - if (IsAllNodeConfirmed != false) { - output.WriteRawTag(32); - output.WriteBool(IsAllNodeConfirmed); - } - confirmedNodeList_.WriteTo(ref output, _repeated_confirmedNodeList_codec); - if (Payment != 0L) { - output.WriteRawTag(48); - output.WriteInt64(Payment); - } - 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 (originQuerySender_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OriginQuerySender); - } - if (PaidReportFee != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(PaidReportFee); - } - if (IsRejected != false) { - size += 1 + 1; - } - if (IsAllNodeConfirmed != false) { - size += 1 + 1; - } - size += confirmedNodeList_.CalculateSize(_repeated_confirmedNodeList_codec); - if (Payment != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Payment); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ReportQueryRecord other) { - if (other == null) { - return; - } - if (other.originQuerySender_ != null) { - if (originQuerySender_ == null) { - OriginQuerySender = new global::AElf.Types.Address(); - } - OriginQuerySender.MergeFrom(other.OriginQuerySender); - } - if (other.PaidReportFee != 0L) { - PaidReportFee = other.PaidReportFee; - } - if (other.IsRejected != false) { - IsRejected = other.IsRejected; - } - if (other.IsAllNodeConfirmed != false) { - IsAllNodeConfirmed = other.IsAllNodeConfirmed; - } - confirmedNodeList_.Add(other.confirmedNodeList_); - if (other.Payment != 0L) { - Payment = other.Payment; - } - _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 (originQuerySender_ == null) { - OriginQuerySender = new global::AElf.Types.Address(); - } - input.ReadMessage(OriginQuerySender); - break; - } - case 16: { - PaidReportFee = input.ReadInt64(); - break; - } - case 24: { - IsRejected = input.ReadBool(); - break; - } - case 32: { - IsAllNodeConfirmed = input.ReadBool(); - break; - } - case 42: { - confirmedNodeList_.AddEntriesFrom(input, _repeated_confirmedNodeList_codec); - break; - } - case 48: { - Payment = 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 (originQuerySender_ == null) { - OriginQuerySender = new global::AElf.Types.Address(); - } - input.ReadMessage(OriginQuerySender); - break; - } - case 16: { - PaidReportFee = input.ReadInt64(); - break; - } - case 24: { - IsRejected = input.ReadBool(); - break; - } - case 32: { - IsAllNodeConfirmed = input.ReadBool(); - break; - } - case 42: { - confirmedNodeList_.AddEntriesFrom(ref input, _repeated_confirmedNodeList_codec); - break; - } - case 48: { - Payment = input.ReadInt64(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ObserverList : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ObserverList()); - 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.Report.ReportContractReflection.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 ObserverList() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ObserverList(ObserverList other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ObserverList Clone() { - return new ObserverList(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.Address.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 ObserverList); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ObserverList 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(ObserverList 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 Observations : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Observations()); - 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.Report.ReportContractReflection.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 Observations() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Observations(Observations other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Observations Clone() { - return new Observations(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.Report.Observation.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 Observations); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Observations 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(Observations 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 Observation : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Observation()); - 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.Report.ReportContractReflection.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 Observation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Observation(Observation other) : this() { - key_ = other.key_; - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Observation Clone() { - return new Observation(this); - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 2; - private string data_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Data { - get { return data_; } - set { - data_ = 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 Observation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Observation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Data != other.Data) 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 (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Data.Length != 0) hash ^= Data.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 (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Data.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Data); - } - 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 (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Data.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Data); - } - 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 (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Observation other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - _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: { - Key = input.ReadString(); - break; - } - case 18: { - Data = 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: { - Key = input.ReadString(); - break; - } - case 18: { - Data = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class GetSignatureInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSignatureInput()); - 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.Report.ReportContractReflection.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 GetSignatureInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetSignatureInput(GetSignatureInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - 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 GetSignatureInput Clone() { - return new GetSignatureInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "address" field. - public const int AddressFieldNumber = 3; - 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 GetSignatureInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GetSignatureInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) return false; - 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (address_ != null) { - output.WriteRawTag(26); - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (address_ != null) { - output.WriteRawTag(26); - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - 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(GetSignatureInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 26: { - if (address_ == null) { - Address = new global::AElf.Types.Address(); - } - input.ReadMessage(Address); - break; - } - } - } - } - #endif - - } - - public sealed partial class GetSignatureMapInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSignatureMapInput()); - 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.Report.ReportContractReflection.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 GetSignatureMapInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetSignatureMapInput(GetSignatureMapInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetSignatureMapInput Clone() { - return new GetSignatureMapInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GetSignatureMapInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GetSignatureMapInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GetSignatureMapInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - } - } - } - #endif - - } - - public sealed partial class SignatureMap : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SignatureMap()); - 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.Report.ReportContractReflection.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 SignatureMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SignatureMap(SignatureMap other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SignatureMap Clone() { - return new SignatureMap(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_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as SignatureMap); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SignatureMap 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, _map_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, _map_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(_map_value_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SignatureMap 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, _map_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, _map_value_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class MemberList : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemberList()); - 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.Report.ReportContractReflection.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 MemberList() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MemberList(MemberList other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MemberList Clone() { - return new MemberList(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.Address.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 MemberList); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MemberList 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(MemberList 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 OffChainAggregationInfo : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OffChainAggregationInfo()); - 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.Report.ReportContractReflection.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 OffChainAggregationInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainAggregationInfo(OffChainAggregationInfo other) : this() { - token_ = other.token_; - offChainQueryInfoList_ = other.offChainQueryInfoList_ != null ? other.offChainQueryInfoList_.Clone() : null; - regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; - configDigest_ = other.configDigest_; - aggregateThreshold_ = other.aggregateThreshold_; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - roundIds_ = other.roundIds_.Clone(); - chainName_ = other.chainName_; - register_ = other.register_ != null ? other.register_.Clone() : null; - aggregateOption_ = other.aggregateOption_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainAggregationInfo Clone() { - return new OffChainAggregationInfo(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "off_chain_query_info_list" field. - public const int OffChainQueryInfoListFieldNumber = 2; - private global::AElf.Contracts.Report.OffChainQueryInfoList offChainQueryInfoList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfoList OffChainQueryInfoList { - get { return offChainQueryInfoList_; } - set { - offChainQueryInfoList_ = value; - } - } - - /// 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 "config_digest" field. - public const int ConfigDigestFieldNumber = 4; - private pb::ByteString configDigest_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ConfigDigest { - get { return configDigest_; } - set { - configDigest_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 5; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "round_ids" field. - public const int RoundIdsFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_roundIds_codec - = pb::FieldCodec.ForInt64(58); - private readonly pbc::RepeatedField roundIds_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField RoundIds { - get { return roundIds_; } - } - - /// Field number for the "chain_name" field. - public const int ChainNameFieldNumber = 8; - private string chainName_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ChainName { - get { return chainName_; } - set { - chainName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "register" field. - public const int RegisterFieldNumber = 9; - private global::AElf.Types.Address register_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address Register { - get { return register_; } - set { - register_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 10; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OffChainAggregationInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OffChainAggregationInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (!object.Equals(OffChainQueryInfoList, other.OffChainQueryInfoList)) return false; - if (!object.Equals(RegimentId, other.RegimentId)) return false; - if (ConfigDigest != other.ConfigDigest) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if(!roundIds_.Equals(other.roundIds_)) return false; - if (ChainName != other.ChainName) return false; - if (!object.Equals(Register, other.Register)) return false; - if (AggregateOption != other.AggregateOption) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (offChainQueryInfoList_ != null) hash ^= OffChainQueryInfoList.GetHashCode(); - if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); - if (ConfigDigest.Length != 0) hash ^= ConfigDigest.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - hash ^= roundIds_.GetHashCode(); - if (ChainName.Length != 0) hash ^= ChainName.GetHashCode(); - if (register_ != null) hash ^= Register.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - roundIds_.WriteTo(output, _repeated_roundIds_codec); - if (ChainName.Length != 0) { - output.WriteRawTag(66); - output.WriteString(ChainName); - } - if (register_ != null) { - output.WriteRawTag(74); - output.WriteMessage(Register); - } - if (AggregateOption != 0) { - output.WriteRawTag(80); - output.WriteInt32(AggregateOption); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - roundIds_.WriteTo(ref output, _repeated_roundIds_codec); - if (ChainName.Length != 0) { - output.WriteRawTag(66); - output.WriteString(ChainName); - } - if (register_ != null) { - output.WriteRawTag(74); - output.WriteMessage(Register); - } - if (AggregateOption != 0) { - output.WriteRawTag(80); - output.WriteInt32(AggregateOption); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (offChainQueryInfoList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OffChainQueryInfoList); - } - if (regimentId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); - } - if (ConfigDigest.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConfigDigest); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - size += roundIds_.CalculateSize(_repeated_roundIds_codec); - if (ChainName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainName); - } - if (register_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Register); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OffChainAggregationInfo other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.offChainQueryInfoList_ != null) { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - OffChainQueryInfoList.MergeFrom(other.OffChainQueryInfoList); - } - if (other.regimentId_ != null) { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - RegimentId.MergeFrom(other.RegimentId); - } - if (other.ConfigDigest.Length != 0) { - ConfigDigest = other.ConfigDigest; - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - roundIds_.Add(other.roundIds_); - if (other.ChainName.Length != 0) { - ChainName = other.ChainName; - } - if (other.register_ != null) { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - Register.MergeFrom(other.Register); - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - _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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: - case 56: { - roundIds_.AddEntriesFrom(input, _repeated_roundIds_codec); - break; - } - case 66: { - ChainName = input.ReadString(); - break; - } - case 74: { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - input.ReadMessage(Register); - break; - } - case 80: { - AggregateOption = 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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: - case 56: { - roundIds_.AddEntriesFrom(ref input, _repeated_roundIds_codec); - break; - } - case 66: { - ChainName = input.ReadString(); - break; - } - case 74: { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - input.ReadMessage(Register); - break; - } - case 80: { - AggregateOption = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class RegisterOffChainAggregationInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegisterOffChainAggregationInput()); - 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.Report.ReportContractReflection.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 RegisterOffChainAggregationInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RegisterOffChainAggregationInput(RegisterOffChainAggregationInput other) : this() { - regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; - offChainQueryInfoList_ = other.offChainQueryInfoList_ != null ? other.offChainQueryInfoList_.Clone() : null; - token_ = other.token_; - configDigest_ = other.configDigest_; - aggregateThreshold_ = other.aggregateThreshold_; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - chainId_ = other.chainId_; - aggregateOption_ = other.aggregateOption_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RegisterOffChainAggregationInput Clone() { - return new RegisterOffChainAggregationInput(this); - } - - /// Field number for the "regiment_id" field. - public const int RegimentIdFieldNumber = 1; - 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 "off_chain_query_info_list" field. - public const int OffChainQueryInfoListFieldNumber = 2; - private global::AElf.Contracts.Report.OffChainQueryInfoList offChainQueryInfoList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfoList OffChainQueryInfoList { - get { return offChainQueryInfoList_; } - set { - offChainQueryInfoList_ = value; - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 3; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "config_digest" field. - public const int ConfigDigestFieldNumber = 4; - private pb::ByteString configDigest_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ConfigDigest { - get { return configDigest_; } - set { - configDigest_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 5; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "chain_id" field. - public const int ChainIdFieldNumber = 7; - 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 "aggregate_option" field. - public const int AggregateOptionFieldNumber = 8; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as RegisterOffChainAggregationInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(RegisterOffChainAggregationInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentId, other.RegimentId)) return false; - if (!object.Equals(OffChainQueryInfoList, other.OffChainQueryInfoList)) return false; - if (Token != other.Token) return false; - if (ConfigDigest != other.ConfigDigest) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (ChainId != other.ChainId) return false; - if (AggregateOption != other.AggregateOption) 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 (regimentId_ != null) hash ^= RegimentId.GetHashCode(); - if (offChainQueryInfoList_ != null) hash ^= OffChainQueryInfoList.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (ConfigDigest.Length != 0) hash ^= ConfigDigest.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (ChainId.Length != 0) hash ^= ChainId.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.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 (regimentId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentId); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (ChainId.Length != 0) { - output.WriteRawTag(58); - output.WriteString(ChainId); - } - if (AggregateOption != 0) { - output.WriteRawTag(64); - output.WriteInt32(AggregateOption); - } - 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 (regimentId_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentId); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (ChainId.Length != 0) { - output.WriteRawTag(58); - output.WriteString(ChainId); - } - if (AggregateOption != 0) { - output.WriteRawTag(64); - output.WriteInt32(AggregateOption); - } - 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 (regimentId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); - } - if (offChainQueryInfoList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OffChainQueryInfoList); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (ConfigDigest.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConfigDigest); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (ChainId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainId); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(RegisterOffChainAggregationInput other) { - if (other == null) { - return; - } - if (other.regimentId_ != null) { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - RegimentId.MergeFrom(other.RegimentId); - } - if (other.offChainQueryInfoList_ != null) { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - OffChainQueryInfoList.MergeFrom(other.OffChainQueryInfoList); - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.ConfigDigest.Length != 0) { - ConfigDigest = other.ConfigDigest; - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.ChainId.Length != 0) { - ChainId = other.ChainId; - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - _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 (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: { - ChainId = input.ReadString(); - break; - } - case 64: { - AggregateOption = 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 (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: { - ChainId = input.ReadString(); - break; - } - case 64: { - AggregateOption = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class BindOffChainAggregationInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BindOffChainAggregationInput()); - 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.Report.ReportContractReflection.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 BindOffChainAggregationInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BindOffChainAggregationInput(BindOffChainAggregationInput other) : this() { - taskIdList_ = other.taskIdList_.Clone(); - chainName_ = other.chainName_; - token_ = other.token_; - configDigest_ = other.configDigest_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BindOffChainAggregationInput Clone() { - return new BindOffChainAggregationInput(this); - } - - /// Field number for the "task_id_list" field. - public const int TaskIdListFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_taskIdList_codec - = pb::FieldCodec.ForMessage(10, global::AElf.Types.Hash.Parser); - private readonly pbc::RepeatedField taskIdList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField TaskIdList { - get { return taskIdList_; } - } - - /// Field number for the "chain_name" field. - public const int ChainNameFieldNumber = 2; - private string chainName_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ChainName { - get { return chainName_; } - set { - chainName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 3; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "config_digest" field. - public const int ConfigDigestFieldNumber = 4; - private pb::ByteString configDigest_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ConfigDigest { - get { return configDigest_; } - set { - configDigest_ = 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 BindOffChainAggregationInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(BindOffChainAggregationInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!taskIdList_.Equals(other.taskIdList_)) return false; - if (ChainName != other.ChainName) return false; - if (Token != other.Token) return false; - if (ConfigDigest != other.ConfigDigest) 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 ^= taskIdList_.GetHashCode(); - if (ChainName.Length != 0) hash ^= ChainName.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (ConfigDigest.Length != 0) hash ^= ConfigDigest.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 - taskIdList_.WriteTo(output, _repeated_taskIdList_codec); - if (ChainName.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ChainName); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - 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) { - taskIdList_.WriteTo(ref output, _repeated_taskIdList_codec); - if (ChainName.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ChainName); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - 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 += taskIdList_.CalculateSize(_repeated_taskIdList_codec); - if (ChainName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainName); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (ConfigDigest.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConfigDigest); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(BindOffChainAggregationInput other) { - if (other == null) { - return; - } - taskIdList_.Add(other.taskIdList_); - if (other.ChainName.Length != 0) { - ChainName = other.ChainName; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.ConfigDigest.Length != 0) { - ConfigDigest = other.ConfigDigest; - } - _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: { - taskIdList_.AddEntriesFrom(input, _repeated_taskIdList_codec); - break; - } - case 18: { - ChainName = input.ReadString(); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 34: { - ConfigDigest = 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: { - taskIdList_.AddEntriesFrom(ref input, _repeated_taskIdList_codec); - break; - } - case 18: { - ChainName = input.ReadString(); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class OffChainQueryInfo : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OffChainQueryInfo()); - 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.Report.ReportContractReflection.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 OffChainQueryInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainQueryInfo(OffChainQueryInfo other) : this() { - title_ = other.title_; - options_ = other.options_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainQueryInfo Clone() { - return new OffChainQueryInfo(this); - } - - /// Field number for the "title" field. - public const int TitleFieldNumber = 1; - private string title_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Title { - get { return title_; } - set { - title_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForString(18); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OffChainQueryInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OffChainQueryInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Title != other.Title) return false; - if(!options_.Equals(other.options_)) 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 (Title.Length != 0) hash ^= Title.GetHashCode(); - hash ^= options_.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 (Title.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Title); - } - options_.WriteTo(output, _repeated_options_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 (Title.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Title); - } - options_.WriteTo(ref output, _repeated_options_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 (Title.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Title); - } - size += options_.CalculateSize(_repeated_options_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OffChainQueryInfo other) { - if (other == null) { - return; - } - if (other.Title.Length != 0) { - Title = other.Title; - } - options_.Add(other.options_); - _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: { - Title = input.ReadString(); - break; - } - case 18: { - options_.AddEntriesFrom(input, _repeated_options_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: { - Title = input.ReadString(); - break; - } - case 18: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class GetReportInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetReportInput()); - 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.Report.ReportContractReflection.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 GetReportInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetReportInput(GetReportInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetReportInput Clone() { - return new GetReportInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GetReportInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GetReportInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GetReportInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - } - } - } - #endif - - } - - public sealed partial class GetMerklePathInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetMerklePathInput()); - 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.Report.ReportContractReflection.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 GetMerklePathInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetMerklePathInput(GetMerklePathInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - nodeIndex_ = other.nodeIndex_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetMerklePathInput Clone() { - return new GetMerklePathInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "node_index" field. - public const int NodeIndexFieldNumber = 3; - private int nodeIndex_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int NodeIndex { - get { return nodeIndex_; } - set { - nodeIndex_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GetMerklePathInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GetMerklePathInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) return false; - if (NodeIndex != other.NodeIndex) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - if (NodeIndex != 0) hash ^= NodeIndex.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (NodeIndex != 0) { - output.WriteRawTag(24); - output.WriteInt32(NodeIndex); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - if (NodeIndex != 0) { - output.WriteRawTag(24); - output.WriteInt32(NodeIndex); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (NodeIndex != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeIndex); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GetMerklePathInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - if (other.NodeIndex != 0) { - NodeIndex = other.NodeIndex; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 24: { - NodeIndex = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - case 24: { - NodeIndex = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class GetRawReportInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetRawReportInput()); - 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.Report.ReportContractReflection.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 GetRawReportInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetRawReportInput(GetRawReportInput other) : this() { - token_ = other.token_; - roundId_ = other.roundId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GetRawReportInput Clone() { - return new GetRawReportInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 2; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GetRawReportInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GetRawReportInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RoundId != other.RoundId) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(16); - output.WriteInt64(RoundId); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GetRawReportInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RoundId = input.ReadInt64(); - break; - } - } - } - } - #endif - - } - - public sealed partial class GenerateRawReportInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GenerateRawReportInput()); - 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.Report.ReportContractReflection.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 GenerateRawReportInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GenerateRawReportInput(GenerateRawReportInput other) : this() { - report_ = other.report_ != null ? other.report_.Clone() : null; - configDigest_ = other.configDigest_; - organization_ = other.organization_ != null ? other.organization_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GenerateRawReportInput Clone() { - return new GenerateRawReportInput(this); - } - - /// Field number for the "report" field. - public const int ReportFieldNumber = 1; - private global::AElf.Contracts.Report.Report report_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.Report Report { - get { return report_; } - set { - report_ = value; - } - } - - /// Field number for the "config_digest" field. - public const int ConfigDigestFieldNumber = 2; - private pb::ByteString configDigest_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ConfigDigest { - get { return configDigest_; } - set { - configDigest_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "organization" field. - public const int OrganizationFieldNumber = 3; - private global::AElf.Types.Address organization_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address Organization { - get { return organization_; } - set { - organization_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GenerateRawReportInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GenerateRawReportInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Report, other.Report)) return false; - if (ConfigDigest != other.ConfigDigest) return false; - if (!object.Equals(Organization, other.Organization)) 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 (report_ != null) hash ^= Report.GetHashCode(); - if (ConfigDigest.Length != 0) hash ^= ConfigDigest.GetHashCode(); - if (organization_ != null) hash ^= Organization.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 (report_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Report); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(ConfigDigest); - } - if (organization_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Organization); - } - 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 (report_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Report); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(ConfigDigest); - } - if (organization_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Organization); - } - 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 (report_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Report); - } - if (ConfigDigest.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConfigDigest); - } - if (organization_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Organization); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GenerateRawReportInput other) { - if (other == null) { - return; - } - if (other.report_ != null) { - if (report_ == null) { - Report = new global::AElf.Contracts.Report.Report(); - } - Report.MergeFrom(other.Report); - } - if (other.ConfigDigest.Length != 0) { - ConfigDigest = other.ConfigDigest; - } - if (other.organization_ != null) { - if (organization_ == null) { - Organization = new global::AElf.Types.Address(); - } - Organization.MergeFrom(other.Organization); - } - _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 (report_ == null) { - Report = new global::AElf.Contracts.Report.Report(); - } - input.ReadMessage(Report); - break; - } - case 18: { - ConfigDigest = input.ReadBytes(); - break; - } - case 26: { - if (organization_ == null) { - Organization = new global::AElf.Types.Address(); - } - input.ReadMessage(Organization); - 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 (report_ == null) { - Report = new global::AElf.Contracts.Report.Report(); - } - input.ReadMessage(Report); - break; - } - case 18: { - ConfigDigest = input.ReadBytes(); - break; - } - case 26: { - if (organization_ == null) { - Organization = new global::AElf.Types.Address(); - } - input.ReadMessage(Organization); - break; - } - } - } - } - #endif - - } - - public sealed partial class OffChainQueryInfoList : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OffChainQueryInfoList()); - 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.Report.ReportContractReflection.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 OffChainQueryInfoList() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainQueryInfoList(OffChainQueryInfoList other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainQueryInfoList Clone() { - return new OffChainQueryInfoList(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.Report.OffChainQueryInfo.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 OffChainQueryInfoList); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OffChainQueryInfoList 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(OffChainQueryInfoList 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 AddOffChainQueryInfoInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddOffChainQueryInfoInput()); - 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.Report.ReportContractReflection.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 AddOffChainQueryInfoInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AddOffChainQueryInfoInput(AddOffChainQueryInfoInput other) : this() { - token_ = other.token_; - offChainQueryInfo_ = other.offChainQueryInfo_ != null ? other.offChainQueryInfo_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AddOffChainQueryInfoInput Clone() { - return new AddOffChainQueryInfoInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "off_chain_query_info" field. - public const int OffChainQueryInfoFieldNumber = 2; - private global::AElf.Contracts.Report.OffChainQueryInfo offChainQueryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfo OffChainQueryInfo { - get { return offChainQueryInfo_; } - set { - offChainQueryInfo_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as AddOffChainQueryInfoInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(AddOffChainQueryInfoInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (!object.Equals(OffChainQueryInfo, other.OffChainQueryInfo)) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (offChainQueryInfo_ != null) hash ^= OffChainQueryInfo.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfo); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfo); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (offChainQueryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OffChainQueryInfo); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(AddOffChainQueryInfoInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.offChainQueryInfo_ != null) { - if (offChainQueryInfo_ == null) { - OffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - OffChainQueryInfo.MergeFrom(other.OffChainQueryInfo); - } - _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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfo_ == null) { - OffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(OffChainQueryInfo); - 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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfo_ == null) { - OffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(OffChainQueryInfo); - break; - } - } - } - } - #endif - - } - - public sealed partial class RemoveOffChainQueryInfoInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemoveOffChainQueryInfoInput()); - 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.Report.ReportContractReflection.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 RemoveOffChainQueryInfoInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RemoveOffChainQueryInfoInput(RemoveOffChainQueryInfoInput other) : this() { - token_ = other.token_; - removeNodeIndex_ = other.removeNodeIndex_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RemoveOffChainQueryInfoInput Clone() { - return new RemoveOffChainQueryInfoInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "remove_node_index" field. - public const int RemoveNodeIndexFieldNumber = 2; - private int removeNodeIndex_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int RemoveNodeIndex { - get { return removeNodeIndex_; } - set { - removeNodeIndex_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as RemoveOffChainQueryInfoInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(RemoveOffChainQueryInfoInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (RemoveNodeIndex != other.RemoveNodeIndex) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RemoveNodeIndex != 0) hash ^= RemoveNodeIndex.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RemoveNodeIndex != 0) { - output.WriteRawTag(16); - output.WriteInt32(RemoveNodeIndex); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (RemoveNodeIndex != 0) { - output.WriteRawTag(16); - output.WriteInt32(RemoveNodeIndex); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RemoveNodeIndex != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(RemoveNodeIndex); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(RemoveOffChainQueryInfoInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RemoveNodeIndex != 0) { - RemoveNodeIndex = other.RemoveNodeIndex; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - RemoveNodeIndex = 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: { - Token = input.ReadString(); - break; - } - case 16: { - RemoveNodeIndex = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ChangeOffChainQueryInfoInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChangeOffChainQueryInfoInput()); - 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.Report.ReportContractReflection.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 ChangeOffChainQueryInfoInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ChangeOffChainQueryInfoInput(ChangeOffChainQueryInfoInput other) : this() { - token_ = other.token_; - newOffChainQueryInfo_ = other.newOffChainQueryInfo_ != null ? other.newOffChainQueryInfo_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ChangeOffChainQueryInfoInput Clone() { - return new ChangeOffChainQueryInfoInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "new_off_chain_query_info" field. - public const int NewOffChainQueryInfoFieldNumber = 2; - private global::AElf.Contracts.Report.OffChainQueryInfo newOffChainQueryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfo NewOffChainQueryInfo { - get { return newOffChainQueryInfo_; } - set { - newOffChainQueryInfo_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ChangeOffChainQueryInfoInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ChangeOffChainQueryInfoInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (!object.Equals(NewOffChainQueryInfo, other.NewOffChainQueryInfo)) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (newOffChainQueryInfo_ != null) hash ^= NewOffChainQueryInfo.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (newOffChainQueryInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(NewOffChainQueryInfo); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (newOffChainQueryInfo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(NewOffChainQueryInfo); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (newOffChainQueryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewOffChainQueryInfo); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ChangeOffChainQueryInfoInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.newOffChainQueryInfo_ != null) { - if (newOffChainQueryInfo_ == null) { - NewOffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - NewOffChainQueryInfo.MergeFrom(other.NewOffChainQueryInfo); - } - _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: { - Token = input.ReadString(); - break; - } - case 18: { - if (newOffChainQueryInfo_ == null) { - NewOffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(NewOffChainQueryInfo); - 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: { - Token = input.ReadString(); - break; - } - case 18: { - if (newOffChainQueryInfo_ == null) { - NewOffChainQueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(NewOffChainQueryInfo); - break; - } - } - } - } - #endif - - } - - public sealed partial class ApplyObserverInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApplyObserverInput()); - 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.Report.ReportContractReflection.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 ApplyObserverInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ApplyObserverInput(ApplyObserverInput other) : this() { - regimentAddressList_ = other.regimentAddressList_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ApplyObserverInput Clone() { - return new ApplyObserverInput(this); - } - - /// Field number for the "regiment_address_list" field. - public const int RegimentAddressListFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_regimentAddressList_codec - = pb::FieldCodec.ForMessage(10, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField regimentAddressList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField RegimentAddressList { - get { return regimentAddressList_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ApplyObserverInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ApplyObserverInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!regimentAddressList_.Equals(other.regimentAddressList_)) 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 ^= regimentAddressList_.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 - regimentAddressList_.WriteTo(output, _repeated_regimentAddressList_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) { - regimentAddressList_.WriteTo(ref output, _repeated_regimentAddressList_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 += regimentAddressList_.CalculateSize(_repeated_regimentAddressList_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ApplyObserverInput other) { - if (other == null) { - return; - } - regimentAddressList_.Add(other.regimentAddressList_); - _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: { - regimentAddressList_.AddEntriesFrom(input, _repeated_regimentAddressList_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: { - regimentAddressList_.AddEntriesFrom(ref input, _repeated_regimentAddressList_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class QuitObserverInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QuitObserverInput()); - 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.Report.ReportContractReflection.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 QuitObserverInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public QuitObserverInput(QuitObserverInput other) : this() { - regimentAddressList_ = other.regimentAddressList_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public QuitObserverInput Clone() { - return new QuitObserverInput(this); - } - - /// Field number for the "regiment_address_list" field. - public const int RegimentAddressListFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_regimentAddressList_codec - = pb::FieldCodec.ForMessage(10, global::AElf.Types.Address.Parser); - private readonly pbc::RepeatedField regimentAddressList_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField RegimentAddressList { - get { return regimentAddressList_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as QuitObserverInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(QuitObserverInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!regimentAddressList_.Equals(other.regimentAddressList_)) 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 ^= regimentAddressList_.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 - regimentAddressList_.WriteTo(output, _repeated_regimentAddressList_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) { - regimentAddressList_.WriteTo(ref output, _repeated_regimentAddressList_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 += regimentAddressList_.CalculateSize(_repeated_regimentAddressList_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(QuitObserverInput other) { - if (other == null) { - return; - } - regimentAddressList_.Add(other.regimentAddressList_); - _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: { - regimentAddressList_.AddEntriesFrom(input, _repeated_regimentAddressList_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: { - regimentAddressList_.AddEntriesFrom(ref input, _repeated_regimentAddressList_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class IsObserverInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IsObserverInput()); - 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.Report.ReportContractReflection.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 IsObserverInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public IsObserverInput(IsObserverInput other) : this() { - regimentAddress_ = other.regimentAddress_ != null ? other.regimentAddress_.Clone() : null; - oracleNodeAddress_ = other.oracleNodeAddress_ != null ? other.oracleNodeAddress_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public IsObserverInput Clone() { - return new IsObserverInput(this); - } - - /// Field number for the "regiment_address" field. - public const int RegimentAddressFieldNumber = 1; - private global::AElf.Types.Address regimentAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address RegimentAddress { - get { return regimentAddress_; } - set { - regimentAddress_ = value; - } - } - - /// Field number for the "oracle_node_address" field. - public const int OracleNodeAddressFieldNumber = 2; - private global::AElf.Types.Address oracleNodeAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address OracleNodeAddress { - get { return oracleNodeAddress_; } - set { - oracleNodeAddress_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as IsObserverInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(IsObserverInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RegimentAddress, other.RegimentAddress)) return false; - if (!object.Equals(OracleNodeAddress, other.OracleNodeAddress)) 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 (regimentAddress_ != null) hash ^= RegimentAddress.GetHashCode(); - if (oracleNodeAddress_ != null) hash ^= OracleNodeAddress.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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (oracleNodeAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OracleNodeAddress); - } - 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 (regimentAddress_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RegimentAddress); - } - if (oracleNodeAddress_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OracleNodeAddress); - } - 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 (regimentAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentAddress); - } - if (oracleNodeAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OracleNodeAddress); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(IsObserverInput other) { - if (other == null) { - return; - } - if (other.regimentAddress_ != null) { - if (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - RegimentAddress.MergeFrom(other.RegimentAddress); - } - if (other.oracleNodeAddress_ != null) { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - OracleNodeAddress.MergeFrom(other.OracleNodeAddress); - } - _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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - 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 (regimentAddress_ == null) { - RegimentAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(RegimentAddress); - break; - } - case 18: { - if (oracleNodeAddress_ == null) { - OracleNodeAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(OracleNodeAddress); - break; - } - } - } - } - #endif - - } - - public sealed partial class SetSkipMemberListInput : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetSkipMemberListInput()); - 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.Report.ReportContractReflection.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 SetSkipMemberListInput() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SetSkipMemberListInput(SetSkipMemberListInput other) : this() { - token_ = other.token_; - value_ = other.value_ != null ? other.value_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SetSkipMemberListInput Clone() { - return new SetSkipMemberListInput(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 2; - private global::AElf.Contracts.Report.MemberList value_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.MemberList 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 SetSkipMemberListInput); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SetSkipMemberListInput other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (!object.Equals(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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (value_ != null) 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SetSkipMemberListInput other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.value_ != null) { - if (value_ == null) { - Value = new global::AElf.Contracts.Report.MemberList(); - } - Value.MergeFrom(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: { - Token = input.ReadString(); - break; - } - case 18: { - if (value_ == null) { - Value = new global::AElf.Contracts.Report.MemberList(); - } - input.ReadMessage(Value); - 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: { - Token = input.ReadString(); - break; - } - case 18: { - if (value_ == null) { - Value = new global::AElf.Contracts.Report.MemberList(); - } - input.ReadMessage(Value); - break; - } - } - } - } - #endif - - } - - public sealed partial class ReportProposed : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReportProposed()); - 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.Report.ReportContractReflection.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 ReportProposed() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportProposed(ReportProposed other) : this() { - rawReport_ = other.rawReport_; - regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; - token_ = other.token_; - roundId_ = other.roundId_; - queryInfo_ = other.queryInfo_ != null ? other.queryInfo_.Clone() : null; - targetChainId_ = other.targetChainId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportProposed Clone() { - return new ReportProposed(this); - } - - /// Field number for the "raw_report" field. - public const int RawReportFieldNumber = 1; - private string rawReport_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RawReport { - get { return rawReport_; } - set { - rawReport_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// 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 "token" field. - public const int TokenFieldNumber = 3; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 4; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "query_info" field. - public const int QueryInfoFieldNumber = 5; - private global::AElf.Contracts.Report.OffChainQueryInfo queryInfo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfo QueryInfo { - get { return queryInfo_; } - set { - queryInfo_ = 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 ReportProposed); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ReportProposed other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (RawReport != other.RawReport) return false; - if (!object.Equals(RegimentId, other.RegimentId)) return false; - if (Token != other.Token) return false; - if (RoundId != other.RoundId) return false; - if (!object.Equals(QueryInfo, other.QueryInfo)) 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 (RawReport.Length != 0) hash ^= RawReport.GetHashCode(); - if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (RoundId != 0L) hash ^= RoundId.GetHashCode(); - if (queryInfo_ != null) hash ^= QueryInfo.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 (RawReport.Length != 0) { - output.WriteRawTag(10); - output.WriteString(RawReport); - } - if (regimentId_ != null) { - output.WriteRawTag(18); - output.WriteMessage(RegimentId); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(32); - output.WriteInt64(RoundId); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - 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 (RawReport.Length != 0) { - output.WriteRawTag(10); - output.WriteString(RawReport); - } - if (regimentId_ != null) { - output.WriteRawTag(18); - output.WriteMessage(RegimentId); - } - if (Token.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Token); - } - if (RoundId != 0L) { - output.WriteRawTag(32); - output.WriteInt64(RoundId); - } - if (queryInfo_ != null) { - output.WriteRawTag(42); - output.WriteMessage(QueryInfo); - } - 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 (RawReport.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RawReport); - } - if (regimentId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (queryInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(QueryInfo); - } - 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(ReportProposed other) { - if (other == null) { - return; - } - if (other.RawReport.Length != 0) { - RawReport = other.RawReport; - } - if (other.regimentId_ != null) { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - RegimentId.MergeFrom(other.RegimentId); - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - if (other.queryInfo_ != null) { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - QueryInfo.MergeFrom(other.QueryInfo); - } - 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: { - RawReport = input.ReadString(); - break; - } - case 18: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 32: { - RoundId = input.ReadInt64(); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(QueryInfo); - 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: { - RawReport = input.ReadString(); - break; - } - case 18: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 26: { - Token = input.ReadString(); - break; - } - case 32: { - RoundId = input.ReadInt64(); - break; - } - case 42: { - if (queryInfo_ == null) { - QueryInfo = new global::AElf.Contracts.Report.OffChainQueryInfo(); - } - input.ReadMessage(QueryInfo); - break; - } - case 50: { - TargetChainId = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ReportConfirmed : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReportConfirmed()); - 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.Report.ReportContractReflection.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 ReportConfirmed() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportConfirmed(ReportConfirmed other) : this() { - roundId_ = other.roundId_; - signature_ = other.signature_; - regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; - token_ = other.token_; - isAllNodeConfirmed_ = other.isAllNodeConfirmed_; - targetChainId_ = other.targetChainId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReportConfirmed Clone() { - return new ReportConfirmed(this); - } - - /// Field number for the "round_id" field. - public const int RoundIdFieldNumber = 1; - private long roundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RoundId { - get { return roundId_; } - set { - roundId_ = value; - } - } - - /// Field number for the "signature" field. - public const int SignatureFieldNumber = 2; - private string signature_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Signature { - get { return signature_; } - set { - signature_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// 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 "token" field. - public const int TokenFieldNumber = 4; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "is_all_node_confirmed" field. - public const int IsAllNodeConfirmedFieldNumber = 5; - private bool isAllNodeConfirmed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsAllNodeConfirmed { - get { return isAllNodeConfirmed_; } - set { - isAllNodeConfirmed_ = 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 ReportConfirmed); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ReportConfirmed other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (RoundId != other.RoundId) return false; - if (Signature != other.Signature) return false; - if (!object.Equals(RegimentId, other.RegimentId)) return false; - if (Token != other.Token) return false; - if (IsAllNodeConfirmed != other.IsAllNodeConfirmed) 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 (RoundId != 0L) hash ^= RoundId.GetHashCode(); - if (Signature.Length != 0) hash ^= Signature.GetHashCode(); - if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (IsAllNodeConfirmed != false) hash ^= IsAllNodeConfirmed.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 (RoundId != 0L) { - output.WriteRawTag(8); - output.WriteInt64(RoundId); - } - if (Signature.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Signature); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (Token.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Token); - } - if (IsAllNodeConfirmed != false) { - output.WriteRawTag(40); - output.WriteBool(IsAllNodeConfirmed); - } - 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 (RoundId != 0L) { - output.WriteRawTag(8); - output.WriteInt64(RoundId); - } - if (Signature.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Signature); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (Token.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Token); - } - if (IsAllNodeConfirmed != false) { - output.WriteRawTag(40); - output.WriteBool(IsAllNodeConfirmed); - } - 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 (RoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoundId); - } - if (Signature.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Signature); - } - if (regimentId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (IsAllNodeConfirmed != false) { - size += 1 + 1; - } - 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(ReportConfirmed other) { - if (other == null) { - return; - } - if (other.RoundId != 0L) { - RoundId = other.RoundId; - } - if (other.Signature.Length != 0) { - Signature = other.Signature; - } - if (other.regimentId_ != null) { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - RegimentId.MergeFrom(other.RegimentId); - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.IsAllNodeConfirmed != false) { - IsAllNodeConfirmed = other.IsAllNodeConfirmed; - } - 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 8: { - RoundId = input.ReadInt64(); - break; - } - case 18: { - Signature = input.ReadString(); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - Token = input.ReadString(); - break; - } - case 40: { - IsAllNodeConfirmed = input.ReadBool(); - 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 8: { - RoundId = input.ReadInt64(); - break; - } - case 18: { - Signature = input.ReadString(); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - Token = input.ReadString(); - break; - } - case 40: { - IsAllNodeConfirmed = input.ReadBool(); - break; - } - case 50: { - TargetChainId = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class OffChainAggregationRegistered : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OffChainAggregationRegistered()); - 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.Report.ReportContractReflection.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 OffChainAggregationRegistered() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainAggregationRegistered(OffChainAggregationRegistered other) : this() { - token_ = other.token_; - offChainQueryInfoList_ = other.offChainQueryInfoList_ != null ? other.offChainQueryInfoList_.Clone() : null; - regimentId_ = other.regimentId_ != null ? other.regimentId_.Clone() : null; - configDigest_ = other.configDigest_; - aggregateThreshold_ = other.aggregateThreshold_; - aggregatorContractAddress_ = other.aggregatorContractAddress_ != null ? other.aggregatorContractAddress_.Clone() : null; - chainName_ = other.chainName_; - register_ = other.register_ != null ? other.register_.Clone() : null; - aggregateOption_ = other.aggregateOption_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OffChainAggregationRegistered Clone() { - return new OffChainAggregationRegistered(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "off_chain_query_info_list" field. - public const int OffChainQueryInfoListFieldNumber = 2; - private global::AElf.Contracts.Report.OffChainQueryInfoList offChainQueryInfoList_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Contracts.Report.OffChainQueryInfoList OffChainQueryInfoList { - get { return offChainQueryInfoList_; } - set { - offChainQueryInfoList_ = value; - } - } - - /// 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 "config_digest" field. - public const int ConfigDigestFieldNumber = 4; - private pb::ByteString configDigest_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ConfigDigest { - get { return configDigest_; } - set { - configDigest_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "aggregate_threshold" field. - public const int AggregateThresholdFieldNumber = 5; - private int aggregateThreshold_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateThreshold { - get { return aggregateThreshold_; } - set { - aggregateThreshold_ = value; - } - } - - /// Field number for the "aggregator_contract_address" field. - public const int AggregatorContractAddressFieldNumber = 6; - private global::AElf.Types.Address aggregatorContractAddress_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address AggregatorContractAddress { - get { return aggregatorContractAddress_; } - set { - aggregatorContractAddress_ = value; - } - } - - /// Field number for the "chain_name" field. - public const int ChainNameFieldNumber = 7; - private string chainName_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ChainName { - get { return chainName_; } - set { - chainName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "register" field. - public const int RegisterFieldNumber = 8; - private global::AElf.Types.Address register_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::AElf.Types.Address Register { - get { return register_; } - set { - register_ = value; - } - } - - /// Field number for the "aggregate_option" field. - public const int AggregateOptionFieldNumber = 9; - private int aggregateOption_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AggregateOption { - get { return aggregateOption_; } - set { - aggregateOption_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OffChainAggregationRegistered); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OffChainAggregationRegistered other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (!object.Equals(OffChainQueryInfoList, other.OffChainQueryInfoList)) return false; - if (!object.Equals(RegimentId, other.RegimentId)) return false; - if (ConfigDigest != other.ConfigDigest) return false; - if (AggregateThreshold != other.AggregateThreshold) return false; - if (!object.Equals(AggregatorContractAddress, other.AggregatorContractAddress)) return false; - if (ChainName != other.ChainName) return false; - if (!object.Equals(Register, other.Register)) return false; - if (AggregateOption != other.AggregateOption) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (offChainQueryInfoList_ != null) hash ^= OffChainQueryInfoList.GetHashCode(); - if (regimentId_ != null) hash ^= RegimentId.GetHashCode(); - if (ConfigDigest.Length != 0) hash ^= ConfigDigest.GetHashCode(); - if (AggregateThreshold != 0) hash ^= AggregateThreshold.GetHashCode(); - if (aggregatorContractAddress_ != null) hash ^= AggregatorContractAddress.GetHashCode(); - if (ChainName.Length != 0) hash ^= ChainName.GetHashCode(); - if (register_ != null) hash ^= Register.GetHashCode(); - if (AggregateOption != 0) hash ^= AggregateOption.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (ChainName.Length != 0) { - output.WriteRawTag(58); - output.WriteString(ChainName); - } - if (register_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Register); - } - if (AggregateOption != 0) { - output.WriteRawTag(72); - output.WriteInt32(AggregateOption); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (offChainQueryInfoList_ != null) { - output.WriteRawTag(18); - output.WriteMessage(OffChainQueryInfoList); - } - if (regimentId_ != null) { - output.WriteRawTag(26); - output.WriteMessage(RegimentId); - } - if (ConfigDigest.Length != 0) { - output.WriteRawTag(34); - output.WriteBytes(ConfigDigest); - } - if (AggregateThreshold != 0) { - output.WriteRawTag(40); - output.WriteInt32(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - output.WriteRawTag(50); - output.WriteMessage(AggregatorContractAddress); - } - if (ChainName.Length != 0) { - output.WriteRawTag(58); - output.WriteString(ChainName); - } - if (register_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Register); - } - if (AggregateOption != 0) { - output.WriteRawTag(72); - output.WriteInt32(AggregateOption); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (offChainQueryInfoList_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OffChainQueryInfoList); - } - if (regimentId_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegimentId); - } - if (ConfigDigest.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConfigDigest); - } - if (AggregateThreshold != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateThreshold); - } - if (aggregatorContractAddress_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AggregatorContractAddress); - } - if (ChainName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChainName); - } - if (register_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Register); - } - if (AggregateOption != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregateOption); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OffChainAggregationRegistered other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.offChainQueryInfoList_ != null) { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - OffChainQueryInfoList.MergeFrom(other.OffChainQueryInfoList); - } - if (other.regimentId_ != null) { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - RegimentId.MergeFrom(other.RegimentId); - } - if (other.ConfigDigest.Length != 0) { - ConfigDigest = other.ConfigDigest; - } - if (other.AggregateThreshold != 0) { - AggregateThreshold = other.AggregateThreshold; - } - if (other.aggregatorContractAddress_ != null) { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - AggregatorContractAddress.MergeFrom(other.AggregatorContractAddress); - } - if (other.ChainName.Length != 0) { - ChainName = other.ChainName; - } - if (other.register_ != null) { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - Register.MergeFrom(other.Register); - } - if (other.AggregateOption != 0) { - AggregateOption = other.AggregateOption; - } - _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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: { - ChainName = input.ReadString(); - break; - } - case 66: { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - input.ReadMessage(Register); - break; - } - case 72: { - AggregateOption = 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: { - Token = input.ReadString(); - break; - } - case 18: { - if (offChainQueryInfoList_ == null) { - OffChainQueryInfoList = new global::AElf.Contracts.Report.OffChainQueryInfoList(); - } - input.ReadMessage(OffChainQueryInfoList); - break; - } - case 26: { - if (regimentId_ == null) { - RegimentId = new global::AElf.Types.Hash(); - } - input.ReadMessage(RegimentId); - break; - } - case 34: { - ConfigDigest = input.ReadBytes(); - break; - } - case 40: { - AggregateThreshold = input.ReadInt32(); - break; - } - case 50: { - if (aggregatorContractAddress_ == null) { - AggregatorContractAddress = new global::AElf.Types.Address(); - } - input.ReadMessage(AggregatorContractAddress); - break; - } - case 58: { - ChainName = input.ReadString(); - break; - } - case 66: { - if (register_ == null) { - Register = new global::AElf.Types.Address(); - } - input.ReadMessage(Register); - break; - } - case 72: { - AggregateOption = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class MerkleReportNodeAdded : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MerkleReportNodeAdded()); - 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.Report.ReportContractReflection.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 MerkleReportNodeAdded() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MerkleReportNodeAdded(MerkleReportNodeAdded other) : this() { - token_ = other.token_; - nodeIndex_ = other.nodeIndex_; - nodeRoundId_ = other.nodeRoundId_; - aggregatedData_ = other.aggregatedData_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MerkleReportNodeAdded Clone() { - return new MerkleReportNodeAdded(this); - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "node_index" field. - public const int NodeIndexFieldNumber = 2; - private int nodeIndex_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int NodeIndex { - get { return nodeIndex_; } - set { - nodeIndex_ = value; - } - } - - /// Field number for the "node_round_id" field. - public const int NodeRoundIdFieldNumber = 3; - private long nodeRoundId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long NodeRoundId { - get { return nodeRoundId_; } - set { - nodeRoundId_ = value; - } - } - - /// Field number for the "aggregated_data" field. - public const int AggregatedDataFieldNumber = 4; - private string aggregatedData_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string AggregatedData { - get { return aggregatedData_; } - set { - aggregatedData_ = 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 MerkleReportNodeAdded); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MerkleReportNodeAdded other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Token != other.Token) return false; - if (NodeIndex != other.NodeIndex) return false; - if (NodeRoundId != other.NodeRoundId) return false; - if (AggregatedData != other.AggregatedData) 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 (Token.Length != 0) hash ^= Token.GetHashCode(); - if (NodeIndex != 0) hash ^= NodeIndex.GetHashCode(); - if (NodeRoundId != 0L) hash ^= NodeRoundId.GetHashCode(); - if (AggregatedData.Length != 0) hash ^= AggregatedData.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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (NodeIndex != 0) { - output.WriteRawTag(16); - output.WriteInt32(NodeIndex); - } - if (NodeRoundId != 0L) { - output.WriteRawTag(24); - output.WriteInt64(NodeRoundId); - } - if (AggregatedData.Length != 0) { - output.WriteRawTag(34); - output.WriteString(AggregatedData); - } - 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 (Token.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Token); - } - if (NodeIndex != 0) { - output.WriteRawTag(16); - output.WriteInt32(NodeIndex); - } - if (NodeRoundId != 0L) { - output.WriteRawTag(24); - output.WriteInt64(NodeRoundId); - } - if (AggregatedData.Length != 0) { - output.WriteRawTag(34); - output.WriteString(AggregatedData); - } - 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 (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (NodeIndex != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeIndex); - } - if (NodeRoundId != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(NodeRoundId); - } - if (AggregatedData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(AggregatedData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MerkleReportNodeAdded other) { - if (other == null) { - return; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - if (other.NodeIndex != 0) { - NodeIndex = other.NodeIndex; - } - if (other.NodeRoundId != 0L) { - NodeRoundId = other.NodeRoundId; - } - if (other.AggregatedData.Length != 0) { - AggregatedData = other.AggregatedData; - } - _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: { - Token = input.ReadString(); - break; - } - case 16: { - NodeIndex = input.ReadInt32(); - break; - } - case 24: { - NodeRoundId = input.ReadInt64(); - break; - } - case 34: { - AggregatedData = 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: { - Token = input.ReadString(); - break; - } - case 16: { - NodeIndex = input.ReadInt32(); - break; - } - case 24: { - NodeRoundId = input.ReadInt64(); - break; - } - case 34: { - AggregatedData = input.ReadString(); - 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 index f30139c..48a3898 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenBucketDto.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/Contracts/TokenBucketDto.cs @@ -5,4 +5,7 @@ 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/CrossChain/AddCrossChainTransferIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs index 64d6ff5..728c972 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddCrossChainTransferIndexInput.cs @@ -25,4 +25,7 @@ public class AddCrossChainTransferIndexInput 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/AddOracleQueryInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddOracleQueryInfoIndexInput.cs deleted file mode 100644 index a014d21..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddOracleQueryInfoIndexInput.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class AddOracleQueryInfoIndexInput -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public string QueryId { get; set; } - public string Option { get; set; } - public OracleStep Step { get; set; } - public long LastUpdateHeight { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddReportInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddReportInfoIndexInput.cs deleted file mode 100644 index dbbf6a9..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/AddReportInfoIndexInput.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class AddReportInfoIndexInput -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public long RoundId { get; set; } - public string Token { get; set; } - public string TargetChainId { get; set; } - public string ReceiptId { get; set; } - public string ReceiptHash { get; set; } - public int QueryTimes { get; set; } - public long TransmitHeight { get; set; } - public long LastUpdateHeight { get; set; } - public string QueryTransactionId { get; set; } - public string ReceiptInfo { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateOracleQueryInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateOracleQueryInfoInput.cs deleted file mode 100644 index c68a446..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateOracleQueryInfoInput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class CreateOracleQueryInfoInput -{ - public string ChainId { get; set; } - public string QueryId { get; set; } - public string Option { get; set; } - public OracleStep Step { get; set; } - public long LastUpdateHeight { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateReportInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateReportInfoInput.cs deleted file mode 100644 index d6acac5..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CreateReportInfoInput.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class CreateReportInfoInput -{ - public string ChainId { get; set; } - public long RoundId { get; set; } - public string Token { get; set; } - public string TargetChainId { get; set; } - public string ReceiptId { get; set; } - public string ReceiptHash { get; set; } - public long LastUpdateHeight { get; set; } - public string ReceiptInfo { get; set; } - -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs index 34be230..2074f6c 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainReceiveInput.cs @@ -15,4 +15,6 @@ public class CrossChainReceiveInput 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 index 84f369e..8bd9ed3 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferIndexDto.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferIndexDto.cs @@ -34,4 +34,7 @@ public class CrossChainTransferIndexDto: EntityDto 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 index 9b5a576..f08cef0 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInfoDto.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInfoDto.cs @@ -20,6 +20,7 @@ public class CrossChainTransferInfoDto : GraphQLDto public string ReceiveTokenSymbol { get; set; } public TransferType TransferType { get; set; } public CrossChainType CrossChainType { get; set; } + public long ReceiveBlockHeight { get; set; } } public enum TransferType diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs index 6da3c54..f129d15 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/CrossChainTransferInput.cs @@ -16,4 +16,5 @@ public class CrossChainTransferInput 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/ICrossChainLimitAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs index a5a4e65..0e11cc1 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainLimitAppService.cs @@ -5,6 +5,7 @@ namespace AElf.CrossChainServer.CrossChain; public interface ICrossChainLimitAppService { + Task InitLimitAsync(); Task SetCrossChainRateLimitAsync(SetCrossChainRateLimitInput input); Task ConsumeCrossChainRateLimitAsync(ConsumeCrossChainRateLimitInput input); Task SetCrossChainRateLimitIndexAsync(SetCrossChainRateLimitInput input); diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs index 8dbebff..c804174 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/ICrossChainTransferAppService.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; @@ -12,7 +13,11 @@ public interface ICrossChainTransferAppService Task UpdateProgressAsync(); Task AddIndexAsync(AddCrossChainTransferIndexInput input); Task UpdateIndexAsync(UpdateCrossChainTransferIndexInput input); + Task DeleteIndexAsync(Guid id); Task UpdateReceiveTransactionAsync(); Task AutoReceiveAsync(); - Task CheckReceiveTransactionAsync(); + 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/IOracleQueryInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IOracleQueryInfoAppService.cs deleted file mode 100644 index 97959b7..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IOracleQueryInfoAppService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.CrossChain; - -public interface IOracleQueryInfoAppService -{ - Task CreateAsync(CreateOracleQueryInfoInput input); - Task UpdateAsync(UpdateOracleQueryInfoInput input); - Task AddIndexAsync(AddOracleQueryInfoIndexInput input); - Task UpdateIndexAsync(UpdateOracleQueryInfoIndexInput input); - Task CalculateCrossChainProgressAsync(string chainId, string option); -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IReportInfoAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IReportInfoAppService.cs deleted file mode 100644 index 3c1b353..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/IReportInfoAppService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.CrossChain; - -public interface IReportInfoAppService -{ - Task CreateAsync(CreateReportInfoInput input); - - Task UpdateStepAsync(string chainId, long roundId, string token, string targetChainId, ReportStep step - , long blockHeight); - Task AddIndexAsync(AddReportInfoIndexInput input); - Task UpdateIndexAsync(UpdateReportInfoIndexInput input); - Task CalculateCrossChainProgressAsync(string chainId, string receiptId); - Task UpdateStepAsync(); - Task ReSendQueryAsync(); - Task CheckQueryTransactionAsync(); -} \ 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/UpdateCrossChainTransferIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs index e97a07f..0d29795 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateCrossChainTransferIndexInput.cs @@ -26,4 +26,7 @@ public class UpdateCrossChainTransferIndexInput 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/CrossChain/UpdateOracleQueryInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoIndexInput.cs deleted file mode 100644 index 20c9b1c..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoIndexInput.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class UpdateOracleQueryInfoIndexInput -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public string QueryId { get; set; } - public string Option { get; set; } - public OracleStep Step { get; set; } - public long LastUpdateHeight { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoInput.cs deleted file mode 100644 index ef3f0cc..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateOracleQueryInfoInput.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class UpdateOracleQueryInfoInput -{ - public string ChainId { get; set; } - public string QueryId { get; set; } - public OracleStep Step { get; set; } - public long LastUpdateHeight { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateReportInfoIndexInput.cs b/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateReportInfoIndexInput.cs deleted file mode 100644 index 5072fa2..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/CrossChain/UpdateReportInfoIndexInput.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class UpdateReportInfoIndexInput -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public long RoundId { get; set; } - public string Token { get; set; } - public string TargetChainId { get; set; } - public string ReceiptId { get; set; } - public string ReceiptHash { get; set; } - public ReportStep Step { get; set; } - public int QueryTimes { get; set; } - public long TransmitHeight { get; set; } - public long LastUpdateHeight { get; set; } - public string QueryTransactionId { get; set; } - public string ReceiptInfo { get; set; } -} \ 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 index cf05c75..296ea34 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/Indexer/GraphQLClientEnum.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/GraphQLClientEnum.cs @@ -2,7 +2,6 @@ namespace AElf.CrossChainServer.Indexer; public enum GraphQLClientEnum { - CrossChainServerClient, CrossChainClient, ScanClient } \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IEvmIndexerAppService.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IEvmIndexerAppService.cs deleted file mode 100644 index 2b7fe88..0000000 --- a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IEvmIndexerAppService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.Indexer; - -public interface IEvmIndexerAppService -{ - Task GetCurrentBlockNumberAsync(string chainId); -} \ 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 index 3751f3a..a95e670 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerAppService.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/IIndexerAppService.cs @@ -7,5 +7,10 @@ namespace AElf.CrossChainServer.Indexer; public interface IIndexerAppService { Task GetLatestIndexHeightAsync(string chainId); - Task GetPendingTransactionAsync(string chainId,string transferTransactionId); + 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/SyncStateDto.cs b/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs index 0975f93..1b9b5da 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/Indexer/SyncStateDto.cs @@ -2,18 +2,6 @@ namespace AElf.CrossChainServer.Indexer; -public class SyncStateDto -{ - public long ConfirmedBlockHeight { get; set; } -} - -public enum BlockFilterType -{ - BLOCK, - TRANSACTION, - LOG_EVENT -} - public class SyncStateResponse { public SyncStateItems CurrentVersion { get; set; } diff --git a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs index 47af6fa..ade80d7 100644 --- a/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs +++ b/src/AElf.CrossChainServer.Application.Contracts/TokenPool/PoolLiquiditySyncOptions.cs @@ -4,6 +4,6 @@ namespace AElf.CrossChainServer.TokenPool; public class PoolLiquiditySyncOptions { - public bool IsSyncEnabled { get; set; } + public bool IsSyncEnabled { get; set; } = false; public Dictionary> Token { 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 index 1c28b92..7e4e809 100644 --- a/src/AElf.CrossChainServer.Application/AElf.CrossChainServer.Application.csproj +++ b/src/AElf.CrossChainServer.Application/AElf.CrossChainServer.Application.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs b/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs index a060f61..5556804 100644 --- a/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs +++ b/src/AElf.CrossChainServer.Application/Chains/EvmClientProvider.cs @@ -65,9 +65,30 @@ public async Task GetChainStatusAsync(string chainId) }; } - public Task GetTransactionResultAsync(string chainId, string transactionId) + public async Task GetTransactionResultAsync(string chainId, string transactionId) { - throw new NotImplementedException(); + 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) diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs index 8417a35..a00cbd7 100644 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/AElfBridgeContractProvider.cs @@ -32,91 +32,13 @@ public AElfBridgeContractProvider(IBlockchainClientFactory blockchai _tokenAppService = tokenAppService; } - public Task> GetSendReceiptInfosAsync(string chainId, string contractAddress, - string targetChainId, Guid tokenId, - long fromIndex, long endIndex) - { - throw new NotImplementedException(); - } - - public Task> GetReceivedReceiptInfosAsync(string chainId, string contractAddress, - string fromChainId, Guid tokenId, - long fromIndex, long endIndex) - { - throw new NotImplementedException(); - } - - public Task> GetTransferReceiptIndexAsync(string chainId, string contractAddress, - List tokenIds, List targetChainIds) - { - throw new NotImplementedException(); - } - - public Task> GetReceiveReceiptIndexAsync(string chainId, string contractAddress, - List tokenIds, List fromChainIds) - { - throw new NotImplementedException(); - } - - public Task CheckTransmitAsync(string chainId, string contractAddress, string receiptHash) + public Task GetReceiptDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, + string targetChainId) { throw new NotImplementedException(); } - public async Task GetSwapIdByTokenAsync(string chainId, string contractAddress, string fromChainId, - string symbol) - { - var client = BlockchainClientFactory.GetClient(chainId); - - var param = new GetSwapIdByTokenInput - { - ChainId = fromChainId, - Symbol = symbol - }; - - var transaction = - await client.GenerateTransactionAsync(client.GetAddressFromPrivateKey(GetPrivateKey(chainId)), - contractAddress, - "GetSwapIdByToken", param); - var txWithSign = client.SignTransaction(GetPrivateKey(chainId), transaction); - var transactionResult = await client.ExecuteTransactionAsync(new ExecuteTransactionDto - { - RawTransaction = txWithSign.ToByteArray().ToHex() - }); - var swapId = Hash.Parser.ParseFrom(ByteArrayHelper.HexStringToByteArray(transactionResult)); - return swapId.ToHex(); - } - - [ExceptionHandler(typeof(Exception), typeof(InvalidOperationException), typeof(WebException), - Message = "[AElf contract provider] Swap token failed.", ReturnDefault = ReturnDefault.Default, - LogTargets = new[] { "chainId", "contractAddress", "swapId", "receiptId", "originAmount", "receiverAddress" })] - public virtual async Task SwapTokenAsync(string chainId, string contractAddress, string privateKey, - string swapId, string receiptId, string originAmount, - string receiverAddress) - { - var client = BlockchainClientFactory.GetClient(chainId); - - var param = new SwapTokenInput - { - SwapId = Hash.LoadFromHex(swapId), - ReceiptId = receiptId, - OriginAmount = originAmount, - ReceiverAddress = Address.FromBase58(receiverAddress) - }; - var fromAddress = client.GetAddressFromPrivateKey(privateKey); - var transaction = await client.GenerateTransactionAsync(fromAddress, contractAddress, "SwapToken", param); - var txWithSign = client.SignTransaction(privateKey, transaction); - - var result = await client.SendTransactionAsync(new SendTransactionInput - { - RawTransaction = txWithSign.ToByteArray().ToHex() - }); - - return result.TransactionId; - } - - public Task GetDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, - string targetChainId) + public Task GetSwapDailyLimitAsync(string chainId, string contractAddress, string swapId) { throw new NotImplementedException(); } diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs index 6985298..dfd87f9 100644 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/BridgeContractAppService.cs @@ -1,13 +1,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using AElf.CrossChainServer.BridgeContract; -using AElf.CrossChainServer.ExceptionHandler; using AElf.CrossChainServer.TokenPool; -using AElf.ExceptionHandler; using Microsoft.Extensions.Options; using Volo.Abp; -using Volo.Abp.Domain.Entities; namespace AElf.CrossChainServer.Contracts.Bridge; @@ -16,168 +12,36 @@ public class BridgeContractAppService : CrossChainServerAppService, IBridgeContr { private readonly IBridgeContractProviderFactory _bridgeContractProviderFactory; private readonly BridgeContractOptions _bridgeContractOptions; - private readonly IBridgeContractSyncInfoRepository _bridgeContractSyncInfoRepository; - private readonly AccountOptions _accountOptions; public BridgeContractAppService(IBridgeContractProviderFactory bridgeContractProviderFactory, - IOptionsSnapshot options, - IBridgeContractSyncInfoRepository bridgeContractSyncInfoRepository, - IOptionsSnapshot accountOptions) + IOptionsSnapshot options) { _bridgeContractProviderFactory = bridgeContractProviderFactory; - _bridgeContractSyncInfoRepository = bridgeContractSyncInfoRepository; _bridgeContractOptions = options.Value; - _accountOptions = accountOptions.Value; } - public async Task> GetTransferReceiptInfosAsync(string chainId, string targetChainId, - Guid tokenId, - long fromIndex, long endIndex) - { - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return new List(); - } - - return await provider.GetSendReceiptInfosAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeInContract, targetChainId, tokenId, fromIndex, - endIndex); - } - - public async Task> GetReceivedReceiptInfosAsync(string chainId, string targetChainId, - Guid tokenId, - long fromIndex, long endIndex) - { - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return new List(); - } - - return await provider.GetReceivedReceiptInfosAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeOutContract, targetChainId, tokenId, fromIndex, - endIndex); - } - - public async Task GetSyncInfoAsync(string chainId, TransferType type, - string targetChainId, Guid tokenId) - { - var info = await _bridgeContractSyncInfoRepository.FindAsync(o => - o.ChainId == chainId && o.Type == type && o.TargetChainId == targetChainId && o.TokenId == tokenId); - - return ObjectMapper.Map(info); - } - - public async Task UpdateSyncInfoAsync(string chainId, TransferType type, string targetChainId, Guid tokenId, - long syncIndex) - { - var info = await _bridgeContractSyncInfoRepository.FindAsync(o => - o.ChainId == chainId && o.Type == type && o.TargetChainId == targetChainId && o.TokenId == tokenId); - - if (info == null) - { - info = new BridgeContractSyncInfo - { - ChainId = chainId, - TargetChainId = targetChainId, - Type = type, - TokenId = tokenId, - SyncIndex = syncIndex, - }; - await InsertBridgeSyncInfoAsync(info); - } - else - { - info.SyncIndex = syncIndex; - await UpdateBridgeSyncInfoAsync(info); - } - } - - [ExceptionHandler(typeof(Exception), typeof(InvalidOperationException), typeof(ArgumentNullException), Message = "Insert bridge sync info failed.", - LogTargets = new[]{"info"})] - public virtual async Task InsertBridgeSyncInfoAsync(BridgeContractSyncInfo info) - { - await _bridgeContractSyncInfoRepository.InsertAsync(info); - } - - [ExceptionHandler(typeof(Exception), typeof(InvalidOperationException), typeof(ArgumentNullException), Message = "update bridge sync info failed.", - LogTargets = new[]{"info"})] - public virtual async Task UpdateBridgeSyncInfoAsync(BridgeContractSyncInfo info) - { - await _bridgeContractSyncInfoRepository.UpdateAsync(info); - } - public async Task> GetTransferReceiptIndexAsync(string chainId, List tokenIds, - List targetChainIds) - { - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return new List(); - } - return await provider.GetTransferReceiptIndexAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeInContract, tokenIds, targetChainIds); - } - - public async Task> GetReceiveReceiptIndexAsync(string chainId, List tokenIds, - List targetChainIds) - { - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return new List(); - } - return await provider.GetReceiveReceiptIndexAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeOutContract, tokenIds, targetChainIds); - } - - public async Task CheckTransmitAsync(string chainId, string receiptHash) + public async Task GetDailyLimitAsync(string chainId, Guid tokenId, string targetChainId) { var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); if (provider == null) { - return false; + return new DailyLimitDto(); } - return await provider.CheckTransmitAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeOutContract, receiptHash); - } - public async Task GetSwapIdByTokenAsync(string chainId, string fromChainId, string symbol) - { - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return ""; - } - return await provider.GetSwapIdByTokenAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeOutContract, fromChainId, symbol); - } - - [ExceptionHandler(typeof(Exception), Message = "Swap token failed.",ReturnDefault = ReturnDefault.Default, - LogTargets = new[]{"chainId","swapId","receiptId","originAmount","receiverAddress"})] - public async Task SwapTokenAsync(string chainId, string swapId, string receiptId, string originAmount, - string receiverAddress) - { - var privateKey = _accountOptions.PrivateKeys[chainId]; - var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); - if (provider == null) - { - return ""; - } - return await provider.SwapTokenAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].BridgeOutContract, privateKey, swapId, receiptId, - originAmount, receiverAddress); + return await provider.GetReceiptDailyLimitAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenId, targetChainId); } - public async Task GetDailyLimitAsync(string chainId, Guid tokenId, string targetChainId) + public async Task GetSwapDailyLimitAsync(string chainId, string swapId) { var provider = await _bridgeContractProviderFactory.GetBridgeContractProviderAsync(chainId); if (provider == null) { return new DailyLimitDto(); } - return await provider.GetDailyLimitAsync(chainId, - _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenId, targetChainId); + + return await provider.GetSwapDailyLimitAsync(chainId, + _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, swapId); } public async Task> GetCurrentReceiptTokenBucketStatesAsync(string chainId, List tokenIds, @@ -188,6 +52,7 @@ public async Task> GetCurrentReceiptTokenBucketStatesAsync( { return new List(); } + return await provider.GetCurrentReceiptTokenBucketStatesAsync(chainId, _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenIds, targetChainIds); } @@ -200,10 +65,11 @@ public async Task> GetCurrentSwapTokenBucketStatesAsync(str { return new List(); } + return await provider.GetCurrentSwapTokenBucketStatesAsync(chainId, _bridgeContractOptions.ContractAddresses[chainId].LimiterContract, tokenIds, fromChainIds); } - + public async Task> GetPoolLiquidityAsync(string chainId, string contractAddress, List tokenIds) { @@ -212,6 +78,7 @@ public async Task> GetPoolLiquidityAsync(string chainId, { 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/EvmBridgeContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs index d1b4cfe..9b133f1 100644 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/EvmBridgeContractProvider.cs @@ -24,179 +24,7 @@ public EvmBridgeContractProvider(IBlockchainClientFactory blockchainClient _tokenAppService = tokenAppService; } - [ExceptionHandler(typeof(Exception), Message = "[Evm bridge contract] Get send receipt infos failed.", - ReturnDefault = ReturnDefault.New, - LogTargets = new[] { "chainId", "contractAddress", "targetChainId", "tokenId", "fromIndex", "endIndex" })] - public async Task> GetSendReceiptInfosAsync(string chainId, string contractAddress, - string targetChainId, Guid tokenId, - long fromIndex, long endIndex) - { - var token = await _tokenAppService.GetAsync(tokenId); - var web3 = BlockchainClientFactory.GetClient(chainId); - var contractHandler = web3.Eth.GetContractHandler(contractAddress); - - var evmGetReceiptInfos = await contractHandler - .QueryDeserializingToObjectAsync( - new GetReceiptInfosFunctionMessage - { - Token = token.Address, - TargetChainId = targetChainId, - FromIndex = fromIndex, - EndIndex = endIndex - }); - - var result = new List(); - foreach (var receipt in evmGetReceiptInfos.Receipts) - { - var receiptInfo = new ReceiptInfoDto(); - receiptInfo.ReceiptId = receipt.ReceiptId; - receiptInfo.TokenId = tokenId; - receiptInfo.FromAddress = receipt.Owner; - receiptInfo.ToChainId = receipt.TargetChainId; - receiptInfo.ToAddress = receipt.TargetAddress; - receiptInfo.Amount = (decimal)((BigDecimal)receipt.Amount / BigInteger.Pow(10, token.Decimals)); - receiptInfo.BlockHeight = (long)receipt.BlockHeight; - receiptInfo.BlockTime = DateTimeHelper.FromUnixTimeMilliseconds((long)receipt.BlockTime * 1000); - - result.Add(receiptInfo); - } - - return result; - } - - [ExceptionHandler(typeof(Exception), Message = "[Evm bridge contract] Get received receipt info failed.", - ReturnDefault = ReturnDefault.New, - LogTargets = new[] { "chainId", "contractAddress", "fromChainId", "tokenId", "fromIndex", "endIndex" })] - public virtual async Task> GetReceivedReceiptInfosAsync(string chainId, - string contractAddress, - string fromChainId, Guid tokenId, - long fromIndex, long endIndex) - { - var token = await _tokenAppService.GetAsync(tokenId); - var web3 = BlockchainClientFactory.GetClient(chainId); - var contractHandler = web3.Eth.GetContractHandler(contractAddress); - - var evmGetReceiptInfos = await contractHandler - .QueryDeserializingToObjectAsync( - new GetReceivedReceiptInfosFunctionMessage - { - Token = token.Address, - FromChainId = fromChainId, - FromIndex = fromIndex, - EndIndex = endIndex - }); - - var result = new List(); - foreach (var receipt in evmGetReceiptInfos.Receipts) - { - var receiptInfo = new ReceivedReceiptInfoDto(); - receiptInfo.ReceiptId = receipt.ReceiptId; - receiptInfo.TokenId = tokenId; - //receiptInfo.FromAddress = receipt.Owner; - receiptInfo.FromChainId = receipt.FromChainId; - receiptInfo.ToAddress = receipt.TargetAddress; - receiptInfo.Amount = (decimal)((BigDecimal)receipt.Amount / BigInteger.Pow(10, token.Decimals)); - receiptInfo.BlockHeight = (long)receipt.BlockHeight; - receiptInfo.BlockTime = DateTimeHelper.FromUnixTimeMilliseconds((long)receipt.BlockTime * 1000); - - result.Add(receiptInfo); - } - - return result; - } - - [ExceptionHandler(typeof(Exception), Message = "[Evm bridge contract] Get transfer receipt index failed.", - ReturnDefault = ReturnDefault.New, - LogTargets = new[] { "chainId", "contractAddress", "tokenIds", "targetChainIds" })] - public virtual async Task> GetTransferReceiptIndexAsync(string chainId, - string contractAddress, - List tokenIds, List targetChainIds) - { - var tokenAddress = new List(); - foreach (var tokenId in tokenIds) - { - var token = await _tokenAppService.GetAsync(tokenId); - tokenAddress.Add(token.Address); - } - - var web3 = BlockchainClientFactory.GetClient(chainId); - var contractHandler = web3.Eth.GetContractHandler(contractAddress); - - var indexes = await contractHandler - .QueryDeserializingToObjectAsync( - new GetSendReceiptIndexFunctionMessage - { - Tokens = tokenAddress, - TargetChainIds = targetChainIds - }); - - return indexes.Indexes.Select((t, i) => new ReceiptIndexDto - { - TargetChainId = targetChainIds[i], - TokenId = tokenIds[i], - Index = (long)t - }).ToList(); - } - - [ExceptionHandler(typeof(Exception), Message = "[Evm bridge contract] Get receive receipt index failed.", - ReturnDefault = ReturnDefault.New, - LogTargets = new[] { "chainId", "contractAddress", "tokenIds", "fromChainIds" })] - public async Task> GetReceiveReceiptIndexAsync(string chainId, string contractAddress, - List tokenIds, List fromChainIds) - { - var tokenAddress = new List(); - foreach (var tokenId in tokenIds) - { - var token = await _tokenAppService.GetAsync(tokenId); - tokenAddress.Add(token.Address); - } - - var web3 = BlockchainClientFactory.GetClient(chainId); - var contractHandler = web3.Eth.GetContractHandler(contractAddress); - - var indexes = await contractHandler - .QueryDeserializingToObjectAsync( - new GetReceiveReceiptIndexFunctionMessage - { - Tokens = tokenAddress, - FromChainIds = fromChainIds - }); - - return indexes.Indexes.Select((t, i) => new ReceiptIndexDto - { - TargetChainId = fromChainIds[i], - TokenId = tokenIds[i], - Index = (long)t - }).ToList(); - } - - public async Task CheckTransmitAsync(string chainId, string contractAddress, string receiptHash) - { - var web3 = BlockchainClientFactory.GetClient(chainId); - var contractHandler = web3.Eth.GetContractHandler(contractAddress); - var isTransmit = await contractHandler - .QueryDeserializingToObjectAsync( - new IsReceiptRecordedFunctionMessage - { - ReceiptHash = ByteArrayHelper.HexStringToByteArray(receiptHash) - }); - - return isTransmit.IsReceiptRecorded; - } - - public Task GetSwapIdByTokenAsync(string chainId, string contractAddress, string fromChainId, string symbol) - { - throw new NotImplementedException(); - } - - public Task SwapTokenAsync(string chainId, string contractAddress, string privateKey, string swapId, - string receiptId, string originAmount, - string receiverAddress) - { - throw new NotImplementedException(); - } - - public async Task GetDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, + public async Task GetReceiptDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, string targetChainId) { var token = await _tokenAppService.GetAsync(tokenId); @@ -223,6 +51,31 @@ public async Task GetDailyLimitAsync(string chainId, string contr 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.", @@ -251,7 +104,7 @@ public virtual async Task> GetCurrentReceiptTokenBucketStat TargetChainId = targetChainIds }); var tokenBuckets = receiptTokenBucket.TokenBuckets.Select((t, i) => - GetTokenBuckets(t.TokenCapacity, t.Rate, tokenDecimals[i])).ToList(); + GetTokenBuckets(t.TokenCapacity, t.Rate,t.IsEnabled,t.LastUpdatedTime,t.CurrentTokenAmount, tokenDecimals[i])).ToList(); return tokenBuckets; } @@ -281,7 +134,7 @@ public virtual async Task> GetCurrentSwapTokenBucketStatesA FromChainId = fromChainIds }); var tokenBuckets = swapTokenBucket.SwapTokenBuckets.Select((t, i) => - GetTokenBuckets(t.TokenCapacity, t.Rate, tokenDecimals[i])).ToList(); + GetTokenBuckets(t.TokenCapacity, t.Rate,t.IsEnabled,t.LastUpdatedTime,t.CurrentTokenAmount, tokenDecimals[i])).ToList(); return tokenBuckets; } @@ -308,7 +161,7 @@ public async Task> GetPoolLiquidityAsync(string chainId, return result; } - private TokenBucketDto GetTokenBuckets(BigInteger capacity, BigInteger rate, int tokenDecimal) + private TokenBucketDto GetTokenBuckets(BigInteger capacity, BigInteger rate, bool isEnabled,long lastUpdatedTime, BigInteger currentTokenAmount,int tokenDecimal) { if (capacity == 0 || rate == 0) { @@ -317,13 +170,17 @@ private TokenBucketDto GetTokenBuckets(BigInteger capacity, BigInteger rate, int 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 + MaximumTimeConsumed = maximumTimeConsumed, + CurrentTokenAmount = currentAmount, + IsEnabled = isEnabled, + LastUpdatedTime = lastUpdatedTime }; } } \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiptInfosFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiptInfosFunctionMessage.cs deleted file mode 100644 index e53af9e..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiptInfosFunctionMessage.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using System.Numerics; -using Nethereum.ABI.FunctionEncoding.Attributes; -using Nethereum.Contracts; - -namespace AElf.CrossChainServer.Contracts.Bridge; - -[Function("getSendReceiptInfos", "tuple[]")] -public class GetReceiptInfosFunctionMessage: FunctionMessage -{ - [Parameter("address", "token", 1)] - public string Token { get; set; } - - [Parameter("string", "targetChainId", 2)] - public string TargetChainId { get; set; } - - [Parameter("uint256", "fromIndex", 3)] - public BigInteger FromIndex { get; set; } - - [Parameter("uint256", "endIndex", 4)] - public BigInteger EndIndex { get; set; } -} - -[FunctionOutput] -public class GetReceiptInfosDto: IFunctionOutputDTO -{ - [Parameter("tuple[]", "_receipts", 1)] - public List Receipts { get; set; } -} - -[FunctionOutput] -public class ReceiptDto : IFunctionOutputDTO -{ - [Parameter("address", "asset", 1)] - public string Asset { get; set; } - [Parameter("address", "owner", 2)] - public string Owner { get; set; } - [Parameter("uint256", "amount", 3)] - public BigInteger Amount { get; set; } - [Parameter("uint256", "blockHeight", 4)] - public BigInteger BlockHeight { get; set; } - [Parameter("uint256", "blockTime", 5)] - public BigInteger BlockTime { get; set; } - [Parameter("string", "targetChainId", 6)] - public string TargetChainId { get; set; } - [Parameter("string", "targetAddress", 7)] - public string TargetAddress { get; set; } - [Parameter("string", "receiptId", 8)] - public string ReceiptId { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiveReceiptIndexFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiveReceiptIndexFunctionMessage.cs deleted file mode 100644 index d01c12b..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceiveReceiptIndexFunctionMessage.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using System.Numerics; -using Nethereum.ABI.FunctionEncoding.Attributes; -using Nethereum.Contracts; - -namespace AElf.CrossChainServer.Contracts.Bridge; - -[Function("getReceiveReceiptIndex", "tuple[]")] -public class GetReceiveReceiptIndexFunctionMessage: FunctionMessage -{ - [Parameter("address[]", "tokens", 1)] - public List Tokens { get; set; } - - [Parameter("string[]", "fromChainIds", 2)] - public List FromChainIds { get; set; } -} - -[FunctionOutput] -public class GetReceiveReceiptIndexDto: IFunctionOutputDTO -{ - [Parameter("uint256[]", "indexes", 1)] - public List Indexes { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceivedReceiptInfosFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceivedReceiptInfosFunctionMessage.cs deleted file mode 100644 index 1615e69..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetReceivedReceiptInfosFunctionMessage.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using System.Numerics; -using Nethereum.ABI.FunctionEncoding.Attributes; -using Nethereum.Contracts; - -namespace AElf.CrossChainServer.Contracts.Bridge; - -[Function("getReceivedReceiptInfos", "tuple[]")] -public class GetReceivedReceiptInfosFunctionMessage: FunctionMessage -{ - [Parameter("address", "token", 1)] - public string Token { get; set; } - - [Parameter("string", "fromChainId", 2)] - public string FromChainId { get; set; } - - [Parameter("uint256", "fromIndex", 3)] - public BigInteger FromIndex { get; set; } - - [Parameter("uint256", "endIndex", 4)] - public BigInteger EndIndex { get; set; } -} - -[FunctionOutput] -public class GetReceivedReceiptInfosDto: IFunctionOutputDTO -{ - [Parameter("tuple[]", "_receipts", 1)] - public List Receipts { get; set; } -} - -[FunctionOutput] -public class ReceivedReceiptDto : IFunctionOutputDTO -{ - [Parameter("address", "asset", 1)] - public string Asset { get; set; } - [Parameter("address", "targetAddress", 2)] - public string TargetAddress { get; set; } - [Parameter("uint256", "amount", 3)] - public BigInteger Amount { get; set; } - [Parameter("uint256", "blockHeight", 4)] - public BigInteger BlockHeight { get; set; } - [Parameter("uint256", "blockTime", 5)] - public BigInteger BlockTime { get; set; } - [Parameter("string", "fromChainId", 6)] - public string FromChainId { get; set; } - [Parameter("string", "receiptId", 7)] - public string ReceiptId { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSendReceiptIndexFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSendReceiptIndexFunctionMessage.cs deleted file mode 100644 index 0a6f440..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/GetSendReceiptIndexFunctionMessage.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using System.Numerics; -using Nethereum.ABI.FunctionEncoding.Attributes; -using Nethereum.Contracts; - -namespace AElf.CrossChainServer.Contracts.Bridge; - -[Function("getSendReceiptIndex", "tuple[]")] -public class GetSendReceiptIndexFunctionMessage: FunctionMessage -{ - [Parameter("address[]", "tokens", 1)] - public List Tokens { get; set; } - - [Parameter("string[]", "targetChainIds", 2)] - public List TargetChainIds { get; set; } -} - -[FunctionOutput] -public class GetSendReceiptIndexDto: IFunctionOutputDTO -{ - [Parameter("uint256[]", "indexes", 1)] - public List Indexes { 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 index 02475e4..93ff469 100644 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProvider.cs +++ b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IBridgeContractProvider.cs @@ -10,23 +10,8 @@ public interface IBridgeContractProvider { BlockchainType ChainType { get; } - Task> GetSendReceiptInfosAsync(string chainId, string contractAddress, string targetChainId, Guid tokenId, - long fromIndex, long endIndex); - - Task> GetReceivedReceiptInfosAsync(string chainId, string contractAddress, string fromChainId, Guid tokenId, - long fromIndex, long endIndex); - - Task> GetTransferReceiptIndexAsync(string chainId, string contractAddress, List tokenIds, List targetChainIds); - - Task> GetReceiveReceiptIndexAsync(string chainId, string contractAddress, List tokenIds, List fromChainIds); - - Task CheckTransmitAsync(string chainId, string contractAddress, string receiptHash); - - Task GetSwapIdByTokenAsync(string chainId, string contractAddress, string fromChainId, string symbol); - Task SwapTokenAsync(string chainId, string contractAddress, string privateKey, string swapId, string receiptId, string originAmount, - string receiverAddress); - - Task GetDailyLimitAsync(string chainId, string contractAddress, Guid tokenId, string targetChainId); + 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); diff --git a/src/AElf.CrossChainServer.Application/Contracts/Bridge/IsReceiptRecordedFunctionMessage.cs b/src/AElf.CrossChainServer.Application/Contracts/Bridge/IsReceiptRecordedFunctionMessage.cs deleted file mode 100644 index 98dd6c7..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Bridge/IsReceiptRecordedFunctionMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Nethereum.ABI.FunctionEncoding.Attributes; -using Nethereum.Contracts; - -namespace AElf.CrossChainServer.Contracts.Bridge; - -[Function("isReceiptRecorded", "bool")] -public class IsReceiptRecordedFunctionMessage: FunctionMessage -{ - [Parameter("bytes32", "receiptHash", 1)] - public byte[] ReceiptHash { get; set; } -} - -[FunctionOutput] -public class IsReceiptRecordedDto: IFunctionOutputDTO -{ - [Parameter("bool", "", 1)] - public bool IsReceiptRecorded { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Report/AElfReportContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Report/AElfReportContractProvider.cs deleted file mode 100644 index 68fe024..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Report/AElfReportContractProvider.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Threading.Tasks; -using AElf.Client.Dto; -using AElf.Client.Service; -using AElf.Contracts.Report; -using AElf.CrossChainServer.Chains; -using Google.Protobuf; -using Microsoft.Extensions.Options; - -namespace AElf.CrossChainServer.Contracts.Report; - -public class AElfReportContractProvider : AElfClientProvider, IReportContractProvider -{ - public AElfReportContractProvider(IBlockchainClientFactory blockchainClientFactory, - IOptionsSnapshot accountOptions) : base(blockchainClientFactory, accountOptions) - { - } - - public async Task QueryOracleAsync(string chainId, string contractAddress, string privateKey, - string targetChainId, string receiptId, string receiptHash, string receiptInfo) - { - var client = BlockchainClientFactory.GetClient(chainId); - - var param = new QueryOracleInput - { - Payment = 0, - QueryInfo = new OffChainQueryInfo - { - Title = $"lock_token_{receiptId}", - Options = { receiptHash, receiptInfo } - }, - ChainId = targetChainId - }; - var fromAddress = client.GetAddressFromPrivateKey(privateKey); - var transaction = await client.GenerateTransactionAsync(fromAddress, contractAddress, "QueryOracle", param); - var txWithSign = client.SignTransaction(privateKey, transaction); - - var result = await client.SendTransactionAsync(new SendTransactionInput - { - RawTransaction = txWithSign.ToByteArray().ToHex() - }); - - return result.TransactionId; - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Report/IReportContractProvider.cs b/src/AElf.CrossChainServer.Application/Contracts/Report/IReportContractProvider.cs deleted file mode 100644 index ef4f175..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Report/IReportContractProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.Contracts.Report; - -public interface IReportContractProvider -{ - Task QueryOracleAsync(string chainId, string contractAddress, string privateKey, - string targetChainId, string receiptId, string receiptHash, string receiptInfo); -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractAppService.cs b/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractAppService.cs deleted file mode 100644 index e9a5166..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractAppService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.Options; -using Volo.Abp; - -namespace AElf.CrossChainServer.Contracts.Report; - -[RemoteService(IsEnabled = false)] -public class ReportContractAppService : CrossChainServerAppService, IReportContractAppService -{ - private readonly IReportContractProvider _reportContractProvider; - private readonly ReportContractOptions _reportContractOptions; - private readonly AccountOptions _accountOptions; - - public ReportContractAppService(IReportContractProvider reportContractProvider, - IOptionsSnapshot oracleOptions, IOptionsSnapshot accountOptions) - { - _reportContractProvider = reportContractProvider; - _reportContractOptions = oracleOptions.Value; - _accountOptions = accountOptions.Value; - } - - public async Task QueryOracleAsync(string chainId, string targetChainId, string receiptId, - string receiptHash,string receiptInfo) - { - var privateKey = _accountOptions.PrivateKeys[chainId]; - var contractAddress = _reportContractOptions.ContractAddresses[chainId]; - return await _reportContractProvider.QueryOracleAsync(chainId, contractAddress, privateKey, targetChainId, - receiptId, receiptHash, receiptInfo); - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractOptions.cs b/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractOptions.cs deleted file mode 100644 index 362422d..0000000 --- a/src/AElf.CrossChainServer.Application/Contracts/Report/ReportContractOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Collections.Generic; - -namespace AElf.CrossChainServer.Contracts.Report; - -public class ReportContractOptions -{ - public Dictionary ContractAddresses { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs index a1c33a4..d249424 100644 --- a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitAppService.cs @@ -1,9 +1,13 @@ 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 Nest; +using Microsoft.Extensions.Options; +using Serilog; using Volo.Abp; namespace AElf.CrossChainServer.CrossChain; @@ -16,25 +20,148 @@ public class CrossChainLimitAppService : CrossChainServerAppService, ICrossChain 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) + 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); - + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + if (limit == null) { limit = ObjectMapper.Map(input); @@ -60,7 +187,8 @@ public async Task SetCrossChainRateLimitIndexAsync(SetCrossChainRateLimitInput i 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); + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); if (limit.IsEnable) { limit.CurrentAmount -= input.Amount; @@ -77,8 +205,9 @@ public async Task> GetCrossChainRateLimitsAsync() 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); - + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); + if (limit == null) { limit = ObjectMapper.Map(input); @@ -92,18 +221,21 @@ public async Task SetCrossChainDailyLimitAsync(SetCrossChainDailyLimitInput inpu 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); + o.ChainId == input.ChainId && o.TargetChainId == input.TargetChainId && o.TokenId == input.TokenId && + o.Type == input.Type); limit.RemainAmount -= input.Amount; await _crossChainDailyLimitRepository.UpdateAsync(limit); } diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs index e23c390..c600e39 100644 --- a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainLimitInfoAppService.cs @@ -18,8 +18,6 @@ namespace AElf.CrossChainServer.CrossChain; public class CrossChainLimitInfoAppService : CrossChainServerAppService, ICrossChainLimitInfoAppService { private readonly IIndexerCrossChainLimitInfoService _indexerCrossChainLimitInfoService; - private readonly IBridgeContractAppService _bridgeContractAppService; - private readonly IOptionsMonitor _evmTokensOptions; private readonly ITokenAppService _tokenAppService; private readonly IChainAppService _chainAppService; private readonly IOptionsMonitor _crossChainLimitsOptions; @@ -28,15 +26,12 @@ public class CrossChainLimitInfoAppService : CrossChainServerAppService, ICrossC public CrossChainLimitInfoAppService( IIndexerCrossChainLimitInfoService indexerCrossChainLimitInfoService, - IBridgeContractAppService bridgeContractAppService, - IOptionsMonitor evmTokensOptions, ITokenAppService tokenAppService, + ITokenAppService tokenAppService, IChainAppService chainAppService, IOptionsMonitor crossChainLimitsOptions, ITokenSymbolMappingProvider tokenSymbolMappingProvider, ICrossChainLimitAppService crossChainLimitAppService) { _indexerCrossChainLimitInfoService = indexerCrossChainLimitInfoService; - _bridgeContractAppService = bridgeContractAppService; - _evmTokensOptions = evmTokensOptions; _tokenAppService = tokenAppService; _chainAppService = chainAppService; _crossChainLimitsOptions = crossChainLimitsOptions; @@ -103,8 +98,7 @@ public async Task> GetCrossChainRateLimit { var result = new List(); var crossChainLimitInfos = await GetCrossChainLimitInfosAsync(); - var evmLimitInfos = await GetEvmRateLimitInfosAsync(); - var tvmLimitInfos = await GetRateLimitsAsync(); + var otherChainLimitInfos = await GetRateLimitsAsync(); foreach (var crossChainLimitInfo in crossChainLimitInfos) { var chain = await _chainAppService.GetAsync(crossChainLimitInfo.Key.FromChainId); @@ -122,16 +116,11 @@ public async Task> GetCrossChainRateLimit var receiptRateLimits = await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.FromChainId); var swapRateLimits = new List(); - if (evmLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) { swapRateLimits = OfEvmRateLimitInfos(value); } - if (tvmLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var tvmLimits)) - { - swapRateLimits = OfEvmRateLimitInfos(tvmLimits); - } - var chainDto = await _chainAppService.GetAsync(crossChainLimitInfo.Key.FromChainId); if (chainDto == null) { @@ -159,7 +148,7 @@ public async Task> GetCrossChainRateLimit await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.ToChainId); var receiptRateLimits = new List(); - if (evmLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) { receiptRateLimits = OfEvmRateLimitInfos(value); } @@ -191,7 +180,7 @@ public async Task> GetCrossChainRateLimit await OfRateLimitInfos(crossChainLimitInfo.Value, crossChainLimitInfo.Key.ToChainId); var receiptRateLimits = new List(); - if (tvmLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) + if (otherChainLimitInfos.TryGetValue(crossChainLimitInfo.Key, out var value)) { receiptRateLimits = OfEvmRateLimitInfos(value); } @@ -314,118 +303,6 @@ private static List OfEvmRateLimitInfos( }).ToList(); } - [ExceptionHandler(typeof(Exception), - Message = "Get evm cross chain limit info failed.", ReturnDefault = ReturnDefault.New)] - public virtual async Task>> - GetEvmRateLimitInfosAsync() - { - var result = new Dictionary>(); - foreach (var (chainId, tokenInfos) in _evmTokensOptions.CurrentValue.Tokens) - { - var res = await GetEvmRateLimitInfosByChainIdAsync(chainId, tokenInfos); - ConcatRateLimits(ref result, res); - } - - return result; - } - - [ExceptionHandler(typeof(Exception), Message = "Get evm rate limit info failed.", - ReturnDefault = ReturnDefault.New, LogTargets = new[] { "chainId", "tokenInfos" })] - public virtual async Task>> - GetEvmRateLimitInfosByChainIdAsync(string chainId, List tokenInfos) - { - var result = new Dictionary>(); - var targetChainIds = tokenInfos.Select(t => t.TargetChainId).ToList(); - var tokenIds = new List(); - var tokenSymbols = new List(); - foreach (var token in tokenInfos) - { - var tokenInfo = await GetTokenAsync(token.Address, chainId); - if (tokenInfo == null) - { - continue; - } - - tokenIds.Add(tokenInfo.Id); - tokenInfo.Symbol = - _tokenSymbolMappingProvider.GetMappingSymbol(chainId, token.TargetChainId, tokenInfo.Symbol); - tokenSymbols.Add(tokenInfo.Symbol); - } - - Log.ForContext("fromChainId", chainId).Debug( - "Start to get receipt limit info. From chain:{fromChainId}, to chain list:{toChainId}, symbol list:{symbol}", - chainId, targetChainIds, tokenSymbols); - var receiptRateLimits = - await GetEvmReceiptRateLimitsAsync(chainId, targetChainIds, tokenIds, - tokenSymbols); - ConcatRateLimits(ref result, receiptRateLimits); - Log.ForContext("fromChainId", chainId).Debug( - "Start to get swap limit info. From chain list:{fromChainId}, to chain:{toChainId}, symbol:{symbol}", - targetChainIds, chainId, tokenSymbols); - var swapRateLimits = - await GetEvmSwapRateLimitsAsync(targetChainIds, chainId, tokenIds, - tokenSymbols); - ConcatRateLimits(ref result, swapRateLimits); - - return result; - } - - [ExceptionHandler(typeof(Exception), Message = "Get evm receipt rate limits failed.", - ReturnDefault = ReturnDefault.Default, LogTargets = new[] { "tokenAddress", "chainId" })] - public virtual async Task GetTokenAsync(string tokenAddress, string chainId) - { - var tokenInfo = await _tokenAppService.GetAsync(new GetTokenInput - { - Address = tokenAddress, - ChainId = chainId - }); - return tokenInfo; - } - - [ExceptionHandler(typeof(Exception), Message = "Get evm receipt rate limits failed.", - ReturnDefault = ReturnDefault.New, LogTargets = new[] { "chainId", "targetChainIds", "tokenIds", "symbols" })] - public virtual async Task>> - GetEvmReceiptRateLimitsAsync( - string chainId, List targetChainIds, List tokenIds, List symbols) - { - var result = new Dictionary>(); - var receiptTokenBucketDto = await _bridgeContractAppService.GetCurrentReceiptTokenBucketStatesAsync(chainId, - tokenIds, targetChainIds); - for (var i = 0; i < receiptTokenBucketDto.Count; i++) - { - var limitKey = new CrossChainLimitKey - { - FromChainId = chainId, - ToChainId = targetChainIds[i] - }; - GetRateLimitsResult(ref result, limitKey, receiptTokenBucketDto[i], symbols[i]); - } - - return result; - } - - [ExceptionHandler(typeof(Exception), Message = "Get evm swap rate limits failed.", - ReturnDefault = ReturnDefault.New, LogTargets = new[] { "fromChainIds", "toChainId", "tokenIds", "symbols" })] - public virtual async Task>> - GetEvmSwapRateLimitsAsync( - List fromChainIds, string toChainId, List tokenIds, List symbols) - { - var result = new Dictionary>(); - var swapTokenBucketDto = await _bridgeContractAppService.GetCurrentSwapTokenBucketStatesAsync(toChainId, - tokenIds, fromChainIds); - for (var i = 0; i < swapTokenBucketDto.Count; i++) - { - var limitKey = new CrossChainLimitKey - { - FromChainId = fromChainIds[i], - ToChainId = toChainId - }; - GetRateLimitsResult(ref result, limitKey, swapTokenBucketDto[i], symbols[i]); - } - - return result; - } - private async Task>> GetRateLimitsAsync() { var result = new Dictionary>(); @@ -472,40 +349,7 @@ private async Task> result, - CrossChainLimitKey limitKey, TokenBucketDto tokenBucket, string symbol) - { - var tokenDictionary = new Dictionary - { - [symbol] = tokenBucket - }; - if (result.ContainsKey(limitKey)) - { - result[limitKey] = result[limitKey].Concat(tokenDictionary).ToDictionary(k => k.Key, v => v.Value); - } - else - { - result[limitKey] = tokenDictionary; - } - } - - public void ConcatRateLimits(ref Dictionary> result, - Dictionary> rateLimits) - { - foreach (var pair in rateLimits) - { - if (result.ContainsKey(pair.Key)) - { - result[pair.Key] = result[pair.Key].Concat(pair.Value).ToDictionary(k => k.Key, v => v.Value); - } - else - { - result[pair.Key] = pair.Value; - } - } - } - + [ExceptionHandler(typeof(Exception), Message = "Get token info failed.", ReturnDefault = ReturnDefault.Default, LogTargets = new[] { "chainId", "symbol" })] public virtual async Task GetTokenInfoAsync(string chainId, string symbol) diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainOptions.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainOptions.cs deleted file mode 100644 index d62af2f..0000000 --- a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainOptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace AElf.CrossChainServer.CrossChain; - -public class CrossChainOptions -{ - public long ReportTimeoutHeightThreshold { get; set; } = CrossChainServerConsts.DefaultReportTimeoutHeightThreshold; - public long MaxReportResendTimes { get; set; } = CrossChainServerConsts.DefaultMaxReportResendTimes; -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs index 96e4e52..d266638 100644 --- a/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs +++ b/src/AElf.CrossChainServer.Application/CrossChain/CrossChainTransferAppService.cs @@ -5,6 +5,7 @@ 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; @@ -34,6 +35,7 @@ public partial class CrossChainTransferAppService : CrossChainServerAppService, private readonly AutoReceiveConfigOptions _autoReceiveConfigOptions; private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly TonConfigOption _tonConfigOption; + private readonly SyncStateServiceOption _syncStateServiceOption; private const int PageCount = 1000; @@ -46,7 +48,8 @@ public CrossChainTransferAppService(ICrossChainTransferRepository crossChainTran IEnumerable crossChainTransferProviders, IIndexerAppService indexerAppService, ITokenAppService tokenAppService, IOptionsSnapshot autoReceiveConfigOptions, IUnitOfWorkManager unitOfWorkManager, - IOptionsSnapshot tonConfigOption) + IOptionsSnapshot tonConfigOption, + IOptionsSnapshot syncStateServiceOption) { _crossChainTransferRepository = crossChainTransferRepository; _chainAppService = chainAppService; @@ -60,6 +63,7 @@ public CrossChainTransferAppService(ICrossChainTransferRepository crossChainTran _autoReceiveConfigOptions = autoReceiveConfigOptions.Value; _crossChainTransferProviders = crossChainTransferProviders.ToList(); _tonConfigOption = tonConfigOption.Value; + _syncStateServiceOption = syncStateServiceOption.Value; } public async Task> GetListAsync(GetCrossChainTransfersInput input) @@ -179,9 +183,12 @@ public async Task> GetListAsync(GetCr 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); + .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(); @@ -216,9 +223,10 @@ public async Task TransferAsync(CrossChainTransferInput input) if (transfer == null) { Log.Information( - "New transfer {transferTxId},{receiptId}", input.TransferTransactionId, input.ReceiptId); + "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; @@ -228,13 +236,15 @@ public async Task TransferAsync(CrossChainTransferInput input) { Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) .Debug( - "Update transfer {transferTxId},{receiptId}", input.TransferTransactionId, input.ReceiptId); + "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) @@ -252,7 +262,7 @@ public async Task TransferAsync(CrossChainTransferInput input) MethodName = nameof(HandleTransferDbException))] public virtual Task UpdateCrossChainTransferAsync(CrossChainTransfer transfer) { - return _crossChainTransferRepository.UpdateAsync(transfer); + return _crossChainTransferRepository.UpdateAsync(transfer, true); } [ExceptionHandler(typeof(DbUpdateConcurrencyException), typeof(DbUpdateException), @@ -306,7 +316,13 @@ private async Task HandleUniqueTransfer(Exception ex, T input) transfer.ReceiveTime = receiveInput.ReceiveTime; transfer.ReceiveAmount = receiveInput.ReceiveAmount; - transfer.Status = CrossChainStatus.Received; + 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; @@ -341,24 +357,33 @@ public async Task ReceiveAsync(CrossChainReceiveInput input) if (transfer == null) { Log.ForContext("fromChainId", input.FromChainId).ForContext("toChainId", input.ToChainId).Information( - "New receive {transferTxId},{receiptId},{receiveTxId}", input.TransferTransactionId, input.ReceiptId, - input.ReceiveTransactionId); + "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}", input.TransferTransactionId, input.ReceiptId, - input.ReceiveTransactionId); + "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.Status = CrossChainStatus.Received; + 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) @@ -371,6 +396,19 @@ public async Task ReceiveAsync(CrossChainReceiveInput input) } } + 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" })] @@ -416,6 +454,11 @@ public async Task UpdateIndexAsync(UpdateCrossChainTransferIndexInput input) await _crossChainTransferIndexRepository.UpdateAsync(index); } + public async Task DeleteIndexAsync(Guid id) + { + await _crossChainTransferIndexRepository.DeleteAsync(id); + } + public async Task UpdateProgressAsync() { var page = 0; @@ -482,8 +525,8 @@ 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.ProgressUpdateTime > DateTime.UtcNow.AddDays(-3)) + .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)); @@ -514,11 +557,19 @@ await _blockchainAppService.GetTransactionResultAsync(transfer.ToChainId, 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) { @@ -558,27 +609,28 @@ private async Task> GetToUpdateReceiveTransactionAsync( 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 GetToReceivedAsync(page); + 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); + "AutoReceive. TransferTransactionId:{id}", transfer.TransferTransactionId); var toChain = await _chainAppService.GetAsync(transfer.ToChainId); - var fromChain = await _chainAppService.GetAsync(transfer.FromChainId); if (toChain == null || toChain.Type != BlockchainType.AElf) { continue; } Log.ForContext("fromChainId", transfer.FromChainId).ForContext("toChainId", transfer.ToChainId) - .Debug( + .Information( "Start to auto receive, transferTransactionId:{id}", transfer.TransferTransactionId); if (!await _checkTransferProvider.CheckTokenExistAsync(transfer.FromChainId, transfer.ToChainId, @@ -591,7 +643,7 @@ public async Task AutoReceiveAsync() toUpdate.Add(transfer); continue; } - + var provider = GetCrossChainTransferProvider(transfer.Type); var txId = await provider.SendReceiveTransactionAsync(transfer); if (string.IsNullOrWhiteSpace(txId)) @@ -612,7 +664,7 @@ public async Task AutoReceiveAsync() } page++; - crossChainTransfers = await GetToReceivedAsync(page); + crossChainTransfers = await GetHomogeneousTransferToReceivedAsync(page); } if (toUpdate.Count > 0) @@ -621,80 +673,406 @@ public async Task AutoReceiveAsync() } } - public async Task CheckReceiveTransactionAsync() + public async Task CheckTransferTransactionConfirmedAsync(string chainId) { - Logger.LogInformation("Start to check receive transaction."); + Log.Information( + "[CheckTransferTransactionConfirmedAsync] Start to check transfer transaction confirmed. ChainId:{ChainId}", + chainId); var page = 0; var toUpdate = new List(); - var crossChainTransfers = await GetToCheckReceivedTransactionAsync(page); - Logger.LogInformation("Check receive transaction. Count:{count}", crossChainTransfers.Count); + 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) { - Logger.LogInformation("Check if the transaction has been received. TransferTransactionId:{id}", - transfer.TransferTransactionId); + 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); - var crossChainTransferInfo = - await _indexerAppService.GetPendingTransactionAsync( + 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), - string.IsNullOrWhiteSpace(transfer.InlineTransferTransactionId) - ? transfer.TransferTransactionId - : transfer.InlineTransferTransactionId); - if (crossChainTransferInfo == null) + transfer.ReceiveTransactionId); + } + if (!success) { - Logger.LogInformation("Transaction not exist. TransferTransactionId:{id}", - transfer.TransferTransactionId); + Log.Warning( + "[CheckReceiveTransactionConfirmedAsync] Query aefinder failed, retry. ReceiveTransactionId:{id}, receiptId:{receiptId}", + transfer.ReceiveTransactionId, transfer.ReceiptId); continue; } - if (crossChainTransferInfo.ReceiveTransactionId == null) + if (success && crossChainTransferInfo == null) { - Logger.LogInformation("Transaction was not received. TransferTransactionId:{id}", - transfer.TransferTransactionId); + 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; } - Logger.LogInformation("Transaction exist. TransferTransactionId:{id},receiveTransactionId:{receiveId}", - transfer.TransferTransactionId, crossChainTransferInfo.ReceiveTransactionId); - var receiveToken = await _tokenAppService.GetAsync(new GetTokenInput + 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 = receiveToken.Id; + transfer.ReceiveTokenId = token.Id; transfer.ReceiveTransactionId = crossChainTransferInfo.ReceiveTransactionId; transfer.ReceiveTime = crossChainTransferInfo.ReceiveTime; - transfer.ReceiveAmount = crossChainTransferInfo.ReceiveAmount; + + 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 GetToCheckReceivedTransactionAsync(page); + crossChainTransfers = await GetPendingReceiveTransactionAsync(chainId, currentLib, page); } if (toUpdate.Count > 0) { - await _crossChainTransferRepository.UpdateManyAsync(toUpdate); + await _crossChainTransferRepository.UpdateManyAsync(toUpdate, true); } } - private async Task> GetToCheckReceivedTransactionAsync(int page) + 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.Progress == CrossChainServerConsts.FullOfTheProgress && - o.Status == CrossChainStatus.Indexed && o.Type == CrossChainType.Homogeneous) - .OrderBy(o => o.ProgressUpdateTime) + .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; } - private async Task> GetToReceivedAsync(int page) + // 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(); diff --git a/src/AElf.CrossChainServer.Application/CrossChain/EvmTokensOptions.cs b/src/AElf.CrossChainServer.Application/CrossChain/EvmTokensOptions.cs deleted file mode 100644 index cdf8657..0000000 --- a/src/AElf.CrossChainServer.Application/CrossChain/EvmTokensOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using AElf.CrossChainServer.BridgeContract; - -namespace AElf.CrossChainServer.CrossChain; - -public class EvmTokensOptions -{ - /// - /// ChainId -> Token Dic - /// - public Dictionary> Tokens { get; set; } = new(); - -} - -public class TokenInfo -{ - public string Address { get; set; } - public string TargetChainId { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs index d402fa9..2c31224 100644 --- a/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs +++ b/src/AElf.CrossChainServer.Application/CrossChain/HeterogeneousCrossChainTransferProvider.cs @@ -18,32 +18,20 @@ namespace AElf.CrossChainServer.CrossChain; public class HeterogeneousCrossChainTransferProvider : ICrossChainTransferProvider, ITransientDependency { private readonly IChainAppService _chainAppService; - private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; - private readonly IReportInfoAppService _reportInfoAppService; - private readonly ITokenRepository _tokenRepository; - private readonly ITokenSymbolMappingProvider _tokenSymbolMappingProvider; - private readonly IBridgeContractAppService _bridgeContractAppService; private readonly ICrossChainTransferRepository _crossChainTransferRepository; private readonly IAetherLinkProvider _aetherLinkProvider; public HeterogeneousCrossChainTransferProvider(IChainAppService chainAppService, - IOracleQueryInfoAppService oracleQueryInfoAppService, IReportInfoAppService reportInfoAppService, - ITokenRepository tokenRepository, ITokenSymbolMappingProvider tokenSymbolMappingProvider, - IBridgeContractAppService bridgeContractAppService, ICrossChainTransferRepository crossChainTransferRepository, + ICrossChainTransferRepository crossChainTransferRepository, IAetherLinkProvider aetherLinkProvider) { _chainAppService = chainAppService; - _oracleQueryInfoAppService = oracleQueryInfoAppService; - _reportInfoAppService = reportInfoAppService; - _tokenRepository = tokenRepository; - _tokenSymbolMappingProvider = tokenSymbolMappingProvider; - _bridgeContractAppService = bridgeContractAppService; _crossChainTransferRepository = crossChainTransferRepository; _aetherLinkProvider = aetherLinkProvider; } public CrossChainType CrossChainType { get; } = CrossChainType.Heterogeneous; - + [UnitOfWork] public async Task FindTransferAsync(string fromChainId, string toChainId, string transferTransactionId, string receiptId) @@ -62,7 +50,8 @@ public async Task CalculateCrossChainProgressAsync(CrossChainTransfer trans { return 0; } - Log.Debug("Calculate cross chain progress {txId}",transfer.TransferTransactionId); + + Log.Debug("Calculate cross chain progress {txId}", transfer.TransferTransactionId); return await _aetherLinkProvider.CalculateCrossChainProgressAsync(new AetherLinkCrossChainStatusInput { TransactionId = transfer.TransferTransactionId diff --git a/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs b/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs index 3bbf182..ac509fc 100644 --- a/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs +++ b/src/AElf.CrossChainServer.Application/CrossChain/ICheckTransferProvider.cs @@ -17,7 +17,6 @@ namespace AElf.CrossChainServer.CrossChain; public interface ICheckTransferProvider { - Task CheckTransferAsync(string fromChainId, string toChainId, Guid tokenId, decimal transferAmount); Task CheckTokenExistAsync(string fromChainId, string toChainId, Guid tokenId); } @@ -39,70 +38,6 @@ public CheckTransferProvider( _tokenSymbolMappingProvider = tokenSymbolMappingProvider; } - [ExceptionHandler(typeof(Exception), Message = "Check transfer error.", - TargetType = typeof(ExceptionHandlingService), - MethodName = nameof(ExceptionHandlingService.HandleException))] - public virtual async Task CheckTransferAsync(string fromChainId, string toChainId, Guid tokenId, - decimal transferAmount) - { - var (amount, symbol) = await GetTokenTransferAmountAsync(fromChainId, toChainId, tokenId, transferAmount); - Log.ForContext("fromChainId", fromChainId).ForContext("toChainId", toChainId).Debug( - "Start to check limit. From chain:{fromChainId}, to chain:{toChainId}, token symbol:{symbol}, transfer amount:{amount}", - fromChainId, toChainId, symbol, amount); - var chain = await _chainAppService.GetAsync(toChainId); - if (chain == null) - { - Log.Warning("No chain info."); - return false; - } - - toChainId = ChainHelper.ConvertChainIdToBase58(chain.AElfChainId); - var limitInfo = - (await _indexerCrossChainLimitInfoService.GetCrossChainLimitInfoIndexAsync(fromChainId, toChainId, - symbol)).FirstOrDefault(); - if (limitInfo == null) - { - Log.Warning("No limit info."); - return true; - } - - var time = DateTime.UtcNow; - if (time.Subtract(limitInfo.RefreshTime).TotalSeconds >= CrossChainServerConsts.DefaultDailyLimitRefreshTime) - { - Log.Debug("Daily limit refresh."); - limitInfo.CurrentDailyLimit = limitInfo.DefaultDailyLimit; - } - - if (limitInfo.Capacity == 0) - { - Log.Warning("Rate limit does not set."); - return amount <= limitInfo.CurrentDailyLimit; - } - - var timeDiff = time.Subtract(limitInfo.BucketUpdateTime).TotalSeconds; - var rateLimit = Math.Min(limitInfo.Capacity, - limitInfo.CurrentBucketTokenAmount + timeDiff * limitInfo.RefillRate); - Log.Information( - "Limit info,daily limit:{dailyLimit},capacity:{capacity},current bucket amount:{currentBucket},bucketUpdateTime:{bucketUpdateTime},rate:{rate},now:{timeNow},time diff:{dif},rate limit:{limit}.", - limitInfo.CurrentDailyLimit, limitInfo.Capacity, limitInfo.CurrentBucketTokenAmount, - limitInfo.BucketUpdateTime, limitInfo.RefillRate, time, timeDiff, rateLimit); - - return amount <= limitInfo.CurrentDailyLimit && amount <= (decimal)rateLimit; - } - - private async Task<(decimal,string)> GetTokenTransferAmountAsync(string fromChainId, string toChainId, Guid tokenId, - decimal transferAmount) - { - var token = await GetTokenInfoAsync(fromChainId, toChainId, tokenId); - if (token == null) - { - throw new EntityNotFoundException("Token not exist."); - } - - return (transferAmount * (decimal)Math.Pow(10, token.Decimals), token.Symbol); - } - - [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) diff --git a/src/AElf.CrossChainServer.Application/CrossChain/OracleQueryInfoAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/OracleQueryInfoAppService.cs deleted file mode 100644 index feab655..0000000 --- a/src/AElf.CrossChainServer.Application/CrossChain/OracleQueryInfoAppService.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using AElf.Indexing.Elasticsearch; -using Microsoft.Extensions.Logging; -using Nest; -using Serilog; -using Volo.Abp; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Uow; - -namespace AElf.CrossChainServer.CrossChain; - -[RemoteService(IsEnabled = false)] -public class OracleQueryInfoAppService : CrossChainServerAppService, IOracleQueryInfoAppService -{ - private readonly INESTRepository _oracleQueryInfoIndexRepository; - private readonly IOracleQueryInfoRepository _oracleQueryInfoRepository; - private readonly IUnitOfWorkManager _unitOfWorkManager; - - public OracleQueryInfoAppService(IOracleQueryInfoRepository oracleQueryInfoRepository, - INESTRepository oracleQueryInfoIndexRepository, IUnitOfWorkManager unitOfWorkManager) - { - _oracleQueryInfoRepository = oracleQueryInfoRepository; - _oracleQueryInfoIndexRepository = oracleQueryInfoIndexRepository; - _unitOfWorkManager = unitOfWorkManager; - } - - public async Task CreateAsync(CreateOracleQueryInfoInput input) - { - using var uow = _unitOfWorkManager.Begin(); - if (await _oracleQueryInfoRepository.FirstOrDefaultAsync(o => - o.ChainId == input.ChainId && o.QueryId == input.QueryId && o.Option == input.Option) != null) - { - return; - } - - var info = ObjectMapper.Map(input); - await _oracleQueryInfoRepository.InsertAsync(info); - await uow.CompleteAsync(); - } - - public async Task UpdateAsync(UpdateOracleQueryInfoInput input) - { - var infoList = await _oracleQueryInfoRepository.GetListAsync(o => - o.ChainId == input.ChainId && o.QueryId == input.QueryId); - - if (infoList.Count == 0) - { - return; - } - - foreach (var info in infoList) - { - if (info.Step >= input.Step) - { - Log.ForContext("chainId",info.ChainId).Debug( - "Invalid oracle step. ChainId: {chainId}, QueryId: {queryId}, Step: {step}, Input Step: {inputStep}", - info.ChainId, info.QueryId, info.Step, input.Step); - continue; - } - - info.Step = input.Step; - info.LastUpdateHeight = input.LastUpdateHeight; - } - - await _oracleQueryInfoRepository.UpdateManyAsync(infoList); - } - - public async Task AddIndexAsync(AddOracleQueryInfoIndexInput input) - { - var index = ObjectMapper.Map(input); - await _oracleQueryInfoIndexRepository.AddAsync(index); - } - - public async Task UpdateIndexAsync(UpdateOracleQueryInfoIndexInput input) - { - var index = ObjectMapper.Map(input); - await _oracleQueryInfoIndexRepository.UpdateAsync(index); - } - - public async Task CalculateCrossChainProgressAsync(string chainId, string option) - { - var mustQuery = new List, QueryContainer>> - { - q => q.Term(i => i.Field(f => f.ChainId).Value(chainId)), - q => q.Term(i => i.Field(f => f.Option).Value(option)), - }; - QueryContainer Query(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); - - var queryInfo = await _oracleQueryInfoIndexRepository.GetAsync(Query, sortExp: o=>o.Step, sortType: SortOrder.Descending); - - if (queryInfo == null) - { - return 0; - } - - return ((int)queryInfo.Step + 1) * 20; - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/ReportInfoAppService.cs b/src/AElf.CrossChainServer.Application/CrossChain/ReportInfoAppService.cs deleted file mode 100644 index 41499de..0000000 --- a/src/AElf.CrossChainServer.Application/CrossChain/ReportInfoAppService.cs +++ /dev/null @@ -1,266 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using AElf.Indexing.Elasticsearch; -using Nest; -using System.Linq; -using AElf.CrossChainServer.Chains; -using AElf.CrossChainServer.Contracts; -using AElf.CrossChainServer.Indexer; -using AElf.CrossChainServer.Settings; -using AElf.ExceptionHandler; -using Microsoft.Extensions.Options; -using Serilog; -using Volo.Abp; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Uow; - -namespace AElf.CrossChainServer.CrossChain; - -[RemoteService(IsEnabled = false)] -public class ReportInfoAppService : CrossChainServerAppService,IReportInfoAppService -{ - private readonly IReportInfoRepository _reportInfoRepository; - private readonly INESTRepository _nestRepository; - private readonly IBridgeContractAppService _bridgeContractAppService; - private readonly IBlockchainAppService _blockchainAppService; - private readonly IReportContractAppService _reportContractAppService; - private readonly IIndexerAppService _indexerAppService; - private readonly CrossChainOptions _crossChainOptions; - private readonly ISettingManager _settingManager; - private readonly ReportQueryTimesOptions _reportQueryTimesOptions; - private readonly IUnitOfWorkManager _unitOfWorkManager; - - public ReportInfoAppService(IReportInfoRepository reportInfoRepository, - INESTRepository nestRepository, IBridgeContractAppService bridgeContractAppService, - IBlockchainAppService blockchainAppService, - IReportContractAppService reportContractAppService, - IOptionsSnapshot crossChainOptions, IIndexerAppService indexerAppService, - ISettingManager settingManager,IOptionsSnapshot reportQueryTimesOptions, IUnitOfWorkManager unitOfWorkManager) - { - _reportInfoRepository = reportInfoRepository; - _nestRepository = nestRepository; - _bridgeContractAppService = bridgeContractAppService; - _blockchainAppService = blockchainAppService; - _reportContractAppService = reportContractAppService; - _indexerAppService = indexerAppService; - _settingManager = settingManager; - _unitOfWorkManager = unitOfWorkManager; - _crossChainOptions = crossChainOptions.Value; - _reportQueryTimesOptions = reportQueryTimesOptions.Value; - } - - public async Task CreateAsync(CreateReportInfoInput input) - { - using var uow = _unitOfWorkManager.Begin(); - if (await _reportInfoRepository.FirstOrDefaultAsync(o => - o.ChainId == input.ChainId && o.RoundId == input.RoundId && o.Token == input.Token && - o.TargetChainId == input.TargetChainId) != null) - { - return; - } - - var info = ObjectMapper.Map(input); - info.Step = ReportStep.Proposed; - var resendTimes = await _reportInfoRepository.CountAsync(o=>o.ChainId == info.ChainId && o.ReceiptHash == info.ReceiptHash); - info.ResendTimes = resendTimes; - - await _reportInfoRepository.InsertAsync(info); - await uow.CompleteAsync(); - } - - public async Task UpdateStepAsync(string chainId, long roundId, string token, string targetChainId, ReportStep step, long blockHeight) - { - var info = await _reportInfoRepository.FindAsync(o => - o.ChainId == chainId && o.RoundId == roundId && o.Token == token && o.TargetChainId == targetChainId); - - if (info == null || info.Step >= step) - { - Log.Debug( - "Invalid report step. ChainId: {chainId}, RoundId: {roundId}, Step: {oldStep}, Input Step: {newStep}", - info?.ChainId, roundId, info?.Step, step); - return; - } - - info.Step = step; - info.LastUpdateHeight = blockHeight; - await _reportInfoRepository.UpdateAsync(info); - } - - public async Task AddIndexAsync(AddReportInfoIndexInput input) - { - var index = ObjectMapper.Map(input); - await _nestRepository.AddAsync(index); - } - - public async Task UpdateIndexAsync(UpdateReportInfoIndexInput input) - { - var index = ObjectMapper.Map(input); - await _nestRepository.UpdateAsync(index); - } - - public async Task CalculateCrossChainProgressAsync(string chainId, string receiptId) - { - var mustQuery = new List, QueryContainer>> - { - q => q.Term(i => i.Field(f => f.ChainId).Value(chainId)), - q => q.Term(i => i.Field(f => f.ReceiptId).Value(receiptId)), - }; - QueryContainer Query(QueryContainerDescriptor f) => f.Bool(b => b.Must(mustQuery)); - - var info = await _nestRepository.GetAsync(Query, sortExp: o=>o.Step, sortType: SortOrder.Descending); - - if (info == null || info.Step < ReportStep.Proposed) - { - return 0; - } - - return ((int)info.Step + 1) * 100 / 3; - } - - public async Task UpdateStepAsync() - { - using var uow = _unitOfWorkManager.Begin(); - var q = await _reportInfoRepository.GetQueryableAsync(); - var list = await AsyncExecuter.ToListAsync(q - .Where(o => o.Step == ReportStep.Confirmed && o.QueryTimes < _reportQueryTimesOptions.QueryTimes)); - await uow.CompleteAsync(); - if (list.Count == 0) - { - return; - } - - var chainIds = list.Select(o => o.TargetChainId).Distinct().ToList(); - - var chainStatus = new Dictionary(); - foreach (var chainId in chainIds) - { - var status = await _blockchainAppService.GetChainStatusAsync(chainId); - chainStatus.Add(chainId, status); - } - - var toUpdateList = new List(); - foreach (var info in list.Where(info => info.TransmitHeight == 0 || info.TransmitHeight < chainStatus[info.TargetChainId].ConfirmedBlockHeight)) - { - var isTransmit = await _bridgeContractAppService.CheckTransmitAsync(info.TargetChainId, info.ReceiptHash); - if (isTransmit) - { - if (info.TransmitHeight == 0) - { - info.TransmitHeight = chainStatus[info.TargetChainId].BlockHeight; - } - else - { - info.Step = ReportStep.Transmitted; - } - } - - info.QueryTimes += 1; - toUpdateList.Add(info); - } - - await _reportInfoRepository.UpdateManyAsync(toUpdateList); - } - - public async Task ReSendQueryAsync() - { - using var uow = _unitOfWorkManager.Begin(); - var q = await _reportInfoRepository.GetQueryableAsync(); - var list = await AsyncExecuter.ToListAsync(q - .Where(o => o.Step == ReportStep.Proposed && o.ResendTimes < _crossChainOptions.MaxReportResendTimes)); - await uow.CompleteAsync(); - - if (list.Count == 0) - { - return; - } - - var toUpdateReports = new List(); - foreach (var item in list) - { - var latestIndexHeight = await GetReportSyncHeightAsync(item.ChainId); - if (latestIndexHeight - item.LastUpdateHeight <= _crossChainOptions.ReportTimeoutHeightThreshold) - { - continue; - } - - var transmittedReport = await _reportInfoRepository.FirstOrDefaultAsync(o => - o.ChainId == item.ChainId && o.ReceiptHash == item.ReceiptHash && o.Step == ReportStep.Transmitted ); - if (transmittedReport != null) - { - item.Step = ReportStep.ResendSucceeded; - } - else - { - var txId = await SendQueryTransactionAsync(item); - Log.ForContext("txId",txId) - .Information("ReSend Query, Resending Report: {reportId}, Query Tx Id: {txId}", item.Id, txId); - item.QueryTransactionId = txId; - item.Step = ReportStep.Resending; - } - - toUpdateReports.Add(item); - } - - if (toUpdateReports.Count > 0) - { - await _reportInfoRepository.UpdateManyAsync(toUpdateReports); - } - } - - [ExceptionHandler(typeof(Exception),Message = "Check query transaction failed.")] - public virtual async Task CheckQueryTransactionAsync() - { - using var uow = _unitOfWorkManager.Begin(); - var q = await _reportInfoRepository.GetQueryableAsync(); - var list = await AsyncExecuter.ToListAsync(q - .Where(o => o.Step == ReportStep.Resending)); - await uow.CompleteAsync(); - if (list.Count == 0) - { - return; - } - - var toUpdateReports = new List(); - foreach (var item in list) - { - var txResult = await _blockchainAppService.GetTransactionResultAsync(item.ChainId, item.QueryTransactionId); - if (txResult.IsMined) - { - var chainStatus = await _blockchainAppService.GetChainStatusAsync(item.ChainId); - if (txResult.BlockHeight > chainStatus.ConfirmedBlockHeight) - { - continue; - } - - var block = await _blockchainAppService.GetBlockByHeightAsync(item.ChainId, txResult.BlockHeight); - if (block.BlockHash == txResult.BlockHash) - { - item.Step = ReportStep.ResendSucceeded; - toUpdateReports.Add(item); - continue; - } - } - - item.Step = ReportStep.Proposed; - toUpdateReports.Add(item); - } - - if (toUpdateReports.Count > 0) - { - await _reportInfoRepository.UpdateManyAsync(toUpdateReports); - } - } - - private async Task SendQueryTransactionAsync(ReportInfo reportInfo) - { - return await _reportContractAppService.QueryOracleAsync(reportInfo.ChainId, reportInfo.TargetChainId, - reportInfo.ReceiptId, reportInfo.ReceiptHash,reportInfo.ReceiptInfo); - } - - private async Task GetReportSyncHeightAsync(string chainId) - { - var setting = await _settingManager.GetOrNullAsync(chainId, CrossChainServerSettings.ReportIndexerSync); - return setting == null ? 0 : long.Parse(setting); - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChain/ReportJobCategoryOptions.cs b/src/AElf.CrossChainServer.Application/CrossChain/ReportJobCategoryOptions.cs deleted file mode 100644 index cdccb7d..0000000 --- a/src/AElf.CrossChainServer.Application/CrossChain/ReportJobCategoryOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Collections.Generic; - -namespace AElf.CrossChainServer.CrossChain; - -public class ReportJobCategoryOptions -{ - public Dictionary Mapping { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs index b6b7e20..fe83e21 100644 --- a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs +++ b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationAutoMapperProfile.cs @@ -31,18 +31,6 @@ public CrossChainServerApplicationAutoMapperProfile() CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); CreateMap(); @@ -58,8 +46,7 @@ public CrossChainServerApplicationAutoMapperProfile() CreateMap(); CreateMap(); CreateMap(); - - CreateMap(); + CreateMap(); CreateMap(); CreateMap(); diff --git a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs index 5c7ad2a..29343dd 100644 --- a/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs +++ b/src/AElf.CrossChainServer.Application/CrossChainServerApplicationModule.cs @@ -4,7 +4,6 @@ using AElf.CrossChainServer.Chains.Ton; using AElf.CrossChainServer.Contracts.Bridge; using AElf.CrossChainServer.Contracts.CrossChain; -using AElf.CrossChainServer.Contracts.Report; using AElf.CrossChainServer.Contracts.Token; using AElf.CrossChainServer.CrossChain; using AElf.CrossChainServer.HttpClient; @@ -47,18 +46,13 @@ public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration(); Configure(configuration.GetSection("ChainApi")); Configure(configuration.GetSection("BridgeContract")); - Configure(configuration.GetSection("ReportContract")); Configure(configuration.GetSection("BlockConfirmation")); Configure(configuration.GetSection("Account")); - Configure(configuration.GetSection("ReportJobCategory")); Configure(configuration.GetSection("TokenContract")); Configure(configuration.GetSection("CrossChainContract")); Configure(configuration.GetSection("TokenSymbolMapping")); - Configure(configuration.GetSection("CrossChain")); Configure(configuration.GetSection("GraphQLClients")); - Configure(configuration.GetSection("EvmTokens")); Configure(configuration.GetSection("CrossChainLimits")); - Configure(configuration.GetSection("ReportQueryTimes")); Configure(configuration.GetSection("AutoReceiveConfig")); Configure(configuration.GetSection("SyncStateService")); Configure(configuration.GetSection("TokenPriceIdMapping")); @@ -70,6 +64,7 @@ public override void ConfigureServices(ServiceConfigurationContext context) Configure(configuration.GetSection("LarkNotifyTemplate")); Configure(configuration.GetSection("ChainIdMap")); Configure(configuration.GetSection("TonConfig")); + Configure(configuration.GetSection("LimitSync")); context.Services.AddSingleton, AElfClientFactory>(); context.Services.AddSingleton, EvmClientFactory>(); @@ -80,7 +75,6 @@ public override void ConfigureServices(ServiceConfigurationContext context) 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/HttpClient/JsonSettingsBuilder.cs b/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs index 72b2f7c..2a096a2 100644 --- a/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs +++ b/src/AElf.CrossChainServer.Application/HttpClient/JsonSettingsBuilder.cs @@ -38,98 +38,5 @@ public JsonSettingsBuilder IgnoreNullValue() _instance.NullValueHandling = NullValueHandling.Ignore; return this; } - - public JsonSettingsBuilder WithAElfTypesConverters() - { - return WithAElfAddressConverter() - .WithByteStringBase64Converter() - .WithHashHexConverter(); - } - - public JsonSettingsBuilder WithAElfAddressConverter() - { - _instance.Converters.Add(new AElfAddressConverter()); - return this; - } - - public JsonSettingsBuilder WithHashHexConverter() - { - _instance.Converters.Add(new AElfHashHexConverter()); - return this; - } - - public JsonSettingsBuilder WithHashBase64Converter() - { - _instance.Converters.Add(new AElfHashBase64Converter()); - return this; - } - - public JsonSettingsBuilder WithByteStringBase64Converter() - { - _instance.Converters.Add(new ByteStringBase64Converter()); - return this; - } } - - -// AElf.Types.Address -public class AElfAddressConverter : JsonConverter
-{ - public override void WriteJson(JsonWriter writer, Address value, JsonSerializer serializer) - { - writer.WriteValue(value.ToBase58()); - } - - public override Address ReadJson(JsonReader reader, Type objectType, Address existingValue, bool hasExistingValue, - JsonSerializer serializer) - { - return reader?.Value == null ? null : Address.FromBase58(reader?.Value.ToString()); - } -} - -// AElf.Types.Hash (Hex) -public class AElfHashHexConverter : JsonConverter -{ - public override void WriteJson(JsonWriter writer, Hash value, JsonSerializer serializer) - { - writer.WriteValue(value.ToHex()); - } - - public override Hash ReadJson(JsonReader reader, Type objectType, Hash existingValue, bool hasExistingValue, - JsonSerializer serializer) - { - return reader?.Value == null ? null : Hash.LoadFromHex(reader.Value.ToString()); - } -} - -// AElf.Types.Hash (Base64) -public class AElfHashBase64Converter : JsonConverter -{ - public override void WriteJson(JsonWriter writer, Hash value, JsonSerializer serializer) - { - writer.WriteValue(Base64.ToBase64String(value.ToByteArray())); - } - - public override Hash ReadJson(JsonReader reader, Type objectType, Hash existingValue, bool hasExistingValue, - JsonSerializer serializer) - { - return reader?.Value == null ? null : Hash.LoadFromBase64(reader.Value.ToString()); - } -} - -// Google.Protobuf.ByteString (Base64) -public class ByteStringBase64Converter : JsonConverter -{ - public override void WriteJson(JsonWriter writer, ByteString value, JsonSerializer serializer) - { - writer.WriteValue(Base64.ToBase64String(value.ToByteArray())); - } - - public override ByteString ReadJson(JsonReader reader, Type objectType, ByteString existingValue, bool hasExistingValue, - JsonSerializer serializer) - { - return reader?.Value == null ? null : ByteString.FromBase64(reader.Value.ToString()); - } -} - diff --git a/src/AElf.CrossChainServer.Application/Indexer/EvmIndexerAppService.cs b/src/AElf.CrossChainServer.Application/Indexer/EvmIndexerAppService.cs deleted file mode 100644 index 95829b1..0000000 --- a/src/AElf.CrossChainServer.Application/Indexer/EvmIndexerAppService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; - -namespace AElf.CrossChainServer.Indexer; - -public class EvmIndexerAppService : IEvmIndexerAppService -{ - public Task GetCurrentBlockNumberAsync(string chainId) - { - throw new System.NotImplementedException(); - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs b/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs index 6d77212..db46ab0 100644 --- a/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs +++ b/src/AElf.CrossChainServer.Application/Indexer/IndexerAppService.cs @@ -30,7 +30,7 @@ public IndexerAppService(IGraphQLClientFactory graphQlClientFactory, IChainAppSe IHttpProvider httpProvider, IOptionsSnapshot syncStateServiceOption) { - _graphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainServerClient); + _graphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); _chainAppService = chainAppService; _httpProvider = httpProvider; _syncStateServiceOption = syncStateServiceOption.Value; @@ -51,12 +51,32 @@ public virtual async Task GetLatestIndexHeightAsync(string chainId) var res = await _httpProvider.InvokeAsync(_syncStateServiceOption.BaseUrl, _syncStateUri); var blockHeight = res.CurrentVersion.Items.FirstOrDefault(i => i.ChainId == aelfChainId) ?.LastIrreversibleBlockHeight; - Logger.LogInformation("Get latest index height. chainId: {chainId}, height: {height}", aelfChainId, + 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; + } - public async Task GetPendingTransactionAsync(string chainId, + 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, @@ -66,15 +86,53 @@ public async Task GetPendingTransactionAsync(string c Logger.LogInformation( "Get pending transaction failed. chainId: {chainId}, transferTransactionId: {transferTransactionId}", chainId, transferTransactionId); - return null; + 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 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 @@ -109,7 +167,54 @@ private GraphQLRequest GetRequest(string chainId, string transactionId) receiveAmount, receiveTime, receiveTransactionId, - receiptId + 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 @@ -120,6 +225,53 @@ private GraphQLRequest GetRequest(string chainId, string 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); @@ -132,21 +284,4 @@ private async Task QueryDataAsync(GraphQLRequest request) string.Join(",", data.Errors.Select(e => e.Message).ToList())); return default; } -} - -public class ConfirmedBlockHeight -{ - public SyncState SyncState { get; set; } -} - -public class SyncState -{ - public long ConfirmedBlockHeight { get; set; } -} - -public enum BlockFilterType -{ - BLOCK, - TRANSACTION, - LOG_EVENT } \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Application/ReportQueryTimesOptions.cs b/src/AElf.CrossChainServer.Application/ReportQueryTimesOptions.cs deleted file mode 100644 index 9d76521..0000000 --- a/src/AElf.CrossChainServer.Application/ReportQueryTimesOptions.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AElf.CrossChainServer; - -public class ReportQueryTimesOptions -{ - public int QueryTimes { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.DbMigrator/appsettings.json b/src/AElf.CrossChainServer.DbMigrator/appsettings.json index f861ef8..64dddc2 100644 --- a/src/AElf.CrossChainServer.DbMigrator/appsettings.json +++ b/src/AElf.CrossChainServer.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "Server=127.0.0.1;Port=3306;Database=CrossChainServerV2;Uid=root;Pwd=12345678;" + "Default": "Server=127.0.0.1;Port=3306;Database=eBridgeServerV4;Uid=root;Pwd=12345678;" }, "Chain": [ { @@ -19,6 +19,30 @@ "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", @@ -182,6 +206,6 @@ "IndexSetting": { "NumberOfShards": 5, "NumberOfReplicas": 1, - "IndexPrefix": "eBridgeServer" + "IndexPrefix": "eBridgeServerV4" } } \ 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 index 9ac0de2..eecbff1 100644 --- a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainTransferEto.cs +++ b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/CrossChainTransferEto.cs @@ -25,6 +25,9 @@ public class CrossChainTransferEto 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.Domain.Shared/CrossChain/OracleQueryInfoEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleQueryInfoEto.cs deleted file mode 100644 index 94b44ea..0000000 --- a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleQueryInfoEto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class OracleQueryInfoEto -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public string QueryId { get; set; } - public string Option { get; set; } - public OracleStep Step { get; set; } - public DateTime UpdateTime { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleStep.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleStep.cs deleted file mode 100644 index fbe7ccd..0000000 --- a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/OracleStep.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace AElf.CrossChainServer.CrossChain; - -public enum OracleStep -{ - QueryCreated, - Committed, - SufficientCommitmentsCollected, - CommitmentRevealed, - QueryCompleted -} \ 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/CrossChain/ReportInfoEto.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportInfoEto.cs deleted file mode 100644 index d6c6bd6..0000000 --- a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportInfoEto.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace AElf.CrossChainServer.CrossChain; - -public class ReportInfoEto -{ - public Guid Id { get; set; } - public string ChainId { get; set; } - public long RoundId { get; set; } - public string Token { get; set; } - public string TargetChainId { get; set; } - public string ReceiptId { get; set; } - public string ReceiptHash { get; set; } - public ReportStep Step { get; set; } - public int QueryTimes { get; set; } - public long TransmitHeight { get; set; } - public DateTime UpdateTime { get; set; } - public string QueryOracleTransactionId { get; set; } - public string ReceiptInfo { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportStep.cs b/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportStep.cs deleted file mode 100644 index 493e66d..0000000 --- a/src/AElf.CrossChainServer.Domain.Shared/CrossChain/ReportStep.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace AElf.CrossChainServer.CrossChain; - -public enum ReportStep -{ - ResendSucceeded = -2, - Resending = -1, - Proposed = 0, - Confirmed = 1, - Transmitted = 2, -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/BridgeContract/BridgeContractSyncInfo.cs b/src/AElf.CrossChainServer.Domain/BridgeContract/BridgeContractSyncInfo.cs deleted file mode 100644 index 317a830..0000000 --- a/src/AElf.CrossChainServer.Domain/BridgeContract/BridgeContractSyncInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AElf.CrossChainServer.Entities; - -namespace AElf.CrossChainServer.BridgeContract; - -public class BridgeContractSyncInfo: MultiChainEntity -{ - public string TargetChainId { get; set; } - public Guid TokenId { get; set; } - public TransferType Type { get; set; } - public long SyncIndex { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/BridgeContract/IBridgeContractSyncInfoRepository.cs b/src/AElf.CrossChainServer.Domain/BridgeContract/IBridgeContractSyncInfoRepository.cs deleted file mode 100644 index e1d1349..0000000 --- a/src/AElf.CrossChainServer.Domain/BridgeContract/IBridgeContractSyncInfoRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace AElf.CrossChainServer.BridgeContract -{ - public interface IBridgeContractSyncInfoRepository : IRepository - { - - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs index 9f93baa..fcdfaf9 100644 --- a/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs +++ b/src/AElf.CrossChainServer.Domain/CrossChain/CrossChainTransferBase.cs @@ -24,6 +24,7 @@ public class CrossChainTransferBase : CrossChainServerEntity 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; } @@ -31,8 +32,10 @@ public class CrossChainTransferBase : CrossChainServerEntity public string ReceiptId { get; set; } public int Progress { get; set; } public DateTime ProgressUpdateTime { get; set; } - public bool TransferNeedToBeApproved { 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/IOracleQueryInfoRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/IOracleQueryInfoRepository.cs deleted file mode 100644 index 1005b6b..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/IOracleQueryInfoRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace AElf.CrossChainServer.CrossChain -{ - public interface IOracleQueryInfoRepository : IRepository - { - - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/IReportInfoRepository.cs b/src/AElf.CrossChainServer.Domain/CrossChain/IReportInfoRepository.cs deleted file mode 100644 index 209cad9..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/IReportInfoRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace AElf.CrossChainServer.CrossChain -{ - public interface IReportInfoRepository : IRepository - { - - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfo.cs b/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfo.cs deleted file mode 100644 index 364324a..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using AElf.CrossChainServer.Entities; -using Nest; - -namespace AElf.CrossChainServer.CrossChain; - -public class OracleQueryInfo : MultiChainEntity -{ - [Keyword] - public string QueryId { get; set; } - [Keyword] - public string Option { get; set; } - public OracleStep Step { get; set; } - public long LastUpdateHeight { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfoIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfoIndex.cs deleted file mode 100644 index 8e903a5..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/OracleQueryInfoIndex.cs +++ /dev/null @@ -1,7 +0,0 @@ -using AElf.Indexing.Elasticsearch; - -namespace AElf.CrossChainServer.CrossChain; - -public class OracleQueryInfoIndex : OracleQueryInfo, IIndexBuild -{ -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfo.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfo.cs deleted file mode 100644 index 0e2221f..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfo.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using AElf.CrossChainServer.Entities; -using Nest; - -namespace AElf.CrossChainServer.CrossChain; - -public class ReportInfo : MultiChainEntity -{ - public long RoundId { get; set; } - [Keyword] - public string Token { get; set; } - [Keyword] - public string TargetChainId { get; set; } - [Keyword] - public string ReceiptId { get; set; } - [Keyword] - public string ReceiptHash { get; set; } - public ReportStep Step { get; set; } - public int QueryTimes { get; set; } - public long TransmitHeight { get; set; } - public long LastUpdateHeight { get; set; } - public string QueryTransactionId { get; set; } - public int ResendTimes { get; set; } = 0; - public string ReceiptInfo { get; set; } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfoIndex.cs b/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfoIndex.cs deleted file mode 100644 index 05f9890..0000000 --- a/src/AElf.CrossChainServer.Domain/CrossChain/ReportInfoIndex.cs +++ /dev/null @@ -1,8 +0,0 @@ -using AElf.Indexing.Elasticsearch; - -namespace AElf.CrossChainServer.CrossChain; - -public class ReportInfoIndex : ReportInfo, IIndexBuild -{ - -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs b/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs index 0982e28..67f4111 100644 --- a/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs +++ b/src/AElf.CrossChainServer.Domain/CrossChainServerConsts.cs @@ -11,11 +11,8 @@ public static class CrossChainServerConsts public const string AElfMainChainId = "MainChain_AELF"; public const string AElfMainChain = "AELF"; - public const int MaxReportQueryTimes = 10; public const int HalfOfTheProgress = 50; public const int FullOfTheProgress = 100; - public const int DefaultReportTimeoutHeightThreshold = 3600; - public const long DefaultMaxReportResendTimes = 3; public const long DefaultDailyLimitRefreshTime = 86400; public const long DefaultRateLimitSeconds = 60; diff --git a/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs b/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs index b14fca2..43d5563 100644 --- a/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs +++ b/src/AElf.CrossChainServer.Domain/CrossChainServerDomainModule.cs @@ -87,12 +87,6 @@ public override void ConfigureServices(ServiceConfigurationContext context) 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(); diff --git a/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs b/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs index f3a076a..661c80e 100644 --- a/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs +++ b/src/AElf.CrossChainServer.Domain/DomainAutoMapperProfile.cs @@ -13,8 +13,6 @@ public DomainAutoMapperProfile() { CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); CreateMap(); CreateMap(); CreateMap(); diff --git a/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs index fe05f93..d151968 100644 --- a/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs +++ b/src/AElf.CrossChainServer.Domain/Settings/CrossChainServerSettings.cs @@ -16,5 +16,8 @@ public static class CrossChainServerSettings 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.EntityFrameworkCore/BridgeContract/EfCoreBridgeContractSyncInfoRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/BridgeContract/EfCoreBridgeContractSyncInfoRepository.cs deleted file mode 100644 index 7dcc398..0000000 --- a/src/AElf.CrossChainServer.EntityFrameworkCore/BridgeContract/EfCoreBridgeContractSyncInfoRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using AElf.CrossChainServer.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace AElf.CrossChainServer.BridgeContract -{ - public class EfCoreBridgeContractSyncInfoRepository : EfCoreCacheRepository, IBridgeContractSyncInfoRepository - { - public EfCoreBridgeContractSyncInfoRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreOracleQueryInfoRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreOracleQueryInfoRepository.cs deleted file mode 100644 index e935837..0000000 --- a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreOracleQueryInfoRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using AElf.CrossChainServer.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace AElf.CrossChainServer.CrossChain -{ - public class EfCoreOracleQueryInfoRepository : EfCoreRepository, IOracleQueryInfoRepository - { - public EfCoreOracleQueryInfoRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreReportInfoRepository.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreReportInfoRepository.cs deleted file mode 100644 index 3d4f7cd..0000000 --- a/src/AElf.CrossChainServer.EntityFrameworkCore/CrossChain/EfCoreReportInfoRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using AElf.CrossChainServer.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace AElf.CrossChainServer.CrossChain -{ - public class EfCoreReportInfoRepository : EfCoreRepository, IReportInfoRepository - { - public EfCoreReportInfoRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs index 39187d8..8390103 100644 --- a/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/EntityFrameworkCore/CrossChainServerDbContext.cs @@ -69,9 +69,6 @@ public class CrossChainServerDbContext : public DbSet CrossChainTransfers { get; set; } public DbSet WalletUsers { get; set; } public DbSet WalletUserAddressInfos { get; set; } - public DbSet BridgeContractSyncInfos { get; set; } - public DbSet OracleQueryInfos { get; set; } - public DbSet ReportInfos { get; set; } public DbSet Settings { get; set; } public DbSet CrossChainDailyLimits { get; set; } public DbSet CrossChainRateLimits { get; set; } @@ -150,27 +147,6 @@ protected override void OnModelCreating(ModelBuilder builder) b.ConfigureByConvention(); }); - builder.Entity(b => - { - b.ToTable(CrossChainServerConsts.DbTablePrefix + "BridgeContractSyncInfos", - CrossChainServerConsts.DbSchema); - b.ConfigureByConvention(); - }); - - builder.Entity(b => - { - b.ToTable(CrossChainServerConsts.DbTablePrefix + "OracleQueryInfos", CrossChainServerConsts.DbSchema); - b.HasIndex(o => new { o.ChainId, o.QueryId }); - b.ConfigureByConvention(); - }); - - builder.Entity(b => - { - b.ToTable(CrossChainServerConsts.DbTablePrefix + "ReportInfos", CrossChainServerConsts.DbSchema); - b.HasIndex(o => new { o.ChainId, o.RoundId, o.Token, o.TargetChainId }); - b.ConfigureByConvention(); - }); - builder.Entity(b => { b.ToTable(CrossChainServerConsts.DbTablePrefix + "Settings", CrossChainServerConsts.DbSchema); 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 index be606c8..b64e752 100644 --- a/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/CrossChainServerDbContextModelSnapshot.cs +++ b/src/AElf.CrossChainServer.EntityFrameworkCore/Migrations/CrossChainServerDbContextModelSnapshot.cs @@ -24,31 +24,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) 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") @@ -213,6 +188,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ReceiveAmount") .HasColumnType("decimal(65,30)"); + b.Property("ReceiveBlockHeight") + .HasColumnType("bigint"); + + b.Property("ReceiveStatus") + .HasColumnType("int"); + b.Property("ReceiveTime") .HasColumnType("datetime(6)"); @@ -243,8 +224,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("TransferBlockHeight") .HasColumnType("bigint"); - b.Property("TransferNeedToBeApproved") - .HasColumnType("tinyint(1)"); + b.Property("TransferStatus") + .HasColumnType("int"); b.Property("TransferTime") .HasColumnType("datetime(6)"); @@ -272,84 +253,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) 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") diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs index 7243718..de4f383 100644 --- a/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs +++ b/src/AElf.CrossChainServer.EntityHandler.Core/CrossChainTransferEntityHandler.cs @@ -9,7 +9,9 @@ namespace AElf.CrossChainServer.EntityHandler.Core { public class CrossChainTransferEntityHandler : ITransientDependency, IDistributedEventHandler>, - IDistributedEventHandler> + IDistributedEventHandler>, + IDistributedEventHandler> + { private readonly ICrossChainTransferAppService _crossChainTransferAppService; private readonly IObjectMapper _objectMapper; @@ -32,5 +34,10 @@ public async Task HandleEventAsync(EntityUpdatedEto event 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/OracleQueryInfoEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/OracleQueryInfoEntityHandler.cs deleted file mode 100644 index b9474de..0000000 --- a/src/AElf.CrossChainServer.EntityHandler.Core/OracleQueryInfoEntityHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -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 OracleQueryInfoEntityHandler : ITransientDependency, - IDistributedEventHandler>, - IDistributedEventHandler> - { - private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; - private readonly IObjectMapper _objectMapper; - - public OracleQueryInfoEntityHandler(IObjectMapper objectMapper, IOracleQueryInfoAppService oracleQueryInfoAppService) - { - _objectMapper = objectMapper; - _oracleQueryInfoAppService = oracleQueryInfoAppService; - } - - public async Task HandleEventAsync(EntityCreatedEto eventData) - { - var input = _objectMapper.Map(eventData.Entity); - await _oracleQueryInfoAppService.AddIndexAsync(input); - } - - public async Task HandleEventAsync(EntityUpdatedEto eventData) - { - var input = _objectMapper.Map(eventData.Entity); - await _oracleQueryInfoAppService.UpdateIndexAsync(input); - } - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.EntityHandler.Core/ReportInfoEntityHandler.cs b/src/AElf.CrossChainServer.EntityHandler.Core/ReportInfoEntityHandler.cs deleted file mode 100644 index 7d526aa..0000000 --- a/src/AElf.CrossChainServer.EntityHandler.Core/ReportInfoEntityHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -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 ReportInfoEntityHandler : ITransientDependency, - IDistributedEventHandler>, - IDistributedEventHandler> - { - private readonly IReportInfoAppService _reportInfoAppService; - private readonly IObjectMapper _objectMapper; - - public ReportInfoEntityHandler(IObjectMapper objectMapper, IReportInfoAppService reportInfoAppService) - { - _objectMapper = objectMapper; - _reportInfoAppService = reportInfoAppService; - } - - public async Task HandleEventAsync(EntityCreatedEto eventData) - { - var input = _objectMapper.Map(eventData.Entity); - await _reportInfoAppService.AddIndexAsync(input); - } - - public async Task HandleEventAsync(EntityUpdatedEto eventData) - { - var input = _objectMapper.Map(eventData.Entity); - await _reportInfoAppService.UpdateIndexAsync(input); - } - } -} \ 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.Worker/AElf.CrossChainServer.Worker.csproj b/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj index bb4d385..b2af182 100644 --- a/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj +++ b/src/AElf.CrossChainServer.Worker/AElf.CrossChainServer.Worker.csproj @@ -7,6 +7,7 @@ + diff --git a/src/AElf.CrossChainServer.Worker/BridgeContractSyncOptions.cs b/src/AElf.CrossChainServer.Worker/BridgeContractSyncOptions.cs deleted file mode 100644 index 47e9df6..0000000 --- a/src/AElf.CrossChainServer.Worker/BridgeContractSyncOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using AElf.CrossChainServer.BridgeContract; - -namespace AElf.CrossChainServer.Worker; - -public class BridgeContractSyncOptions -{ - /// - /// ChainId -> Token Dic - /// - public Dictionary>> Tokens { get; set; } = new(); - public int SyncDelayHeight { get; set; } = 100; - public string ConfirmedSyncKeyPrefix { get; set; } = "Confirmed"; - public int ConfirmedSyncDelayHeight { get; set; } = 2000; - -} - -public class TokenInfo -{ - public string Address { get; set; } - public string Symbol { get; set; } - public string TargetChainId { get; set; } -} \ No newline at end of file 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 index 01a29da..e69de29 100644 --- a/src/AElf.CrossChainServer.Worker/CheckReceiveWorker.cs +++ b/src/AElf.CrossChainServer.Worker/CheckReceiveWorker.cs @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using AElf.CrossChainServer.CrossChain; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.BackgroundWorkers; -using Volo.Abp.Threading; - -namespace AElf.CrossChainServer.Worker; - -public class CheckReceiveWorker : AsyncPeriodicBackgroundWorkerBase -{ - private readonly ICrossChainTransferAppService _crossChainTransferAppService; - public CheckReceiveWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, - ICrossChainTransferAppService crossChainTransferAppService) : base(timer, - serviceScopeFactory) - { - Timer.Period = 1000 * 60; - _crossChainTransferAppService = crossChainTransferAppService; - } - - protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) - { - await _crossChainTransferAppService.CheckReceiveTransactionAsync(); - } -} \ No newline at end of file diff --git a/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs b/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs index 8d934ad..6f5f16b 100644 --- a/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs +++ b/src/AElf.CrossChainServer.Worker/CrossChainIndexingCleanWorker.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using AElf.CrossChainServer.CrossChain; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Threading; @@ -12,10 +13,10 @@ public class CrossChainIndexingCleanWorker : AsyncPeriodicBackgroundWorkerBase private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; public CrossChainIndexingCleanWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, - ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService) : base(timer, serviceScopeFactory) + ICrossChainIndexingInfoAppService crossChainIndexingInfoAppService,IOptionsSnapshot workerSyncPeriodOptions) : base(timer, serviceScopeFactory) { _crossChainIndexingInfoAppService = crossChainIndexingInfoAppService; - Timer.Period = 1000 * 60 * 60; + Timer.Period = workerSyncPeriodOptions.Value.CrossChainIndexingCleanPeriod; } protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) diff --git a/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs b/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs index fbba5e7..0568fd6 100644 --- a/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs +++ b/src/AElf.CrossChainServer.Worker/CrossChainServerWorkerModule.cs @@ -1,5 +1,8 @@ +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; @@ -11,7 +14,7 @@ namespace AElf.CrossChainServer.Worker { [DependsOn( - typeof(AbpBackgroundWorkersModule))] + typeof(AbpBackgroundWorkersModule), typeof(CrossChainServerEvmIndexerModule))] public class CrossChainServerWorkerModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) @@ -20,27 +23,43 @@ public override void ConfigureServices(ServiceConfigurationContext context) 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>(); + var liquiditySyncOption = + context.ServiceProvider.GetRequiredService>(); if (liquiditySyncOption.Value.IsSyncEnabled) { var service = context.ServiceProvider.GetRequiredService(); - AsyncHelper.RunSync(async()=> await service.SyncPoolLiquidityInfoFromChainAsync()); + 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(); + 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/EvmContractSyncOptions.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs index 50e0b92..9c31ed4 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmContractSyncOptions.cs @@ -6,14 +6,18 @@ namespace AElf.CrossChainServer.Worker.EvmIndexerSync; public class EvmContractSyncOptions { public bool Enabled { get; set; } = true; - public Dictionary ContractAddresses { get; set; } - public int SyncPeriod { get; set; } = 60 * 1000; // 1min + public Dictionary IndexerInfos { get; set; } + public int SyncPeriod { get; set; } = 3 * 1000; // 1min } -public class Contract +public class IndexerInfo { - public string TokenPoolContract { get; set; } + 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 index f958fb9..a1f683f 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncProviderBase.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncProviderBase.cs @@ -23,8 +23,12 @@ public async Task ExecuteAsync(string 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); @@ -51,13 +55,15 @@ private async Task GetSyncHeightAsync(string chainId, string 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) + + protected async Task GetContractLogsAsync(string chainId, string contractAddress, long startHeight, + long endHeight) { var logs = await BlockchainAppService.GetContractLogsAsync(chainId, contractAddress, startHeight, endHeight); return logs; @@ -67,7 +73,8 @@ protected async Task> GetContractLogsAndParseA string contractAddress, long startHeight, long endHeight, string logSignature) where TEventDTO : IEventDTO, new() { - var logs = await BlockchainAppService.GetContractLogsAndParseAsync(chainId, contractAddress, startHeight, endHeight,logSignature); + var logs = await BlockchainAppService.GetContractLogsAndParseAsync(chainId, contractAddress, + startHeight, endHeight, logSignature); return logs; } diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs index 93c9e10..a4e899f 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmIndexerSyncWorker.cs @@ -44,6 +44,7 @@ protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext worker { 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); } } diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs index 98afb93..d30f60b 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmNewReceiptSyncProvider.cs @@ -32,7 +32,7 @@ protected override async Task HandleDataAsync(string chainId, long startHe Log.ForContext("chainId", chainId).Debug( "Start to sync new receipt info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, endHeight); - var bridgeInContract = _evmContractSyncOptions.ContractAddresses[chainId].BridgeInContract; + var bridgeInContract = _evmContractSyncOptions.IndexerInfos[chainId].BridgeInContract; var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, bridgeInContract, startHeight, endHeight, NewReceiptEventSignature); @@ -73,7 +73,8 @@ await crossChainTransferAppService.TransferAsync(new CrossChainTransferInput FromChainId = chainId, ToChainId = events.TargetChainId, TransferBlockHeight = log.BlockNumber, - TransferTokenId = token.Id + TransferTokenId = token.Id, + TransferStatus = ReceiptStatus.Confirmed }); } } diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs index 767a7bb..2aff2c1 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenPoolIndexerSyncProvider.cs @@ -38,7 +38,7 @@ protected override async Task HandleDataAsync(string chainId, long startHe Log.ForContext("chainId", chainId).Debug( "Start to sync pool liquidity info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, endHeight); - var tokenPoolContractAddress = _evmContractSyncOptions.ContractAddresses[chainId].TokenPoolContract; + var tokenPoolContractAddress = _evmContractSyncOptions.IndexerInfos[chainId].TokenPoolContract; var logs = await GetContractLogsAsync(chainId, tokenPoolContractAddress, startHeight, endHeight); if (logs == null || logs.Logs.Count == 0) { diff --git a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs index d406ef9..340d0bb 100644 --- a/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/EvmIndexerSync/EvmTokenSwapSyncProvider.cs @@ -32,7 +32,7 @@ protected override async Task HandleDataAsync(string chainId, long startHe Log.ForContext("chainId", chainId).Debug( "Start to sync token swap info {chainId} from {StartHeight} to {EndHeight}", chainId, startHeight, endHeight); - var bridgeOutContract = _evmContractSyncOptions.ContractAddresses[chainId].BridgeOutContract; + var bridgeOutContract = _evmContractSyncOptions.IndexerInfos[chainId].BridgeOutContract; var filterLogsAndEventsDto = await GetContractLogsAndParseAsync(chainId, bridgeOutContract, startHeight, endHeight, TokenSwappedEventSignature); @@ -73,6 +73,8 @@ await crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput 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 }); } } 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 index ad5d903..75746c3 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainIndexingInfoIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainIndexingInfoIndexerSyncProvider.cs @@ -30,7 +30,7 @@ public CrossChainIndexingInfoIndexerSyncProvider(IGraphQLClientFactory graphQlCl protected override string SyncType { get; } = CrossChainServerSettings.CrossChainIndexingIndexerSync; - protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight) + 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); diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs index 3386aff..2bdd8ff 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/CrossChainTransferIndexerSyncProvider.cs @@ -33,10 +33,12 @@ public CrossChainTransferIndexerSyncProvider(IGraphQLClientFactory graphQlClient protected override string SyncType { get; } = CrossChainServerSettings.CrossChainTransferIndexerSync; - protected override async Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight) + 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}", - aelfChainId, startHeight, endHeight); + 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) { @@ -50,13 +52,13 @@ protected override async Task HandleDataAsync(string aelfChainId, long sta crossChainTransfer.ChainId, crossChainTransfer.TransferTokenSymbol, crossChainTransfer.TransferType == TransferType.Transfer ? "Transfer" : "Receive", crossChainTransfer.CrossChainType == CrossChainType.Heterogeneous ? "Heterogeneous" : "Homogeneous"); - await HandleDataAsync(crossChainTransfer); + await HandleDataAsync(crossChainTransfer,isConfirmed); } return endHeight; } - private async Task HandleDataAsync(CrossChainTransferInfo transfer) + private async Task HandleDataAsync(CrossChainTransferInfo transfer,bool isConfirmed) { var chain = await ChainAppService.GetByAElfChainIdAsync(ChainHelper.ConvertBase58ToChainId(transfer.ChainId)); @@ -75,7 +77,7 @@ private async Task HandleDataAsync(CrossChainTransferInfo transfer) { toAddress = TonAddressHelper.GetTonRawAddress(transfer.ToAddress); } - + var transferToken = await _tokenAppService.GetAsync(new GetTokenInput { ChainId = chain.Id, @@ -94,12 +96,15 @@ await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput TransferBlockHeight = transfer.BlockHeight, TransferTime = transfer.TransferTime, TransferTransactionId = transfer.TransferTransactionId, - ReceiptId = transfer.ReceiptId + ReceiptId = transfer.ReceiptId, + TransferStatus = isConfirmed + ? ReceiptStatus.Confirmed + : ReceiptStatus.Pending, }); break; case TransferType.Receive: - var formChainId = await GetChainIdAsync(transfer.FromChainId, transfer.CrossChainType); - if (formChainId == null) + var fromChainId = await GetChainIdAsync(transfer.FromChainId, transfer.CrossChainType); + if (fromChainId == null) { return; } @@ -110,22 +115,26 @@ await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput Symbol = transfer.ReceiveTokenSymbol }); - Log.ForContext("fromChainId", formChainId).ForContext("toChainId", chain.Id).Information( + Log.ForContext("fromChainId", fromChainId).ForContext("toChainId", chain.Id).Information( "Start to receive token {symbol} from {fromChainId} to {toChainId}", - transfer.ReceiveTokenSymbol, formChainId, chain.Id); + transfer.ReceiveTokenSymbol, fromChainId, chain.Id); await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput() { ReceiveAmount = transfer.ReceiveAmount / (decimal)Math.Pow(10, receiveToken.Decimals), ReceiveTime = transfer.ReceiveTime, - FromChainId = formChainId, + FromChainId = fromChainId, ReceiveTransactionId = transfer.ReceiveTransactionId, ToChainId = chain.Id, TransferTransactionId = transfer.TransferTransactionId, ReceiveTokenId = receiveToken.Id, FromAddress = transfer.FromAddress, ToAddress = transfer.ToAddress, - ReceiptId = transfer.ReceiptId + ReceiptId = transfer.ReceiptId, + ReceiveStatus = isConfirmed + ? ReceiptStatus.Confirmed + : ReceiptStatus.Pending, + ReceiveBlockHeight = transfer.ReceiveBlockHeight }); break; } @@ -138,6 +147,7 @@ private async Task GetChainIdAsync(string originalChainId, CrossChainTyp { return chainId; } + Log.Debug("Start to get chain id by {originalChainId}", originalChainId); var toChain = await ChainAppService.GetByAElfChainIdAsync( @@ -177,7 +187,8 @@ private GraphQLRequest GetRequest(string chainId, long startHeight, long endHeig receiveAmount, receiveTime, receiveTransactionId, - receiptId + receiptId, + receiveBlockHeight } }", Variables = new @@ -214,6 +225,7 @@ public class CrossChainTransferInfo : GraphQLDto public string ReceiveTokenSymbol { get; set; } public TransferType TransferType { get; set; } public CrossChainType CrossChainType { get; set; } + public long ReceiveBlockHeight { get; set; } } public enum TransferType diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs index b0de2f1..c4955de 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IIndexerSyncProvider.cs @@ -4,7 +4,7 @@ namespace AElf.CrossChainServer.Worker.IndexerSync; public interface IIndexerSyncProvider { - bool IsConfirmEnabled { get; } + bool RequiresRealTime { get; } - Task ExecuteAsync(string chainId, int syncDelayHeight = 0, string typePrefix = null); + 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 index 11e6b58..b43923f 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncProviderBase.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncProviderBase.cs @@ -25,18 +25,30 @@ public abstract class IndexerSyncProviderBase : IIndexerSyncProvider, ITransient protected IndexerSyncProviderBase(IGraphQLClientFactory graphQlClientFactory, ISettingManager settingManager, IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, IChainAppService chainAppService) { - GraphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainServerClient); + GraphQlClient = graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); SettingManager = settingManager; JsonSerializer = jsonSerializer; IndexerAppService = indexerAppService; ChainAppService = chainAppService; } - public virtual bool IsConfirmEnabled { get; set; } = true; - - public async Task ExecuteAsync(string chainId, int syncDelayHeight = 0, string typePrefix = null) + + 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); - var currentIndexHeight = await GetIndexBlockHeightAsync(chainId); + long currentIndexHeight; + if (isConfirmed) + { + currentIndexHeight = await GetLatestIndexConfirmedHeightAsync(chainId); + } + else + { + currentIndexHeight = await GetLatestIndexBestHeightAsync(chainId); + } + var endHeight = Math.Min(syncHeight + MaxRequestCount, currentIndexHeight - syncDelayHeight); if (endHeight <= syncHeight) { @@ -48,11 +60,12 @@ public async Task ExecuteAsync(string chainId, int syncDelayHeight = 0, string t { 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); + endHeight,isConfirmed); await SetSyncHeightAsync(chainId, typePrefix, height); } @@ -64,12 +77,18 @@ protected async Task QueryDataAsync(GraphQLRequest request) { 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 GetIndexBlockHeightAsync(string chainId) + private async Task GetLatestIndexBestHeightAsync(string chainId) + { + return await IndexerAppService.GetLatestIndexBestHeightAsync(chainId); + } + + private async Task GetLatestIndexConfirmedHeightAsync(string chainId) { return await IndexerAppService.GetLatestIndexHeightAsync(chainId); } @@ -86,14 +105,14 @@ private async Task SetSyncHeightAsync(string chainId, string typePrefix, long he var settingKey = GetSettingKey(typePrefix); await SettingManager.SetAsync(chainId, settingKey, height.ToString()); } - + private string GetSettingKey(string typePrefix) { - return string.IsNullOrWhiteSpace(typePrefix)? SyncType : $"{typePrefix}-{SyncType}"; + return string.IsNullOrWhiteSpace(typePrefix) ? SyncType : $"{typePrefix}-{SyncType}"; } protected abstract string SyncType { get; } - protected abstract Task HandleDataAsync(string aelfChainId, long startHeight, long endHeight); -} - + 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 index e87bb89..a5734f3 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncWorker.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/IndexerSyncWorker.cs @@ -38,16 +38,17 @@ protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext worker Log.Debug("Start to sync chain."); var tasks = chains.Items.Select(o => o.Id).SelectMany(chainId => - _indexerSyncProviders.Select(async provider => await provider.ExecuteAsync(chainId, _bridgeContractSyncOptions.SyncDelayHeight))); + _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 - .Where(provider => provider.IsConfirmEnabled) .Select(async provider => await provider.ExecuteAsync(chainId, _bridgeContractSyncOptions.ConfirmedSyncDelayHeight, - _bridgeContractSyncOptions.ConfirmedSyncKeyPrefix))); + _bridgeContractSyncOptions.ConfirmedSyncKeyPrefix,true))); await Task.WhenAll(confirmTasks); } diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs index 656982d..35d8454 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/PoolLiquidityIndexerSyncProvider.cs @@ -22,22 +22,29 @@ public class PoolLiquidityIndexerSyncProvider : IndexerSyncProviderBase public PoolLiquidityIndexerSyncProvider(IGraphQLClientFactory graphQlClientFactory, ISettingManager settingManager, IJsonSerializer jsonSerializer, IIndexerAppService indexerAppService, IChainAppService chainAppService, - IPoolLiquidityInfoAppService poolLiquidityInfoAppService, ITokenAppService tokenAppService, IOptionsSnapshot evmContractSyncOptions) : base( + IPoolLiquidityInfoAppService poolLiquidityInfoAppService, ITokenAppService tokenAppService, + IOptionsSnapshot evmContractSyncOptions) : base( graphQlClientFactory, settingManager, jsonSerializer, indexerAppService, chainAppService) { _poolLiquidityInfoAppService = poolLiquidityInfoAppService; _tokenAppService = tokenAppService; _evmContractSyncOptions = evmContractSyncOptions.Value; } - public override bool IsConfirmEnabled { get; set; } = false; + + 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) + 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); diff --git a/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs b/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs index 922c069..1916dea 100644 --- a/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs +++ b/src/AElf.CrossChainServer.Worker/IndexerSync/UserLiquidityIndexerSyncProvider.cs @@ -30,11 +30,14 @@ public UserLiquidityIndexerSyncProvider(IGraphQLClientFactory graphQlClientFacto _evmContractSyncOptions = evmContractSyncOptions.Value; } - public override bool IsConfirmEnabled { get; set; } = false; + 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) + 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; diff --git a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs index 7bf5165..622ee89 100644 --- a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs +++ b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncOptions.cs @@ -5,8 +5,6 @@ namespace AElf.CrossChainServer.Worker; public class TonIndexSyncOptions { public bool IsEnable { get; set; } = true; - // ChainId -> ContractAddress - // public Dictionary> ContractAddress { get; set; } = new(); public Dictionary ContractAddress { get; set; } = new(); public int SyncPeriod { get; set; } = 10 * 1000; // 10s public int QueryDelayTime { get; set; } = 1000; // 1s diff --git a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs index 006b2dc..2bd6346 100644 --- a/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs +++ b/src/AElf.CrossChainServer.Worker/TonIndexerSync/TonIndexSyncWorker.cs @@ -108,8 +108,8 @@ private async Task HandleTonTransactionAsync(string chainId, string contractAddr switch (outMsg.Opcode) { case CrossChainServerConsts.TonReceivedOpCode: - await ReceiveAsync(chainId, DateTimeHelper.FromUnixTimeSeconds(tx.Now), outMsg, - txId); + await ReceiveAsync(chainId, tx.McBlockSeqno, DateTimeHelper.FromUnixTimeSeconds(tx.Now), + outMsg, txId); break; case CrossChainServerConsts.TonTransferredOpCode: await TransferAsync(chainId, tx.McBlockSeqno, DateTimeHelper.FromUnixTimeSeconds(tx.Now), @@ -188,11 +188,12 @@ await _crossChainTransferAppService.TransferAsync(new CrossChainTransferInput FromChainId = chainId, ToChainId = toChain.Id, TransferBlockHeight = blockHeight, - TransferTokenId = token.Id + TransferTokenId = token.Id, + TransferStatus = ReceiptStatus.Confirmed }); } - private async Task ReceiveAsync(string chainId, DateTime blockTime, TonMessageDto outMessage, + private async Task ReceiveAsync(string chainId, long blockHeight, DateTime blockTime, TonMessageDto outMessage, string txId) { Log.ForContext("chainId", chainId).Debug( @@ -227,6 +228,8 @@ await _crossChainTransferAppService.ReceiveAsync(new CrossChainReceiveInput ReceiveAmount = (decimal)((BigDecimal)amount / BigInteger.Pow(10, token.Decimals)), ReceiveTime = blockTime, ReceiveTokenId = token.Id, + ReceiveStatus = ReceiptStatus.Confirmed, + ReceiveBlockHeight = blockHeight }); } @@ -351,5 +354,4 @@ await _crossChainLimitAppService.ConsumeCrossChainRateLimitAsync(new ConsumeCros 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 index f618721..7f7fb8f 100644 --- a/src/AElf.CrossChainServer.Worker/TransferAutoReceiveWorker.cs +++ b/src/AElf.CrossChainServer.Worker/TransferAutoReceiveWorker.cs @@ -1,21 +1,22 @@ 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 +public class TransferAutoReceiveWorker : AsyncPeriodicBackgroundWorkerBase { private readonly ICrossChainTransferAppService _crossChainTransferAppService; public TransferAutoReceiveWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, - ICrossChainTransferAppService crossChainTransferAppService) : base(timer, + ICrossChainTransferAppService crossChainTransferAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, serviceScopeFactory) { - Timer.Period = 1000 * 60; - + Timer.Period = workerSyncPeriodOptions.Value.AutoReceiveSyncPeriod; _crossChainTransferAppService = crossChainTransferAppService; } diff --git a/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs b/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs index 833225a..18abf9d 100644 --- a/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs +++ b/src/AElf.CrossChainServer.Worker/TransferProgressUpdateWorker.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using AElf.CrossChainServer.CrossChain; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Threading; @@ -11,10 +12,11 @@ public class TransferProgressUpdateWorker : AsyncPeriodicBackgroundWorkerBase private readonly ICrossChainTransferAppService _crossChainTransferAppService; public TransferProgressUpdateWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, - ICrossChainTransferAppService crossChainTransferAppService) : base(timer, serviceScopeFactory) + ICrossChainTransferAppService crossChainTransferAppService, + IOptionsSnapshot workerSyncPeriodOptions) : base(timer, serviceScopeFactory) { _crossChainTransferAppService = crossChainTransferAppService; - Timer.Period = 10000; + Timer.Period = workerSyncPeriodOptions.Value.ProgressUpdatePeriod; } protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) 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 index 40d1285..57f6efb 100644 --- a/test/AElf.CrossChainServer.Application.Tests/AElf.CrossChainServer.Application.Tests.csproj +++ b/test/AElf.CrossChainServer.Application.Tests/AElf.CrossChainServer.Application.Tests.csproj @@ -25,4 +25,8 @@ + + + + diff --git a/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs b/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs index e324212..7a1f542 100644 --- a/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/AElfClientFactoryTests.cs @@ -16,10 +16,8 @@ public AElfClientFactoryTests() [Fact] public void GetClientTest() { - var client = _aelfClientFactory.GetClient("MainChain_AELF"); - client.ShouldNotBeNull(); - client = _aelfClientFactory.GetClient("MainChain_AELF"); + var client = _aelfClientFactory.GetClient("MainChain_AELF"); client.ShouldNotBeNull(); } } \ 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 index 1d3e80f..cfd027f 100644 --- a/test/AElf.CrossChainServer.Application.Tests/Chains/MockEvmClientProvider.cs +++ b/test/AElf.CrossChainServer.Application.Tests/Chains/MockEvmClientProvider.cs @@ -29,14 +29,27 @@ public Task GetChainHeightAsync(string chainId) throw new System.NotImplementedException(); } - public Task GetChainStatusAsync(string chainId) + public async Task GetChainStatusAsync(string chainId) { - throw new System.NotImplementedException(); + return new ChainStatusDto + { + ChainId = chainId, + BlockHeight = 105, + ConfirmedBlockHeight = 100 + }; } public Task GetTransactionResultAsync(string chainId, string transactionId) { - throw new System.NotImplementedException(); + 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) diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs index 11734b8..f734a44 100644 --- a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainLimitInfoAppServiceTest.cs @@ -22,7 +22,6 @@ public class CrossChainLimitInfoAppServiceTest private readonly IObjectMapper _mockObjectMapper; private readonly IIndexerCrossChainLimitInfoService _mockIndexerCrossChainLimitInfoService; private readonly IBridgeContractAppService _mockBridgeContractAppService; - private readonly IOptionsMonitor _mockEvmTokensOptions; private readonly ITokenAppService _mockTokenAppService; private readonly IChainAppService _mockChainAppService; private readonly IOptionsMonitor _mockCrossChainLimitsOptions; @@ -34,7 +33,6 @@ public CrossChainLimitInfoAppServiceTest() _mockObjectMapper = Substitute.For(); _mockIndexerCrossChainLimitInfoService = Substitute.For(); _mockBridgeContractAppService = Substitute.For(); - _mockEvmTokensOptions = Substitute.For>(); _mockTokenAppService = Substitute.For(); _mockChainAppService = Substitute.For(); _mockCrossChainLimitsOptions = Substitute.For>(); @@ -43,8 +41,6 @@ public CrossChainLimitInfoAppServiceTest() _service = new CrossChainLimitInfoAppService( _mockIndexerCrossChainLimitInfoService, - _mockBridgeContractAppService, - _mockEvmTokensOptions, _mockTokenAppService, _mockChainAppService, _mockCrossChainLimitsOptions, @@ -92,7 +88,6 @@ public async void GetCrossChainRateLimitsAsyncTest() _mockCrossChainLimitsOptions.CurrentValue.Returns(MockEthChainIdsOptions()); - _mockEvmTokensOptions.CurrentValue.Returns(MockEvmTokensOptions()); MockChainAppService(); @@ -147,31 +142,6 @@ private CrossChainLimitsOptions MockEthChainIdsOptions() }; return evmTokensOptions; } - - private EvmTokensOptions MockEvmTokensOptions() - { - var evmTokensOptions = new EvmTokensOptions - { - Tokens = new Dictionary> - { - { - "Sepolia", new List - { - new TokenInfo { Address = "Sepolia_Address", TargetChainId = "MainChain_AELF" }, - new TokenInfo { Address = "Sepolia_Address", TargetChainId = "SideChain_tDVV" } - } - }, - { - "BSCTest", new List - { - new TokenInfo { Address = "BSCTest_Address", TargetChainId = "MainChain_AELF" }, - new TokenInfo { Address = "BSCTest_Address", TargetChainId = "SideChain_tDVV" } - } - } - } - }; - return evmTokensOptions; - } private List MockIndexerCrossChainLimitInfos() { diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs index 6f807fc..b85be69 100644 --- a/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChain/CrossChainTransferAppServiceTests.cs @@ -2,6 +2,7 @@ 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; @@ -15,9 +16,8 @@ public class CrossChainTransferAppServiceTests : CrossChainServerApplicationTest private readonly ICrossChainTransferAppService _crossChainTransferAppService; private readonly ITokenAppService _tokenAppService; private readonly ICrossChainIndexingInfoAppService _crossChainIndexingInfoAppService; - private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; - private readonly IReportInfoAppService _reportInfoAppService; private readonly IAetherLinkProvider _aetherLinkProvider; + private readonly IIndexerAppService _indexerAppService; public CrossChainTransferAppServiceTests() { @@ -25,9 +25,8 @@ public CrossChainTransferAppServiceTests() _crossChainTransferAppService = GetRequiredService(); _tokenAppService = GetRequiredService(); _crossChainIndexingInfoAppService = GetRequiredService(); - _oracleQueryInfoAppService = GetRequiredService(); - _reportInfoAppService = GetRequiredService(); _aetherLinkProvider = GetRequiredService(); + _indexerAppService = GetRequiredService(); } [Fact] @@ -54,7 +53,8 @@ public async Task HomogeneousTransferTest() ToChainId = "SideChain_tDVV", TransferBlockHeight = 100, TransferTime = DateTime.UtcNow.AddMinutes(-1), - TransferTransactionId = "TransferTransactionId" + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.TransferAsync(input); @@ -77,6 +77,29 @@ public async Task HomogeneousTransferTest() 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 { @@ -175,7 +198,9 @@ await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexing ReceiveTransactionId = "ReceiveTransactionId", TransferTransactionId = "TransferTransactionId", ReceiveAmount = 100, - ReceiveTokenId = tokenReceived.Id + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 110, + ReceiveStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.ReceiveAsync(receiveInput); @@ -186,10 +211,25 @@ await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexing 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].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 } @@ -197,7 +237,7 @@ await _crossChainIndexingInfoAppService.CreateAsync(new CreateCrossChainIndexing status.Items.Count.ShouldBe(1); status.Items[0].Progress.ShouldBe(100); } - + [Fact] public async Task HeterogeneousTransfer_ETH_To_AELF_Test() { @@ -211,18 +251,19 @@ public async Task HeterogeneousTransfer_ETH_To_AELF_Test() 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), - ReceiptId = "ReceiptId" + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.TransferAsync(input); @@ -244,69 +285,38 @@ public async Task HeterogeneousTransfer_ETH_To_AELF_Test() 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); - - var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput - { - Ids = { list.Items[0].Id } - }); - status.Items.Count.ShouldBe(1); - status.Items[0].Progress.ShouldBe(0); - - await _oracleQueryInfoAppService.CreateAsync(new CreateOracleQueryInfoInput - { - Option = "ReceiptId", - Step = OracleStep.QueryCreated, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }); + list.Items[0].TransferTransactionId.ShouldBe(input.TransferTransactionId); + list.Items[0].TransferStatus.ShouldBe(ReceiptStatus.Pending); - await _crossChainTransferAppService.UpdateProgressAsync(); - + await _crossChainTransferAppService.CheckEvmTransferTransactionConfirmedAsync("Ethereum"); list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput { MaxResultCount = 100 }); - list.Items[0].Progress.ShouldBe(50); - - status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + 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(50); - - await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput - { - Step = OracleStep.Committed, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }); - await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput - { - Step = OracleStep.SufficientCommitmentsCollected, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }); - await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput - { - Step = OracleStep.CommitmentRevealed, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }); - await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput - { - Step = OracleStep.QueryCompleted, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }); + status.Items[0].Progress.ShouldBe(0); - await Task.Delay(1000); await _crossChainTransferAppService.UpdateProgressAsync(); list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput @@ -314,24 +324,19 @@ await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput MaxResultCount = 100 }); list.Items[0].Progress.ShouldBe(50); - list.Items[0].Status.ShouldBe(CrossChainStatus.Transferred); - 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 = "Ethereum", ToChainId = "MainChain_AELF", ReceiveTransactionId = "ReceiveTransactionId", - ReceiptId = "ReceiptId", + TransferTransactionId = "TransferTransactionId", ReceiveAmount = 100, - ReceiveTokenId = tokenReceived.Id + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 110, + ReceiveStatus = ReceiptStatus.Pending, + ReceiptId = "ReceiptId" }; await _crossChainTransferAppService.ReceiveAsync(receiveInput); @@ -342,10 +347,25 @@ await _oracleQueryInfoAppService.UpdateAsync(new UpdateOracleQueryInfoInput 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].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 } @@ -367,18 +387,19 @@ public async Task HeterogeneousTransfer_AELF_To_ETH_Test() ChainId ="Ethereum", Symbol = "ELF" }); - var input = new CrossChainTransferInput { TransferAmount = 100, FromAddress = "FromAddress", ToAddress = "ToAddress", TransferTokenId = tokenTransfer.Id, - FromChainId = "MainChain_AELF", + ReceiptId = "ReceiptId", ToChainId = "Ethereum", + FromChainId = "MainChain_AELF", TransferBlockHeight = 100, TransferTime = DateTime.UtcNow.AddMinutes(-1), - ReceiptId = "ReceiptId" + TransferTransactionId = "TransferTransactionId", + TransferStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.TransferAsync(input); @@ -400,80 +421,59 @@ public async Task HeterogeneousTransfer_AELF_To_ETH_Test() 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); - var status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput - { - Ids = { list.Items[0].Id } - }); - status.Items.Count.ShouldBe(1); - status.Items[0].Progress.ShouldBe(0); - - await _reportInfoAppService.CreateAsync(new CreateReportInfoInput() - { - ChainId = "MainChain_AELF", - RoundId = 1, - Token = "Eth", - ReceiptHash = "ReceiptHash", - ReceiptId = "ReceiptId", - TargetChainId = "Ethereum" - }); - await _crossChainTransferAppService.UpdateProgressAsync(); - list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput - { - MaxResultCount = 100 - }); - list.Items[0].Progress.ShouldBe(50); - - status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput - { - Ids = { list.Items[0].Id } - }); - status.Items.Count.ShouldBe(1); - status.Items[0].Progress.ShouldBe(50); - - await _reportInfoAppService.UpdateStepAsync("MainChain_AELF",1,"Eth","Ethereum", ReportStep.Confirmed, 100); - await Task.Delay(2000); - await _crossChainTransferAppService.UpdateProgressAsync(); + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput { MaxResultCount = 100 }); - list.Items[0].Progress.ShouldBe(50); - - status = await _crossChainTransferAppService.GetStatusAsync(new GetCrossChainTransferStatusInput + 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(50); + status.Items[0].Progress.ShouldBe(0); - await _reportInfoAppService.UpdateStepAsync("MainChain_AELF",1,"Eth", "Ethereum",ReportStep.Transmitted, 110); - await Task.Delay(2000); await _crossChainTransferAppService.UpdateProgressAsync(); + list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput { MaxResultCount = 100 }); list.Items[0].Progress.ShouldBe(50); - 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 = "Ethereum", ReceiveTransactionId = "ReceiveTransactionId", - ReceiptId = "ReceiptId", + TransferTransactionId = "TransferTransactionId", ReceiveAmount = 100, - ReceiveTokenId = tokenReceived.Id + ReceiveTokenId = tokenReceived.Id, + ReceiveBlockHeight = 100, + ReceiveStatus = ReceiptStatus.Pending, + ReceiptId = "ReceiptId" }; await _crossChainTransferAppService.ReceiveAsync(receiveInput); @@ -484,10 +484,25 @@ await _reportInfoAppService.CreateAsync(new CreateReportInfoInput() 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].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 } @@ -496,6 +511,7 @@ await _reportInfoAppService.CreateAsync(new CreateReportInfoInput() status.Items[0].Progress.ShouldBe(100); } + [Fact] public async Task HeterogeneousTransfer_AELF_To_TON_Test() { @@ -504,11 +520,11 @@ public async Task HeterogeneousTransfer_AELF_To_TON_Test() ChainId ="MainChain_AELF", Symbol = "ELF" }); - // var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput - // { - // ChainId ="Ton", - // Symbol = "ELF" - // }); + var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput + { + ChainId ="Ton", + Symbol = "ELF" + }); var input = new CrossChainTransferInput { @@ -522,7 +538,8 @@ public async Task HeterogeneousTransfer_AELF_To_TON_Test() TransferTime = DateTime.UtcNow.AddMinutes(-1), ReceiptId = "ReceiptId", TransferTransactionId = "txID", - TraceId = "TraceId" + TraceId = "TraceId", + TransferStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.TransferAsync(input); @@ -553,6 +570,8 @@ public async Task HeterogeneousTransfer_AELF_To_TON_Test() }); status.Items.Count.ShouldBe(1); status.Items[0].Progress.ShouldBe(0); + + await _crossChainTransferAppService.CheckTransferTransactionConfirmedAsync("MainChain_AELF"); await _crossChainTransferAppService.UpdateProgressAsync(); @@ -562,21 +581,61 @@ public async Task HeterogeneousTransfer_AELF_To_TON_Test() }); 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 ="MainChain_AELF", + ChainId ="Ton", Symbol = "ELF" }); - // var tokenReceived = await _tokenAppService.GetAsync(new GetTokenInput - // { - // ChainId ="Ton", - // Symbol = "ELF" - // }); var input = new CrossChainTransferInput { @@ -585,12 +644,13 @@ public async Task HeterogeneousTransfer_TON_To_AELF_Test() ToAddress = "ToAddress", TransferTokenId = tokenTransfer.Id, FromChainId = "Ton", - ToChainId = "MainChain_AELF", + ToChainId = "SideChain_tDVV", TransferBlockHeight = 100, TransferTime = DateTime.UtcNow.AddMinutes(-1), ReceiptId = "ReceiptId", TransferTransactionId = "txID", - TraceId = "TraceId" + TraceId = "TraceId", + TransferStatus = ReceiptStatus.Confirmed }; await _crossChainTransferAppService.TransferAsync(input); @@ -630,6 +690,57 @@ public async Task HeterogeneousTransfer_TON_To_AELF_Test() }); 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] @@ -657,9 +768,13 @@ public async Task ReceiveFirstTest() 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 @@ -668,7 +783,7 @@ public async Task ReceiveFirstTest() 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.Received); + 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); @@ -693,9 +808,11 @@ public async Task ReceiveFirstTest() ToChainId = "Ethereum", TransferBlockHeight = 100, TransferTime = DateTime.UtcNow.AddMinutes(-1), - ReceiptId = "ReceiptId" + ReceiptId = "ReceiptId", + TransferStatus = ReceiptStatus.Pending }; await _crossChainTransferAppService.TransferAsync(input); + await _crossChainTransferAppService.CheckEvmReceiveTransactionConfirmedAsync("Ethereum"); list = await _crossChainTransferAppService.GetListAsync(new GetCrossChainTransfersInput { diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/OracleQueryInfoAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/OracleQueryInfoAppServiceTests.cs deleted file mode 100644 index bc2e062..0000000 --- a/test/AElf.CrossChainServer.Application.Tests/CrossChain/OracleQueryInfoAppServiceTests.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Threading.Tasks; -using AElf.Indexing.Elasticsearch; -using Shouldly; -using Xunit; - -namespace AElf.CrossChainServer.CrossChain; - -public class OracleQueryInfoAppServiceTests : CrossChainServerApplicationTestBase -{ - private readonly IOracleQueryInfoAppService _oracleQueryInfoAppService; - private readonly INESTRepository _oracleQueryInfoIndexRepository; - private readonly IOracleQueryInfoRepository _oracleQueryInfoRepository; - - public OracleQueryInfoAppServiceTests() - { - _oracleQueryInfoAppService = GetRequiredService(); - _oracleQueryInfoIndexRepository = GetRequiredService>(); - _oracleQueryInfoRepository = GetRequiredService(); - } - - [Fact] - public async Task CreateTest() - { - var createInput = new CreateOracleQueryInfoInput - { - Option = "Option", - Step = OracleStep.QueryCreated, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.CreateAsync(createInput); - - var progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput.ChainId, createInput.Option); - progress.ShouldBe(20); - - var updateInput = new UpdateOracleQueryInfoInput - { - Step = OracleStep.Committed, - ChainId = "MainChain_AELF", - QueryId = "QueryIdNotExist", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.UpdateAsync(updateInput); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput.ChainId, createInput.Option); - progress.ShouldBe(20); - - updateInput = new UpdateOracleQueryInfoInput - { - Step = OracleStep.Committed, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.UpdateAsync(updateInput); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput.ChainId, createInput.Option); - progress.ShouldBe(40); - - updateInput = new UpdateOracleQueryInfoInput - { - Step = OracleStep.SufficientCommitmentsCollected, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.UpdateAsync(updateInput); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput.ChainId, createInput.Option); - progress.ShouldBe(60); - - updateInput = new UpdateOracleQueryInfoInput - { - Step = OracleStep.Committed, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.UpdateAsync(updateInput); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput.ChainId, createInput.Option); - progress.ShouldBe(60); - } - - [Fact] - public async Task RepeatedQueryTest() - { - var createInput1 = new CreateOracleQueryInfoInput - { - Option = "Option", - Step = OracleStep.QueryCreated, - ChainId = "MainChain_AELF", - QueryId = "QueryId1", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.CreateAsync(createInput1); - - var progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput1.ChainId, createInput1.Option); - progress.ShouldBe(20); - - var createInput2 = new CreateOracleQueryInfoInput - { - Option = "Option", - Step = OracleStep.QueryCreated, - ChainId = "MainChain_AELF", - QueryId = "QueryId2", - LastUpdateHeight = 150 - }; - await _oracleQueryInfoAppService.CreateAsync(createInput2); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput1.ChainId, createInput1.Option); - progress.ShouldBe(20); - - var updateInput = new UpdateOracleQueryInfoInput - { - Step = OracleStep.Committed, - ChainId = "MainChain_AELF", - QueryId = "QueryId2", - LastUpdateHeight = 200 - }; - await _oracleQueryInfoAppService.UpdateAsync(updateInput); - - progress = await _oracleQueryInfoAppService.CalculateCrossChainProgressAsync(createInput1.ChainId, createInput1.Option); - progress.ShouldBe(40); - } - - [Fact] - public async Task Create_Repeat_Test() - { - var createInput = new CreateOracleQueryInfoInput - { - Option = "Option", - Step = OracleStep.QueryCreated, - ChainId = "MainChain_AELF", - QueryId = "QueryId", - LastUpdateHeight = 100 - }; - await _oracleQueryInfoAppService.CreateAsync(createInput); - - var list = await _oracleQueryInfoRepository.GetListAsync(); - list.Count.ShouldBe(1); - } -} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChain/ReportInfoAppServiceTests.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChain/ReportInfoAppServiceTests.cs deleted file mode 100644 index 279e999..0000000 --- a/test/AElf.CrossChainServer.Application.Tests/CrossChain/ReportInfoAppServiceTests.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace AElf.CrossChainServer.CrossChain; - -public class ReportInfoAppServiceTests : CrossChainServerApplicationTestBase -{ - private readonly IReportInfoAppService _reportInfoAppService; - private readonly IReportInfoRepository _reportInfoRepository; - - public ReportInfoAppServiceTests() - { - _reportInfoAppService = GetRequiredService(); - _reportInfoRepository = GetRequiredService(); - } - - [Fact] - public async Task CreateTest() - { - var input = new CreateReportInfoInput - { - ChainId = "MainChain_AELF", - Token = "Token", - ReceiptHash = "ReceiptHash", - ReceiptId = "ReceiptId", - RoundId = 1, - LastUpdateHeight = 100, - TargetChainId = "SideChain_tDVV", - ReceiptInfo = "ReceiptInfo" - }; - await _reportInfoAppService.CreateAsync(input); - - var reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(1); - reports[0].ChainId.ShouldBe(input.ChainId); - reports[0].Token.ShouldBe(input.Token); - reports[0].ReceiptHash.ShouldBe(input.ReceiptHash); - reports[0].ReceiptId.ShouldBe(input.ReceiptId); - reports[0].RoundId.ShouldBe(input.RoundId); - reports[0].LastUpdateHeight.ShouldBe(input.LastUpdateHeight); - reports[0].TargetChainId.ShouldBe(input.TargetChainId); - reports[0].Step.ShouldBe(ReportStep.Proposed); - - await _reportInfoAppService.UpdateStepAsync("MainChain_AELF",1, "Token1", "SideChain_tDVV", ReportStep.Confirmed, 150); - - reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(1); - reports[0].LastUpdateHeight.ShouldBe(input.LastUpdateHeight); - reports[0].Step.ShouldBe(ReportStep.Proposed); - - await _reportInfoAppService.UpdateStepAsync("MainChain_AELF",1, "Token", "SideChain_tDVV", ReportStep.Confirmed, 150); - - reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(1); - reports[0].LastUpdateHeight.ShouldBe(150); - reports[0].Step.ShouldBe(ReportStep.Confirmed); - - await _reportInfoAppService.UpdateStepAsync("MainChain_AELF",1, "Token", "SideChain_tDVV", ReportStep.Proposed, 200); - - reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(1); - reports[0].LastUpdateHeight.ShouldBe(150); - reports[0].Step.ShouldBe(ReportStep.Confirmed); - } - - [Fact] - public async Task Create_Repeat_Test() - { - var input = new CreateReportInfoInput - { - ChainId = "MainChain_AELF", - Token = "Token", - ReceiptHash = "ReceiptHash", - ReceiptId = "ReceiptId", - RoundId = 1, - LastUpdateHeight = 100, - TargetChainId = "SideChain_tDVV", - ReceiptInfo = "ReceiptInfo" - }; - await _reportInfoAppService.CreateAsync(input); - await _reportInfoAppService.CreateAsync(input); - - var reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(1); - } - - [Fact] - public async Task Create_ResentTimes_Test() - { - var input1 = new CreateReportInfoInput - { - ChainId = "MainChain_AELF", - Token = "Token", - ReceiptHash = "ReceiptHash", - ReceiptId = "ReceiptId", - RoundId = 1, - LastUpdateHeight = 100, - TargetChainId = "SideChain_tDVV", - ReceiptInfo = "ReceiptInfo" - }; - await _reportInfoAppService.CreateAsync(input1); - var input2 = new CreateReportInfoInput - { - ChainId = "MainChain_AELF", - Token = "Token", - ReceiptHash = "ReceiptHash", - ReceiptId = "ReceiptId", - RoundId = 2, - LastUpdateHeight = 100, - TargetChainId = "SideChain_tDVV", - ReceiptInfo = "ReceiptInfo" - }; - await _reportInfoAppService.CreateAsync(input2); - - var reports = await _reportInfoRepository.GetListAsync(); - reports.Count.ShouldBe(2); - reports[0].ResendTimes.ShouldBe(0); - reports[1].ResendTimes.ShouldBe(1); - } -} \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs index 166e63c..5ad591b 100644 --- a/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs +++ b/test/AElf.CrossChainServer.Application.Tests/CrossChainServerApplicationTestModule.cs @@ -4,6 +4,9 @@ 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; @@ -21,19 +24,27 @@ 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://kovan.infura.io/v3/" }, + { "Ethereum", "https://ethereum-sepolia-rpc.publicnode.com" }, { "MainChain_AELF", "https://aelf.io" }, { "Ton", "https://toncenter.com/api/v3/" } }; @@ -52,14 +63,6 @@ public override void ConfigureServices(ServiceConfigurationContext context) } }; }); - - Configure(o => - { - o.Mapping = new Dictionary - { - { "MainChain_AELF", "CrossChain" } - }; - }); Configure(o => { @@ -76,7 +79,8 @@ public override void ConfigureServices(ServiceConfigurationContext context) 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" } + { "CrossChainClient", "http://192.168.67.84:8083/AElfIndexer_DApp/CrossChainIndexerCASchema/graphql" }, + { "ScanClient", "http://localhost:8080/graphql" } }; }); } diff --git a/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs b/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs index f8af1a0..fde2b9c 100644 --- a/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs +++ b/test/AElf.CrossChainServer.Application.Tests/Indexer/GraphQLClientFactoryTest.cs @@ -15,10 +15,7 @@ public GraphQLClientFactoryTest() [Fact] public void GetClientTest() { - var client = _graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainServerClient); - client.ShouldNotBeNull(); - - client = _graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); + var client = _graphQlClientFactory.GetClient(GraphQLClientEnum.CrossChainClient); client.ShouldNotBeNull(); } } \ No newline at end of file diff --git a/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs b/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs index 7711dcf..2b27e6e 100644 --- a/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs +++ b/test/AElf.CrossChainServer.Application.Tests/MockIndexerAppService.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using AElf.CrossChainServer.CrossChain; using AElf.CrossChainServer.Indexer; @@ -5,15 +6,116 @@ namespace AElf.CrossChainServer; -public class MockIndexerAppService: CrossChainServerAppService, IIndexerAppService +public class MockIndexerAppService : CrossChainServerAppService, IIndexerAppService { public async Task GetLatestIndexHeightAsync(string chainId) { - return 100; + return 110; } - public Task GetPendingTransactionAsync(string chainId, string transferTransactionId) + 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 index f4cc604..6629ddc 100644 --- a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessAppServiceTests.cs +++ b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessAppServiceTests.cs @@ -1,130 +1,309 @@ -// using System; -// using System.Threading.Tasks; -// using AElf.CrossChainServer.TokenAccess.ThirdUserTokenIssue; -// using Microsoft.Extensions.DependencyInjection; -// using NSubstitute; -// using Shouldly; -// using Volo.Abp.Users; -// using Xunit; -// -// namespace AElf.CrossChainServer.TokenAccess; -// -// public sealed partial class TokenAccessAppServiceTests : CrossChainServerApplicationTestBase -// { -// protected ICurrentUser _currentUser; -// private readonly ITokenAccessAppService _tokenAccessAppService; -// private readonly IThirdUserTokenIssueRepository _thirdUserTokenIssueRepository; -// -// public TokenAccessAppServiceTests() -// { -// _tokenAccessAppService = GetRequiredService(); -// _thirdUserTokenIssueRepository = GetRequiredService(); -// } -// -// protected override void AfterAddApplication(IServiceCollection services) -// { -// base.AfterAddApplication(services); -// _currentUser = Substitute.For(); -// services.AddSingleton(_currentUser); -// services.AddSingleton(GetMockTokenInvokeProvider()); -// // services.AddSingleton(GetMockUserTokenOwnerProvider()); -// } -// -// private void Login(Guid userId) -// { -// _currentUser.Id.Returns(userId); -// _currentUser.IsAuthenticated.Returns(true); -// } -// -// [Fact] -// public async Task GetAvailableTokensTest() -// { -// Login(new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b")); -// var result = await _tokenAccessAppService.GetAvailableTokensAsync(new GetAvailableTokensInput()); -// result.TokenList.Count.ShouldBe(1); -// result.TokenList[0].TokenName.ShouldBe("test_token"); -// result.TokenList[0].Symbol.ShouldBe("test_token"); -// result.TokenList[0].LiquidityInUsd.ShouldBe("100000"); -// result.TokenList[0].Holders.ShouldBe(100000); -// } -// -// [Fact] -// public async Task CommitTokenAccessInfoTest() -// { -// Login(new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b")); -// var input = new UserTokenAccessInfoInput -// { -// Symbol = "test_token", -// OfficialWebsite = "test_official_website", -// OfficialTwitter = "test_official_twitter", -// Title = "test_title", -// PersonName = "test_person", -// TelegramHandler = "test_telegram", -// Email = "test@gmail.com" -// }; -// var result = await _tokenAccessAppService.CommitTokenAccessInfoAsync(input); -// result.ShouldBe(true); -// } -// -// [Fact] -// public async Task GetUserTokenAccessInfoTest() -// { -// Login(new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b")); -// var input = new UserTokenAccessInfoInput -// { -// Symbol = "test_token", -// OfficialWebsite = "test_official_website", -// OfficialTwitter = "test_official_twitter", -// Title = "test_title", -// PersonName = "test_person", -// TelegramHandler = "test_telegram", -// Email = "test@gmail.com" -// }; -// var result = await _tokenAccessAppService.GetUserTokenAccessInfoAsync(input); -// } -// -// [Fact] -// public async Task CheckChainAccessStatusTest() -// { -// Login(new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b")); -// var input = new CheckChainAccessStatusInput -// { -// Symbol = "test_token" -// }; -// var result = await _tokenAccessAppService.CheckChainAccessStatusAsync(input); -// } -// -// [Fact] -// public async Task PrepareBindingIssueTest() -// { -// Login(new Guid("d3d94468-2d38-4b1f-9dcd-fbfc7ddcab1b")); -// await _thirdUserTokenIssueRepository.InsertAsync(new ThirdUserTokenIssueInfo -// { -// Id = default, -// Address = "side_test_user_address", -// WalletAddress = "test_wallet", -// Symbol = "test_token", -// ChainId = "AELF", -// CreateTime = 0, -// UpdateTime = 0, -// TokenName = "test_token", -// TokenImage = "test_image", -// OtherChainId = "test_third_chain", -// TotalSupply = "10000", -// ContractAddress = "test_contract_address", -// BindingId = "test_bind_id", -// ThirdTokenId = "test_third_token_id", -// Status = "issued" -// }); -// var input = new PrepareBindIssueInput -// { -// Address = "side_test_user_address", -// Symbol = "test_token", -// ChainId = "test_third_chain", -// ContractAddress = "test_contract_address", -// Supply = "1000" -// }; -// // var result = await _tokenAccessAppService.PrepareBindingIssueAsync(input); -// } -// -// } \ No newline at end of file +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/TokenAccess/TokenAccessMockTest.cs b/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessMockTest.cs deleted file mode 100644 index f916745..0000000 --- a/test/AElf.CrossChainServer.Application.Tests/TokenAccess/TokenAccessMockTest.cs +++ /dev/null @@ -1,93 +0,0 @@ -// using System.Collections.Generic; -// using Moq; -// -// namespace AElf.CrossChainServer.TokenAccess; -// -// public partial class TokenAccessAppServiceTests -// { -// private ITokenInvokeProvider GetMockTokenInvokeProvider() -// { -// var mockTokenInvokeProvider = new Mock(); -// // mockTokenInvokeProvider.Setup(o => o.GetUserTokenOwnerListAndUpdateAsync(It.IsAny())) -// // .ReturnsAsync(new List -// // { -// // new() -// // { -// // Address = "test_address", -// // TokenName = "test_token", -// // Symbol = "test_token", -// // Decimals = 8, -// // Icon = "test_icon", -// // Owner = "test_owner", -// // ChainId = "AELF", -// // TotalSupply = 1000000, -// // LiquidityInUsd = "100000", -// // Holders = 100000, -// // PoolAddress = "test_pool", -// // ContractAddress = "test_contract_address", -// // Status = "test_status" -// // } -// // }); -// // -// // mockTokenInvokeProvider.Setup(o => o.GetAsync(It.IsAny())) -// // .ReturnsAsync(new List() -// // { -// // new() -// // { -// // Address = "test_address", -// // TokenName = "test_token", -// // Symbol = "test_token", -// // Decimals = 8, -// // Icon = "test_icon", -// // Owner = "test_owner", -// // ChainId = "AELF", -// // TotalSupply = 1000000, -// // LiquidityInUsd = "100000", -// // Holders = 100000, -// // PoolAddress = "test_pool", -// // ContractAddress = "test_contract_address", -// // Status = "test_status" -// // } -// // }); -// // -// mockTokenInvokeProvider.Setup(o => o.GetThirdTokenListAndUpdateAsync(It.IsAny(), It.IsAny())) -// .ReturnsAsync(true); -// -// mockTokenInvokeProvider.Setup(o => o.PrepareBindingAsync(It.IsAny())) -// .ReturnsAsync(new UserTokenBindingDto -// { -// BindingId = "test_binding_id", -// ThirdTokenId = "test_third_token_id" -// }); -// mockTokenInvokeProvider.Setup(o => o.BindingAsync(It.IsAny())) -// .ReturnsAsync(true); -// -// return mockTokenInvokeProvider.Object; -// } -// -// // private IUserTokenOwnerProvider GetMockUserTokenOwnerProvider() -// // { -// // var mockUserTokenOwnerProvider = new Mock(); -// // // mockUserTokenOwnerProvider.Setup(o => o.GetUserTokenOwnerListAsync(It.IsAny())) -// // // .ReturnsAsync(new List() -// // // { -// // // new() -// // // { -// // // Address = "test_address", -// // // TokenName = "test_token", -// // // Symbol = "test_token", -// // // Decimals = 8, -// // // Icon = "test_icon", -// // // Owner = "test_owner", -// // // ChainId = "AELF", -// // // TotalSupply = 1000000, -// // // LiquidityInUsd = "100000", -// // // Holders = 100000, -// // // PoolAddress = "test_pool", -// // // ContractAddress = "test_contract_address", -// // // Status = "test_status" -// // // } -// // // }); -// // return mockUserTokenOwnerProvider.Object; -// // } -// } \ 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.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs b/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs index bd0a4bf..d0a548f 100644 --- a/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs +++ b/test/AElf.CrossChainServer.Domain.Tests/BridgeContract/BridgeContractSyncInfoRepositoryTests.cs @@ -1,38 +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 +// 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