예제 #1
0
 public static TransactionExecutionEntity FromDomain(TransactionExecutionAggregate aggregate)
 {
     return(new TransactionExecutionEntity
     {
         TransactionId = aggregate.TransactionId,
         Address = aggregate.Address,
         ClaimedGas = aggregate.ClaimedGas,
         GasAssetId = aggregate.GasAssetId,
         LockRejectedAt = aggregate.LockRejectedAt,
         LockAcquiredAt = aggregate.LockAcquiredAt,
         BroadcastingBlock = aggregate.BroadcastingBlock,
         AllGas = aggregate.AllGas,
         LockReleasedAt = aggregate.LockReleasedAt,
         TransactionExecutedAt = aggregate.TransactionExecutedAt,
         AssetInfoRetrievedAt = aggregate.AssetInfoRetrievedAt,
         GasBlockchainAssetId = aggregate.GasBlockchainAssetId,
         GasBlockchainType = aggregate.GasBlockchainType,
         NeoAssetId = aggregate.NeoAssetId,
         NeoBlockchainAssetId = aggregate.NeoBlockchainAssetId,
         NeoBlockchainType = aggregate.NeoBlockchainType,
         TransactionBroadcastedAt = aggregate.TransactionBroadcastedAt,
         TransactionBuiltAt = aggregate.TransactionBuiltAt,
         ClaimableGasNotAvailableReportedAt = aggregate.ClaimableGasNotAvailableReportedAt,
         TransactionClearedAt = aggregate.TransactionClearedAt,
         TransactionHash = aggregate.TransactionHash,
         TransactionSignedAt = aggregate.TransactionSignedAt,
         ETag = aggregate.Version,
         PartitionKey = AggregateKeysBuilder.BuildPartitionKey(aggregate.TransactionId),
         RowKey = AggregateKeysBuilder.BuildRowKey()
     });
 }
예제 #2
0
        // ReSharper restore MemberCanBePrivate.Global

        #endregion


        #region Conversion

        public static TransactionExecutionEntity FromDomain(TransactionExecutionAggregate aggregate)
        {
            return(new TransactionExecutionEntity
            {
                ETag = aggregate.Version,
                PartitionKey = AggregateKeysBuilder.BuildPartitionKey(aggregate.TransactionId),
                RowKey = AggregateKeysBuilder.BuildRowKey(aggregate.TransactionId),
                State = aggregate.State,
                Result = aggregate.Result,
                StartMoment = aggregate.StartMoment,
                SourceAddressLockingMoment = aggregate.SourceAddressLockingMoment,
                BuildingMoment = aggregate.BuildingMoment,
                SigningMoment = aggregate.SigningMoment,
                BroadcastingMoment = aggregate.BroadcastingMoment,
                FinishMoment = aggregate.FinishMoment,
                BuildingFailureMoment = aggregate.BuildingFailureMoment,
                BroadcastinFailureMoment = aggregate.BroadcastinFailureMoment,
                WaitingForEndingStartMoment = aggregate.WaitingForEndingStartMoment,
                WaitingForEndingFailureMoment = aggregate.WaitingForEndingFailureMoment,
                SourceAddressReleaseMoment = aggregate.SourceAddressReleasingMoment,
                ClearedMoment = aggregate.ClearingMoment,
                OperationId = aggregate.OperationId,
                TransactionId = aggregate.TransactionId,
                TransactionNumber = aggregate.TransactionNumber,
                BlockchainType = aggregate.BlockchainType,
                FromAddress = aggregate.FromAddress,
                FromAddressContext = aggregate.FromAddressContext,
                Outputs = aggregate.Outputs
                          .Select(TransactionOutputEntity.FromDomain)
                          .ToArray(),
                AssetId = aggregate.AssetId,
                IncludeFee = aggregate.IncludeFee,
                BlockchainAssetId = aggregate.BlockchainAssetId,
                TransactionOutputs = aggregate.TransactionOutputs?
                                     .Select(TransactionOutputEntity.FromDomain)
                                     .ToArray(),
                Hash = aggregate.Hash,
                Fee = aggregate.Fee,
                Error = aggregate.Error,
                Block = aggregate.Block
            });
        }
예제 #3
0
        // ReSharper restore MemberCanBePrivate.Global

        #endregion


        #region Conversion

        public static OperationExecutionEntity FromDomain(OperationExecutionAggregate aggregate)
        {
            return(new OperationExecutionEntity
            {
                ETag = aggregate.Version,
                PartitionKey = AggregateKeysBuilder.BuildPartitionKey(aggregate.OperationId),
                RowKey = AggregateKeysBuilder.BuildRowKey(aggregate.OperationId),
                State = aggregate.State,
                Result = aggregate.Result,
                StartMoment = aggregate.StartMoment,
                ActiveTransactionIdGenerationMoment = aggregate.ActiveTransactionIdGenerationMoment,
                ActiveTransactionStartMoment = aggregate.ActiveTransactionStartMoment,
                TransactionExecutionRepeatRequestMoment = aggregate.TransactionExecutionRepeatRequestMoment,
                ActiveTransactionClearingMoment = aggregate.ActiveTransactionClearingMoment,
                TransactionFinishMoment = aggregate.TransactionFinishMoment,
                FinishMoment = aggregate.FinishMoment,
                OperationId = aggregate.OperationId,
                BlockchainType = aggregate.BlockchainType,
                FromAddress = aggregate.FromAddress,
                Outputs = aggregate.Outputs
                          .Select(TransactionOutputEntity.FromDomain)
                          .ToArray(),
                AssetId = aggregate.AssetId,
                IncludeFee = aggregate.IncludeFee,
                BlockchainAssetId = aggregate.BlockchainAssetId,
                EndpointsConfiguration = aggregate.EndpointsConfiguration,
                ActiveTransactionId = aggregate.ActiveTransactionId,
                ActiveTransactionNumber = aggregate.ActiveTransactionNumber,
                TransactionOutputs = aggregate.TransactionOutputs?
                                     .Select(TransactionOutputEntity.FromDomain)
                                     .ToArray(),
                TransactionBlock = aggregate.TransactionBlock,
                TransactionFee = aggregate.TransactionFee,
                TransactionHash = aggregate.TransactionHash,
                Error = aggregate.Error,
                RebuildConfirmationResult = aggregate.RebuildConfirmationResult
            });
        }