Consensys / web3js-eea

EEA JavaScript libraries.
Mozilla Public License 2.0
35 stars 40 forks source link

Set gasPrice and gasLimit dynamically #159

Closed marcosio closed 3 years ago

marcosio commented 3 years ago

To make the use of the web3j-eea library more flexible to more use cases, we propose to set the gasPrice or the gasLimit globally or in each transaction.

We propose to change EEAClient constructor to receive gasPrice and gasLimit as optional parameters, with the default values of the current GAS_PRICE and GAS_LIMIT constants. In this way, users will be able to assign global default values to the gasPrice and gasLimit, which will be applied to all transactions.

On the other hand, if the user sets gasPrice and gasLimit when issuing a transaction (by setting this values in the "options" argument of the sendRawTransaction function), they will be applied only to that transaction, overwriting the global default values mentioned in the previous paragraph.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

achraf17 commented 3 years ago

+1

achraf17 commented 3 years ago

LGTM