Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixtures docs and tests #128

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/all_moccasin_toml_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ All possible options

[networks.sepolia.contracts]
# You can override the default named contract parameters
usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3", abi = "ERC20.vy", force_deploy = false, fixture = false, deployer_script = "script/deploy.py"}
usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3", abi = "ERC20.vy", force_deploy = false, deployer_script = "script/deploy.py"}

# You can also format a contract like this, for example, this one is "dai"
[networks.sepolia.contracts.dai]
Expand Down
3 changes: 0 additions & 3 deletions docs/source/core_concepts/named_contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ There are a number of flags we can set for our ``NamedContract``:
address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi = "ERC20.vy"
abi_from_explorer = true
fixture = false
deployment_script = "script/deploy_erc20.py"
force_deploy = false

Expand All @@ -81,7 +80,6 @@ There are a number of flags we can set for our ``NamedContract``:
address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi = "ERC20.vy"
abi_from_explorer = true
fixture = false
deployment_script = "script/deploy_erc20.py"
force_deploy = false
}
Expand All @@ -95,7 +93,6 @@ Let's break these down:
- *Coming soon* ``.vyi`` file path to a Vyper interface
- A "raw" ABI string
- ``abi_from_explorer``: If you want to get the ABI from an explorer. This is useful if you don't have the ABI and you want to get it from a public source. You'll need to set a ``explorer_api_key`` in your ``moccasin.toml``, or an ``EXPLORER_API_KEY`` environment variable.
- ``fixture```: If you want to use this contract as a :doc:`fixture </core_concepts/testing/fixtures>`.
- ``deployment_script``: The path to the :doc:`deployment script </core_concepts/scripting/deploy>` for this named contract, this will be a shorthand for deploying in the future.
- ``force_deploy```: If you want to force deploy the contract when :ref:`manifesting <manifesting>` the contract.

Expand Down
2 changes: 1 addition & 1 deletion tests/data/complex_project/moccasin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ is_zksync = true
save_to_db = false

[networks.contracts]
price_feed = { abi = "MockV3Aggregator", force_deploy = false, deployer_script = "mock_deployer/deploy_feed.py", fixture = false }
price_feed = { abi = "MockV3Aggregator", force_deploy = false, deployer_script = "mock_deployer/deploy_feed.py" }

[networks.optimism]
explorer_api_key = "${OPTIMISTIC_ETHERSCAN_API_KEY}"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/deployments_project/moccasin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = "src"

[networks.contracts]
price_feed = { abi = "MockV3Aggregator", force_deploy = false, deployer_script = "mock_deployer/deploy_feed.py", fixture = false }
price_feed = { abi = "MockV3Aggregator", force_deploy = false, deployer_script = "mock_deployer/deploy_feed.py" }
# You can view all configuration options at https://cyfrin.github.io/moccasin/all_moccasin_toml_parameters.html

[networks.anvil]
Expand Down