コード例 #1
0
 public static EthereumCashinAggregate Restore(
     string version,
     EthereumCashinState state,
     string transactionHash,
     Guid clientId,
     string assetId,
     string clientAddress,
     decimal amount,
     bool createPendingActions,
     Guid cashinOperationId,
     DateTime?cashinEnrolledToMatchingEngineDate,
     DateTime?historySavedDate)
 {
     return(new EthereumCashinAggregate(version,
                                        state,
                                        transactionHash,
                                        clientId,
                                        assetId,
                                        clientAddress,
                                        amount,
                                        createPendingActions,
                                        cashinOperationId,
                                        cashinEnrolledToMatchingEngineDate,
                                        historySavedDate));
 }
コード例 #2
0
        private bool SwitchState(EthereumCashinState expectedState, EthereumCashinState nextState)
        {
            if (State < expectedState)
            {
                // Throws to retry and wait until aggregate will be in the required state
                throw new InvalidAggregateStateException(State, expectedState, nextState);
            }

            if (State > expectedState)
            {
                // Aggregate already in the next state, so this event can be just ignored
                return(false);
            }

            State = nextState;

            return(true);
        }
コード例 #3
0
 private EthereumCashinAggregate(string version,
                                 EthereumCashinState state,
                                 string transactionHash,
                                 Guid clientId,
                                 string assetId,
                                 string clientAddress,
                                 decimal amount,
                                 bool createPendingActions,
                                 Guid cashinOperationId,
                                 DateTime?cashinEnrolledToMatchingEngineDate,
                                 DateTime?historySavedDate)
 {
     Version              = version;
     State                = state;
     TransactionHash      = transactionHash;
     ClientId             = clientId;
     AssetId              = assetId;
     ClientAddress        = clientAddress;
     Amount               = amount;
     CreatePendingActions = createPendingActions;
     CashinOperationId    = cashinOperationId;
     CashinEnrolledToMatchingEngineDate = cashinEnrolledToMatchingEngineDate;
     HistorySavedDate = historySavedDate;
 }