Skip to content

Commit

Permalink
restore missing GetReadinessAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Oct 8, 2024
1 parent 3413d5f commit a759dd3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/BeeNet.Client/BeeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,19 @@ public async Task<PostageBatch> GetPostageBatchAsync(
storageRadius: null);
}

public async Task<bool> GetReadinessAsync(CancellationToken cancellationToken = default)
{
try
{
await generatedClient.ReadinessAsync(cancellationToken).ConfigureAwait(false);
return true;
}
catch (BeeNetApiException e) when (e.StatusCode == 400)
{
return false;
}
}

public async Task<ReserveCommitment> GetReserveCommitmentAsync(int depth, string anchor1, string anchor2,
CancellationToken cancellationToken = default)
{
Expand Down
2 changes: 2 additions & 0 deletions src/BeeNet.Util/IBeeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ Task<PostageBatch> GetPostageBatchAsync(
PostageBatchId batchId,
CancellationToken cancellationToken = default);

Task<bool> GetReadinessAsync(CancellationToken cancellationToken = default);

/// <summary>
/// Get reserve commitment hash with sample proofs
/// </summary>
Expand Down

0 comments on commit a759dd3

Please sign in to comment.