-
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
Remove FederationInfo #4297
Remove FederationInfo #4297
Conversation
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.
The whole point of this struct is to allow 3rd party integrators to gather some basic information about the federation to show to users before joining. I guess we could try to merge its functionality with the ClientConfig
type now that we can generate InviteCode
s from config again (that wasn't possible when this type was created).
I think porting the functionality to the client config makes sense as FederationInfo is practically only a wrapper around the config since we can generate invite codes from the client config. What functionality would you like to see ported? |
The whole public interface except |
b51d334
to
a7a18f4
Compare
5012799
to
849fa63
Compare
fedimint-client/src/lib.rs
Outdated
@@ -2214,29 +2159,66 @@ pub async fn get_invite_code_from_db(db: &Database) -> Option<InviteCode> { | |||
|
|||
/// Tries to download the client config from the federation, | |||
/// attempts up to `retries` number times |
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.
retries
isn't an argument anymore.
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.
Done
fedimint-client/src/lib.rs
Outdated
invite_code: InviteCode, | ||
max_retries: usize, | ||
) -> anyhow::Result<ClientConfig> { | ||
pub async fn download_client_config(invite_code: &InviteCode) -> anyhow::Result<ClientConfig> { |
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.
Can we make this a constructor/member of ClientConfig
to replicate the FederationInfo
interface. I.e. the user should be able to call ClientConfig::download_with_invite(invite)
or something similar.
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.
Done
DynGlobalApi::from_config(self) | ||
} | ||
|
||
pub fn invite_code(&self, peer: &PeerId) -> Option<InviteCode> { |
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.
Documentation needed: what does the peer
argument do?
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.
Done
849fa63
to
53a8849
Compare
} | ||
|
||
/// Tries to download the client config from the federation, | ||
/// attempts to retry teb times before giving up. |
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.
Nit: s/teb/ten/
?
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.
still relevant, but whatever …
Needs rebase, feel free to request review from others in the future when I'm out :) |
53a8849
to
eb9a381
Compare
} | ||
|
||
/// Tries to download the client config from the federation, | ||
/// attempts to retry teb times before giving up. |
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.
still relevant, but whatever …
Might be worth incorporating #4371 into this PR too or a follow-up. |
Many methods were never used, the invite_code field was never read. Every time this struct was created from an invite code the caller just wanted to obtain the client config.