|
2 | 2 | using Monero.Daemon; |
3 | 3 | using Monero.Daemon.Common; |
4 | 4 | using Monero.Daemon.Rpc; |
5 | | -using Monero.IntegrationTests.Utils; |
6 | 5 |
|
7 | 6 | using NUnit.Framework; |
8 | 7 |
|
9 | 8 | namespace Monero.IntegrationTests; |
10 | 9 |
|
11 | 10 | public class MoneroDaemonRpcIntegrationTest : MoneroIntegrationTestBase |
12 | 11 | { |
13 | | - |
14 | 12 | #region Notification Tests |
15 | 13 |
|
16 | 14 | // Can notify listeners when a new block is added to the chain |
17 | 15 | [Test] |
18 | 16 | public async Task TestBlockListener() |
19 | 17 | { |
20 | | - try |
21 | | - { |
22 | | - // register a listener |
23 | | - MoneroDaemonListener listener = new(); |
24 | | - Daemon.AddListener(listener); |
| 18 | + // register a listener |
| 19 | + MoneroDaemonListener listener = new(); |
| 20 | + Daemon.AddListener(listener); |
25 | 21 |
|
26 | | - // wait for the next block notification |
27 | | - MoneroBlockHeader header = await Daemon.WaitForNextBlockHeader(); |
28 | | - Daemon.RemoveListener(listener); // unregister listener so daemon does not keep polling |
29 | | - TestBlockHeader(header, true); |
| 22 | + // wait for the next block notification |
| 23 | + MoneroBlockHeader header = await Daemon.WaitForNextBlockHeader(); |
| 24 | + Daemon.RemoveListener(listener); // unregister listener so daemon does not keep polling |
| 25 | + TestBlockHeader(header, true); |
30 | 26 |
|
31 | | - // test that listener was called with the equivalent header |
32 | | - Assert.That(header.Equals(listener.GetLastBlockHeader())); |
33 | | - } |
34 | | - finally |
35 | | - { |
36 | | - // stop mining |
37 | | - try { await Daemon.StopMining(); } |
38 | | - catch (MoneroError) |
39 | | - { |
40 | | - // ignore |
41 | | - } |
42 | | - } |
| 27 | + // test that listener was called with the equivalent header |
| 28 | + Assert.That(header.Equals(listener.GetLastBlockHeader())); |
43 | 29 | } |
44 | 30 |
|
45 | 31 | #endregion |
|
0 commit comments