Skip to content

Commit 6887976

Browse files
Beaker deprecation (#106)
* feat: beaker deprecation
1 parent e308466 commit 6887976

File tree

7 files changed

+579
-1055
lines changed

7 files changed

+579
-1055
lines changed

tests/contract/build.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,40 @@
22
import subprocess
33
from pathlib import Path
44

5-
import beaker
6-
7-
from contract import app
8-
95
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)-10s: %(message)s")
106
logger = logging.getLogger(__name__)
117
root_path = Path(__file__).parent
128

139

14-
def build(output_dir: Path, app: beaker.Application) -> Path:
15-
logger.info(f"Exporting {app.name} to {output_dir}")
16-
specification = app.build()
17-
specification.export(output_dir)
10+
def main() -> None:
11+
artifacts = root_path / "artifacts"
1812

13+
app_path = root_path / "testing_app" / "contract.py"
14+
app_artifacts = artifacts / "testing_app"
15+
subprocess.run(
16+
[
17+
"algokit",
18+
"--no-color",
19+
"compile",
20+
"python",
21+
app_path.absolute(),
22+
f"--out-dir={app_artifacts}",
23+
"--output-arc56",
24+
"--no-output-arc32",
25+
"--no-output-teal",
26+
"--no-output-source-map",
27+
],
28+
stdout=subprocess.PIPE,
29+
stderr=subprocess.STDOUT,
30+
text=True,
31+
check=False,
32+
)
1933
result = subprocess.run(
2034
[
2135
"algokit",
2236
"generate",
2337
"client",
24-
"application.json",
38+
app_artifacts / "TestingApp.arc56.json",
2539
"--output",
2640
"client.ts",
2741
],
@@ -32,13 +46,6 @@ def build(output_dir: Path, app: beaker.Application) -> Path:
3246
if result.returncode:
3347
raise Exception("Could not generate typed client")
3448

35-
return output_dir / "application.json"
36-
37-
38-
def main() -> None:
39-
logger.info("Building contract")
40-
build(root_path, app)
41-
4249

4350
if __name__ == "__main__":
4451
main()

tests/contract/client.ts

Lines changed: 294 additions & 710 deletions
Large diffs are not rendered by default.

tests/contract/contract.py

Lines changed: 0 additions & 162 deletions
This file was deleted.

tests/contract/contract.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)