Skip to content

refactor: drop poll_for_swap_creation, reuse poll_for_swap_with_progress in post-tx#138

Open
dataCenter430 wants to merge 1 commit intoentrius:testfrom
dataCenter430:refactor/drop-poll-swap-creation
Open

refactor: drop poll_for_swap_creation, reuse poll_for_swap_with_progress in post-tx#138
dataCenter430 wants to merge 1 commit intoentrius:testfrom
dataCenter430:refactor/drop-poll-swap-creation

Conversation

@dataCenter430
Copy link
Copy Markdown

@dataCenter430 dataCenter430 commented Apr 21, 2026

Closes: #137

Summary

poll_for_swap_creation in swap.py was a duplicate of poll_for_swap_with_progress — identical polling logic, but with a static spinner and no elapsed-time feedback.
It had a single call site in post_tx.py.

Changes:

  • Add a message parameter to poll_for_swap_with_progress (default keeps existing callers unchanged)
  • Replace the poll_for_swap_creation call in post_tx.py with poll_for_swap_with_progress,
    passing message='Waiting for swap to appear on-chain...' to preserve the original UX text
  • Delete poll_for_swap_creation from swap.py

Visual diff (alw swap post-tx final polling step)

Before:

⠋ Waiting for swap to appear on-chain...

(static — no time feedback)

After:

⠋ Waiting for swap to appear on-chain... 0:00 elapsed
⠙ Waiting for swap to appear on-chain... 0:03 elapsed
⠹ Waiting for swap to appear on-chain... 0:06 elapsed

(same message, now with live elapsed time, keep clean and concise code, remove unnecessary duplication)

@dataCenter430 dataCenter430 force-pushed the refactor/drop-poll-swap-creation branch from 3cf3d9a to 7a8d8de Compare April 21, 2026 00:09
@anderdc anderdc added the refactor Restructures code without changing behavior label Apr 21, 2026
@dataCenter430 dataCenter430 force-pushed the refactor/drop-poll-swap-creation branch from 7a8d8de to 64689aa Compare April 22, 2026 22:37
@dataCenter430
Copy link
Copy Markdown
Author

Hi, @LandynDev
Would be it possible to review the PR? 🙏
Thanks

@dataCenter430 dataCenter430 force-pushed the refactor/drop-poll-swap-creation branch from 0e6f8c7 to 5715d4c Compare April 27, 2026 21:30
@dataCenter430 dataCenter430 reopened this May 8, 2026
@dataCenter430
Copy link
Copy Markdown
Author

Hi, @LandynDev
Could you please review the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructures code without changing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplicate poll_for_swap_creation and use poll_for_swap_with_progress

2 participants