Skip to content

Commit

Permalink
Refactor function transaction_info_windows to use parameter name `b…
Browse files Browse the repository at this point in the history
…oc` instead of `transaction_boc`.
  • Loading branch information
nessshon committed Jan 20, 2024
1 parent 0fe45a8 commit 4500fba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/user-guide/sending-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ creates an inline keyboard for navigation.
#### Transaction Info Window

```python title="windows.py"
async def transaction_info_windows(atc_manager: ATCManager, transaction_boc: str, **_) -> None:
async def transaction_info_windows(atc_manager: ATCManager, boc: str, **_) -> None:
"""
Displays the transaction information window.
:param atc_manager: ATCManager instance for managing TON Connect integration.
:param transaction_boc: The BOC (Bag of Cells) representing the transaction.
:param boc: The BOC (Bag of Cells) representing the transaction.
:param _: Unused data from the middleware.
:return: None
"""
# Determine text based on user's language and show transaction details
text = (
"Transaction successfully sent!\n\n"
f"boc:\n{transaction_boc}"
f"boc:\n{boc}"
if atc_manager.user.language_code == "en" else
"Транзакция успешно отправлена!\n\n"
f"boc:\n{transaction_boc}"
f"boc:\n{boc}"
)
button_text = "‹ Go to main" if atc_manager.user.language_code == "en" else "‹ На главную"
reply_markup = Markup(inline_keyboard=[
Expand Down
8 changes: 4 additions & 4 deletions example/sending-transaction/bot/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,22 @@ async def send_amount_ton_window(atc_manager: ATCManager, **_) -> None:
await atc_manager.state.set_state(UserState.send_amount_ton)


async def transaction_info_windows(atc_manager: ATCManager, transaction_boc: str, **_) -> None:
async def transaction_info_windows(atc_manager: ATCManager, boc: str, **_) -> None:
"""
Displays the transaction information window.
:param atc_manager: ATCManager instance for managing TON Connect integration.
:param transaction_boc: The BOC (Bag of Cells) representing the transaction.
:param boc: The BOC (Bag of Cells) representing the transaction.
:param _: Unused data from the middleware.
:return: None
"""
# Determine text based on user's language and show transaction details
text = (
"Транзакция успешно отправлена!\n\n"
f"boc:\n{transaction_boc}"
f"boc:\n{boc}"
if atc_manager.user.language_code == "ru" else
"Transaction successfully sent!\n\n"
f"boc:\n{transaction_boc}"
f"boc:\n{boc}"
)
button_text = "‹ На главную" if atc_manager.user.language_code == "ru" else "‹ Go to main"
reply_markup = Markup(inline_keyboard=[
Expand Down

0 comments on commit 4500fba

Please sign in to comment.