コード例 #1
0
 public override void RevertEffect()
 {
     MarkAsProcessed();
     withdrawal.Source.Account.Withdrawal = 0;
     withdrawal.Source.Withdrawal         = null;
     withdrawalStorage.Remove(withdrawal.Hash);
     foreach (var withdrawalItem in Effect.Items)
     {
         Effect.AccountWrapper.Account.GetBalance(withdrawalItem.Asset).UpdateLiabilities(-withdrawalItem.Amount);
     }
 }
コード例 #2
0
        public override void CommitEffect()
        {
            MarkAsProcessed();
            withdrawal.Source.Account.Withdrawal = 0;
            withdrawal.Source.Withdrawal         = null;
            withdrawalStorage.Remove(withdrawal.Hash);

            foreach (var withdrawalItem in Effect.Items)
            {
                var balance = Effect.AccountWrapper.Account.GetBalance(withdrawalItem.Asset);
                if (Effect.IsSuccessful)
                {
                    balance.UpdateBalance(-withdrawalItem.Amount);
                }
                balance.UpdateLiabilities(-withdrawalItem.Amount);
            }
        }