@@ -21,25 +21,31 @@ describe('AssetsContractController with NetworkClientId', () => {
2121 it ( 'should throw when getting ERC-20 token balance when networkClientId is invalid' , async ( ) => {
2222 const { messenger } = await setupAssetContractControllers ( ) ;
2323 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+ ) ;
3134 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
3235 } ) ;
3336
3437 it ( 'should throw when getting ERC-20 token decimal when networkClientId is invalid' , async ( ) => {
3538 const { messenger } = await setupAssetContractControllers ( ) ;
3639 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+ ) ;
4349 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
4450 } ) ;
4551
@@ -138,13 +144,14 @@ describe('AssetsContractController with NetworkClientId', () => {
138144 it ( 'should throw error when getting ERC-721 token standard and details when networkClientId is invalid' , async ( ) => {
139145 const { messenger } = await setupAssetContractControllers ( ) ;
140146 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+ ) ,
148155 ) . rejects . toThrow ( 'No custom network client was found' ) ;
149156 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
150157 } ) ;
@@ -153,13 +160,14 @@ describe('AssetsContractController with NetworkClientId', () => {
153160 const { messenger } = await setupAssetContractControllers ( ) ;
154161 const error = 'Unable to determine contract standard' ;
155162 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+ ) ,
163171 ) . rejects . toThrow ( error ) ;
164172 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
165173 } ) ;
@@ -558,11 +566,12 @@ describe('AssetsContractController with NetworkClientId', () => {
558566 it ( 'should throw error when getting ERC-721 NFT symbol when networkClientId is invalid' , async ( ) => {
559567 const { messenger } = await setupAssetContractControllers ( ) ;
560568 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+ ) ,
566575 ) . rejects . toThrow ( 'No custom network client was found' ) ;
567576 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
568577 } ) ;
@@ -672,12 +681,13 @@ describe('AssetsContractController with NetworkClientId', () => {
672681 it ( 'should throw error when getting ERC-721 NFT ownership using networkClientId that is invalid' , async ( ) => {
673682 const { messenger } = await setupAssetContractControllers ( ) ;
674683 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+ ) ,
681691 ) . rejects . toThrow ( 'No custom network client was found' ) ;
682692 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
683693 } ) ;
@@ -792,15 +802,16 @@ describe('AssetsContractController with NetworkClientId', () => {
792802 it ( 'should throw error when transferring single ERC-1155 when networkClientId is invalid' , async ( ) => {
793803 const { messenger } = await setupAssetContractControllers ( ) ;
794804 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+ ) ,
804815 ) . rejects . toThrow ( 'No custom network client was found' ) ;
805816 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
806817 } ) ;
@@ -843,13 +854,14 @@ describe('AssetsContractController with NetworkClientId', () => {
843854 it ( 'should throw error when getting the balance of a ERC-1155 NFT when networkClientId is invalid' , async ( ) => {
844855 const { messenger } = await setupAssetContractControllers ( ) ;
845856 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+ ) ,
853865 ) . rejects . toThrow ( 'No custom network client was found' ) ;
854866 messenger . clearEventSubscriptions ( 'NetworkController:stateChange' ) ;
855867 } ) ;
0 commit comments