@@ -247,6 +247,11 @@ Each Contract Factory exposes the following methods.
247
247
.. py :classmethod :: Contract.constructor(* args, ** kwargs).estimateGas(transaction = None , block_identifier = None )
248
248
:noindex:
249
249
250
+ .. warning :: Deprecated: This method is deprecated in favor of :py:meth:`Contract.constructor(*args, **kwargs).estimate_gas`
251
+
252
+ .. py :classmethod :: Contract.constructor(* args, ** kwargs).estimate_gas(transaction = None , block_identifier = None )
253
+ :noindex:
254
+
250
255
Estimate gas for constructing and deploying the contract.
251
256
252
257
This method behaves the same as the
@@ -264,12 +269,17 @@ Each Contract Factory exposes the following methods.
264
269
265
270
.. code-block :: python
266
271
267
- >> > token_contract.constructor(web3.eth.coinbase, 12345 ).estimateGas ()
272
+ >> > token_contract.constructor(web3.eth.coinbase, 12345 ).estimate_gas ()
268
273
12563
269
274
270
275
.. py :classmethod :: Contract.constructor(* args, ** kwargs).buildTransaction(transaction = None )
271
276
:noindex:
272
277
278
+ .. warning :: Deprecated: This method is deprecated in favor of :py:meth:`Contract.constructor(*args, **kwargs).build_transaction`
279
+
280
+ .. py :classmethod :: Contract.constructor(* args, ** kwargs).build_transaction(transaction = None )
281
+ :noindex:
282
+
273
283
Construct the contract deploy transaction bytecode data.
274
284
275
285
If the contract takes constructor parameters they should be provided as
@@ -286,7 +296,7 @@ Each Contract Factory exposes the following methods.
286
296
' gasPrice' : w3.eth.gas_price,
287
297
' chainId' : None
288
298
}
289
- >> > contract_data = token_contract.constructor(web3.eth.coinbase, 12345 ).buildTransaction (transaction)
299
+ >> > contract_data = token_contract.constructor(web3.eth.coinbase, 12345 ).build_transaction (transaction)
290
300
>> > web3.eth.send_transaction(contract_data)
291
301
292
302
.. _contract_createFilter :
@@ -835,14 +845,18 @@ Methods
835
845
836
846
.. py :method :: ContractFunction.estimateGas(transaction, block_identifier = None )
837
847
848
+ .. warning :: Deprecated: This method is deprecated in favor of :class:`~estimate_gas`
849
+
850
+ .. py :method :: ContractFunction.estimate_gas(transaction, block_identifier = None )
851
+
838
852
Call a contract function, executing the transaction locally using the
839
853
``eth_call `` API. This will not create a new public transaction.
840
854
841
855
Refer to the following invocation:
842
856
843
857
.. code-block :: python
844
858
845
- myContract.functions.myMethod(* args, ** kwargs).estimateGas (transaction)
859
+ myContract.functions.myMethod(* args, ** kwargs).estimate_gas (transaction)
846
860
847
861
This method behaves the same as the :py:meth: `ContractFunction.transact ` method,
848
862
with transaction details being passed into the end portion of the
@@ -853,7 +867,7 @@ Methods
853
867
854
868
.. code-block :: python
855
869
856
- >> > my_contract.functions.multiply7(3 ).estimateGas ()
870
+ >> > my_contract.functions.multiply7(3 ).estimate_gas ()
857
871
42650
858
872
859
873
.. note ::
@@ -863,13 +877,17 @@ Methods
863
877
864
878
.. py :method :: ContractFunction.buildTransaction(transaction)
865
879
880
+ .. warning :: Deprecated: This method is deprecated in favor of :class:`~build_transaction`
881
+
882
+ .. py :method :: ContractFunction.build_transaction(transaction)
883
+
866
884
Builds a transaction dictionary based on the contract function call specified.
867
885
868
886
Refer to the following invocation:
869
887
870
888
.. code-block :: python
871
889
872
- myContract.functions.myMethod(* args, ** kwargs).buildTransaction (transaction)
890
+ myContract.functions.myMethod(* args, ** kwargs).build_transaction (transaction)
873
891
874
892
This method behaves the same as the :py:meth: `Contract.transact ` method,
875
893
with transaction details being passed into the end portion of the
@@ -881,15 +899,15 @@ Methods
881
899
882
900
.. code-block :: python
883
901
884
- >> > math_contract.functions.increment(5 ).buildTransaction ({' nonce' : 10 })
902
+ >> > math_contract.functions.increment(5 ).build_transaction ({' nonce' : 10 })
885
903
886
904
You may use :meth: `~web3.eth.Eth.getTransactionCount ` to get the current nonce
887
905
for an account. Therefore a shortcut for producing a transaction dictionary with
888
906
nonce included looks like:
889
907
890
908
.. code-block :: python
891
909
892
- >> > math_contract.functions.increment(5 ).buildTransaction ({' nonce' : web3.eth.get_transaction_count(' 0xF5...' )})
910
+ >> > math_contract.functions.increment(5 ).build_transaction ({' nonce' : web3.eth.get_transaction_count(' 0xF5...' )})
893
911
894
912
Returns a transaction dictionary. This transaction dictionary can then be sent using
895
913
:meth: `~web3.eth.Eth.send_transaction `.
@@ -899,7 +917,7 @@ Methods
899
917
900
918
.. code-block :: python
901
919
902
- >> > math_contract.functions.increment(5 ).buildTransaction ({' maxFeePerGas' : 2000000000 , ' maxPriorityFeePerGas' : 1000000000 })
920
+ >> > math_contract.functions.increment(5 ).build_transaction ({' maxFeePerGas' : 2000000000 , ' maxPriorityFeePerGas' : 1000000000 })
903
921
{
904
922
' to' : ' 0x6Bc272FCFcf89C14cebFC57B8f1543F5137F97dE' ,
905
923
' data' : ' 0x7cf5dab00000000000000000000000000000000000000000000000000000000000000005' ,
0 commit comments