diff --git a/Thirdweb.Tests/Thirdweb.Utils.Tests.cs b/Thirdweb.Tests/Thirdweb.Utils.Tests.cs index aab72ed..cbe9e54 100644 --- a/Thirdweb.Tests/Thirdweb.Utils.Tests.cs +++ b/Thirdweb.Tests/Thirdweb.Utils.Tests.cs @@ -87,6 +87,12 @@ public async Task GetTransactionReceipt_CancellationToken() var infiniteReceipt = await Assert.ThrowsAsync(async () => await Utils.GetTransactionReceipt(client, chainId, infiniteTxHash, cts.Token)); Assert.Equal("A task was canceled.", infiniteReceipt.Message); + cts = new CancellationTokenSource(); + var infiniteReceipt2 = Assert.ThrowsAsync(() => 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); }