Skip to content

Commit

Permalink
Update Thirdweb.Utils.Tests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Apr 8, 2024
1 parent 58e0723 commit a61f0f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Thirdweb.Tests/Thirdweb.Utils.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public async Task GetTransactionReceipt_CancellationToken()
var infiniteReceipt = await Assert.ThrowsAsync<TaskCanceledException>(async () => await Utils.GetTransactionReceipt(client, chainId, infiniteTxHash, cts.Token));
Assert.Equal("A task was canceled.", infiniteReceipt.Message);

cts = new CancellationTokenSource();
var infiniteReceipt2 = Assert.ThrowsAsync<TaskCanceledException>(() => Utils.GetTransactionReceipt(client, chainId, infiniteTxHash, cts.Token));
await Task.Delay(2000);
cts.Cancel();
Assert.Equal("A task was canceled.", (await infiniteReceipt2).Message);

var aaReceipt2 = await Utils.GetTransactionReceipt(client, chainId, aaTxHash, CancellationToken.None);
Assert.NotNull(aaReceipt2);
}
Expand Down

0 comments on commit a61f0f6

Please sign in to comment.