Skip to content

Commit 39e6788

Browse files
committed
fix(e2e): update transport configuration to support custom RPC URL
- Modified `fundAccount` and `getViemPublicClient` functions to utilize a custom RPC URL if provided, enhancing flexibility in network configurations. - Cleaned up commented-out code in `runPkpSignTest` for clarity.
1 parent 54b0bdc commit 39e6788

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

e2e/artillery/src/processors/multi-endpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export async function runPkpSignTest() {
113113
authContext: authContext,
114114
pubKey: state.masterAccount.pkp.publicKey,
115115
toSign: `Hello from Artillery! ${Date.now()}`, // Unique message per request
116-
// userMaxPrice: await litClient
116+
// userMaxPrice: 1000000000000000000n,
117117
});
118118

119119
// Validate the result using Zod schema

e2e/src/helper/NetworkManager.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ export const getViemPublicClient = async ({
4747
networkModule: any;
4848
}) => {
4949
const viemChainConfig = networkModule.getChainConfig();
50+
51+
const customRpcUrl = process.env['LIT_YELLOWSTONE_PRIVATE_RPC_URL'];
52+
if (customRpcUrl) {
53+
console.log(`🔧 Using custom E2E RPC URL: ${customRpcUrl}`);
54+
}
55+
5056
const publicClient = createPublicClient({
5157
chain: viemChainConfig,
52-
transport: http(),
58+
transport: customRpcUrl ? http(customRpcUrl) : http(),
5359
});
5460

5561
return publicClient;

e2e/src/helper/fundAccount.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@ export const fundAccount = async (
7878
thenFundWith?: string;
7979
}
8080
) => {
81+
const customRpcUrl = process.env['LIT_YELLOWSTONE_PRIVATE_RPC_URL'];
82+
if (customRpcUrl) {
83+
console.log(`🔧 Using custom E2E RPC URL: ${customRpcUrl}`);
84+
}
85+
8186
// check account balance
8287
const publicClient = createPublicClient({
8388
chain: networkModule.getChainConfig(),
84-
transport: http(networkModule.getChainConfig().rpcUrls.default.http[0]),
89+
transport: http(customRpcUrl || networkModule.getChainConfig().rpcUrls.default.http[0]),
8590
});
8691

8792
const balance = await publicClient.getBalance({
@@ -94,7 +99,7 @@ export const fundAccount = async (
9499

95100
const walletClient = createWalletClient({
96101
account: sponsorAccount,
97-
transport: http(networkModule.getChainConfig().rpcUrls.default.http[0]),
102+
transport: http(customRpcUrl || networkModule.getChainConfig().rpcUrls.default.http[0]),
98103
});
99104

100105
// Get the next managed nonce for this sponsor account

0 commit comments

Comments
 (0)