From ae84782d0eccaf209e25d6381f34d22786221ca5 Mon Sep 17 00:00:00 2001 From: Micah Zoltu Date: Mon, 23 Sep 2019 16:42:34 +0800 Subject: [PATCH] Removes the optionality on `output` in ABI docs. I _believe_ (someone more knowledgable than I should verify this claim) that Solidity will always write out an `output` member. If there are no return parameters, then the array will be empty, but the `output` property will be present. If this is not correct, I will withdraw this PR, but if the assertion is correct then the docs should reflect that so people can rely on the `output` property being present when writing ABI processors. I also fixed some inconsistency in line termination character. It was sometimes `.` and sometimes `;`. I picked `.`, but don't really care which as long as it is consistent. --- docs/abi-spec.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index 3a6d077d4..3d3e846c8 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -444,17 +444,17 @@ JSON The JSON format for a contract's interface is given by an array of function and/or event descriptions. A function description is a JSON object with the fields: -- ``type``: ``"function"``, ``"constructor"``, or ``"fallback"`` (the :ref:`unnamed "default" function `); -- ``name``: the name of the function; +- ``type``: ``"function"``, ``"constructor"``, or ``"fallback"`` (the :ref:`unnamed "default" function `). +- ``name``: the name of the function. - ``inputs``: an array of objects, each of which contains: - * ``name``: the name of the parameter; + * ``name``: the name of the parameter. * ``type``: the canonical type of the parameter (more below). * ``components``: used for tuple types (more below). -- ``outputs``: an array of objects similar to ``inputs``, can be omitted if function doesn't return anything; -- ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state `), ``view`` (:ref:`specified to not modify the blockchain state `), ``nonpayable`` (function does not accept Ether) and ``payable`` (function accepts Ether); -- ``payable``: ``true`` if function accepts Ether, ``false`` otherwise; +- ``outputs``: an array of objects similar to ``inputs``. +- ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state `), ``view`` (:ref:`specified to not modify the blockchain state `), ``nonpayable`` (function does not accept Ether) and ``payable`` (function accepts Ether). +- ``payable``: ``true`` if function accepts Ether, ``false`` otherwise. - ``constant``: ``true`` if function is either ``pure`` or ``view``, ``false`` otherwise. ``type`` can be omitted, defaulting to ``"function"``, likewise ``payable`` and ``constant`` can be omitted, both defaulting to ``false``. @@ -470,10 +470,10 @@ Constructor and fallback function never have ``name`` or ``outputs``. Fallback f An event description is a JSON object with fairly similar fields: - ``type``: always ``"event"`` -- ``name``: the name of the event; +- ``name``: the name of the event. - ``inputs``: an array of objects, each of which contains: - * ``name``: the name of the parameter; + * ``name``: the name of the parameter. * ``type``: the canonical type of the parameter (more below). * ``components``: used for tuple types (more below). * ``indexed``: ``true`` if the field is part of the log's topics, ``false`` if it one of the log's data segment.