From e0fcf6301ff8fedc2e403e58b23836d6ad3b6d96 Mon Sep 17 00:00:00 2001 From: Felix Mohr Date: Sun, 21 Jun 2020 14:57:15 +0200 Subject: [PATCH] updating docs: genesis is not a valid block identifier any longer --- docs/web3-eth-contract.rst | 13 ++++++------- docs/web3-eth.rst | 25 ++++++++++++------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index afb686f4002..1f95211b6cc 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -141,10 +141,9 @@ Property The default block parameters can be one of the following: - ``Number|BN|BigNumber``: A block number -- ``"genesis"`` - ``String``: The genesis block +- ``"earliest"`` - ``String``: The genesis block - ``"latest"`` - ``String``: The latest block (current head of the blockchain) - ``"pending"`` - ``String``: The currently mined block (including pending transactions) -- ``"earliest"`` - ``String``: The genesis block Default is ``"latest"``. @@ -749,7 +748,7 @@ Parameters * ``from`` - ``String`` (optional): The address the call "transaction" should be made from. For calls the ``from`` property is optional however it is highly recommended to explicitly set it or it may default to `address(0)` depending on your node or provider. * ``gasPrice`` - ``String`` (optional): The gas price in wei to use for this call "transaction". * ``gas`` - ``Number`` (optional): The maximum gas provided for this call "transaction" (gas limit). -``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`contract.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. Useful for requesting data from or replaying transactions in past blocks. +``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`contract.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. Useful for requesting data from or replaying transactions in past blocks. 3. ``callback`` - ``Function`` (optional): This callback will be fired with the result of the smart contract method execution as the second argument, or with an error object as the first argument. ------- @@ -989,7 +988,7 @@ methods.myMethod.encodeABI myContract.methods.myMethod([param1[, param2[, ...]]]).encodeABI() -Encodes the ABI for this method. The resulting hex string is 32-bit function signature hash plus the passed parameters in Solidity tightly packed format. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. Set the `data` field on `web3.eth.sendTransaction` options as the `encodeABI()` result and it is the same as calling the contract method with `contract.myMethod.send()`. +Encodes the ABI for this method. The resulting hex string is 32-bit function signature hash plus the passed parameters in Solidity tightly packed format. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. Set the `data` field on `web3.eth.sendTransaction` options as the `encodeABI()` result and it is the same as calling the contract method with `contract.myMethod.send()`. Some use cases for `encodeABI()` include: preparing a smart contract transaction for a multisignature wallet, working with offline wallets and cold storage and creating transaction payload for complex smart contract proxy calls. @@ -1102,7 +1101,7 @@ Parameters 1. ``options`` - ``Object`` (optional): The options used for deployment. * ``filter`` - ``Object`` (optional): Let you filter events by indexed parameters, e.g. ``{filter: {myNumber: [12,13]}}`` means all events where "myNumber" is 12 or 13. - * ``fromBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (greater than or equal to) from which to get events on. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. For specific range use :ref:`getPastEvents `. + * ``fromBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (greater than or equal to) from which to get events on. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. For specific range use :ref:`getPastEvents `. * ``topics`` - ``Array`` (optional): This allows to manually set the topics for the event filter. If given the filter property and event signature, (topic[0]) will not be set automatically. 2. ``callback`` - ``Function`` (optional): This callback will be fired for each *event* as the second argument, or an error as the first argument. @@ -1211,8 +1210,8 @@ Parameters 1. ``event`` - ``String``: The name of the event in the contract, or ``"allEvents"`` to get all events. 2. ``options`` - ``Object`` (optional): The options used for deployment. * ``filter`` - ``Object`` (optional): Lets you filter events by indexed parameters, e.g. ``{filter: {myNumber: [12,13]}}`` means all events where "myNumber" is 12 or 13. - * ``fromBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (greater than or equal to) from which to get events on. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. - * ``toBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (less than or equal to) to get events up to (Defaults to ``"latest"``). Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. + * ``fromBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (greater than or equal to) from which to get events on. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. + * ``toBlock`` - ``Number|String|BN|BigNumber`` (optional): The block number (less than or equal to) to get events up to (Defaults to ``"latest"``). Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. * ``topics`` - ``Array`` (optional): This allows manually setting the topics for the event filter. If given the filter property and event signature, (topic[0]) will not be set automatically. 3. ``callback`` - ``Function`` (optional): This callback will be fired with an array of event logs as the second argument, or an error as the first argument. diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index 5147bc29e19..7f3cdce4844 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -188,10 +188,9 @@ Property Default block parameters can be one of the following: - ``Number|BN|BigNumber``: A block number -- ``"genesis"`` - ``String``: The genesis block +- ``"earliest"`` - ``String``: The genesis block - ``"latest"`` - ``String``: The latest block (current head of the blockchain) - ``"pending"`` - ``String``: The currently mined block (including pending transactions) -- ``"earliest"`` - ``String``: The genesis block Default is ``"latest"`` @@ -792,7 +791,7 @@ Parameters ---------- 1. ``String`` - The address to get the balance of. -2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. +2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -833,7 +832,7 @@ Parameters 1. ``String`` - The address to get the storage from. 2. ``Number|String|BN|BigNumber`` - The index position of the storage. -3. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. +3. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 4. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. @@ -871,7 +870,7 @@ Parameters ---------- 1. ``String`` - The address to get the code from. -2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. +2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -910,7 +909,7 @@ Returns a block matching the block number or block hash. Parameters ---------- -1. ``String|Number|BN|BigNumber`` - The block number or block hash. Or the string ``"genesis"``, ``"latest"``, ``"earliest"``, or ``"pending"`` as in the :ref:`default block parameter `. +1. ``String|Number|BN|BigNumber`` - The block number or block hash. Or the string ``"earliest"``, ``"latest"`` or ``"pending"`` as in the :ref:`default block parameter `. 2. ``Boolean`` - (optional, default ``false``) If specified ``true``, the returned block will contain all transactions as objects. If ``false`` it will only contains the transaction hashes. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. @@ -991,7 +990,7 @@ Parameters ---------- -1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"genesis"``, ``"latest"``, ``"earliest"``, or ``"pending"`` as in the :ref:`default block parameter `. +1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"earliest"``, ``"latest"`` or ``"pending"`` as in the :ref:`default block parameter `. 2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -1031,7 +1030,7 @@ Parameters ---------- -1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"genesis"``, ``"latest"``, ``"earliest"``, or ``"pending"`` as in the :ref:`default block parameter `. +1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"earliest"``, ``"latest"`` or ``"pending"`` as in the :ref:`default block parameter `. 2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -1068,7 +1067,7 @@ Returns a blocks uncle by a given uncle index position. Parameters ---------- -1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"genesis"``, ``"latest"``, ``"earliest"``, or ``"pending"`` as in the :ref:`default block parameter `. +1. ``String|Number|BN|BigNumber`` - The block number or hash. Or the string ``"earliest"``, ``"latest"`` or ``"pending"`` as in the :ref:`default block parameter `. 2. ``Number`` - The index position of the uncle. 3. ``Boolean`` - (optional, default ``false``) If specified ``true``, the returned block will contain all transactions as objects. By default it is ``false`` so, there is no need to explictly specify false. And, if ``false`` it will only contains the transaction hashes. 4. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. @@ -1262,7 +1261,7 @@ Parameters ---------- -1. ``String|Number|BN|BigNumber`` - A block number or hash. Or the string ``"genesis"``, ``"latest"``, ``"earliest"``, or ``"pending"`` as in the :ref:`default block parameter `. +1. ``String|Number|BN|BigNumber`` - A block number or hash. Or the string ``"earliest"``, ``"latest"`` or ``"pending"`` as in the :ref:`default block parameter `. 2. ``Number`` - The transaction's index position. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. @@ -1374,7 +1373,7 @@ Parameters ---------- 1. ``String`` - The address to get the numbers of transactions from. -2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. +2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -1688,7 +1687,7 @@ Parameters ---------- 1. ``Object`` - A transaction object, see :ref:`web3.eth.sendTransaction `. For calls the ``from`` property is optional however it is highly recommended to explicitly set it or it may default to `address(0)` depending on your node or provider. -2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. +2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock `. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. ------- @@ -2016,7 +2015,7 @@ Parameters 1. ``String`` 20 Bytes: The Address of the account or contract. 2. ``Number[] | BigNumber[] | BN[] | String[]`` 32 Bytes: Array of storage-keys which should be proofed and included. See :ref:`web3.eth.getStorageAt `. -3. ``Number | String | BN | BigNumber``: Integer block number. Pre-defined block numbers as ``"latest"``, ``"earliest"``, and ``"genesis"`` can also be used. +3. ``Number | String | BN | BigNumber``: Integer block number. Pre-defined block numbers as ``"earliest"``, ``"latest"`` and ``"pending"`` can also be used. 4. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second. -------