private void SwapInitiatedEventHandler( Swap swap, CancellationToken cancellationToken = default) { Log.Debug( "Initiator's payment transaction received. Now acceptor can broadcast payment tx for swap {@swapId}", swap.Id); swap.StateFlags |= SwapStateFlags.HasPartyPayment; swap.StateFlags |= SwapStateFlags.IsPartyPaymentConfirmed; RaiseSwapUpdated(swap, SwapStateFlags.HasPartyPayment | SwapStateFlags.IsPartyPaymentConfirmed); InitiatorPaymentConfirmed?.Invoke(this, new SwapEventArgs(swap)); }
protected async Task SwapInitiatedHandler( Swap swap, CancellationToken cancellationToken = default) { Log.Debug( "Initiator payment transaction received. Now counter party can broadcast payment tx for swap {@swapId}", swap.Id); swap.StateFlags |= SwapStateFlags.HasPartyPayment; swap.StateFlags |= SwapStateFlags.IsPartyPaymentConfirmed; await UpdateSwapAsync(swap, SwapStateFlags.HasPartyPayment | SwapStateFlags.IsPartyPaymentConfirmed, cancellationToken) .ConfigureAwait(false); await InitiatorPaymentConfirmed.Invoke(this, new SwapEventArgs(swap), cancellationToken) .ConfigureAwait(false); }
private void SwapInitiatedEventHandler(BackgroundTask task) { var initiatedControlTask = task as TezosSwapInitiatedControlTask; var swap = initiatedControlTask?.Swap; if (swap == null) { return; } Log.Debug( "Initiator's payment transaction received. Now acceptor can broadcast payment tx for swap {@swapId}", swap.Id); swap.SetHasPartyPayment(); swap.SetPartyPaymentConfirmed(); RaiseSwapUpdated(swap, SwapStateFlags.HasPartyPayment | SwapStateFlags.IsPartyPaymentConfirmed); InitiatorPaymentConfirmed?.Invoke(this, new SwapEventArgs(swap)); }
protected void RaiseInitiatorPaymentConfirmed(ClientSwap swap) { InitiatorPaymentConfirmed?.Invoke(this, new SwapEventArgs(swap)); }
protected Task RaiseInitiatorPaymentConfirmed( Swap swap, CancellationToken cancellationToken = default) => InitiatorPaymentConfirmed?.Invoke(this, new SwapEventArgs(swap), cancellationToken);