Skip to content

Remove exclusions from Makefile#60

Draft
szemate wants to merge 28 commits intomasterfrom
remove-excludes
Draft

Remove exclusions from Makefile#60
szemate wants to merge 28 commits intomasterfrom
remove-excludes

Conversation

@szemate
Copy link
Contributor

@szemate szemate commented Sep 17, 2024

This pull request should be merged after exclusions are added to Solidity code via @custom:exclude NatSpec tags.

Triggering the CI for pushes on development branches that haven't been
published in a PR results in builds that unnecessarily consume the
monthly build quota.
Use the `pyabigen` tool (https://github.com/clearmatics/pyabigen)
to generate Autonity contract bindings.

Use a Makefile instead of the old shell script because it can track
which targets are up-to-date.

All contract functions that are marked with `onlyProtocol` and
`onlyAutonity` modifiers in the contract code are excluded from
the generated bindings with the `--exclude` command line argument.
Execute the Makefile to generate contract bindings for Autonity v0.14.0.
Allow importing contract classes directly from `autonity.contracts` so
that imports are shorter in the module users' code.
Add `plum-dispatch` as dependency because the Stabilization contract
includes overloaded contract functions, see
https://github.com/clearmatics/pyabigen?tab=readme-ov-file#multiple-dispatch

Remove `typing-extensions` because it is not needed any more.
Make it easier for users to connect to Autonity networks by including
data on them in the `autonity.networks` module.

This way a connection to Piccadilly Testnet can be established as:

    w3 = web3.Web3(autonity.networks.piccadilly.http_provider)
Update the Python code snippet in README.md.
Move mypy from test dependencies to lint dependencies and include it in
the lint:check command.
A number of mypy rules were ignored for the "old" autonity module;
these can now be put back.
Extend the developer documentation in README.md.
Add a test generator that generates very basic sanity tests that call
all contract functions from the generated wrappers that don't have any
inputs, using the Piccadilly Testnet RPC.

To be replaced later with tests that spin up an Autonity network.
When a protocol contract gets upgraded its address changes. Therefore
it should not be hard-coded into the wrapper.
Add factory functions that query the protocol contract addresses from
the Autonity contract and ensure that the Autonity contract version
matches the supported one.
Instead of specifying the Autonity contract address in the Makefile and
copying it into the generated binding, specify the contract address in
the factory function where other bindings also get their contract
address.

Also move the native token symbol from networks module as it's the same
in all networks.
There is a good chance that keepers who build with autonity.py would
like to inspect events emitted by Autonity protocol contracts.

The Web3.py event bindings are already accessible as
`wrapper._contract.events.EventName`, however they should be part of the
public API.
As Pyright is more widely used than mypy for type checking.
Generate NumPy-style docstrings from NatSpec files.
The functions to be excluded will be tagged with the @Custom:exclude
natspec tag, which are handled by pyabigen.
Base automatically changed from rework to master October 10, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant