Skip to content

Commit

Permalink
allow passing router description to Contract constructor (#448)
Browse files Browse the repository at this point in the history
* allow passing router description to Contract constructor
  • Loading branch information
barnjamin authored Jul 18, 2022
1 parent bd7de04 commit 281f2d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyteal/ast/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,18 @@ def __init__(
self,
name: str,
bare_calls: BareCallActions = None,
descr: str = None,
) -> None:
"""
Args:
name: the name of the smart contract, used in the JSON object.
bare_calls: the bare app call registered for each on_completion.
descr: a description of the smart contract, used in the JSON object.
"""

self.name: str = name
self.descr = descr

self.approval_ast = ASTBuilder()
self.clear_state_ast = ASTBuilder()

Expand Down Expand Up @@ -662,10 +666,10 @@ def contract_construct(self) -> sdk_abi.Contract:
Returns:
contract: a dictified `Contract` object constructed from
approval program's method specs and `self.name`.
approval program's method specs, `self.name`, and `self.descr`.
"""

return sdk_abi.Contract(self.name, self.methods)
return sdk_abi.Contract(self.name, self.methods, self.descr)

def build_program(self) -> tuple[Expr, Expr, sdk_abi.Contract]:
"""
Expand Down

0 comments on commit 281f2d3

Please sign in to comment.