refactor: improve tx waiting, fees, and compatibility#101
Conversation
*Clarifies transaction lifecycle handling so sends can return on submission by default or wait for inclusion or finalization, with more accurate status reporting and safer post-submit behavior. *Improves transfer safety by parsing decimal amounts exactly, estimating fees before send and batch operations, and checking balances against amount, tip, and fee needs to avoid misleading success paths. *Tightens compatibility checks to require matching runtime and transaction versions, updates regeneration guidance and usage docs, and removes wallet debug output while rejecting duplicate developer wallet creation.
|
Comment: We definitely need to fix #4 below - there should be no default tip. We currently don't expose tips to end users because they're confusing and useless for end users as long as the chain doesn't have congestion. For context - the wallet doesn't have a tip. I believe tip is something we inherited from substrate, and it has some limited usefulness for the blockchain later on when we have millions of users but for now, it's not needed at all. TL;DR: Default tip amount should be 0 (zero) on all transactions. ========================================== AI ReviewThis is a substantial, well-motivated PR (10 files, +807/-230) that addresses real correctness issues: float-based amount parsing, a hardcoded fee estimate, misleading "confirmed" messages after submit-only, and a spec-version-only compatibility check. The new That said, I found a few items worth flagging. Issues1. DRY violation in
|
|
Now I have a complete picture. Here's my review of PR #101. PR #101 Review:
|
n13
left a comment
There was a problem hiding this comment.
GTG as I am concerned
The first item above could maybe be fixed but up to you
*Centralizes balance and fee checks so single and batch transfers report shortages more consistently and avoid duplicated overflow logic. *Adds shared address-to-account conversion for transfer and recovery commands, reducing repeated parsing code and keeping wallet-name resolution consistent. *Refactors transaction status watching into smaller helpers for clearer success and failure handling, and separates finalization from the generic wait flag.
|
Agree, let's merge! |
Summary
This PR improves transaction submission behavior, fee handling, and runtime compatibility checks across the Quantus CLI.
The main goal is to make transaction flow semantics clearer and safer:
spec_versionandtransaction_versionto match supported valuesWhat changed
Transaction lifecycle / waiting behavior
submittedincludedfinalized--wait-for-transactionand--finalized-txFee estimation and balance safety
Exact amount / tip parsing
--amountand--tipusing exact decimal conversion based on configured chain decimalsBatch transfer behavior
Compatibility and metadata regeneration
(spec_version, transaction_version)pairCleanup