Skip to content

Commit 9a031bb

Browse files
chore: bump timeout for userop receipts to 2 mins (#2905)
1 parent e6fce1f commit 9a031bb

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

.changeset/modern-news-thank.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Bump timeout for userOps receipts to 2mins

legacy_packages/auth/test/smart-wallet.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require("dotenv-mono").load();
1010
describe.runIf(process.env.TW_SECRET_KEY)(
1111
"Wallet Authentication - EVM - Smart Wallet",
1212
{
13-
timeout: 60000,
13+
timeout: 240000,
1414
},
1515
async () => {
1616
let adminWallet: any, signerWallet: any, attackerWallet: any;

legacy_packages/wallets/test/smart-wallet-integration.test.ts

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,20 @@ beforeAll(async () => {
3434
secretKey: SECRET_KEY,
3535
});
3636
contract = await sdk.getContract(
37-
"0x638263e3eAa3917a53630e61B1fBa685308024fa", // arb sep edition drop
37+
"0x638263e3eAa3917a53630e61B1fBa685308024fa", // edition drop
3838
);
3939
});
4040

4141
describeIf(!!SECRET_KEY)(
4242
"SmartWallet core tests",
43-
{
44-
timeout: 240_000,
45-
},
4643
() => {
4744
it("can connect", async () => {
4845
expect(smartWalletAddress).toHaveLength(42);
4946
});
5047

51-
it("can execute a tx via SDK", async () => {
48+
it("can execute a tx via SDK", {
49+
timeout: 120_000,
50+
}, async () => {
5251
const tx = await contract.erc1155.claim(0, 1);
5352
expect(tx.receipt.transactionHash).toHaveLength(66);
5453
const isDeployed = await smartWallet.isDeployed();
@@ -57,29 +56,37 @@ describeIf(!!SECRET_KEY)(
5756
expect(balance.toNumber()).toEqual(1);
5857
});
5958

60-
it("can estimate a tx", async () => {
59+
it("can estimate a tx", {
60+
timeout: 120_000,
61+
}, async () => {
6162
const preparedTx = await contract.erc1155.claim.prepare(0, 1);
6263
const estimates = await smartWallet.estimate(preparedTx);
6364
expect(estimates.wei.toString()).not.toBe("0");
6465
});
6566

66-
it("can execute a tx", async () => {
67+
it("can execute a tx", {
68+
timeout: 120_000,
69+
}, async () => {
6770
const preparedTx = await contract.erc1155.claim.prepare(0, 1);
6871
const tx = await smartWallet.execute(preparedTx);
6972
expect(tx.receipt.transactionHash).toHaveLength(66);
7073
const balance = await contract.erc1155.balance(0);
7174
expect(balance.toNumber()).toEqual(2);
7275
});
7376

74-
it("can execute a batched tx", async () => {
77+
it("can execute a batched tx", {
78+
timeout: 120_000,
79+
}, async () => {
7580
const preparedTx = await contract.erc1155.claim.prepare(0, 1);
7681
const tx = await smartWallet.executeBatch([preparedTx, preparedTx]);
7782
expect(tx.receipt.transactionHash).toHaveLength(66);
7883
const balance = await contract.erc1155.balance(0);
7984
expect(balance.toNumber()).toEqual(4);
8085
});
8186

82-
it("can execute a raw tx", async () => {
87+
it("can execute a raw tx", {
88+
timeout: 120_000,
89+
}, async () => {
8390
const preparedTx = await contract.erc1155.claim.prepare(0, 1);
8491
const tx = await smartWallet.executeRaw({
8592
to: preparedTx.getTarget(),
@@ -90,7 +97,9 @@ describeIf(!!SECRET_KEY)(
9097
expect(balance.toNumber()).toEqual(5);
9198
});
9299

93-
it("can execute a batched raw tx", async () => {
100+
it("can execute a batched raw tx", {
101+
timeout: 120_000,
102+
}, async () => {
94103
const preparedTx = await contract.erc1155.claim.prepare(0, 1);
95104
const tx = await smartWallet.executeBatchRaw([
96105
{
@@ -107,7 +116,9 @@ describeIf(!!SECRET_KEY)(
107116
expect(balance.toNumber()).toEqual(7);
108117
});
109118

110-
it("can sign and verify 1271 old factory", async () => {
119+
it("can sign and verify 1271 old factory", {
120+
timeout: 120_000,
121+
}, async () => {
111122
const message = "0x1234";
112123
const sig = await smartWallet.signMessage(message);
113124
const isValidV1 = await smartWallet.verifySignature(
@@ -128,7 +139,9 @@ describeIf(!!SECRET_KEY)(
128139
expect(isValidV2).toEqual(true);
129140
});
130141

131-
it("can sign and verify 1271 new factory", async () => {
142+
it("can sign and verify 1271 new factory", {
143+
timeout: 240_000,
144+
}, async () => {
132145
smartWallet = new SmartWallet({
133146
chain,
134147
factoryAddress: factoryAddressV2,

packages/thirdweb/src/wallets/smart/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async function waitForUserOpReceipt(args: {
295295
userOpHash: Hex;
296296
}): Promise<TransactionReceipt> {
297297
const { options, userOpHash } = args;
298-
const timeout = 30000;
298+
const timeout = 120000; // 2mins
299299
const interval = 1000;
300300
const endtime = Date.now() + timeout;
301301
while (Date.now() < endtime) {

0 commit comments

Comments
 (0)