Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,22 @@ private async Task<string> SendUserOp(object userOperation, int? requestId = nul
// Wait for the transaction to be mined

string txHash = null;
while (txHash == null)
using var ct = new CancellationTokenSource(this.Client.FetchTimeoutOptions.GetTimeout(TimeoutType.Other));
try
{
while (txHash == null)
{
ct.Token.ThrowIfCancellationRequested();

var userOpReceipt = await BundlerClient.EthGetUserOperationReceipt(this.Client, this._bundlerUrl, requestId, userOpHash).ConfigureAwait(false);

txHash = userOpReceipt?.Receipt?.TransactionHash;
await ThirdwebTask.Delay(100, ct.Token).ConfigureAwait(false);
}
}
catch (OperationCanceledException)
{
var userOpReceipt = await BundlerClient.EthGetUserOperationReceipt(this.Client, this._bundlerUrl, requestId, userOpHash).ConfigureAwait(false);
txHash = userOpReceipt?.Receipt?.TransactionHash;
await ThirdwebTask.Delay(100).ConfigureAwait(false);
throw new Exception($"User operation timed out with user op hash: {userOpHash}");
}

this.IsDeploying = false;
Expand Down