From 791b0a7b41874a3806c3457b4d5f93ced623cac7 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 10:10:13 -0500 Subject: [PATCH 01/15] docs: update deploy receipt --- docs/userguides/transactions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index 5c431fb3a9..e4e33d6952 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -22,7 +22,7 @@ def deploy(): return account.deploy(project.MyContract) ``` -To get the receipt of a `deploy` transaction, use the [ContractInstance.receipt](../methoddocs/contracts.html#ape.contracts.base.ContractInstance.receipt) property: +To get the receipt of a `deploy` transaction, use the [ContractInstance.creation_metadata](../methoddocs/contracts.html#ape.contracts.base.ContractInstance.creation_metadata) property: ```python from ape import accounts, project @@ -31,7 +31,7 @@ dev = accounts.load("dev") contract = project.MyContract.deploy(sender=dev) # The receipt is available on the contract instance and has the expected sender. -receipt = contract.receipt +receipt = contract.creation_metadata.receipt assert receipt.sender == dev ``` From d537dbed9558af9badca026d92fe38730fc1df80 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 11:48:35 -0500 Subject: [PATCH 02/15] docs: change geth to node --- docs/userguides/config.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/userguides/config.md b/docs/userguides/config.md index 716012b0a5..d0e71be669 100644 --- a/docs/userguides/config.md +++ b/docs/userguides/config.md @@ -15,7 +15,7 @@ Most of the features in this guide are documented more-fully elsewhere in the us However, here is a list of common-use cases requiring the `ape-config.yaml` file to help you: -1. Setting up a custom node RPC: See the [geth](#geth) section. +1. Setting up a custom node RPC: See the [node](#node) section. 2. Setting up project dependencies: See the [dependencies](#dependencies) section. 3. Declaring your project's plugins: See the [plugins](#plugins) section. @@ -87,13 +87,13 @@ contract = project.MyContract.deployments[0] **NOTE**: Ape does not add or edit deployments in your `ape-config.yaml` file. -## Geth +## Node -When using the `geth` provider, you can customize its settings. +When using the `node` provider, you can customize its settings. For example, to change the URI for an Ethereum network, do: ```yaml -geth: +node: ethereum: mainnet: uri: http://localhost:5030 From 8a2699a0a24ea89fba56dd2dc6df38ba3e5cd7bc Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 11:49:15 -0500 Subject: [PATCH 03/15] docs: expand on creation_metadata --- docs/userguides/transactions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index e4e33d6952..2a1381ef86 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -24,6 +24,12 @@ def deploy(): To get the receipt of a `deploy` transaction, use the [ContractInstance.creation_metadata](../methoddocs/contracts.html#ape.contracts.base.ContractInstance.creation_metadata) property: +Additionally, you can find the `.deployer`, `.proxy` and whatever else on the creaton metadata which may come in handy. + +```{note} +Use `ape-etherscan` or a node with Otterscan for increased support for these features. +``` + ```python from ape import accounts, project From 2f3ebcd33623d274c3cc3c62b36579c37273dee6 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 12:38:45 -0500 Subject: [PATCH 04/15] docs: update notes --- CONTRIBUTING.md | 8 ++++++-- docs/userguides/accounts.md | 23 ++++++++++++++--------- docs/userguides/config.md | 8 ++++++-- docs/userguides/console.md | 4 +++- docs/userguides/contracts.md | 8 ++++++-- docs/userguides/data.md | 8 ++++++-- docs/userguides/dependencies.md | 16 ++++++++++++---- docs/userguides/networks.md | 12 +++++++++--- docs/userguides/scripts.md | 8 ++++++-- docs/userguides/testing.md | 24 ++++++++++++++++++------ docs/userguides/trace.md | 4 +++- docs/userguides/transactions.md | 12 +++++++++--- 12 files changed, 98 insertions(+), 37 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53246cac67..8435b962e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,9 @@ source venv/bin/activate pip install -e .'[dev]' ``` -**NOTE**: You might run into issues where you have a local install and are trying to work with a plugin pinned to a specific version. +```{note} +You might run into issues where you have a local install and are trying to work with a plugin pinned to a specific version. +``` [The easiest solution](https://github.com/ApeWorX/ape/issues/90) to this is to fetch the tags via `git fetch upstream --tags` and reinstall via `pip install .`. You will then have the correct version. @@ -66,7 +68,9 @@ python -m http.server --directory "docs/_build/" --bind 127.0.0.1 1337 ``` Then, open your browser to `127.0.0.1:1337` and click the `ape` directory link. -NOTE: Serving from `"docs/_build/"` rather than `"docs/_build/ape"` is necessary to make routing work. +```{note} +Serving from `"docs/_build/"` rather than `"docs/_build/ape"` is necessary to make routing work. +``` ## Pull Requests diff --git a/docs/userguides/accounts.md b/docs/userguides/accounts.md index d1cd547312..8e57c0b6d9 100644 --- a/docs/userguides/accounts.md +++ b/docs/userguides/accounts.md @@ -30,12 +30,12 @@ def test_my_contract_method(accounts): To access the same prefunded accounts in your scripts or console, use the root `accounts` object and the [test_accounts](../methoddocs/managers.html#ape.managers.accounts.AccountManager.test_accounts) property: ```{eval-rst} - .. doctest:: ->>> from ape import accounts + >>> from ape import accounts + + >>> sender = accounts.test_accounts[0] ->>> sender = accounts.test_accounts[0] ``` You can configure your test accounts using your `ape-config.yaml` file: @@ -54,15 +54,16 @@ The accounts generated from this seed are solely for testing and debugging purpo You can create a new test account by doing the following: ```{eval-rst} - .. doctest:: ->>> from ape import accounts + >>> from ape import accounts ->>> account = accounts.test_accounts.generate_test_account() + >>> account = accounts.test_accounts.generate_test_account() ``` -**NOTE**: Creating a new test account means it will be unfunded by default. +```{note} +Creating a new test account means it will be unfunded by default. +``` Learn more about test accounts from the [testing guide](./testing.html#accounts-fixture). @@ -264,7 +265,8 @@ message = encode_defunct(text="Hello Apes!") signature = account.sign_message(message) ``` -**NOTE**: Ape's `sign_message` API intentionally accepts `Any` as the message argument type. +````{note} +Ape's `sign_message` API intentionally accepts `Any` as the message argument type. Account plugins decide what data-types to support. Most Ethereum account plugins, such as `ape-account`, are able to sign messages like the example above. However, you can also provide other types, such as a `str` directly: @@ -275,6 +277,7 @@ from ape import accounts account = accounts.load("") signature = account.sign_message("Hello Apes!") ``` +```` ### EIP-712 @@ -351,7 +354,9 @@ message = encode_defunct(text="Hello Apes!") signature = account.sign_message(message) ``` -**NOTE**: Alternatively, you may use the `passphrase=` kwarg on methods `account.set_autosign()` and `account.unlock()`, but we highly recommend using the environment variable approach to avoid accidentally leaking your passphrase. +```{note} +Alternatively, you may use the `passphrase=` kwarg on methods `account.set_autosign()` and `account.unlock()`, but we highly recommend using the environment variable approach to avoid accidentally leaking your passphrase. +``` ## Hardware Wallets diff --git a/docs/userguides/config.md b/docs/userguides/config.md index d0e71be669..379f1ea721 100644 --- a/docs/userguides/config.md +++ b/docs/userguides/config.md @@ -85,7 +85,9 @@ from ape import project contract = project.MyContract.deployments[0] ``` -**NOTE**: Ape does not add or edit deployments in your `ape-config.yaml` file. +```{note} +Ape does not add or edit deployments in your `ape-config.yaml` file. +``` ## Node @@ -148,7 +150,9 @@ For the local network configuration, the default is `"max"`. Otherwise, it is `" Set which `ape` plugins you want to always use. -**NOTE**: The `ape-` prefix is not needed and shouldn't be included here. +```{note} +The `ape-` prefix is not needed and shouldn't be included here. +``` ```yaml plugins: diff --git a/docs/userguides/console.md b/docs/userguides/console.md index 2badd72fa4..65ea5ffdd4 100644 --- a/docs/userguides/console.md +++ b/docs/userguides/console.md @@ -41,8 +41,10 @@ In [1]: networks Out[1]: > ``` -**NOTE**: To change the network of the active console, use the `--network` option. +```{note} +To change the network of the active console, use the `--network` option. Follow [this guide](./networks.html) for more information on networks in Ape. +``` ## Namespace Extras diff --git a/docs/userguides/contracts.md b/docs/userguides/contracts.md index 18b9f31aa4..2fecb0f90a 100644 --- a/docs/userguides/contracts.md +++ b/docs/userguides/contracts.md @@ -10,7 +10,9 @@ The other way is to initialize an already-deployed contract using its address. Deploy contracts from your project using the `project` root-level object. You deploy contracts using Python functions such as [AccountAPI.deploy](../methoddocs/api.html#ape.api.accounts.AccountAPI.deploy) or [ContractContainer.deploy](../methoddocs/contracts.html#ape.contracts.base.ContractContainer.deploy). -**NOTE**: You can run Ape's deploy functions from anywhere you run Python! +```{note} +You can run Ape's deploy functions from anywhere you run Python! +``` You need both an account and a contract in order to deploy a contract, as the deployment process requires a transaction to submit the contract data to the blockchain. To learn about accounts and how to use them, see the [Accounts Guide](./accounts.html). @@ -246,7 +248,9 @@ _ = contract.withdraw(sender=account, value="1 wei") Notice that transacting returns a [ReceiptAPI](../methoddocs/api.html#ape.api.transactions.ReceiptAPI) object which contains all the receipt data, such as `gas_used`. -**NOTE**: If you need the `return_value` from a transaction, you have to either treat transaction as a call (see the section below!) or use a provider with tracing-features enabled (such as `ape-foundry` or `ape-node`) and access the [return_value](../methoddocs/api.html#ape.api.transactions.ReceiptAPI.return_value) property on the receipt. +```{note} +If you need the `return_value` from a transaction, you have to either treat transaction as a call (see the section below!) or use a provider with tracing-features enabled (such as `ape-foundry` or `ape-node`) and access the [return_value](../methoddocs/api.html#ape.api.transactions.ReceiptAPI.return_value) property on the receipt. +``` ```python assert receipt.return_value == 123 diff --git a/docs/userguides/data.md b/docs/userguides/data.md index e7a3fbfa3c..391704d96b 100644 --- a/docs/userguides/data.md +++ b/docs/userguides/data.md @@ -51,9 +51,11 @@ See [this guide](../userguides/contracts.html) for more information how to deplo ## Using the Cache -**Note**: This is in Beta release. +```{note} +This is in Beta release. This functionality is in constant development and many features are in planning stages. Use the cache plugin to store provider data in a sqlite database. +``` To use the cache, first you must initialize it for each network you plan on caching data for: @@ -61,7 +63,9 @@ To use the cache, first you must initialize it for each network you plan on cach ape cache init --network : ``` -**Note**: Caching only works for permanently available networks. It will not work with local development networks. +```{note} +Caching only works for permanently available networks. It will not work with local development networks. +``` For example, to initialize the cache database for the Ethereum mainnet network, you would do the following: diff --git a/docs/userguides/dependencies.md b/docs/userguides/dependencies.md index faae4cf7db..b99f1c7a32 100644 --- a/docs/userguides/dependencies.md +++ b/docs/userguides/dependencies.md @@ -9,7 +9,9 @@ There are three sub-folders in `.ape/packages` for dependencies: When you compile a dependency, the contract types are stored in the dependency manifest's JSON file. 3. `api/` - for caching the API data placed in `dependencies:` config or `ape pm install` commands, allowing dependency usage and management from anywhere in the file system. -*NOTE*: You can install dependencies that don't compile out-of-the-box. +```{note} +You can install dependencies that don't compile out-of-the-box. +``` Sometimes, dependencies are only collections of source files not meant to compile on their own but instead be used in projects via import statements. You can change the settings of a dependency using `config_override:` to compile dependencies after installed, if needed, and the `api/` cache always refers to the latest used during installation or compilation. @@ -133,10 +135,12 @@ To install a dependency that is not in your config, you can specify it directly ape pm install gh:OpenZeppelin/openzeppelin-contracts --name openzeppelin --version "4.6.0" ``` -**NOTE**: The `gh:` prefix is used because this dependency is from GitHub. +```{note} +The `gh:` prefix is used because this dependency is from GitHub. For `npm` dependencies, you use an `npm:` prefix. For local dependencies, you give it a path to the local dependency. `--version` is not required when using a local dependency. +``` To change the config of a dependency when installing, use the `--config-override` CLI option: @@ -178,7 +182,9 @@ To skip the confirmation prompts, use the `--yes` flag (abbreviated as `-y`): ape pm uninstall OpenZeppelin all --yes ``` -**NOTE**: Additionally, use the `all` special version key to delete all versions. +```{note} +Additionally, use the `all` special version key to delete all versions. +``` ### compile @@ -194,8 +200,10 @@ You can use the CLI to recompile. ape pm compile OpenZeppelin --version 4.6.0 --force ``` -**NOTE**: You only need to specify a version if you have more than one version of a dependency installed. +```{note} +You only need to specify a version if you have more than one version of a dependency installed. Otherwise, you just give it the name. +``` To compile all dependencies in your local project, run the command with no arguments while in your project: diff --git a/docs/userguides/networks.md b/docs/userguides/networks.md index 04c34b54c1..694f53a37f 100644 --- a/docs/userguides/networks.md +++ b/docs/userguides/networks.md @@ -77,7 +77,9 @@ Here is a list of all L2 network plugins supported by Ape: | ape-polygon | [ApeWorX/ape-polygon](https://github.com/ApeWorX/ape-polygon) | | ape-polygon-zkevm | [ApeWorX/ape-polygon-zkevm](https://github.com/ApeWorX/ape-polygon-zkevm) | -**NOTE**: If you are connecting an L2 network or any other network that does not have a plugin, you can use the custom network support, which is described in the [next section](#custom-network-connection). +```{note} +If you are connecting an L2 network or any other network that does not have a plugin, you can use the custom network support, which is described in the [next section](#custom-network-connection). +``` Once you have the L2 network plugin installed, you can configure its node's URI by setting the values in the `node` core plugin via your `ape-config.yaml` file: @@ -202,8 +204,10 @@ etherscan: api_uri: https://api.custom.scan/api # URL used for making API requests. ``` -**NOTE**: Every explorer plugin may be different in how you configure custom networks. +```{note} +Every explorer plugin may be different in how you configure custom networks. Consult the plugin's README to clarify. +``` #### Block time, transaction type, and more config @@ -222,7 +226,9 @@ ethereum: For a full list of network configurations like this (for both custom and plugin-based networks), [see this section](#configuring-networks). -**NOTE**: This also works if configuring a custom ecosystem. +```{note} +This also works if configuring a custom ecosystem. +``` If using a custom ecosystem, use the custom ecosystem name as the top-level config key instead: ```yaml diff --git a/docs/userguides/scripts.md b/docs/userguides/scripts.md index 012942dd62..5c7ea86d5a 100644 --- a/docs/userguides/scripts.md +++ b/docs/userguides/scripts.md @@ -32,7 +32,9 @@ For example, assuming we have script `/scripts/hello/helloworld.py`, we ape run hello helloworld ``` -**Note**: By default, `cli` scripts do not have [`ape.cli.network_option`](../methoddocs/cli.html?highlight=options#ape.cli.options.network_option) installed, giving you more flexibility in how you define your scripts. +```{note} +By default, `cli` scripts do not have [`ape.cli.network_option`](../methoddocs/cli.html?highlight=options#ape.cli.options.network_option) installed, giving you more flexibility in how you define your scripts. +``` However, you can add the `network_option` or `ConnectedProviderCommand` to your scripts by importing them from the `ape.cli` namespace: ```python @@ -110,9 +112,11 @@ def main(): print("Hello world!") ``` -**NOTE**: main-method scripts will always provide a `--network` option and run in a connected-context. +```{note} +main-method scripts will always provide a `--network` option and run in a connected-context. Therefore, they are not ideal for multi-chain scripts. `main`-method scripts work best for quick, single-network, connection-based workflows. +``` To demonstrate, use the following script: diff --git a/docs/userguides/testing.md b/docs/userguides/testing.md index 8533f0af53..376488eb67 100644 --- a/docs/userguides/testing.md +++ b/docs/userguides/testing.md @@ -21,7 +21,9 @@ def test_add(): assert 1 + 1 == 2 ``` -**NOTE**: `pytest` assumes the *actual* value is on the left and the *expected* value is on the right. +```{note} +`pytest` assumes the *actual* value is on the left and the *expected* value is on the right. +``` ## Test Pattern @@ -492,7 +494,9 @@ def test_error_on_deploy(account, project): ``` Alternatively, you can attempt to use the address from the revert error to find the error type. -**NOTE**: The address will only exist for transactions that were published (e.g. not for failures during estimating gas), and this may only work on certain providers. +```{note} +The address will only exist for transactions that were published (e.g. not for failures during estimating gas), and this may only work on certain providers. +``` ```python import ape @@ -570,8 +574,10 @@ Thus, you can enter and exit a provider's context as much as you need in tests. ## Gas Reporting To include a gas report at the end of your tests, you can use the `--gas` flag. -**NOTE**: This feature works best when using a provider with tracing support, such as [ape-foundry](https://github.com/ApeWorX/ape-foundry). +```{note} +This feature works best when using a provider with tracing support, such as [ape-foundry](https://github.com/ApeWorX/ape-foundry). When not using a provider with adequate tracing support, such as `EthTester`, gas reporting is limited to receipt-level data. +``` ```bash ape test --network ethereum:local:foundry --gas @@ -648,7 +654,9 @@ To get contract coverage, use the `--coverage` flag when running `ape test`: ape test --coverage ``` -**NOTE**: Some types of coverage require using a provider that supports transaction tracing, such as `ape-hardhat` or `ape-foundry`. +```{note} +Some types of coverage require using a provider that supports transaction tracing, such as `ape-hardhat` or `ape-foundry`. +``` Without using a provider with adequate tracing support, coverage is limited to receipt-level data. Afterwards, you should see a coverage report looking something like: @@ -705,12 +713,16 @@ Then, you will see table outputs like this: This is useful when trying to find the missing areas to cover. The HTML report also supports `verbose: true` and it will show similar tables. -**NOTE**: You may notice methods with zero statements. +```{note} +You may notice methods with zero statements. +``` One example of a method with zero statements may be from an auto-generated getter method for a public variable; certain versions of Vyper do not contain source mappings for these methods. However, Ape will still check to see if this method has been called in your tests. To get 100% coverage, you must call these methods in your tests. -**NOTE**: Notice some methods use the full selector while others don't. +```{note} +Notice some methods use the full selector while others don't. +``` Methods that use the selector mean that their short name is shared with other methods. This happens in Vyper from auto-generated kwarg-based methods. Thus, the full selector is used to distinguish the methods in the coverage (and gas) reports. diff --git a/docs/userguides/trace.md b/docs/userguides/trace.md index dd8461243c..7a56de688a 100644 --- a/docs/userguides/trace.md +++ b/docs/userguides/trace.md @@ -13,7 +13,9 @@ Some network providers, such as Alchemy and Foundry, implement `debug_traceTrans To see a transaction trace, use the [show_trace()](../methoddocs/api.html#ape.api.transactions.ReceiptAPI.show_trace) method on a receipt API object. Here is an example using `show_trace()` in Python code to print out a transaction's trace. -**NOTE**: This code runs assuming you are connected to `ethereum:mainnet` using a provider with tracing RPCs. +```{note} +This code runs assuming you are connected to `ethereum:mainnet` using a provider with tracing RPCs. +``` To learn more about networks in Ape, see the [networks guide](./networks.html). ```python diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index 2a1381ef86..3d58b98598 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -101,7 +101,9 @@ One way to use a static-fee transaction is by specifying the `gas_price` as a ke contract.startAuction(gas_price="100 gwei", sender=sender) ``` -**NOTE**: Miners prioritize static-fee transactions based on the highest `gas_price`. +```{note} +Miners prioritize static-fee transactions based on the highest `gas_price`. +``` Another way to use a static-fee transaction (without having to provide `gas_price`) is to set the key-value argument `type` equal to `0x00`. @@ -170,7 +172,9 @@ for log in contract.FooEvent.from_receipt(receipt): print(log.amount) # Assuming 'amount' is a property on the event. ``` -**NOTE**: If you have more than event with the same name in your contract type's ABI, you can access the events by using the [get_event_by_signature()](../methoddocs/contracts.html?highlight=contractinstance#ape.contracts.base.ContractInstance.get_event_by_signature) method: +```{note} +If you have more than event with the same name in your contract type's ABI, you can access the events by using the [get_event_by_signature()](../methoddocs/contracts.html?highlight=contractinstance#ape.contracts.base.ContractInstance.get_event_by_signature) method: +``` ```python event_type = contract.get_event_by_signature("FooEvent(uint256 bar, uint256 baz)") @@ -181,7 +185,9 @@ Otherwise, you will get an `AttributeError`. ## Transaction Acceptance Timeout -**NOTE** For longer running scripts, you may need to increase the transaction acceptance timeout. +```{note} +For longer running scripts, you may need to increase the transaction acceptance timeout. +``` The default value is 2 minutes for live networks and 20 seconds for local networks. In your `ape-config.yaml` file, add the following: From de10c5f275d5da95cfc5e3381f9d6d0d3b02adef Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 12:44:32 -0500 Subject: [PATCH 05/15] docs: select_account --- docs/userguides/clis.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/userguides/clis.md b/docs/userguides/clis.md index 6c6fa54113..396aea054a 100644 --- a/docs/userguides/clis.md +++ b/docs/userguides/clis.md @@ -150,12 +150,12 @@ And when invoking the command from the CLI, it would look like the following: ```shell cmd # Use the default account. - cmd --account 0 # Use first account that would show up in `get_user_selected_account()`. + cmd --account 0 # Use first account that would show up in `select_account()`. cmd --account metamask # Use account with alias "metamask". cmd --account TEST::0 # Use the test account at index 0. ``` -Alternatively, you can call the [get_user_selected_account()](../methoddocs/cli.html#ape.cli.choices.get_user_selected_account) directly to have more control of when the account gets selected: +Alternatively, you can call the [select_account()](../methoddocs/cli.html#ape.cli.choices.select_account) directly to have more control of when the account gets selected: ```python import click @@ -197,7 +197,7 @@ Use `account_type` to filter the choices by specific types of [AccountAPI](../me ```python import click from ape import accounts -from ape.cli import existing_alias_argument, get_user_selected_account +from ape.cli import existing_alias_argument, select_account from ape_accounts.accounts import KeyfileAccount # NOTE: This is just an example and not anything specific or recommended. @@ -215,7 +215,7 @@ def cli_1(alias): # Select from the given accounts directly. my_accounts = [accounts.load("me"), accounts.load("me2")] -selected_account = get_user_selected_account(account_type=my_accounts) +selected_account = select_account(account_type=my_accounts) ``` ## Contract File Paths From 482d8737e718d196b95c2a753ad6611cffec257f Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 13:14:45 -0500 Subject: [PATCH 06/15] docs: refactor warning --- docs/userguides/accounts.md | 4 +++- docs/userguides/compile.md | 4 +++- docs/userguides/config.md | 4 +++- docs/userguides/console.md | 4 +++- docs/userguides/dependencies.md | 2 ++ docs/userguides/developing_plugins.md | 4 +++- docs/userguides/networks.md | 4 +++- docs/userguides/trace.md | 8 ++++++-- 8 files changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/userguides/accounts.md b/docs/userguides/accounts.md index 8e57c0b6d9..289b964a41 100644 --- a/docs/userguides/accounts.md +++ b/docs/userguides/accounts.md @@ -46,7 +46,9 @@ test: number_of_accounts: 5 ``` -**WARN**: NEVER put a seed phrase with real funds here. +```{warning} +NEVER put a seed phrase with real funds here. +``` The accounts generated from this seed are solely for testing and debugging purposes. ### Creating new test accounts diff --git a/docs/userguides/compile.md b/docs/userguides/compile.md index 5a5cbeaa78..e02ab9186a 100644 --- a/docs/userguides/compile.md +++ b/docs/userguides/compile.md @@ -39,7 +39,9 @@ contract.my_method() 3. **Raw Compiler Output**: If you have an artifact with binary compiled elsewhere, you can include it in your project. This is useful if you want to use contracts from much larger projects as dependency for your test cases. -**WARN**: You may have to adjust name and source ID similarly to raw contract-type output. +```{warning} +You may have to adjust name and source ID similarly to raw contract-type output. +``` ## Other Compiler Plugins diff --git a/docs/userguides/config.md b/docs/userguides/config.md index 379f1ea721..b7d58fcc29 100644 --- a/docs/userguides/config.md +++ b/docs/userguides/config.md @@ -103,7 +103,9 @@ node: Now, the `ape-node` core plugin will use the URL `http://localhost:5030` to connect and make requests. -**WARN**: Instead of using `ape-node` to connect to an Infura or Alchemy node, use the [ape-infura](https://github.com/ApeWorX/ape-infura) or [ape-alchemy](https://github.com/ApeWorX/ape-alchemy) provider plugins instead, which have their own way of managing API keys via environment variables. +```{warning} +Instead of using `ape-node` to connect to an Infura or Alchemy node, use the [ape-infura](https://github.com/ApeWorX/ape-infura) or [ape-alchemy](https://github.com/ApeWorX/ape-alchemy) provider plugins instead, which have their own way of managing API keys via environment variables. +``` For more information on networking as a whole, see [this guide](./networks.html). diff --git a/docs/userguides/console.md b/docs/userguides/console.md index 65ea5ffdd4..a138a1a2f6 100644 --- a/docs/userguides/console.md +++ b/docs/userguides/console.md @@ -9,8 +9,10 @@ In [1]: chain.blocks.head.timestamp Out[1]: 1647323479 ``` -WARNING: Contract changes are not reflected in the active console session. +```{warning} +Contract changes are not reflected in the active console session. If you need to make changes to your contract, you must re-start your console session for the compiler to handle the changes. +``` ## Ape Namespace diff --git a/docs/userguides/dependencies.md b/docs/userguides/dependencies.md index b99f1c7a32..4e96824dd1 100644 --- a/docs/userguides/dependencies.md +++ b/docs/userguides/dependencies.md @@ -35,8 +35,10 @@ dependencies: Then, follow the guide below about `remappings` to use the dependency. +```{warning} **An important WARNING about the `version:` key for GitHub dependencies:** The `version:` config first attempts to use an official GitHub release, but if the release is not found, it will check the release tags. +``` If you know the version is not available as an official release, bypass the original check by using the `ref:` key. The `ref:` key is also used for installing branches. diff --git a/docs/userguides/developing_plugins.md b/docs/userguides/developing_plugins.md index 8d3a364384..c26d491e87 100644 --- a/docs/userguides/developing_plugins.md +++ b/docs/userguides/developing_plugins.md @@ -28,7 +28,9 @@ A benefit of the plugin system is that each plugin can implement these however t Two plugins with the same API may do entirely different things and yet be interchangeable in their usage. To implement an API, import its class and use it as a base-class in your implementation class. -**WARNING**: The plugin will fail to work properly if you do not implement all the abstract methods. +```{warning} +The plugin will fail to work properly if you do not implement all the abstract methods. +``` ```python from ape.api import ProviderAPI diff --git a/docs/userguides/networks.md b/docs/userguides/networks.md index 694f53a37f..5a13089a58 100644 --- a/docs/userguides/networks.md +++ b/docs/userguides/networks.md @@ -260,7 +260,9 @@ This uses the default Ethereum ecosystem class. ape run script --network https://foo.bar ``` -**WARNING**: The recommended approach is to use an L2 plugin when one exists, as it will integrate better in the Ape ecosystem. +```{warning} +The recommended approach is to use an L2 plugin when one exists, as it will integrate better in the Ape ecosystem. +``` Here are some general reason why Network plugins are recommended: diff --git a/docs/userguides/trace.md b/docs/userguides/trace.md index 7a56de688a..fb2e50ed2c 100644 --- a/docs/userguides/trace.md +++ b/docs/userguides/trace.md @@ -8,7 +8,9 @@ Using traces, Ape is able to offer features like: 3. Coverage tools in `ape test` Some network providers, such as Alchemy and Foundry, implement `debug_traceTransaction` and Parity's `trace_transaction` affording tracing capabilities in Ape. -**WARN**: Without RPCs for obtaining traces, some features such as gas-reporting and coverage are limited. +```{warning} +Without RPCs for obtaining traces, some features such as gas-reporting and coverage are limited. +``` To see a transaction trace, use the [show_trace()](../methoddocs/api.html#ape.api.transactions.ReceiptAPI.show_trace) method on a receipt API object. @@ -84,7 +86,9 @@ If you want to see the trace of call when making the call, use the `show_trace=` token.balanceOf(account, show_trace=True) ``` -**WARN**: If your provider does not properly support call-tracing (e.g. doesn't implement `debug_traceCall`), traces are limited to the top-level call. +```{warning} +If your provider does not properly support call-tracing (e.g. doesn't implement `debug_traceCall`), traces are limited to the top-level call. +``` Ape traces calls automatically when using `--gas` or `--coverage` in tests to build reports. Learn more about testing in Ape in the [testing guide](./testing.html) and in the following sections. From e0114f0615279caf004d840c8e757c9bbad78949 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 13:39:55 -0500 Subject: [PATCH 07/15] docs: missing notes --- README.md | 4 +++- docs/userguides/accounts.md | 4 ++-- docs/userguides/developing_plugins.md | 12 +++++++++--- docs/userguides/installing_plugins.md | 4 +++- docs/userguides/logging.md | 4 +++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 49ad710752..6505f3763c 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,10 @@ Ape's modular plugin system allows users to have an interoperable experience wit - Learn more about **developing** your own plugins from this [developing user guide](https://docs.apeworx.io/ape/stable/userguides/developing_plugins.html). -**NOTE**: If a plugin does not originate from the [ApeWorX GitHub Organization](https://github.com/ApeWorX?q=ape&type=all), you will get a warning about installing 3rd-party plugins. +```{note} +If a plugin does not originate from the [ApeWorX GitHub Organization](https://github.com/ApeWorX?q=ape&type=all), you will get a warning about installing 3rd-party plugins. Install 3rd party plugins at your own risk. +``` [accounts-guide]: https://docs.apeworx.io/ape/stable/userguides/accounts.html [actions-badge]: https://github.com/ApeWorX/ape/actions/workflows/test.yaml/badge.svg diff --git a/docs/userguides/accounts.md b/docs/userguides/accounts.md index 289b964a41..5c5b792c27 100644 --- a/docs/userguides/accounts.md +++ b/docs/userguides/accounts.md @@ -267,9 +267,10 @@ message = encode_defunct(text="Hello Apes!") signature = account.sign_message(message) ``` -````{note} +```{note} Ape's `sign_message` API intentionally accepts `Any` as the message argument type. Account plugins decide what data-types to support. +``` Most Ethereum account plugins, such as `ape-account`, are able to sign messages like the example above. However, you can also provide other types, such as a `str` directly: @@ -279,7 +280,6 @@ from ape import accounts account = accounts.load("") signature = account.sign_message("Hello Apes!") ``` -```` ### EIP-712 diff --git a/docs/userguides/developing_plugins.md b/docs/userguides/developing_plugins.md index c26d491e87..73853c6b2a 100644 --- a/docs/userguides/developing_plugins.md +++ b/docs/userguides/developing_plugins.md @@ -17,7 +17,9 @@ The following is a list of example plugins to use as a reference when developing As previously mentioned, a plugin project is merely a python project. However, you can optionally use this [project template](https://github.com/ApeWorX/project-template) for initializing your plugin. -**NOTE**: this template is primarily designed for plugins built within the ApeWorX team organization; not everything may apply. +```{note} +This template is primarily designed for plugins built within the ApeWorX team organization; not everything may apply. +``` It is okay to delete anything that does not work or that you don't find helpful. The template may be good to follow if you want to keep your plugin of similar quality to plugins developed by the ApeWorX team. @@ -98,7 +100,9 @@ entry_points={ ... ``` -**NOTE**: Typically, a `_cli.py` module is used instead of a `__init__.py` module for the location of the Click CLI group because it is logically separate from the Python module loading process. +```{note} +Typically, a `_cli.py` module is used instead of a `__init__.py` module for the location of the Click CLI group because it is logically separate from the Python module loading process. +``` If you try to define them together and use `ape` as a library as well, there is a race condition in the loading process that will prevent the CLI plugin from working. For common `click` usages, use the `ape.cli` namespace. @@ -135,7 +139,9 @@ Similarly, if you implemented a `ProviderAPI`, that provider is now accessible i ape console my_script --network ethereum:local:my_provider_plugin ``` -**NOTE**: The `--network` option is available on the commands `test` and `console` as well as any CLI command that uses the [network option decorator](../methoddocs/cli.html?highlight=network_option#ape.cli.options.network_option). +```{note} +The `--network` option is available on the commands `test` and `console` as well as any CLI command that uses the [network option decorator](../methoddocs/cli.html?highlight=network_option#ape.cli.options.network_option). +``` To learn more about networks in Ape, follow [this guide](./networks.html). When creating the CLI-based plugins, you should see your CLI command as a top-level command in the `ape --help` output: diff --git a/docs/userguides/installing_plugins.md b/docs/userguides/installing_plugins.md index 9821f1de76..21a478bd3f 100644 --- a/docs/userguides/installing_plugins.md +++ b/docs/userguides/installing_plugins.md @@ -19,7 +19,9 @@ ape plugins list --all Normally, the `ape plugins list` command shows you all the plugins you have installed. However, when you include the `--all` flag, it shows the core plugins and the available plugins as well. -**NOTE**: The available plugins list is trusted and from the ApeWorX organization, however you can install third-party plugins from other sources as well. +```{note} +The available plugins list is trusted and from the ApeWorX organization, however you can install third-party plugins from other sources as well. +``` ## Installing Plugins diff --git a/docs/userguides/logging.md b/docs/userguides/logging.md index 3ca6b77dbd..e7e04e204b 100644 --- a/docs/userguides/logging.md +++ b/docs/userguides/logging.md @@ -13,8 +13,10 @@ The following log levels are available with Ape: | WARNING | 30 | Indicates a potential issue | Yellow | | ERROR | 40 | An error occurred | Red | -**NOTE**: `SUCCESS` is a non-standard verbosity level custom to the framework. +```{note} +`SUCCESS` is a non-standard verbosity level custom to the framework. It is shown during `INFO` but not shown if set to `WARNING` or above. +``` ## CLI Logging From 5b3fbdabca5f3ed6cb57eb892b42af3e4d9a6f04 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 13:54:19 -0500 Subject: [PATCH 08/15] docs: fix notes --- docs/userguides/accounts.md | 2 +- docs/userguides/console.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/userguides/accounts.md b/docs/userguides/accounts.md index 5c5b792c27..0339fbac36 100644 --- a/docs/userguides/accounts.md +++ b/docs/userguides/accounts.md @@ -269,8 +269,8 @@ signature = account.sign_message(message) ```{note} Ape's `sign_message` API intentionally accepts `Any` as the message argument type. -Account plugins decide what data-types to support. ``` +Account plugins decide what data-types to support. Most Ethereum account plugins, such as `ape-account`, are able to sign messages like the example above. However, you can also provide other types, such as a `str` directly: diff --git a/docs/userguides/console.md b/docs/userguides/console.md index a138a1a2f6..0388a189a0 100644 --- a/docs/userguides/console.md +++ b/docs/userguides/console.md @@ -45,8 +45,8 @@ Out[1]: > ```{note} To change the network of the active console, use the `--network` option. -Follow [this guide](./networks.html) for more information on networks in Ape. ``` +Follow [this guide](./networks.html) for more information on networks in Ape. ## Namespace Extras From 8edd0dd449c92526ea2dfaf09ecb72ee27813e3b Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 13:57:14 -0500 Subject: [PATCH 09/15] chore: lint --- CONTRIBUTING.md | 1 + docs/userguides/accounts.md | 2 ++ docs/userguides/console.md | 1 + docs/userguides/dependencies.md | 2 ++ docs/userguides/developing_plugins.md | 5 +++++ docs/userguides/installing_plugins.md | 1 + docs/userguides/networks.md | 1 + docs/userguides/scripts.md | 1 + docs/userguides/testing.md | 5 +++++ docs/userguides/trace.md | 3 +++ docs/userguides/transactions.md | 3 ++- 11 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8435b962e1..9d6d9c7f32 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,6 +68,7 @@ python -m http.server --directory "docs/_build/" --bind 127.0.0.1 1337 ``` Then, open your browser to `127.0.0.1:1337` and click the `ape` directory link. + ```{note} Serving from `"docs/_build/"` rather than `"docs/_build/ape"` is necessary to make routing work. ``` diff --git a/docs/userguides/accounts.md b/docs/userguides/accounts.md index 0339fbac36..3aca3d8d94 100644 --- a/docs/userguides/accounts.md +++ b/docs/userguides/accounts.md @@ -49,6 +49,7 @@ test: ```{warning} NEVER put a seed phrase with real funds here. ``` + The accounts generated from this seed are solely for testing and debugging purposes. ### Creating new test accounts @@ -270,6 +271,7 @@ signature = account.sign_message(message) ```{note} Ape's `sign_message` API intentionally accepts `Any` as the message argument type. ``` + Account plugins decide what data-types to support. Most Ethereum account plugins, such as `ape-account`, are able to sign messages like the example above. However, you can also provide other types, such as a `str` directly: diff --git a/docs/userguides/console.md b/docs/userguides/console.md index 0388a189a0..211c5aa7ab 100644 --- a/docs/userguides/console.md +++ b/docs/userguides/console.md @@ -46,6 +46,7 @@ Out[1]: > ```{note} To change the network of the active console, use the `--network` option. ``` + Follow [this guide](./networks.html) for more information on networks in Ape. ## Namespace Extras diff --git a/docs/userguides/dependencies.md b/docs/userguides/dependencies.md index 4e96824dd1..30389cab7f 100644 --- a/docs/userguides/dependencies.md +++ b/docs/userguides/dependencies.md @@ -12,6 +12,7 @@ There are three sub-folders in `.ape/packages` for dependencies: ```{note} You can install dependencies that don't compile out-of-the-box. ``` + Sometimes, dependencies are only collections of source files not meant to compile on their own but instead be used in projects via import statements. You can change the settings of a dependency using `config_override:` to compile dependencies after installed, if needed, and the `api/` cache always refers to the latest used during installation or compilation. @@ -39,6 +40,7 @@ Then, follow the guide below about `remappings` to use the dependency. **An important WARNING about the `version:` key for GitHub dependencies:** The `version:` config first attempts to use an official GitHub release, but if the release is not found, it will check the release tags. ``` + If you know the version is not available as an official release, bypass the original check by using the `ref:` key. The `ref:` key is also used for installing branches. diff --git a/docs/userguides/developing_plugins.md b/docs/userguides/developing_plugins.md index 73853c6b2a..199e970cbb 100644 --- a/docs/userguides/developing_plugins.md +++ b/docs/userguides/developing_plugins.md @@ -17,9 +17,11 @@ The following is a list of example plugins to use as a reference when developing As previously mentioned, a plugin project is merely a python project. However, you can optionally use this [project template](https://github.com/ApeWorX/project-template) for initializing your plugin. + ```{note} This template is primarily designed for plugins built within the ApeWorX team organization; not everything may apply. ``` + It is okay to delete anything that does not work or that you don't find helpful. The template may be good to follow if you want to keep your plugin of similar quality to plugins developed by the ApeWorX team. @@ -30,6 +32,7 @@ A benefit of the plugin system is that each plugin can implement these however t Two plugins with the same API may do entirely different things and yet be interchangeable in their usage. To implement an API, import its class and use it as a base-class in your implementation class. + ```{warning} The plugin will fail to work properly if you do not implement all the abstract methods. ``` @@ -103,6 +106,7 @@ entry_points={ ```{note} Typically, a `_cli.py` module is used instead of a `__init__.py` module for the location of the Click CLI group because it is logically separate from the Python module loading process. ``` + If you try to define them together and use `ape` as a library as well, there is a race condition in the loading process that will prevent the CLI plugin from working. For common `click` usages, use the `ape.cli` namespace. @@ -142,6 +146,7 @@ ape console my_script --network ethereum:local:my_provider_plugin ```{note} The `--network` option is available on the commands `test` and `console` as well as any CLI command that uses the [network option decorator](../methoddocs/cli.html?highlight=network_option#ape.cli.options.network_option). ``` + To learn more about networks in Ape, follow [this guide](./networks.html). When creating the CLI-based plugins, you should see your CLI command as a top-level command in the `ape --help` output: diff --git a/docs/userguides/installing_plugins.md b/docs/userguides/installing_plugins.md index 21a478bd3f..892496a6ff 100644 --- a/docs/userguides/installing_plugins.md +++ b/docs/userguides/installing_plugins.md @@ -19,6 +19,7 @@ ape plugins list --all Normally, the `ape plugins list` command shows you all the plugins you have installed. However, when you include the `--all` flag, it shows the core plugins and the available plugins as well. + ```{note} The available plugins list is trusted and from the ApeWorX organization, however you can install third-party plugins from other sources as well. ``` diff --git a/docs/userguides/networks.md b/docs/userguides/networks.md index 5a13089a58..a967edef2b 100644 --- a/docs/userguides/networks.md +++ b/docs/userguides/networks.md @@ -229,6 +229,7 @@ For a full list of network configurations like this (for both custom and plugin- ```{note} This also works if configuring a custom ecosystem. ``` + If using a custom ecosystem, use the custom ecosystem name as the top-level config key instead: ```yaml diff --git a/docs/userguides/scripts.md b/docs/userguides/scripts.md index 5c7ea86d5a..9733aa1a78 100644 --- a/docs/userguides/scripts.md +++ b/docs/userguides/scripts.md @@ -35,6 +35,7 @@ ape run hello helloworld ```{note} By default, `cli` scripts do not have [`ape.cli.network_option`](../methoddocs/cli.html?highlight=options#ape.cli.options.network_option) installed, giving you more flexibility in how you define your scripts. ``` + However, you can add the `network_option` or `ConnectedProviderCommand` to your scripts by importing them from the `ape.cli` namespace: ```python diff --git a/docs/userguides/testing.md b/docs/userguides/testing.md index 376488eb67..41d34c273c 100644 --- a/docs/userguides/testing.md +++ b/docs/userguides/testing.md @@ -494,6 +494,7 @@ def test_error_on_deploy(account, project): ``` Alternatively, you can attempt to use the address from the revert error to find the error type. + ```{note} The address will only exist for transactions that were published (e.g. not for failures during estimating gas), and this may only work on certain providers. ``` @@ -574,6 +575,7 @@ Thus, you can enter and exit a provider's context as much as you need in tests. ## Gas Reporting To include a gas report at the end of your tests, you can use the `--gas` flag. + ```{note} This feature works best when using a provider with tracing support, such as [ape-foundry](https://github.com/ApeWorX/ape-foundry). When not using a provider with adequate tracing support, such as `EthTester`, gas reporting is limited to receipt-level data. @@ -657,6 +659,7 @@ ape test --coverage ```{note} Some types of coverage require using a provider that supports transaction tracing, such as `ape-hardhat` or `ape-foundry`. ``` + Without using a provider with adequate tracing support, coverage is limited to receipt-level data. Afterwards, you should see a coverage report looking something like: @@ -716,6 +719,7 @@ The HTML report also supports `verbose: true` and it will show similar tables. ```{note} You may notice methods with zero statements. ``` + One example of a method with zero statements may be from an auto-generated getter method for a public variable; certain versions of Vyper do not contain source mappings for these methods. However, Ape will still check to see if this method has been called in your tests. To get 100% coverage, you must call these methods in your tests. @@ -723,6 +727,7 @@ To get 100% coverage, you must call these methods in your tests. ```{note} Notice some methods use the full selector while others don't. ``` + Methods that use the selector mean that their short name is shared with other methods. This happens in Vyper from auto-generated kwarg-based methods. Thus, the full selector is used to distinguish the methods in the coverage (and gas) reports. diff --git a/docs/userguides/trace.md b/docs/userguides/trace.md index fb2e50ed2c..df0c402ee0 100644 --- a/docs/userguides/trace.md +++ b/docs/userguides/trace.md @@ -8,6 +8,7 @@ Using traces, Ape is able to offer features like: 3. Coverage tools in `ape test` Some network providers, such as Alchemy and Foundry, implement `debug_traceTransaction` and Parity's `trace_transaction` affording tracing capabilities in Ape. + ```{warning} Without RPCs for obtaining traces, some features such as gas-reporting and coverage are limited. ``` @@ -15,9 +16,11 @@ Without RPCs for obtaining traces, some features such as gas-reporting and cover To see a transaction trace, use the [show_trace()](../methoddocs/api.html#ape.api.transactions.ReceiptAPI.show_trace) method on a receipt API object. Here is an example using `show_trace()` in Python code to print out a transaction's trace. + ```{note} This code runs assuming you are connected to `ethereum:mainnet` using a provider with tracing RPCs. ``` + To learn more about networks in Ape, see the [networks guide](./networks.html). ```python diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index 3d58b98598..181d42ab16 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -26,7 +26,7 @@ To get the receipt of a `deploy` transaction, use the [ContractInstance.creation Additionally, you can find the `.deployer`, `.proxy` and whatever else on the creaton metadata which may come in handy. -```{note} +```{note} Use `ape-etherscan` or a node with Otterscan for increased support for these features. ``` @@ -188,6 +188,7 @@ Otherwise, you will get an `AttributeError`. ```{note} For longer running scripts, you may need to increase the transaction acceptance timeout. ``` + The default value is 2 minutes for live networks and 20 seconds for local networks. In your `ape-config.yaml` file, add the following: From 4c20016aeea125f81707f74d76c612253f9fa010 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 15:07:52 -0500 Subject: [PATCH 10/15] docs: fix mistakes --- docs/userguides/contracts.md | 2 +- docs/userguides/data.md | 3 ++- docs/userguides/dependencies.md | 3 +-- docs/userguides/transactions.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/userguides/contracts.md b/docs/userguides/contracts.md index 2fecb0f90a..d51c619361 100644 --- a/docs/userguides/contracts.md +++ b/docs/userguides/contracts.md @@ -11,7 +11,7 @@ Deploy contracts from your project using the `project` root-level object. You deploy contracts using Python functions such as [AccountAPI.deploy](../methoddocs/api.html#ape.api.accounts.AccountAPI.deploy) or [ContractContainer.deploy](../methoddocs/contracts.html#ape.contracts.base.ContractContainer.deploy). ```{note} -You can run Ape's deploy functions from anywhere you run Python! +You can run Ape's deploy functions anywhere you run Python! ``` You need both an account and a contract in order to deploy a contract, as the deployment process requires a transaction to submit the contract data to the blockchain. diff --git a/docs/userguides/data.md b/docs/userguides/data.md index 391704d96b..95fb544d70 100644 --- a/docs/userguides/data.md +++ b/docs/userguides/data.md @@ -64,7 +64,8 @@ ape cache init --network : ``` ```{note} -Caching only works for permanently available networks. It will not work with local development networks. +Caching only works for permanently available networks. +It will not work with local development networks. ``` For example, to initialize the cache database for the Ethereum mainnet network, you would do the following: diff --git a/docs/userguides/dependencies.md b/docs/userguides/dependencies.md index 30389cab7f..19c883dcc4 100644 --- a/docs/userguides/dependencies.md +++ b/docs/userguides/dependencies.md @@ -11,10 +11,9 @@ There are three sub-folders in `.ape/packages` for dependencies: ```{note} You can install dependencies that don't compile out-of-the-box. -``` - Sometimes, dependencies are only collections of source files not meant to compile on their own but instead be used in projects via import statements. You can change the settings of a dependency using `config_override:` to compile dependencies after installed, if needed, and the `api/` cache always refers to the latest used during installation or compilation. +``` ## Types of Dependencies diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index 181d42ab16..6bbddbda33 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -173,7 +173,7 @@ for log in contract.FooEvent.from_receipt(receipt): ``` ```{note} -If you have more than event with the same name in your contract type's ABI, you can access the events by using the [get_event_by_signature()](../methoddocs/contracts.html?highlight=contractinstance#ape.contracts.base.ContractInstance.get_event_by_signature) method: +If you have more than one event with the same name in your contract type's ABI, you can access the events by using the [get_event_by_signature()](../methoddocs/contracts.html?highlight=contractinstance#ape.contracts.base.ContractInstance.get_event_by_signature) method: ``` ```python From 5fd671b7bb61a1ac8c1122cea8c833a92c98097f Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 15:15:50 -0500 Subject: [PATCH 11/15] docs: fix traces link --- docs/userguides/transactions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/userguides/transactions.md b/docs/userguides/transactions.md index 6bbddbda33..af5f00f0dd 100644 --- a/docs/userguides/transactions.md +++ b/docs/userguides/transactions.md @@ -202,7 +202,7 @@ ethereum: Transaction traces are the steps in the contract the transaction took. Traces both power a myriad of features in Ape as well are themselves a tool for developers to use to debug transactions. -To learn more about traces, see the [traces userguide](./trace.md). +To learn more about traces, see the [traces userguide](./trace.html). ## Estimate Gas Cost From 6a69a02d3cff9e138d1a840758931545b535f431 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 16:06:25 -0500 Subject: [PATCH 12/15] docs: fix docs for decorated functions in sphinx --- src/ape/utils/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ape/utils/misc.py b/src/ape/utils/misc.py index 4e333831ac..2817fbedee 100644 --- a/src/ape/utils/misc.py +++ b/src/ape/utils/misc.py @@ -354,7 +354,7 @@ def raises_not_implemented(fn): def inner(*args, **kwargs): raise _create_raises_not_implemented_error(fn) - + inner.__doc__ = fn.__doc__ return inner From 92a58a0bf5c618ac743e05fe019b7d342dfb8747 Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 16:10:32 -0500 Subject: [PATCH 13/15] chore: lint --- src/ape/utils/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ape/utils/misc.py b/src/ape/utils/misc.py index 2817fbedee..6f2a638393 100644 --- a/src/ape/utils/misc.py +++ b/src/ape/utils/misc.py @@ -354,6 +354,7 @@ def raises_not_implemented(fn): def inner(*args, **kwargs): raise _create_raises_not_implemented_error(fn) + inner.__doc__ = fn.__doc__ return inner From c1e63587f39e5ce34a06f4288cf9e16fe88ee99b Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 3 Jun 2024 16:23:18 -0500 Subject: [PATCH 14/15] docs: add autodoc excluded members --- docs/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 060bda05ae..475f9c9b54 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -83,8 +83,9 @@ # Set some default to avoid unnecessary repetitious directives. autodoc_default_options = { "exclude-members": ( - "__repr__, __weakref__, __metaclass__, __init__, " - "model_config, model_fields, model_post_init, model_computed_fields" + "__repr__, __weakref__, __metaclass__, __init__, __format__, __new__, __str__, __dir__" + "model_config, model_fields, model_post_init, model_computed_fields," + "__ape_extra_attributes__," ) } From c3069037e85334fab5a70a8b2f22fcc82d3d5ab0 Mon Sep 17 00:00:00 2001 From: Dalena Date: Tue, 4 Jun 2024 09:04:00 -0500 Subject: [PATCH 15/15] chore: add comment --- src/ape/utils/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ape/utils/misc.py b/src/ape/utils/misc.py index 6f2a638393..5e36ca3e92 100644 --- a/src/ape/utils/misc.py +++ b/src/ape/utils/misc.py @@ -355,6 +355,7 @@ def raises_not_implemented(fn): def inner(*args, **kwargs): raise _create_raises_not_implemented_error(fn) + # This is necessary for doc strings to show up with sphinx inner.__doc__ = fn.__doc__ return inner