Skip to content

Prevent using GetMe with input#36

Open
orsinium wants to merge 2 commits intomainfrom
type-safe-me
Open

Prevent using GetMe with input#36
orsinium wants to merge 2 commits intomainfrom
type-safe-me

Conversation

@orsinium
Copy link
Member

  1. Make GetMe return a new Me type instead of Peer.
  2. This type can be used only with GetSettings 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, 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 ReadPad(GetMe()).

See firefly-zero/firefly-runtime#9.

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.

1 participant