Skip to content

Commit

Permalink
fixed test for extrinsic state
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfriend77 committed Oct 22, 2023
1 parent 5763ebc commit c6c9c64
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Substrate.NetApi.TestNode/ExtrinsicsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,30 @@ public async Task CloseAsync()
}

[OneTimeSetUp]
public void CreateClient()
public async Task SetupAsync()
{
_chargeType = ChargeAssetTxPayment.Default();
_substrateClient = new SubstrateClient(new Uri(WebSocketUrl), _chargeType);

try
{
await _substrateClient.ConnectAsync();
}
catch (Exception ex)
{
Console.WriteLine($"Failed to connect to Substrate node: {ex.Message}");
Assert.Ignore("Skipped test because no active Substrate node was found on 127.0.0.1:9944");
}
}

[OneTimeTearDown]
public void DisposeClient()
public async Task TearDownAsync()
{
_substrateClient.Dispose();
if (_substrateClient != null)
{
await _substrateClient.CloseAsync();
_substrateClient.Dispose();
}
}

/// <summary>
Expand Down

0 comments on commit c6c9c64

Please sign in to comment.