Skip to content

Commit

Permalink
Revert "An attempt to add decorator syntax to abi-router (#370)"
Browse files Browse the repository at this point in the history
This reverts commit 22cf520.
  • Loading branch information
ahangsu authored May 27, 2022
1 parent 22cf520 commit 76e05bd
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions pyteal/ast/router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass, field, fields, astuple
from typing import cast, Optional, Callable
from typing import cast, Optional
from enum import IntFlag

from algosdk import abi as sdk_abi
Expand Down Expand Up @@ -511,35 +511,6 @@ def add_method_handler(
method_signature, method_clear_state_cond, method_call
)

def method(
self,
func: Callable = None,
/,
*,
overriding_name: str = None,
no_op: CallConfig = CallConfig.CALL,
opt_in: CallConfig = CallConfig.NEVER,
close_out: CallConfig = CallConfig.NEVER,
clear_state: CallConfig = CallConfig.NEVER,
update_application: CallConfig = CallConfig.NEVER,
delete_application: CallConfig = CallConfig.NEVER,
):
def wrap(_func):
wrapped_subroutine = ABIReturnSubroutine(func)
call_configs = MethodConfig(
no_op=no_op,
opt_in=opt_in,
close_out=close_out,
clear_state=clear_state,
update_application=update_application,
delete_application=delete_application,
)
self.add_method_handler(wrapped_subroutine, overriding_name, call_configs)

if not func:
return wrap
return wrap(func)

def contract_construct(self) -> sdk_abi.Contract:
"""A helper function in constructing contract JSON object.
Expand Down

0 comments on commit 76e05bd

Please sign in to comment.