public DepositDetailsForRpc(DepositDetails deposit, uint timestamp) { Id = deposit.Id; Deposit = new DepositForRpc(deposit.Deposit); DataAsset = new DataAssetForRpc(deposit.DataAsset); Consumer = deposit.Consumer; Timestamp = deposit.Timestamp; Transaction = deposit.Transaction is null ? null : new TransactionInfoForRpc(deposit.Transaction); Transactions = deposit.Transactions?.Select(t => new TransactionInfoForRpc(t)).OrderBy(t => t.Timestamp) ?? Enumerable.Empty <TransactionInfoForRpc>(); ConfirmationTimestamp = deposit.ConfirmationTimestamp; Confirmed = deposit.Confirmed; Rejected = deposit.Rejected; Cancelled = deposit.Cancelled; Expired = deposit.IsExpired(timestamp); RefundClaimed = deposit.RefundClaimed; ClaimedRefundTransaction = deposit.ClaimedRefundTransaction is null ? null : new TransactionInfoForRpc(deposit.ClaimedRefundTransaction); ClaimedRefundTransactions = deposit.ClaimedRefundTransactions?.Select(t => new TransactionInfoForRpc(t)) .OrderBy(t => t.Timestamp) ?? Enumerable.Empty <TransactionInfoForRpc>(); RefundCancelled = deposit.RefundCancelled; ConsumedUnits = deposit.ConsumedUnits; Kyc = deposit.Kyc; Confirmations = deposit.Confirmations; RequiredConfirmations = deposit.RequiredConfirmations; }
public DepositDetailsForRpc(DepositDetails deposit, uint timestamp) { Id = deposit.Id; Deposit = new DepositForRpc(deposit.Deposit); DataAsset = new DataAssetForRpc(deposit.DataAsset); Consumer = deposit.Consumer; Timestamp = deposit.Timestamp; TransactionHash = deposit.TransactionHash; ConfirmationTimestamp = deposit.ConfirmationTimestamp; Confirmed = deposit.Confirmed; Rejected = deposit.Rejected; Expired = deposit.IsExpired(timestamp); RefundClaimed = deposit.RefundClaimed; ClaimedRefundTransactionHash = deposit.ClaimedRefundTransactionHash; ConsumedUnits = deposit.ConsumedUnits; Kyc = deposit.Kyc; Confirmations = deposit.Confirmations; RequiredConfirmations = deposit.RequiredConfirmations; }
public void when_is_expired_returns_true() { var isExpired = _depositDetails.IsExpired(30); Assert.IsTrue(isExpired); }