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); } }
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); } }