Skip to content

Commit e4ff57c

Browse files
committed
Fall back to rich account for recovery test relayer from
1 parent ee761a3 commit e4ff57c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/wallet/wdk/test/recovery.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ describe('Recovery', () => {
4848

4949
// Transfer 1 wei to the wallet
5050
const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL))
51-
const [relayerFrom] = (await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[]
51+
const relayerFrom =
52+
((await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[])[0] ??
53+
('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' as const)
5254
await provider.request({
5355
method: 'anvil_setBalance',
5456
params: [wallet!, '0x3635c9adc5dea0000'], // 0.1 ETH
@@ -281,7 +283,9 @@ describe('Recovery', () => {
281283

282284
// Transfer 1 wei to the wallet
283285
const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL))
284-
const [relayerFrom] = (await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[]
286+
const relayerFrom =
287+
((await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[])[0] ??
288+
('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' as const)
285289
await provider.request({
286290
method: 'anvil_setBalance',
287291
params: [wallet!, '0x1'],
@@ -431,7 +435,9 @@ describe('Recovery', () => {
431435

432436
// Transfer some wei to the wallet
433437
const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL))
434-
const [relayerFrom] = (await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[]
438+
const relayerFrom =
439+
((await provider.request({ method: 'eth_accounts', params: [] as any })) as `0x${string}`[])[0] ??
440+
('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' as const)
435441
await provider.request({
436442
method: 'anvil_setBalance',
437443
params: [wallet!, '0x10'],

0 commit comments

Comments
 (0)