Skip to content
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
6 changes: 6 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ The project uses several tools to maintain code quality:

All these tools are automatically run as pre-commit hooks when you commit code.

### Type Checking

```bash
mypy .
```

### Manual Pre-commit Checks

To manually run all pre-commit checks:
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include requirements.txt
recursive-include src *.py *.json
recursive-include src/story_protocol_python_sdk/abi *.json
recursive-include src/story_protocol_python_sdk/scripts *.json
include src/story_protocol_python_sdk/py.typed
24 changes: 24 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[mypy]
python_version = 3.10
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = False
disallow_incomplete_defs = False
check_untyped_defs = True
disallow_untyped_decorators = False
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_no_return = True
warn_unreachable = True
strict_equality = True
exclude = story_protocol_python_sdk/abi|story_protocol_python_sdk/scripts
# Due to previous code having any return types, we need to disable this error code
disable_error_code = no-any-return

# Ignore missing imports for external libraries
[mypy-web3.*]
ignore_missing_imports = True

[mypy-ens.*]
ignore_missing_imports = True
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package_dir={"": "src"},
install_requires=["web3>=7.0.0", "pytest", "python-dotenv", "base58"],
include_package_data=True, # Ensure package data is included
package_data={"story_protocol_python_sdk": ["py.typed"]},
url="https://github.com/storyprotocol/python-sdk",
license="MIT",
author="Andrew Chung",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def __init__(self, web3: Web3):
)
with open(config_path, "r") as config_file:
config = json.load(config_file)

contract_address = None
for contract in config["contracts"]:
if contract["contract_name"] == "CoreMetadataViewModule":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,17 @@ def build_resolveDispute_transaction(self, disputeId, data, tx_params):
disputeId, data
).build_transaction(tx_params)

def tagIfRelatedIpInfringed(self, ipIdToTag, infringerDisputeId):
return self.contract.functions.tagIfRelatedIpInfringed(
ipIdToTag, infringerDisputeId
).transact()

def build_tagIfRelatedIpInfringed_transaction(
self, ipIdToTag, infringerDisputeId, tx_params
):
return self.contract.functions.tagIfRelatedIpInfringed(
ipIdToTag, infringerDisputeId
).build_transaction(tx_params)

def isWhitelistedDisputeTag(self, tag):
return self.contract.functions.isWhitelistedDisputeTag(tag).call()
Loading
Loading