Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Add devdocs to generated contract wrappers #2013

Merged
merged 6 commits into from
Aug 6, 2019

Conversation

xianny
Copy link
Contributor

@xianny xianny commented Jul 30, 2019

Description

Adds devdocs to generated contract-wrappers from Solidity doc comments. Resolves #1903

TODO

  • add test in abi-gen for method params
  • add test in abi-gen for multiline method desc
  • new lines can't be detected in devdocs
  • improve method descriptions for standard methods e.g. callAsync, estimateGasAsync
    - [ ] put generated docs in publish workflow or try new docs workflow ON HOLD

Testing instructions

Run yarn docs and look at generated docs index.html!

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@buildsize
Copy link

buildsize bot commented Jul 30, 2019

File name Previous Size New Size Change
init.py 141.32 KB 141.32 KB 0 bytes (0%)
abi_gen_dummy.ts 103.94 KB [deleted]
lib_dummy.ts 4.74 KB [deleted]
test_lib_dummy.ts 11.37 KB [deleted]
environment.pickle 1.56 MB 1.56 MB 360 bytes (0%)
index.doctree 189.53 KB 189.53 KB 0 bytes (0%)
.buildinfo 230 bytes 230 bytes 0 bytes (0%)
genindex.html 5.6 KB 5.6 KB 0 bytes (0%)
index.html 2.52 KB 2.52 KB 0 bytes (0%)
objects.inv 375 bytes 375 bytes 0 bytes (0%)
py-modindex.html 3.07 KB 3.07 KB 0 bytes (0%)
search.html 2.81 KB 2.81 KB 0 bytes (0%)
searchindex.js 5.83 KB 5.83 KB 0 bytes (0%)
index.rst.txt 415 bytes 415 bytes 0 bytes (0%)
alabaster.css 10.92 KB 10.92 KB 0 bytes (0%)
basic.css 11.83 KB 11.83 KB 0 bytes (0%)
custom.css 42 bytes 42 bytes 0 bytes (0%)
doctools.js 9.05 KB 9.05 KB 0 bytes (0%)
documentation_options.js 303 bytes 303 bytes 0 bytes (0%)
file.png 286 bytes 286 bytes 0 bytes (0%)
jquery-[version].js 261.76 KB 261.76 KB 0 bytes (0%)
jquery.js 84.63 KB 84.63 KB 0 bytes (0%)
language_data.js 10.59 KB 10.59 KB 0 bytes (0%)
minus.png 90 bytes 90 bytes 0 bytes (0%)
plus.png 90 bytes 90 bytes 0 bytes (0%)
pygments.css 4.69 KB 4.69 KB 0 bytes (0%)
searchtools.js 15.61 KB 15.61 KB 0 bytes (0%)
underscore-[version].js 34.34 KB 34.34 KB 0 bytes (0%)
underscore.js 11.86 KB 11.86 KB 0 bytes (0%)
contract_addresses.html 16.87 KB 16.87 KB 0 bytes (0%)
contract_artifacts.html 7.94 KB 7.94 KB 0 bytes (0%)
_bootstrap.html 142.73 KB 142.73 KB 0 bytes (0%)
json_schemas.html 12.43 KB 12.43 KB 0 bytes (0%)
order_utils.html 44.87 KB 44.87 KB 0 bytes (0%)
erc20_token.html 80.14 KB 80.14 KB 0 bytes (0%)
exchange.html 458.9 KB 458.9 KB 0 bytes (0%)
tx_params.html 8.83 KB 8.83 KB 0 bytes (0%)
local_message_signer.html 15.07 KB 15.07 KB 0 bytes (0%)
asset_data_utils.html 22.65 KB 22.65 KB 0 bytes (0%)
default_api.html 118.49 KB 118.49 KB 0 bytes (0%)

@coveralls
Copy link

coveralls commented Jul 30, 2019

Coverage Status

Coverage remained the same at 82.127% when pulling 693ab33 on multilang-1903/devdocs into 78c704e on development.

@xianny xianny marked this pull request as ready for review August 2, 2019 03:07
@xianny xianny requested review from fabioberger and removed request for hysz and abandeali1 August 2, 2019 03:07
Copy link
Contributor

@feuGeneA feuGeneA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also enable doc generation (via package.json) for abi-gen/test-cli? (Note that I requested some changes around your abi-gen-wrappers/package.json; whatever we end up doing there we should also do similarly for test-cli in abi-gen/package.json.)

Can you persist the generated documentation (both for abi-gen-wrappers and abi-gen/test-cli) as CircleCI Build Artifacts? (See store_artifacts tasks in .circleci/config.yml for an example.) That way I don't have to check out and build your branch just to review the doc. 😛

@xianny xianny force-pushed the multilang-1903/devdocs branch from 9d945f6 to ab72e29 Compare August 5, 2019 21:03
@xianny xianny requested a review from feuGeneA August 5, 2019 21:58
Copy link
Contributor

@feuGeneA feuGeneA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biggest (only?) change request is that the Build Artifacts aren't being persisted right (see comment on your config.yml change). Because of that, I still haven't reviewed the generated documentation.

@@ -234,6 +234,8 @@ jobs:
key: coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/python-packages/sra_client/.coverage
- store_artifacts:
path: ~/repo/packages/abi-gen-wrappers/generated_docs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the wrong spot. You've got it persisting artifacts generated as part of test-python, but the docs are generated over in build, not test-python. This addition needs to move over to be part of build. (Concretely, I don't see any abi-gen-wrappers artifacts available in the test-python build results.)

* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _secondsTimeLocked Duration needed after a transaction is confirmed
* and before it becomes executable, in seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My aesthetic eye would like to see wrapped lines (here "and before...") indented 4 spaces, aka a hanging indent. But if this is convention, and, more importantly, if the generated docs look fine, then whatever.

@xianny
Copy link
Contributor Author

xianny commented Aug 6, 2019

Updated. Build artifacts visible here: https://82906-92181371-gh.circle-artifacts.com/0/home/circleci/repo/packages/abi-gen-wrappers/generated_docs/index.html

Right now the goal is to just check that they are valid typedoc i.e. will be generated to readable markdown/html. Will use #2033 when it's ready.

@xianny xianny requested a review from feuGeneA August 6, 2019 19:52
@xianny xianny merged commit 7cd1fd0 into development Aug 6, 2019
@xianny xianny deleted the multilang-1903/devdocs branch August 6, 2019 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add devdoc to typescript generated wrappers
4 participants