@@ -21,25 +21,31 @@ describe('AssetsContractController with NetworkClientId', () => {
21
21
it ( 'should throw when getting ERC-20 token balance when networkClientId is invalid' , async ( ) => {
22
22
const { messenger } = await setupAssetContractControllers ( ) ;
23
23
await expect (
24
- messenger . call (
25
- `AssetsContractController:getERC20BalanceOf` ,
26
- ERC20_UNI_ADDRESS ,
27
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
28
- 'invalidNetworkClientId' ,
29
- ) ,
30
- ) . rejects . toThrow ( 'No custom network client was found' ) ;
24
+ async ( ) =>
25
+ await messenger . call (
26
+ `AssetsContractController:getERC20BalanceOf` ,
27
+ ERC20_UNI_ADDRESS ,
28
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
29
+ 'invalidNetworkClientId' ,
30
+ ) ,
31
+ ) . rejects . toThrow (
32
+ `No custom network client was found with the ID "invalidNetworkClientId".` ,
33
+ ) ;
31
34
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
32
35
} ) ;
33
36
34
37
it ( 'should throw when getting ERC-20 token decimal when networkClientId is invalid' , async ( ) => {
35
38
const { messenger } = await setupAssetContractControllers ( ) ;
36
39
await expect (
37
- messenger . call (
38
- `AssetsContractController:getERC20TokenDecimals` ,
39
- ERC20_UNI_ADDRESS ,
40
- 'invalidNetworkClientId' ,
41
- ) ,
42
- ) . rejects . toThrow ( 'No custom network client was found' ) ;
40
+ async ( ) =>
41
+ await messenger . call (
42
+ `AssetsContractController:getERC20TokenDecimals` ,
43
+ ERC20_UNI_ADDRESS ,
44
+ 'invalidNetworkClientId' ,
45
+ ) ,
46
+ ) . rejects . toThrow (
47
+ `No custom network client was found with the ID "invalidNetworkClientId".` ,
48
+ ) ;
43
49
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
44
50
} ) ;
45
51
@@ -138,13 +144,14 @@ describe('AssetsContractController with NetworkClientId', () => {
138
144
it ( 'should throw error when getting ERC-721 token standard and details when networkClientId is invalid' , async ( ) => {
139
145
const { messenger } = await setupAssetContractControllers ( ) ;
140
146
await expect (
141
- messenger . call (
142
- `AssetsContractController:getTokenStandardAndDetails` ,
143
- ERC20_UNI_ADDRESS ,
144
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
145
- undefined ,
146
- 'invalidNetworkClientId' ,
147
- ) ,
147
+ async ( ) =>
148
+ await messenger . call (
149
+ `AssetsContractController:getTokenStandardAndDetails` ,
150
+ ERC20_UNI_ADDRESS ,
151
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
152
+ undefined ,
153
+ 'invalidNetworkClientId' ,
154
+ ) ,
148
155
) . rejects . toThrow ( 'No custom network client was found' ) ;
149
156
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
150
157
} ) ;
@@ -153,13 +160,14 @@ describe('AssetsContractController with NetworkClientId', () => {
153
160
const { messenger } = await setupAssetContractControllers ( ) ;
154
161
const error = 'Unable to determine contract standard' ;
155
162
await expect (
156
- messenger . call (
157
- `AssetsContractController:getTokenStandardAndDetails` ,
158
- 'BaDeRc20AdDrEsS' ,
159
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
160
- undefined ,
161
- 'mainnet' ,
162
- ) ,
163
+ async ( ) =>
164
+ await messenger . call (
165
+ `AssetsContractController:getTokenStandardAndDetails` ,
166
+ 'BaDeRc20AdDrEsS' ,
167
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
168
+ undefined ,
169
+ 'mainnet' ,
170
+ ) ,
163
171
) . rejects . toThrow ( error ) ;
164
172
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
165
173
} ) ;
@@ -558,11 +566,12 @@ describe('AssetsContractController with NetworkClientId', () => {
558
566
it ( 'should throw error when getting ERC-721 NFT symbol when networkClientId is invalid' , async ( ) => {
559
567
const { messenger } = await setupAssetContractControllers ( ) ;
560
568
await expect (
561
- messenger . call (
562
- `AssetsContractController:getERC721AssetSymbol` ,
563
- ERC721_GODS_ADDRESS ,
564
- 'invalidNetworkClientId' ,
565
- ) ,
569
+ async ( ) =>
570
+ await messenger . call (
571
+ `AssetsContractController:getERC721AssetSymbol` ,
572
+ ERC721_GODS_ADDRESS ,
573
+ 'invalidNetworkClientId' ,
574
+ ) ,
566
575
) . rejects . toThrow ( 'No custom network client was found' ) ;
567
576
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
568
577
} ) ;
@@ -672,12 +681,13 @@ describe('AssetsContractController with NetworkClientId', () => {
672
681
it ( 'should throw error when getting ERC-721 NFT ownership using networkClientId that is invalid' , async ( ) => {
673
682
const { messenger } = await setupAssetContractControllers ( ) ;
674
683
await expect (
675
- messenger . call (
676
- `AssetsContractController:getERC721OwnerOf` ,
677
- ERC721_GODS_ADDRESS ,
678
- '148332' ,
679
- 'invalidNetworkClientId' ,
680
- ) ,
684
+ async ( ) =>
685
+ await messenger . call (
686
+ `AssetsContractController:getERC721OwnerOf` ,
687
+ ERC721_GODS_ADDRESS ,
688
+ '148332' ,
689
+ 'invalidNetworkClientId' ,
690
+ ) ,
681
691
) . rejects . toThrow ( 'No custom network client was found' ) ;
682
692
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
683
693
} ) ;
@@ -792,15 +802,16 @@ describe('AssetsContractController with NetworkClientId', () => {
792
802
it ( 'should throw error when transferring single ERC-1155 when networkClientId is invalid' , async ( ) => {
793
803
const { messenger } = await setupAssetContractControllers ( ) ;
794
804
await expect (
795
- messenger . call (
796
- `AssetsContractController:transferSingleERC1155` ,
797
- ERC1155_ADDRESS ,
798
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
799
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
800
- ERC1155_ID ,
801
- '1' ,
802
- 'invalidNetworkClientId' ,
803
- ) ,
805
+ async ( ) =>
806
+ await messenger . call (
807
+ `AssetsContractController:transferSingleERC1155` ,
808
+ ERC1155_ADDRESS ,
809
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
810
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
811
+ ERC1155_ID ,
812
+ '1' ,
813
+ 'invalidNetworkClientId' ,
814
+ ) ,
804
815
) . rejects . toThrow ( 'No custom network client was found' ) ;
805
816
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
806
817
} ) ;
@@ -843,13 +854,14 @@ describe('AssetsContractController with NetworkClientId', () => {
843
854
it ( 'should throw error when getting the balance of a ERC-1155 NFT when networkClientId is invalid' , async ( ) => {
844
855
const { messenger } = await setupAssetContractControllers ( ) ;
845
856
await expect (
846
- messenger . call (
847
- `AssetsContractController:getERC1155BalanceOf` ,
848
- TEST_ACCOUNT_PUBLIC_ADDRESS ,
849
- ERC1155_ADDRESS ,
850
- ERC1155_ID ,
851
- 'invalidNetworkClientId' ,
852
- ) ,
857
+ async ( ) =>
858
+ await messenger . call (
859
+ `AssetsContractController:getERC1155BalanceOf` ,
860
+ TEST_ACCOUNT_PUBLIC_ADDRESS ,
861
+ ERC1155_ADDRESS ,
862
+ ERC1155_ID ,
863
+ 'invalidNetworkClientId' ,
864
+ ) ,
853
865
) . rejects . toThrow ( 'No custom network client was found' ) ;
854
866
messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
855
867
} ) ;
0 commit comments