Export InMemoryTestPersister under _test-utils#761
Export InMemoryTestPersister under _test-utils#761arminsabouri merged 1 commit intopayjoin:masterfrom
InMemoryTestPersister under _test-utils#761Conversation
Co-authored-by: Dan Gould <d@ngould.dev> `InMemoryTestPerister` now becomes generic over what events it is storing in memory allowing for other rust-payjoin mods to test storing and replaying session logs. We expose the in-memory session persister under a new feature flag: `_test-utils`. We also re-export the in-memory session persister through the payjoin-test-utils crate and added a crates-io patch making it available to other workspace members that use payjoin-test-utils at version 0.0.0.
Pull Request Test Coverage Report for Build 15591349719Details
💛 - Coveralls |
|
Fixing the workspace path defs could be its own commit for clarity since those changes aren't directly related to the export, but you may consider that a nitpick. |
| pub type BoxSendSyncError = Box<dyn std::error::Error + Send + Sync>; | ||
|
|
||
| pub use payjoin::persist::test_utils::InMemoryTestPersister; | ||
| pub use payjoin::persist::SessionPersister; |
There was a problem hiding this comment.
Does this need to be exported in payjoin-test-utils? It should be available from the payjoin crate already afaict
There was a problem hiding this comment.
True. I don't have strong opnions about this. I am not sure how non-workspace entities are consuming test-utils. So I would defer to you @spacebear21.
I will say: it is a bit cleaner to have all testutils consolidated and re-exported from one crate.
There was a problem hiding this comment.
I'm not sure that SessionPersister should be considered a test util since it's a core payjoin trait. Presumably a tester would just use InMemoryTestPersister as is, or they'd be testing their actual persister which itself already implements SessionPersister. I don't feel strongly about it though so will merge this as is.
InMemoryTestPeristernow becomes generic over what events it is storing in memory allowing for other rust-payjoin mods to test storing and replaying session logs. We expose the in-memory session persister under a new feature flag:_test-utils.We also re-export the in-memory session persister through the payjoin-test-utils crate and added a crates-io patch making it available to other workspace members that use payjoin-test-utils at version 0.0.0. This exposes the in-memory session persister to the int. and FFI test suites.