forked from nucypher/nucypher-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make contract verification script generic with click options.
- Loading branch information
1 parent
55797e3
commit 39535d3
Showing
2 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from pathlib import Path | ||
|
||
import click | ||
from ape import networks | ||
from ape.cli import NetworkBoundCommand, network_option | ||
from deployment.registry import contracts_from_registry | ||
from deployment.utils import verify_contracts | ||
|
||
|
||
@click.command(cls=NetworkBoundCommand) | ||
@network_option(required=True) | ||
@click.option( | ||
"--registry-filepath", | ||
"-r", | ||
help="Filepath to registry file", | ||
type=click.Path(dir_okay=False, exists=True, path_type=Path), | ||
required=True, | ||
) | ||
def cli(network, registry_filepath): | ||
"""Verify deployed contracts from a registry file.""" | ||
contracts = contracts_from_registry( | ||
registry_filepath, chain_id=networks.active_provider.chain_id | ||
) | ||
verify_contracts(list(contracts.values())) |