Skip to content

fix: reject transfer when --from and --to are the same account#410

Open
ygd58 wants to merge 2 commits intologos-blockchain:mainfrom
ygd58:fix/wallet-bytes-display
Open

fix: reject transfer when --from and --to are the same account#410
ygd58 wants to merge 2 commits intologos-blockchain:mainfrom
ygd58:fix/wallet-bytes-display

Conversation

@ygd58
Copy link
Copy Markdown
Contributor

@ygd58 ygd58 commented Mar 26, 2026

Summary

Fixes #264 (partially).

When --from and --to point to the same account, wallet previously
submitted the tx and user saw unhelpful error:
error: Transaction not found in preconfigured amount of blocks

Change

Added upfront validation: if from == to, wallet now returns:
Invalid transfer: --from and --to cannot be the same account

Note

Other invalid tx scenarios (#265, #268) require deeper changes at
the sequencer level and are out of scope for this PR.

Fixes #264

Previously, wallet submitted the transaction to the sequencer which
rejected it with 'Duplicate account_ids found in message'. The user
only saw 'Transaction not found in preconfigured amount of blocks'
with no actionable feedback.

Now wallet validates upfront and returns a clear error:
  'Invalid transfer: --from and --to cannot be the same account'

Fixes logos-blockchain#264
@ygd58
Copy link
Copy Markdown
Contributor Author

ygd58 commented Mar 28, 2026

This PR addresses the specific case from #264 where --from and --to point to the same address. The wallet now rejects the transaction upfront with a clear error message before submitting to the sequencer.

Copy link
Copy Markdown
Collaborator

@Pravdyvy Pravdyvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ygd58
Copy link
Copy Markdown
Contributor Author

ygd58 commented Apr 24, 2026

This PR has approvals from Pravdyvy and schouhy. Ready to merge when convenient.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wallet CLI should reject invalid tx

4 participants