-
Notifications
You must be signed in to change notification settings - Fork 78
0.24 name audit part 2 #810
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
Conversation
Pull Request Test Coverage Report for Build 15931307783Details
💛 - Coveralls |
2b63d80 to
05099a4
Compare
It contains every possible state of a session including initialized Receiver types. Include the module `Receive` name to disambiguate the public type used in payjoin-ffi where namespacing is not yet available.
| /// and the state to be updated with the next event over a uniform interface. | ||
| #[derive(Debug, Clone, PartialEq)] | ||
| pub enum ReceiverTypeState { | ||
| pub enum ReceiveSession { |
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.
I kept "Receive" in "ReceiveSession" to disambiguate between Sessions for payjoin-ffi since the disambiguation applies to payjoin-cli/v2 for the time being until that module is separated into send/receive submodules as well.
wdyt about going further and just calling this (and SendSession) both Session, favoring qualified imports and in the ffi module pub use receive::Session as ReceiveSession?
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.
I think the issue is that payoin-ffi doesn't wrap around the rust-payjoin enums but reimplements them (the inner variants wrap the corresponding rust-payjoin types). So using the same names makes it easier to navigate and use the API based on rust docs.
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.
Yeah I had them named Session at first and would prefer that but uniffi is out lowest common denominator
It contains every possible state of a session including Sender types. Include the module `Send` name to disambiguate the public type used in payjoin-ffi where namespacing is not yet available.
|
fixed commit message |
The big change here is moving SessionContext out ofreceive::v2::Stateand intoReceiversince it's common between every state. I still think there's an optimization to be done w.r.t.e/ reply key, which does belong in specificStateobjects and ought to be done before this release so we don't have to do a migration after this release.I got rid of the changes moving SessionContext into Receiver because 1. it's not name related and 2. it's trickier than I thought because you've got to mutate the state of OhttpKeys in the context which requires some mutex behavior to do if you don't just own it, and hav eit in an arc between states instead.
I was also getting confused by the similar
Receiver<State>andReceiverTypeStatetype names, so I went withReceiveSessionfor the enum, which may not have initialized aReceiveryet, and might have even failed. This rename pattern was applied toSenderTypeStateas well. I kept "Receive" in "ReceiveSession" to disambiguate between Sessions for payjoin-ffi since the disambiguation applies to payjoin-cli/v2 for the time being until that module is separated into send/receive submodules as well.