Skip to content

Commit 55dee86

Browse files
committed
Reduce polling interval for sw to 2s + don't wait for tx in client
1 parent e24bd63 commit 55dee86

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Assets/Thirdweb/Core/Scripts/AccountAbstraction/Core/SmartWallet.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -223,25 +223,25 @@ private async Task<RpcResponseMessage> CreateUserOpAndSend(RpcRequestMessage req
223223
{
224224
var getUserOpResponse = await BundlerClient.EthGetUserOperationByHash(Config.bundlerUrl, apiKey, requestMessage.Id, userOpHash);
225225
txHash = getUserOpResponse?.transactionHash;
226-
await new WaitForSecondsRealtime(5f);
226+
await new WaitForSecondsRealtime(2f);
227227
}
228228
ThirdwebDebug.Log("Tx Hash: " + txHash);
229229

230-
// Check if successful
231-
232-
var receipt = await new Web3(ThirdwebManager.Instance.SDK.session.RPC).Eth.Transactions.GetTransactionReceipt.SendRequestAsync(txHash);
233-
var decodedEvents = receipt.DecodeAllEvents<EntryPointContract.UserOperationEventEventDTO>();
234-
if (decodedEvents[0].Event.Success == false)
235-
{
236-
ThirdwebDebug.Log("Transaction not successful, checking reason...");
237-
var reason = await new Web3(ThirdwebManager.Instance.SDK.session.RPC).Eth.GetContractTransactionErrorReason.SendRequestAsync(txHash);
238-
throw new Exception($"Transaction {txHash} reverted with reason: {reason}");
239-
}
240-
else
241-
{
242-
ThirdwebDebug.Log("Transaction successful");
243-
_deployed = true;
244-
}
230+
// // Check if successful
231+
232+
// var receipt = await new Web3(ThirdwebManager.Instance.SDK.session.RPC).Eth.Transactions.GetTransactionReceipt.SendRequestAsync(txHash);
233+
// var decodedEvents = receipt.DecodeAllEvents<EntryPointContract.UserOperationEventEventDTO>();
234+
// if (decodedEvents[0].Event.Success == false)
235+
// {
236+
// ThirdwebDebug.Log("Transaction not successful, checking reason...");
237+
// var reason = await new Web3(ThirdwebManager.Instance.SDK.session.RPC).Eth.GetContractTransactionErrorReason.SendRequestAsync(txHash);
238+
// throw new Exception($"Transaction {txHash} reverted with reason: {reason}");
239+
// }
240+
// else
241+
// {
242+
// ThirdwebDebug.Log("Transaction successful");
243+
// _deployed = true;
244+
// }
245245

246246
return new RpcResponseMessage(requestMessage.Id, txHash);
247247
}

0 commit comments

Comments
 (0)