public async Task TxCommitQuantumTest(KeyPair alphaKeyPair, ConnectionState state, Type excpectedException) { context.AppState.State = ApplicationState.Ready; var clientConnection = new AuditorWebSocketConnection(context, new FakeAuditorConnectionInfo(new FakeWebSocket())) { ConnectionState = state }; var ledgerNotification = new TxNotification { TxCursor = 0, Payments = new List <PaymentBase>() }; var envelope = new TxCommitQuantum { Source = ledgerNotification.CreateEnvelope() }.CreateEnvelope(); envelope.Sign(alphaKeyPair); using var writer = new XdrBufferWriter(); var inMessage = envelope.ToIncomingMessage(writer); await AssertMessageHandling(clientConnection, inMessage, excpectedException); }
public async Task TxCommitQuantumTest(KeyPair alphaKeyPair, ConnectionState state, Type excpectedException) { Global.AppState.State = ApplicationState.Ready; var clientConnection = new AuditorWebSocketConnection(new FakeWebSocket(), null) { ConnectionState = state }; var ledgerNotification = new TxNotification { TxCursor = 0, Payments = new List <PaymentBase>() }; var envelope = new TxCommitQuantum { Source = ledgerNotification.CreateEnvelope() }.CreateEnvelope(); envelope.Sign(alphaKeyPair); await AssertMessageHandling(clientConnection, envelope, excpectedException); }