Skip to content

Commit 3880851

Browse files
authored
fix: patching algopy import syntax in hello world (#30)
1 parent 550eaff commit 3880851

File tree

20 files changed

+68
-52
lines changed

20 files changed

+68
-52
lines changed

examples/generators/production_python_smart_contract_python/.algokit.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ audit = { commands = [
3333
'poetry run pip-audit -r requirements.txt',
3434
], description = 'Audit with pip-audit' }
3535
lint = { commands = [
36-
'poetry run black --check .',
36+
'poetry run black --check --diff .',
3737
'poetry run ruff check .',
3838
'poetry run mypy',
3939
], description = 'Perform linting' }
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class CoolContract(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from algopy import ARC4Contract, arc4
1+
from algopy import ARC4Contract, String
2+
from algopy.arc4 import abimethod
23

34

45
class HelloWorld(ARC4Contract):
5-
@arc4.abimethod()
6-
def hello(self, name: arc4.String) -> arc4.String:
6+
@abimethod()
7+
def hello(self, name: String) -> String:
78
return "Hello, " + name

examples/generators/production_python_smart_contract_typescript/.algokit.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ audit = { commands = [
3333
'poetry run pip-audit -r requirements.txt',
3434
], description = 'Audit with pip-audit' }
3535
lint = { commands = [
36-
'poetry run black --check .',
36+
'poetry run black --check --diff .',
3737
'poetry run ruff check .',
3838
'poetry run mypy',
3939
], description = 'Perform linting' }
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class CoolContract(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from algopy import ARC4Contract, arc4
1+
from algopy import ARC4Contract, String
2+
from algopy.arc4 import abimethod
23

34

45
class HelloWorld(ARC4Contract):
5-
@arc4.abimethod()
6-
def hello(self, name: arc4.String) -> arc4.String:
6+
@abimethod()
7+
def hello(self, name: String) -> String:
78
return "Hello, " + name
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# pyright: reportMissingModuleSource=false
2-
from algopy import ARC4Contract, arc4
2+
from algopy import ARC4Contract, String
3+
from algopy.arc4 import abimethod
34

45

56
class CoolContract(ARC4Contract):
6-
@arc4.abimethod()
7-
def hello(self, name: arc4.String) -> arc4.String:
7+
@abimethod()
8+
def hello(self, name: String) -> String:
89
return "Hello, " + name

0 commit comments

Comments
 (0)