Skip to content

Commit

Permalink
chore: linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Kim (Hyunggun) committed Nov 22, 2024
1 parent c1348f3 commit a0df1d5
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@

from algopy import (
ARC4Contract,
Global,
GlobalState,
String,
Txn,
UInt64,
arc4,
gtxn,
urange,
)
from algopy.arc4 import abimethod
Expand All @@ -30,6 +27,7 @@ def add_arc4_uint64(self, a: arc4.UInt64, b: arc4.UInt64) -> arc4.UInt64:
c = a.native + b.native

return arc4.UInt64(c)

# example: ARC4_UINT64

# example: ARC4_UINTN
Expand All @@ -49,6 +47,7 @@ def add_arc4_uint_n(
total = a.native + b.native + c.native + d.native

return arc4.UInt64(total)

# example: ARC4_UINTN

# example: ARC4_BIGUINT
Expand All @@ -67,6 +66,7 @@ def add_arc4_biguint_n(
total = a.native + b.native + c.native

return arc4.UInt512(total)

# example: ARC4_BIGUINT

# example: ARC4_BYTES
Expand All @@ -76,6 +76,7 @@ def arc4_byte(self, a: arc4.Byte) -> arc4.Byte:
An arc4.Byte is essentially an alias for an 8-bit integer.
"""
return arc4.Byte(a.native + 1)

# example: ARC4_BYTES

# example: ARC4_ADDRESS
Expand Down Expand Up @@ -112,8 +113,10 @@ def arc4_address_return(self, address: arc4.Address) -> arc4.Address:
assert converted_address == address

return converted_address

# example: ARC4_ADDRESS


# example: ARC4_STATIC_ARRAY
AliasedStaticArray: t.TypeAlias = arc4.StaticArray[arc4.UInt8, t.Literal[1]]

Expand Down Expand Up @@ -153,6 +156,8 @@ def arc4_static_array(self) -> None:
so this won't compile:
aliased_static.pop()
"""


# example: ARC4_STATIC_ARRAY

# example: ARC4_DYNAMIC_ARRAY
Expand Down Expand Up @@ -188,9 +193,10 @@ def hello(self, name: arc4.String) -> String:
greeting += x.native

return greeting
# example: ARC4_DYNAMIC_ARRAY

# example: ARC4_DYNAMIC_BYTES
# example: ARC4_DYNAMIC_ARRAY

# example: ARC4_DYNAMIC_BYTES
@abimethod()
def arc4_dynamic_bytes(self) -> arc4.DynamicBytes:
"""arc4.DynamicBytes are essentially an arc4.DynamicArray[arc4.Bytes] and some convenience methods."""
Expand All @@ -208,8 +214,10 @@ def arc4_dynamic_bytes(self) -> arc4.DynamicBytes:
dynamic_bytes.append(arc4.Byte(255))

return dynamic_bytes

# example: ARC4_DYNAMIC_BYTES


# example: ARC4_STRUCT
class Todo(arc4.Struct):
task: arc4.String
Expand Down Expand Up @@ -257,6 +265,8 @@ def return_todo(self, task: arc4.String) -> Todo:
assert exist

return todo_to_return


# example: ARC4_STRUCT

# example: ARC4_TUPLE
Expand All @@ -266,7 +276,6 @@ def return_todo(self, task: arc4.String) -> Todo:


class Arc4Tuple(ARC4Contract):


def __init__(self) -> None:
self.contact_info = GlobalState(
Expand All @@ -291,4 +300,6 @@ def return_contact(self) -> arc4.Tuple[arc4.String, arc4.String, arc4.UInt64]:
"""An arc4.Tuple can be returned when more than one return value is needed."""

return self.contact_info.value


# example: ARC4_TUPLE

0 comments on commit a0df1d5

Please sign in to comment.