Skip to content

Commit bafa0e8

Browse files
feat: set initial balance for Anvil proxy in tests (#5174)
1 parent 5dc1899 commit bafa0e8

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-co
2020
import { sendBatchTransaction } from "../../transaction/actions/send-batch-transaction.js";
2121
import { waitForReceipt } from "../../transaction/actions/wait-for-tx-receipt.js";
2222
import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js";
23+
import { sleep } from "../../utils/sleep.js";
2324
import type { Account, Wallet } from "../interfaces/wallet.js";
2425
import { generateAccount } from "../utils/generateAccount.js";
2526
import { smartWallet } from "./smart-wallet.js";
@@ -332,15 +333,17 @@ describe.runIf(process.env.TW_SECRET_KEY).sequential(
332333
}),
333334
account: newSmartAccount,
334335
}),
335-
sendAndConfirmTransaction({
336-
transaction: claimTo({
337-
contract,
338-
quantity: 1n,
339-
to: newSmartAccount.address,
340-
tokenId: 0n,
336+
sleep(1000).then(() =>
337+
sendAndConfirmTransaction({
338+
transaction: claimTo({
339+
contract,
340+
quantity: 1n,
341+
to: newSmartAccount.address,
342+
tokenId: 0n,
343+
}),
344+
account: newSmartAccount,
341345
}),
342-
account: newSmartAccount,
343-
}),
346+
),
344347
]);
345348
expect(txs.length).toEqual(2);
346349
expect(txs.every((t) => t.transactionHash.length === 66)).toBe(true);

packages/thirdweb/test/globalSetup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export default async function globalSetup() {
6262

6363
const shutdownAnvil = await startProxy({
6464
port: 8648,
65+
options: {
66+
balance: 1000000000n,
67+
},
6568
});
6669

6770
// TODO re-enable thirdweb RPC for this fork

0 commit comments

Comments
 (0)