1- import { Web3Provider , ProxyMessageProvider , WalletSession , WalletRequestHandler , ProxyMessageChannel , ProxyMessageHandler , prefixEIP191Message } from '@0xsequence/provider'
1+ import {
2+ Web3Provider ,
3+ ProxyMessageProvider ,
4+ WalletSession ,
5+ WalletRequestHandler ,
6+ ProxyMessageChannel ,
7+ ProxyMessageHandler ,
8+ prefixEIP191Message
9+ } from '@0xsequence/provider'
210import { ethers , Wallet as EOAWallet } from 'ethers'
311import { JsonRpcProvider } from '@ethersproject/providers'
412import { test , assert } from '../../utils/assert'
@@ -12,7 +20,6 @@ import { testAccounts, getEOAWallet } from '../testutils'
1220configureLogger ( { logLevel : 'DEBUG' , silence : false } )
1321
1422export const tests = async ( ) => {
15-
1623 // ProxyMessageChannel object is to be instantiated by the app coordinating
1724 // the channel, ie. such as the mobile application itself.
1825 //
@@ -22,7 +29,7 @@ export const tests = async () => {
2229 // Sending messages to the wallet port will go through channel and get received by the app.
2330 const ch = new ProxyMessageChannel ( )
2431
25- ch . app . on ( 'open' , ( openInfo ) => {
32+ ch . app . on ( 'open' , openInfo => {
2633 console . log ( 'app, wallet opened.' , openInfo )
2734 } )
2835 ch . app . on ( 'close' , ( ) => {
@@ -68,13 +75,13 @@ export const tests = async () => {
6875 rpcUrl : rpcProvider . connection . url ,
6976 provider : rpcProvider ,
7077 relayer : relayer ,
71- isDefaultChain : true ,
78+ isDefaultChain : true
7279 // isAuthChain: true
7380 }
7481 ]
7582
7683 // the rpc signer via the wallet
77- const walletRequestHandler = new WalletRequestHandler ( undefined , null , networks )
84+ const walletRequestHandler = new WalletRequestHandler ( undefined , null , null , networks )
7885
7986 // fake/force an async wallet initialization for the wallet-request handler. This is the behaviour
8087 // of the wallet-webapp, so lets ensure the mock wallet does the same thing too.
@@ -86,7 +93,6 @@ export const tests = async () => {
8693 const proxyHandler = new ProxyMessageHandler ( walletRequestHandler , ch . wallet )
8794 proxyHandler . register ( )
8895
89-
9096 //
9197 // App Provider
9298 //
@@ -137,7 +143,6 @@ export const tests = async () => {
137143 'signature match'
138144 )
139145
140-
141146 const chainId = await signer . getChainId ( )
142147
143148 //
@@ -152,7 +157,6 @@ export const tests = async () => {
152157 // in order to recover the config properly, the subDigest + sig is required.
153158 const subDigest = packMessageData ( address , chainId , messageDigest )
154159
155-
156160 //
157161 // Recover config / address
158162 //
@@ -166,5 +170,4 @@ export const tests = async () => {
166170 } )
167171
168172 walletProvider . closeWallet ( )
169-
170173}
0 commit comments