Skip to content

Prevent using get_me with input#51

Merged
orsinium merged 1 commit intomainfrom
me-type
Mar 1, 2026
Merged

Prevent using get_me with input#51
orsinium merged 1 commit intomainfrom
me-type

Conversation

@orsinium
Copy link
Member

  1. Make get_me return a new Me type instead of Peer.
  2. This type can be used only with get_settings or for equality comparison with Peer.

While you can, if you really want, convert Me to Peer by iterating over Peers and picking the one that equals to Me (or going through into_u8 -> from_u8), it would require deliberately going out of your way to shoot yourself in the foot. So, the change should prevent the most common pitfalls, like read_pad(get_me()).

See firefly-zero/firefly-runtime#9.

@orsinium orsinium requested a review from applejag February 28, 2026 20:59
Copy link
Collaborator

@applejag applejag left a comment

Choose a reason for hiding this comment

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

LGTM

@orsinium orsinium changed the title Prevent using get_me with input#22 Prevent using get_me with input Mar 1, 2026
@orsinium orsinium merged commit 777051b into main Mar 1, 2026
2 checks passed
@orsinium orsinium deleted the me-type branch March 1, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants