-
Notifications
You must be signed in to change notification settings - Fork 210
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(mint-client): include federation join info in OOBNotes
#4231
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4231 +/- ##
==========================================
+ Coverage 57.94% 58.05% +0.10%
==========================================
Files 197 197
Lines 43414 43563 +149
==========================================
+ Hits 25157 25290 +133
- Misses 18257 18273 +16 ☔ View full report in Codecov by Sentry. |
@@ -110,11 +119,25 @@ impl OOBNotes { | |||
]) | |||
} | |||
|
|||
pub fn new_with_invite(notes: TieredMulti<SpendableNote>, invite: InviteCode) -> Self { | |||
Self(vec![ | |||
// FIXME: once we can break compatibility with 0.2 we can remove the prefix in case an |
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.
maybe FIXME(0.2)
so we can grep for it later
@@ -92,6 +93,14 @@ pub struct OOBNotes(Vec<OOBNotesData>); | |||
enum OOBNotesData { |
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.
OOBNotesData was a good idea!
let cfg = self.get_config().global; | ||
let (any_guardian_id, any_guardian_url) = cfg | ||
.api_endpoints | ||
.iter() | ||
.next() | ||
.expect("A federation always has at least one guardian"); | ||
InviteCode::new( | ||
any_guardian_url.url.clone(), | ||
*any_guardian_id, | ||
cfg.federation_id(), | ||
) |
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.
would be nice to also have this function on config type
/// Invite code to join the federation by which the e-cash was issued | ||
/// | ||
/// Introduce in 0.3.0 | ||
Invite { |
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.
If this is present the FederationIdPrefix
is redundant, though we might start to omit it in some future. Though we might already change code that uses FederationIdPrefix
to use see if Invite
is available.
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.
Is this a documentation request?
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.
No. Code request, unless I'm missing something.
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.
pub fn federation_id_prefix(&self) -> FederationIdPrefix { | ||
self.0 | ||
.iter() | ||
.find_map(|data| match data { | ||
OOBNotesData::FederationIdPrefix(prefix) => Some(*prefix), | ||
OOBNotesData::Invite { federation_id, .. } => Some(federation_id.to_prefix()), |
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.
@dpc feels like this is what you were asking for in your comment?
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.
👍
Fixes #4048