@@ -7,7 +7,10 @@ import {
77 getTestWeb3SignerProvider ,
88 MAX_EXPECTED_WEB2_SERVICES_TIME ,
99} from '../test-utils.js' ;
10- import { DEFAULT_CHAIN_ID , getChainDefaultConfig } from '../../src/config/config.js' ;
10+ import {
11+ DEFAULT_CHAIN_ID ,
12+ getChainDefaultConfig ,
13+ } from '../../src/config/config.js' ;
1114
1215describe ( 'IExecWeb3mail()' , ( ) => {
1316 it ( 'instantiates with a valid ethProvider' , async ( ) => {
@@ -54,8 +57,7 @@ describe('IExecWeb3mail()', () => {
5457 const graphQLClient = web3mail [ 'graphQLClient' ] ;
5558 const defaultConfig = getChainDefaultConfig ( DEFAULT_CHAIN_ID ) ;
5659 expect ( defaultConfig ) . not . toBeNull ( ) ;
57- expect ( graphQLClient [ 'url' ] ) . toBe (
58- defaultConfig ! . dataProtectorSubgraph ) ;
60+ expect ( graphQLClient [ 'url' ] ) . toBe ( defaultConfig ! . dataProtectorSubgraph ) ;
5961 } ) ;
6062
6163 it ( 'should use provided data Protector Subgraph URL when subgraphUrl is provided' , async ( ) => {
@@ -108,7 +110,9 @@ describe('IExecWeb3mail()', () => {
108110 expect ( ipfsNode ) . toStrictEqual ( customIpfsNode ) ;
109111 expect ( ipfsGateway ) . toStrictEqual ( customIpfsGateway ) ;
110112 expect ( dappAddressOrENS ) . toStrictEqual ( customDapp ) ;
111- expect ( whitelistAddress ) . toStrictEqual ( customDappWhitelistAddress . toLowerCase ( ) ) ;
113+ expect ( whitelistAddress ) . toStrictEqual (
114+ customDappWhitelistAddress . toLowerCase ( )
115+ ) ;
112116 expect ( await iexec . config . resolveSmsURL ( ) ) . toBe ( smsURL ) ;
113117 expect ( await iexec . config . resolveIexecGatewayURL ( ) ) . toBe ( iexecGatewayURL ) ;
114118 } ) ;
@@ -149,55 +153,70 @@ describe('IExecWeb3mail()', () => {
149153
150154 describe ( 'With allowExperimentalNetworks: true' , ( ) => {
151155 it ( 'should resolve the configuration' , async ( ) => {
152- const web3mail = new IExecWeb3mail (
153- experimentalNetworkSigner ,
154- { allowExperimentalNetworks : true }
155- ) ;
156+ const web3mail = new IExecWeb3mail ( experimentalNetworkSigner , {
157+ allowExperimentalNetworks : true ,
158+ } ) ;
156159 await expect ( web3mail . init ( ) ) . resolves . toBeUndefined ( ) ;
157160 expect ( web3mail ) . toBeInstanceOf ( IExecWeb3mail ) ;
158161 } ) ;
159162
160163 it ( 'should use Arbitrum Sepolia default configuration' , async ( ) => {
161- const web3mail = new IExecWeb3mail (
162- experimentalNetworkSigner ,
163- { allowExperimentalNetworks : true }
164- ) ;
164+ const web3mail = new IExecWeb3mail ( experimentalNetworkSigner , {
165+ allowExperimentalNetworks : true ,
166+ } ) ;
165167 await web3mail . init ( ) ;
166168
167- const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , { allowExperimentalNetworks : true } ) ;
169+ const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , {
170+ allowExperimentalNetworks : true ,
171+ } ) ;
168172 expect ( arbitrumSepoliaConfig ) . not . toBeNull ( ) ;
169173
170- expect ( web3mail [ 'ipfsGateway' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsGateway ) ;
174+ expect ( web3mail [ 'ipfsGateway' ] ) . toBe (
175+ arbitrumSepoliaConfig ! . ipfsGateway
176+ ) ;
171177 expect ( web3mail [ 'ipfsNode' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsUploadUrl ) ;
172- expect ( web3mail [ 'dappAddressOrENS' ] ) . toBe ( arbitrumSepoliaConfig ! . dappAddress ) ;
173- expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe ( arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( ) ) ;
174- expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe ( arbitrumSepoliaConfig ! . prodWorkerpoolAddress ) ;
175- expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe ( arbitrumSepoliaConfig ! . dataProtectorSubgraph ) ;
178+ expect ( web3mail [ 'dappAddressOrENS' ] ) . toBe (
179+ arbitrumSepoliaConfig ! . dappAddress
180+ ) ;
181+ expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe (
182+ arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( )
183+ ) ;
184+ expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe (
185+ arbitrumSepoliaConfig ! . prodWorkerpoolAddress
186+ ) ;
187+ expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe (
188+ arbitrumSepoliaConfig ! . dataProtectorSubgraph
189+ ) ;
176190 } ) ;
177191
178192 it ( 'should allow custom configuration override for Arbitrum Sepolia' , async ( ) => {
179193 const customIpfsGateway = 'https://custom-arbitrum-ipfs.com' ;
180194 const customDappAddress = 'custom.arbitrum.app.eth' ;
181195
182- const web3mail = new IExecWeb3mail (
183- experimentalNetworkSigner ,
184- {
185- allowExperimentalNetworks : true ,
186- ipfsGateway : customIpfsGateway ,
187- dappAddressOrENS : customDappAddress
188- }
189- ) ;
196+ const web3mail = new IExecWeb3mail ( experimentalNetworkSigner , {
197+ allowExperimentalNetworks : true ,
198+ ipfsGateway : customIpfsGateway ,
199+ dappAddressOrENS : customDappAddress ,
200+ } ) ;
190201 await web3mail . init ( ) ;
191202
192203 expect ( web3mail [ 'ipfsGateway' ] ) . toBe ( customIpfsGateway ) ;
193204 expect ( web3mail [ 'dappAddressOrENS' ] ) . toBe ( customDappAddress ) ;
194205
195- const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , { allowExperimentalNetworks : true } ) ;
206+ const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , {
207+ allowExperimentalNetworks : true ,
208+ } ) ;
196209 expect ( arbitrumSepoliaConfig ) . not . toBeNull ( ) ;
197210 expect ( web3mail [ 'ipfsNode' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsUploadUrl ) ;
198- expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe ( arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( ) ) ;
199- expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe ( arbitrumSepoliaConfig ! . prodWorkerpoolAddress ) ;
200- expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe ( arbitrumSepoliaConfig ! . dataProtectorSubgraph ) ;
211+ expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe (
212+ arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( )
213+ ) ;
214+ expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe (
215+ arbitrumSepoliaConfig ! . prodWorkerpoolAddress
216+ ) ;
217+ expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe (
218+ arbitrumSepoliaConfig ! . dataProtectorSubgraph
219+ ) ;
201220 } ) ;
202221 } ) ;
203222 } ) ;
0 commit comments