
    (iHl                         d dl Z d dlZd dlZd dlZd dlmZmZmZmZm	Z	 d dl
mZmZmZmZmZ d dlmZ d dlmZmZ d dlmZ d dlmZ d dlmZmZmZ d d	lmZ erd d
lmZ h dZ  G d d      Z! G d de!      Z"y)    N)TYPE_CHECKINGAnyNoReturnSequencecast)AddressChecksumAddress
HexAddressHexStrTypeStr)HexBytes)	AsyncWeb3Web3)ens_addresses)Contract)InvalidAddressMethodNotSupportedWeb3ValueError)	BlockData)AsyncContract>   hashnumber	stateRoot
parentHashtransactionsc                   P   e Zd ZdeddfdZdedefdZej                  j                  ddgd	g ed
      fg dg d ed      fdgdg ed      fddgd	dg ed      fdgdg ed      fdgdg ed      fddgddg ed      fdgdgefdgdg ed       fd!gd"g ed#      fd$gd"g ed#      fd%gd&g ed'      fd(gd)g ed*      fg d+g d,efg d+g d- ed.      fd/gd	d0gd0d	ggg ed1      fd2gg d3g ed4      fd5gg d6g ed4      fd7gd8d9gg ed:      fd;gd8d9gg ed:      fd<gd8gg ed=      fd>gdd?gg ed@      fd>gddAggeff      ddBdCee   dDee   dEeddf
dF       Zej                  j                  dGdgdHg ed       fd>gdHdIgg ed@      ff      ddBdCee   dDee   dEeddf
dJ       Zej                  j                  dKdgd?d	gfddgd?gfg d?gff      ddBdCee   dDee   ddfdL       ZdUdMZddBdNeddfdOZddBdNeddfdPZdUdQZdUdRZddBdNeddfdSZ	 	 	 	 dUdTZy)VWeb3ModuleTestw3returnNc                 >    |j                   }| j                  |       y Nclient_version_check_web3_client_version)selfr   r#   s      W/var/www/br/venv/lib/python3.12/site-packages/web3/_utils/module_testing/web3_module.pytest_web3_client_versionz'Web3ModuleTest.test_web3_client_version5   s    **''7    r#   c                     t        d      )Nz!Must be implemented by subclasses)NotImplementedError)r%   r#   s     r&   r$   z)Web3ModuleTest._check_web3_client_version9   s    !"EFFr(   ztypes,values,expectedboolTB0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2)uint8r-   r-   )a   b   c   B0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45uint248   B0x30f95d210785601eb33ae4d53d405b26f920e765dff87cca8e9a4aec99f82671uint16+  B0xed18599ccd80ee9fae9a28b0e34a5573c3233d7468f808fd659bc171cf0b43bdint256iB0xd6fb717f7e270a360f5093ce6a7a3752183e89c9a9afe5c0cb54b458a304d3d5
   B0xc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8int8r-      B0x5c6ab1e634c08d9c0f4df4d789e8727943ef010dd7ca8e3c89de197a26d148beaddress*0x49eddd3769c0712032808d86597b84ac5c2f5614*0x49EdDD3769c0712032808D86597B84ac5c2F5614B0x2ff37b5607484cd4eecf6d13292e22bd6e5401eaffcc07e279583bc742c68882bytes20x5402B0x4ed9171bda52fca71ab28e7f452bd6eacc3e5a568a47e0fa53b503159a9b8910bytes3bytesf0x636865636b6c6f6e6762797465737472696e67616761696e7374736f6c6964697479736861336861736866756e6374696f6eB0xd78a84d65721b67e4011b10c99dafdedcdcd7cb30153064f773e210b4762e22fstringtesting a string!B0xe8c275c0b4070a5ec6cfcb83f0ba394b30ddd283de785d43f2eabfb04bd96747)rJ   r+   r5   rC   r?   )rK   Fr6   rD   r@   )rK   Fr6   rD   rA   B0x8cc6eabb25b842715e8ca39e2524ed946759aa37bfb7d4b81829cf5a7e266103z	bool[2][]FB0x1eef261f2eb51a8c736d52be3f91ff79e78a9ec5df2b7f50d0c6f98ed1e2bc06zbool[])TFTB0x5c6090c0461491a2941743bda5c3658bf1ea53bbd3edcde54e16205e18b45792zuint24[])   r   rP   zuint8[2]   	   B0xc7694af312c4f286114180fd0ba6a52461fcee8a381636770b19a343af92538az
uint256[2]zuint8[]B0xf3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3z	address[]*0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5B0xb98565c0c26a962fd54d93b0ed6fb9296e03e9da29d2281ed3e3473109ef7dde*0xa6b759bbbf4b59d24acf7e06e79f3a5d104fdce5r   typesvaluesexpectedc                     t        |t              rAt        |t              r1t	        j
                  |      5  |j                  ||       d d d        y |j                  ||      }||k(  sJ y # 1 sw Y   y xY wr!   )
isinstancetype
issubclass	Exceptionpytestraisessolidity_keccakr%   r   rX   rY   rZ   actuals         r&   test_solidity_keccakz#Web3ModuleTest.test_solidity_keccak>   sj    @ h%*Xy*Ix( 2""5&12##E62!!!2s   A,,A5ztypes, values, expectedone.ethtwo.ethc                 t   t        |t        t        t        d                  t        t        t        d                  d      5  t	        j
                  t              5  t        j                  ||       d d d        |j                  ||      }||k(  sJ 	 d d d        y # 1 sw Y   ,xY w# 1 sw Y   y xY w)NrA   rU   )rf   rg   )	r   r	   r
   r   r`   ra   r   r   rb   rc   s         r&   test_solidity_keccak_ensz'Web3ModuleTest.test_solidity_keccak_ens  s    4 *v&RST +v&RST	

 	& ~. 4$$UF34 ''v6FX%%%#	& 	&4 4	& 	&s$   B. B"7!B."B+	'B..B7ztypes,valuesc                     t        j                  t              5  |j                  ||       d d d        y # 1 sw Y   y xY wr!   )r`   ra   
ValueErrorrb   )r%   r   rX   rY   s       r&   4test_solidity_keccak_same_number_of_types_and_valueszCWeb3ModuleTest.test_solidity_keccak_same_number_of_types_and_values3  s5     ]]:& 	.uf-	. 	. 	.s   6?c                 (    |j                         sJ y r!   )is_connected)r%   r   s     r&   test_is_connectedz Web3ModuleTest.test_is_connectedA  s       r(   math_contractc                 f   |j                         5 }|j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j
                  g d|j                  j                  g di       t        |j                        dk(  sJ |j                         }t        |      dk(  sJ |j                  g k(  sJ |j                  j                  rJ t        j                  t        d	      5  |j                  |j                  j                  d
             d d d        t        j                  t        d	      5  |j                          d d d        d d d        |j                  j                  }t!        |t"              sJ t%        t&        t(           d d       }|d   d   dk(  sJ |d   d   dk(  sJ |d   d   dk(  sJ |d   d   dk(  sJ t%        t&        t"           |dd       }|d   dk(  sJ |d   dk(  sJ |d   dk(  sJ |d   dk(  sJ t%        t&        t(           |dd        }|d   d   dk(  sJ |d   d   dk(  sJ |d   d   d
k(  sJ y # 1 sw Y   @xY w# 1 sw Y   xY w# 1 sw Y   xY wN         r   )rP   ru      )rP   rv         ,Batch has already been executed or cancelledmatchrw   r   rP   rv   rQ            )batch_requestsaddeth	get_block	functions	multiply7add_mappinglen_requests_infoexecuteprovider_is_batchingr`   ra   r   block_numberr\   intr   r   r   )	r%   r   rp   batch	responses	block_numfirst_four_responsesresponses_five_through_eightlast_three_responsess	            r&   test_batch_requestsz"Web3ModuleTest.test_batch_requestsD  s)     "	 EIIbff&&q)*IIbff&&q)*IIbff&&q)*IIbff&&q)*IIm--77:;!++55yFF$$i u++,222Iy>R''' ''2---{{//// D / 		"&&**1-.	/ D   	 ="	 J FF''	)S)))48Y2A5
 $A&x0A555#A&x0A555#A&x0A555#A&x0A5556:SM9Qq>7
$ ,A.!333+A.!333+A."444+A."44448Y125
 $A&x0A555#A&x0A555#A&x0A555M/ /   ="	  "	 s<   FL&#+L#L&1LL&L	L&L#	L&&L0c                    |j                         }|j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j
                  ddg|j                  j                  ddgi       t        |j                        dk(  sJ |j                         \  }}}}}}	}
|j                  g k(  sJ |j                  j                  rJ t        j                  t        d      5  |j                  |j                  j                  d	             d d d        t        j                  t        d      5  |j                          d d d        |j                  j                  }t!        |t"              sJ t%        t&        |      d
   dk(  sJ t%        t&        |      d
   dk(  sJ t%        t"        |      dk(  sJ t%        t"        |      dk(  sJ t%        t"        |      dk(  sJ t%        t&        |	      d
   dk(  sJ t%        t&        |
      d
   dk(  sJ y # 1 sw Y   xY w# 1 sw Y   xY wNrP   ru   r   rv   rt   r|   ry   rz   rw   r   r}   )r   r   r   r   r   r   r   r   r   r   r   r   r`   ra   r   r   r\   r   r   r   )r%   r   rp   r   b1b2m0m1m2b3b4r   s               r&   )test_batch_requests_initialized_as_objectz8Web3ModuleTest.test_batch_requests_initialized_as_object  s:    !!#		"&&""1%&		"&&""1%&		-))33A67$$..A8H8H1a&Q	
 5''(A---%*]]_"BBB ##r)));;++++ ]]@
 	+ IIbff&&q)*		+ ]]@
 	 MMO		 FF''	)S)))Ir"8,111Ir"8,111C}!!!C}!!!C}"""Ir"8,111Ir"8,111/	+ 	+	 	s   +I5J5I?Jc                 .   |j                         5 }|j                  |j                  j                  d             |j                  |j                  j                  d             t	        |j
                        dk(  sJ |j                          |j
                  g k(  sJ |j                  |j                  j                  d             |j                  |j                  j                  d             |j                         \  }}t        t        |      d   dk(  sJ t        t        |      d   dk(  sJ 	 d d d        |j                         }|j                  |j                  j                  d             t	        |j
                        dk(  sJ |j                          |j
                  g k(  sJ |j                  |j                  j                  d             |j                         \  }t        t        |      d   dk(  sJ y # 1 sw Y   xY wNrP   ru   rv   rt   r   rw   rs   )
r   r   r   r   r   r   clearr   r   r   )r%   r   r   r1r2	new_batchr3s          r&   test_batch_requests_clearz(Web3ModuleTest.test_batch_requests_clear  s     	6EIIbff&&q)*IIbff&&q)*u++,111KKM''2---IIbff&&q)*IIbff&&q)*]]_FB	2&x0A555	2&x0A555	6  %%'	bff&&q)*9++,111''2---bff&&q)*!!#Ir"8,1113	6 	6s   D'HHc                 d   |j                         5 }|j                  |j                  j                  d             |j	                          t        j                  t        d      5  |j                  |j                  j                  d             d d d        t        j                  t        d      5  |j                          d d d        d d d        |j                  j                  }t        |t              sJ |j                         }|j                  |j                  j                  d             |j	                          t        j                  t        d      5  |j                  |j                  j                  d             d d d        t        j                  t        d      5  |j                          d d d        |j                  j                  }t        |t              sJ y # 1 sw Y   cxY w# 1 sw Y   <xY w# 1 sw Y   AxY w# 1 sw Y   xY w# 1 sw Y   exY wNrP   ry   rz   ru   )r   r   r   r   cancelr`   ra   r   r   r   r\   r   )r%   r   r   r   r   s        r&   test_batch_requests_cancelz)Web3ModuleTest.test_batch_requests_cancel  s     	 EIIbff&&q)*LLND / 		"&&**1-.	/
 D   	 	  FF''	)S))) %%'	bff&&q)*]]@
 	/ MM"&&**1-.		/
 ]]@
 	  		  FF''	)S)))A/ /
   	  	 ,	/ 	/
	  	 sT   AH'+G3#H5H H#+H1H&3G=	8H H
	HHH#&H/c           	         |j                         5 }t        j                  t        d      5  |j	                  |j
                  j                  i              |j                          d d d        d d d        |j                         5 }t        j                  t        d      5  |j	                  |j                  j                  d      j                  i              |j                          d d d        d d d        |j                         5 }t        j                  t        d      5  |j	                  |j
                  j                  d             |j                          d d d        d d d        |j                         5 }t        j                  t        d      5  |j	                  |j
                  j                  t        d                   |j                          d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   $xY w# 1 sw Y   )xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   ^xY w# 1 sw Y   y xY wNeth_sendTransactionrz   rP   eth_sendRawTransactionr(   eth_signs                       )r   r`   ra   r   r   r   send_transactionr   r   r   transactsend_raw_transactionsignr   )r%   r   rp   r   s       r&   9test_batch_requests_raises_for_common_unsupported_methodszHWeb3ModuleTest.test_batch_requests_raises_for_common_unsupported_methods  s      	 E19NO  		"&&11"56 	 
   	 E19NO  		-11;;A>GGKL 	 
   	 E19QR  		"&&55c:; 	 
   	 E1D  		"&&++gl&;<= 	  	    	  	    	  	    	  	    	  	 s   H;G6(HH$A
H.HH6*;H*%H6I!AI%I6H 	;HHH	HH'*H3	/H66H?I	IIc                    dg g dfd}dfd}t        j                  |      }t        j                  |      }|j                          |j                          |j                          |j                          |j	                         rJ |j	                         rJ t              k(  sJ t              k(  sJ t        d D              sJ t              t              k(  sJ y )N(   c                      t              D ]A  } j                  j                  j                  d             t	        j
                  d       C y Nr   {Gz?)rangeappendr   r   timesleep)_num_requestsr   r   s    r&   make_regular_requestszdWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.make_regular_requests  s@    <( !  !1!1!!45

4 !r(   c                  ,   j                         5 } t              D ]A  }| j                  j                  j	                  d             t        j                  d       C j                  | j                                d d d        y # 1 sw Y   y xY wr   )	r   r   r   r   r   r   r   extendr   )r   r   batch_responser   r   s     r&   make_batch_requestzaWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.make_batch_request  sw    ""$ 7|, %AIIbff..q12JJt$% %%emmo6	7 7 7s   A/B

B)targetc              3   b   K   | ]'  }t         j                  |j                                ) y wr!   SOME_BLOCK_KEYSissubsetkeys.0responses     r&   	<genexpr>zXWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.<genexpr>,  !     W?++HMMO<W   -/r   N)	threadingThreadstartjoinis_aliver   allset)	r%   r   r   r   regular_threadbatch_threadr   r   r   s	    `    @@@r&   6test_batch_requests_concurrently_with_regular_requestszEWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests
  s     		!
	7 #))1FG ''/AB 	!**,,,((***9~--->"l222WYWWWW9~^!4444r(   )r   r   r   N)__name__
__module____qualname__r   r'   strr   r$   r`   markparametrizer   r   r   r   r   re   ri   rl   ro   r   r   r   r   r   r   r    r(   r&   r   r   4   s   84 8D 8G G G
 [[ X ,X X "sX 
X 
X !b	X => =>X 

X 

X 	Q X	 
$%X B 
 B X -%/0X 
$%X X QX QX X  ED X  ED 	Wu	
xr""  " 	"
 " 
"sxr" [[! X Y'(X	
&&&  & 	&
 & 
&'&&4 [[[GNO #O"PQ>?@	
..!)'!2.<DSM.	..!>6f >6X >6$ >6@*2*2)1*2	*2X28%*N  )1 	 .#5#5	#5r(   r   c                      e Zd Zej                  j
                  dee   ddfd       Zej                  j
                  dee   ddddfd       Z	ej                  j
                  dee   ddddfd       Z
ej                  j
                  dee   ddfd	       Zej                  j
                  dee   ddfd
       Zej                  j
                  dee   ddddfd       Zej                  j
                  dee   ddfd       Zy)AsyncWeb3ModuleTestasync_w3r   Nc                 Z   K   |j                    d {   }| j                  |       y 7 wr!   r"   )r%   r   r#   s      r&   r'   z,AsyncWeb3ModuleTest.test_web3_client_version7  s'     '666''7 7s   +)+async_math_contractr   c                   K   |j                         4 d {   }|j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j
                  g d|j                  j                  g di       t        |j                        dk(  sJ |j                          d {   }t        |      dk(  sJ |j                  g k(  sJ |j                  j                  rJ t        j                  t        d	      5  |j                  |j                  j                  d
             d d d        t        j                  t        d	      5  |j                          d {    d d d        d d d       d {    |j                  j                   d {   }t!        |t"              sJ t%        t&        t(           d d       }|d   d   dk(  sJ |d   d   dk(  sJ |d   d   dk(  sJ |d   d   dk(  sJ t%        t&        t"           |dd       }|d   dk(  sJ |d   dk(  sJ |d   dk(  sJ |d   dk(  sJ t%        t&        t(           |dd        }|d   d   dk(  sJ |d   d   dk(  sJ |d   d   d
k(  sJ y 7 7 # 1 sw Y   ^xY w7 2# 1 sw Y   2xY w7 *# 1 d {  7  sw Y   ;xY w7 %wrr   )r   r   r   r   r   r   r   r   _async_requests_infoasync_executer   r   r`   ra   r   r   r\   r   r   r   r   )	r%   r   r   r   r   r   r   r   r   s	            r&   r   z'AsyncWeb3ModuleTest.test_batch_requests<  sq     **, #	, #	,IIhll,,Q/0IIhll,,Q/0IIhll,,Q/0IIhll,,Q/0II)33==a@A'11;;YLL**I u112b888#1133Iy>R''' --333((5555 D 5 		(,,0034	5 D , ))+++	,?#	, #	,L #,,333	)S)))48Y2A5
 $A&x0A555#A&x0A555#A&x0A555#A&x0A5556:SM9Qq>7
$ ,A.!333+A.!333+A."444+A."44448Y125
 $A&x0A555#A&x0A555#A&x0A555}#	,  45 5 ,	, ,?#	, #	, #	, #	,L 4s   M5L6M5EML9AM5+L< #MMM	MM$M5/M0M5M2C)M59M<M	M	MM	MM5M/"M%#M/*	M5c                 b  K   |j                         }|j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j                  d             |j                  |j                  j
                  ddg|j                  j                  ddgi       t        |j                        dk(  sJ |j                          d {   \  }}}}}}	}
|j                  g k(  sJ |j                  j                  rJ t        j                  t        d      5  |j                  |j                  j                  d	             d d d        t        j                  t        d      5  |j                          d {    d d d        |j                  j                   d {   }t!        |t"              sJ t%        t&        |      d
   dk(  sJ t%        t&        |      d
   dk(  sJ t%        t"        |      dk(  sJ t%        t"        |      dk(  sJ t%        t"        |      dk(  sJ t%        t&        |	      d
   dk(  sJ t%        t&        |
      d
   dk(  sJ y 7 # 1 sw Y   xY w7 # 1 sw Y   xY w7 ԭwr   )r   r   r   r   r   r   r   r   r   r   r   r   r`   ra   r   r   r\   r   r   r   )r%   r   r   r   r   r   r   r   r   r   r   r   s               r&   r   z=AsyncWeb3ModuleTest.test_batch_requests_initialized_as_object  sh     '')		(,,((+,		(,,((+,		%//99!<=#--77!Q&&A	
 5--.!333+0+>+>+@%@"BBB ))R///$$1111 ]]@
 	1 IIhll,,Q/0		1 ]]@
 	( %%'''		( #,,333	)S)))Ir"8,111Ir"8,111C}!!!C}!!!C}"""Ir"8,111Ir"8,111= &A	1 	1 (		( 	( 4sb   C=J/?J AJ/+J;#J/J!2J3J!7!J/J-B7J/JJ/J!!J*&J/c                   K   |j                         4 d {   }|j                  |j                  j                  d             |j                  |j                  j                  d             t	        |j
                        dk(  sJ |j                          |j
                  g k(  sJ |j                  |j                  j                  d             |j                  |j                  j                  d             |j                          d {   \  }}t        t        |      d   dk(  sJ t        t        |      d   dk(  sJ d d d       d {    |j                         }|j                  |j                  j                  d             t	        |j
                        dk(  sJ |j                          |j
                  g k(  sJ |j                  |j                  j                  d             |j                          d {   \  }t        t        |      d   dk(  sJ y 7 7 7 # 1 d {  7  sw Y   xY w7 <wr   )
r   r   r   r   r   r   r   r   r   r   )r%   r   r   r   r   r   r   s          r&   r   z-AsyncWeb3ModuleTest.test_batch_requests_clear  s    **, 	6 	6IIhll,,Q/0IIhll,,Q/0u112a777KKM--333IIhll,,Q/0IIhll,,Q/0 ..00FB	2&x0A555	2&x0A555	6 	6  ++-	hll,,Q/09112a777--333hll,,Q/0--//Ir"8,1113	6 1	6 	6 	6 	60 0sd   IH,IC7H4H/7H4
IH2B6II	 I/H42I4I:H=;IIc                   K   |j                         4 d {   }|j                  |j                  j                  d             |j	                          t        j                  t        d      5  |j                  |j                  j                  d             d d d        t        j                  t        d      5  |j                          d {    d d d        d d d       d {    |j                  j                   d {   }t        |t              sJ |j                         }|j                  |j                  j                  d             |j	                          t        j                  t        d      5  |j                  |j                  j                  d             d d d        t        j                  t        d      5  |j                          d {    d d d        |j                  j                   d {   }t        |t              sJ y 7 # 1 sw Y   xY w7 b# 1 sw Y   bxY w7 Z# 1 d {  7  sw Y   kxY w7 U# 1 sw Y   xY w7 # 1 sw Y   xY w7 mwr   )r   r   r   r   r   r`   ra   r   r   r   r\   r   )r%   r   r   r   r   s        r&   r   z.AsyncWeb3ModuleTest.test_batch_requests_cancel  s     **, 	, 	,IIhll,,Q/0LLND 5 		(,,0034	5
 D , ))+++	,	, 	, #,,333	)S))) ++-	hll,,Q/0]]@
 	5 MM(,,0034		5
 ]]@
 	, ))+++		, #,,333	)S)))G	,5 5 ,	, ,	, 	, 	, 	, 4	5 	5 ,		, 	, 4s   I=H%I=AI1+H(#I?H8H5H8I I=+I,I=	I
A;I=+I!0#I=I/'I-(I/,!I=I;I=(H2	-I5H88I	=II=III	I=!I*&I=-I//I84I=c           	        K   |j                         4 d {   }t        j                  t        d      5  |j	                  |j
                  j                  i              |j                          d {    d d d        d d d       d {    |j                         4 d {   }t        j                  t        d      5  |j	                  |j                  j                  d      j                  i              |j                          d {    d d d        d d d       d {    |j                         4 d {   }t        j                  t        d      5  |j	                  |j
                  j                  d             |j                          d {    d d d        d d d       d {    |j                         4 d {   }t        j                  t        d      5  |j	                  |j
                  j                  t        d                   |j                          d {    d d d        d d d       d {    y 7 A7 # 1 sw Y   xY w7 # 1 d {  7  sw Y   xY w7 7 t# 1 sw Y   txY w7 l# 1 d {  7  sw Y   }xY w7 l7 # 1 sw Y   xY w7 	# 1 d {  7  sw Y   xY w7 	7 # 1 sw Y   xY w7 # 1 d {  7  sw Y   y xY wwr   )r   r`   ra   r   r   r   r   r   r   r   r   r   r   r   )r%   r   r   r   s       r&   r   zMAsyncWeb3ModuleTest.test_batch_requests_raises_for_common_unsupported_methods  s|     **, 	, 	,19NO ,		(,,77;<))+++,	, 	,
 **, 	, 	,19NO ,		-77AA!DMMbQR))+++,	, 	,
 **, 	, 	,19QR ,		(,,;;C@A))+++,	, 	,
 **, 	, 	,1D ,		(,,++GL,ABC))+++,	, 	, 	,	, ,, ,	, 	, 	, 	,
	, ,, ,	, 	, 	, 	,
	, ,, ,	, 	, 	, 	,
	, ,, ,	, 	, 	, 	,s  LILI.>I5I6I:I.LI+L&J'L*JAJ
JJ
J L+J,LJ0LK$>J6"J3#J6'K/L:K;LKLK/3AK!:K;K!?K/LK-LII(	#I.+L.J4I75J<	LJ

J	JLJ- J#!J-(	L3J66K 	;KLKKK	LK!!K*	&K/-L/L5K86L=Lc                 j  K   g g j                   j                   d {   dfd}dfd}t        j                   |        |              d {    t	              k(  sJ t	              k(  sJ t        d D              sJ t              t              k(  sJ y 7 7 Tw)Nc                     K   t              D ]Q  } j                  j                  j                  |        d {          t	        j
                  d       d {    S y 7 (7 	wNr   )r   r   r   r   asyncior   )ir   
num_blocksr   s    r&   r   ziAsyncWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.make_regular_requests  sT     :& *  x||'='=a'@!@AmmD)))*!@)s!   8A(A$
 A(A&A(&A(c                    K   j                         4 d {   } t              D ]I  }| j                  j                  j	                  |             t        j                  d       d {    K j                  | j                          d {          d d d       d {    y 7 7 @7 7 # 1 d {  7  sw Y   y xY wwr   )	r   r   r   r   r   r   r   r   r   )r   r   r   r   r   s     r&   r   zfAsyncWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.make_batch_request  s     ..0 C CEz* .AIIhll44Q78!-----. %%E,?,?,A&AB	C C C .&A	C C C Csi   C	B,C	AB4-B..$B4B0
B4C	&B2'C	.B40B42C	4C:B=;CC	c              3   b   K   | ]'  }t         j                  |j                                ) y wr!   r   r   s     r&   r   z]AsyncWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests.<locals>.<genexpr>-  r   r   r   )r   r   r   gatherr   r   r   )r%   r   r   r   r   r   r   s    `  @@@r&   r   zJAsyncWeb3ModuleTest.test_batch_requests_concurrently_with_regular_requests  s      	#<<444
	*
	C nn!# 
 	
 	

 9~+++>"j000WYWWWW9~^!4444- 5	
s"   B3B/7B3B1AB31B3)r   r   r   r`   r   r   r   r   r'   r   r   r   r   r   r   r   r(   r&   r   r   3  s    [[8y~ 8$ 8 8 [[A6!#A6=LA6	A6 A6F [[/2C./2 -/2 
	/2 /2b [[2	# 24 2 28 [[%*3 %*D %* %*N [[,C., -, 
	, ,2 [[5!#5	5 5r(   r   )#r`   r   r   r   typingr   r   r   r   r   
eth_typingr   r	   r
   r   r   hexbytesr   web3r   r   web3._utils.ensr   web3.contractr   web3.exceptionsr   r   r   
web3.typesr   r   r   r   r   r   r(   r&   <module>r      su          
 
 Py5 y5~{5. {5r(   