Expose shortid method for SessionContext#698
Conversation
By exposing the shortid method for SessionContext it allows us to be able to track the id across all psbt intermediate steps and allows us to not need this method duplicated in every step of the process.
Pull Request Test Coverage Report for Build 15047681959Details
💛 - Coveralls |
|
Curious if you think you are satified with the changes to the method slightly to address #612 here too |
|
@nothingmuch I remember hearing you said you were planning on removing the |
hmm, i don't think so If i understand the code correctly, .id() is only used in #642 for error reporting, the full SessionContexts are compared to each other directly, so this is just a way of reporting the sessions that this error condition is related to? the idea of computing the ShortId derived from the receiver key associated with the session still make sense, we just wanted to move away from relying on the same short ID as the database key, as in here: i was referring to this method: rust-payjoin/payjoin/src/receive/v2/mod.rs Line 343 in e2b66a2 but honestly i kinda misspoke, i didn't consider if we need it for other reasons i just assumed we don't, and what i really meant was just to no longer use this for keying the database |
arminsabouri
left a comment
There was a problem hiding this comment.
Simpler, cleaner and removes duplicate code. Seems like a win to me!
| } | ||
|
|
||
| /// The per-session identifier | ||
| pub fn id(&self) -> ShortId { |
There was a problem hiding this comment.
One thing did just come to mind. Does this need to be pub? IIRC only internal types need access to this?
Seems like it was pub previously as well.
There was a problem hiding this comment.
should be pub(crate) because it's on SessionContext and not receiver.id()
-- @nothingmuch See BullBitcoin source |
It was removed from rust-payjoin in payjoin#698.
It was removed from rust-payjoin in payjoin#698.
) Because SessionContext itself is limited in visibility to the crate this id method should also be limited to crate visibility. Based on the conversation linked here, #698 (comment)
It was removed from rust-payjoin in payjoin#698.
…713) Because SessionContext itself is limited in visibility to the crate this id method should also be limited to crate visibility. Based on the conversation linked here, payjoin/rust-payjoin#698 (comment)
By exposing the shortid method for SessionContext it allows us to be able to track the id across all psbt intermediate steps and allows us to not need this method duplicated in every step of the process.
Closes #697