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

chore: converting some tests to v3 #21

Merged
merged 3 commits into from
Jan 31, 2025
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Documentation: https://cusma.github.io/d-asa/
D-ASA examples deployed on TestNet:

| Type | App ID | App Spec |
|-------------------|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| Zero Coupon Bond] | [733151482](https://lora.algokit.io/testnet/application/733151482) | [ARC-32](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/zero_coupon_bond/ZeroCouponBond.arc32.json) |
| Fixed Coupon Bond | [733151497](https://lora.algokit.io/testnet/application/733151497) | [ARC-32](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/fixed_coupon_bond/FixedCouponBond.arc32.json) |
| Perpetual Bond | [733151498](https://lora.algokit.io/testnet/application/733151498) | [ARC-32](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/perpetual_bond/PerpetualBond.arc32.json) |
| ----------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Zero Coupon Bond] | [733151482](https://lora.algokit.io/testnet/application/733151482) | [ARC-56](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/zero_coupon_bond/ZeroCouponBond.arc56.json) |
| Fixed Coupon Bond | [733151497](https://lora.algokit.io/testnet/application/733151497) | [ARC-56](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/fixed_coupon_bond/FixedCouponBond.arc56.json) |
| Perpetual Bond | [733151498](https://lora.algokit.io/testnet/application/733151498) | [ARC-56](https://github.com/cusma/d-asa/blob/main/smart_contracts/artifacts/perpetual_bond/PerpetualBond.arc56.json) |

1. Download the App Spec JSON file;
1. Navigate to the [Lora App Lab](https://lora.algokit.io/testnet/app-lab);
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ maintainers = ["cusma <[email protected]>"]
readme = ["README.md", "docs/SUMMARY.md"]
documentation = "https://cusma.github.io/d-asa/"
repository = "https://github.com/cusma/d-asa"
keywords = ["algorand", "blockchain", "debt", "finance", "tokenization", "actus"]
keywords = [
"algorand",
"blockchain",
"debt",
"finance",
"tokenization",
"actus",
]

[tool.poetry.dependencies]
python = "^3.12"
algokit-utils = "^3.0.0b2"
algokit-utils = "^3.0.0b3"
python-dotenv = "^1.0.0"
algorand-python = "^2.5.0"
algorand-python-testing = "^0.4.1"

[tool.poetry.group.dev.dependencies]
algokit-client-generator = "^2.0.0b1"
black = {extras = ["d"], version = "^24.10.0"}
algokit-client-generator = "^2.0.0b2"
black = { extras = ["d"], version = "^24.10.0" }
ruff = "^0.9.2"
mypy = "==1.11.2"
pytest = "^8.3.4"
Expand All @@ -36,7 +43,22 @@ build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 120
select = ["E", "F", "ANN", "UP", "N", "C4", "B", "A", "YTT", "W", "FBT", "Q", "RUF", "I"]
select = [
"E",
"F",
"ANN",
"UP",
"N",
"C4",
"B",
"A",
"YTT",
"W",
"FBT",
"Q",
"RUF",
"I",
]
ignore = [
"ANN101", # no type for self
"ANN102", # no type for cls
Expand Down
4 changes: 2 additions & 2 deletions smart_contracts/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def main(action: str, contract_name: str | None = None) -> None:
(
file.name
for file in output_dir.iterdir()
if file.is_file() and file.suffixes == [".arc32", ".json"]
if file.is_file() and file.suffixes == [".arc56", ".json"]
),
None,
)
if app_spec_file_name is None:
raise Exception("Could not deploy app, .arc32.json file not found")
raise Exception("Could not deploy app, .arc56.json file not found")
app_spec_path = output_dir / app_spec_file_name
if contract.deploy:
logger.info(f"Deploying app {contract.name}")
Expand Down
6 changes: 3 additions & 3 deletions smart_contracts/_helpers/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def build(output_dir: Path, contract_path: Path) -> Path:
"python",
contract_path.absolute(),
f"--out-dir={output_dir}",
"--output-arc32",
"--output-arc56",
"--output-source-map",
],
stdout=subprocess.PIPE,
Expand All @@ -40,12 +40,12 @@ def build(output_dir: Path, contract_path: Path) -> Path:
if build_result.returncode:
raise Exception(f"Could not build contract:\n{build_result.stdout}")

app_spec_file_names = [file.name for file in output_dir.glob("*.arc32.json")]
app_spec_file_names = [file.name for file in output_dir.glob("*.arc56.json")]
app_spec_file_name = None
for app_spec_file_name in app_spec_file_names:
if app_spec_file_name is None:
logger.warning(
"No '*.arc32.json' file found (likely a logic signature being compiled). Skipping client generation."
"No '*.arc56.json' file found (likely a logic signature being compiled). Skipping client generation."
)
continue
print(app_spec_file_name)
Expand Down
Loading
Loading