-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: save invite code for each guardian #4318
Conversation
454284e
to
2a8ea63
Compare
devimint/src/federation.rs
Outdated
@@ -203,6 +218,13 @@ impl Federation { | |||
Ok(invite_code) | |||
} | |||
|
|||
pub fn invite_code_for(&self, peer_id: u16) -> Result<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self
not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Federation::invite_code(&self) -> Result<String>
be changed to Federation::invite_code() -> Result<String>
as well? This method is already being used and all of the places it is used would need to be changed since it would become an associated function instead of a method without self
260567c
to
c666795
Compare
I've been amending the commit & force pushing, is that the desired workflow? Or should I make additional commits when there are comments to address? |
let peer_data_dir = utf8(&peer_to_env_vars_map[&0].FM_DATA_DIR); | ||
tokio::fs::copy( | ||
format!("{peer_data_dir}/{invite_code_filename_original}"), | ||
format!("{client_dir}/{invite_code_filename_original}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will be identical to the …-0
version, right? Do we even still need it? Or did you leave it to avoid having to rewrite a lot of testing code (which is probably a good enough reason)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the invite-code
file is identical to invite-code-0
, and yeah, it was left so it didn't break code elsewhere which relies on the presence of invite-code
Closes: #4225
The code compiles, but I didn't write any tests for it because I'm not sure where to put them. All of the tests in
tests.rs
seem like big integration tests and testing the smallFederation::invite_code_for
method along side the other big integration tests doesn't seem good.